From e29794be8601317aa4fa0e679fab3c4488a4a07f Mon Sep 17 00:00:00 2001 From: Jacoby Date: Thu, 8 Jul 2021 10:08:37 +0200 Subject: [PATCH 01/18] initial commit of AML serializer --- dataformat-aml/.gitignore | 30 + dataformat-aml/LICENSE | 215 + dataformat-aml/license-header.txt | 13 + dataformat-aml/pom.xml | 107 + .../v3/dataformat/aml/AmlDeserializer.java | 78 + .../aas/v3/dataformat/aml/AmlSerializer.java | 198 + .../aml/model/caex/AASNamespace.java | 61 + .../aml/model/caex/AdditionalInformation.java | 21 + ...tAdministrationShellInterfaceClassLib.java | 16 + .../AssetAdministrationShellRoleClassLib.java | 35 + .../dataformat/aml/model/caex/Attribute.java | 75 + .../aml/model/caex/CAEXConstants.java | 8 + .../dataformat/aml/model/caex/CAEXFile.java | 67 + .../aml/model/caex/ExternalInterface.java | 58 + .../aml/model/caex/InstanceHierarchy.java | 45 + .../aml/model/caex/InternalElement.java | 80 + .../aml/model/caex/RefSemantic.java | 18 + .../aml/model/caex/RoleRequirements.java | 38 + .../mixin/AdditionalInformationMixin.java | 25 + .../aml/model/mixin/AttributeMixin.java | 91 + .../dataformat/aml/model/mixin/CAEXMixin.java | 84 + .../model/mixin/ExternalInterfaceMixin.java | 64 + .../model/mixin/InstanceHierarchyMixin.java | 52 + .../aml/model/mixin/InternalElementMixin.java | 92 + .../aml/model/mixin/RefSemanticMixin.java | 24 + .../model/mixin/RoleRequirementsMixin.java | 40 + .../mapper/AASEnvironmentMapper.java | 276 + ...rativeInformationToAttributeConverter.java | 49 + .../AllowDuplicatesToAttributeConverter.java | 22 + .../AssetKindToAttributeConverter.java | 25 + .../BillOfMaterialToAttributeConverter.java | 25 + .../CategoryToAttributeConverter.java | 23 + .../DerivedFromToAttributeConverter.java | 25 + .../DescriptionToAttributeConverter.java | 49 + .../EntityTypeToAttributeConverter.java | 24 + .../IdShortToAttributeConverter.java | 23 + .../converter/IdShortToNameConverter.java | 19 + ...entificationModelToAttributeConverter.java | 25 + .../IdentificationToAttributeConverter.java | 50 + .../ModelingKindToAttributeConverter.java | 23 + .../ObservedToAttributeConverter.java | 25 + .../OrderedToAttributeConverter.java | 22 + .../PropertyValueToAttributeConverter.java | 24 + .../SemanticIdToAttributeConverter.java | 25 + .../ValueIdToAttributeConverter.java | 25 + .../AnnotatedRelationshipElementMapper.java | 16 + .../AssetAdministrationShellMapper.java | 45 + .../mapper/mapper/AssetInformationMapper.java | 93 + .../serialize/mapper/mapper/AssetMapper.java | 16 + .../mapper/mapper/BasicEventMapper.java | 17 + .../serialize/mapper/mapper/BlobMapper.java | 50 + .../mapper/mapper/CapabilityMapper.java | 17 + .../serialize/mapper/mapper/EntityMapper.java | 28 + .../serialize/mapper/mapper/FileMapper.java | 49 + .../mapper/mapper/IdentifiableMapper.java | 14 + .../mapper/MultiLanguagePropertyMapper.java | 56 + .../mapper/mapper/OperationMapper.java | 31 + .../mapper/mapper/PropertyMapper.java | 27 + .../serialize/mapper/mapper/RangeMapper.java | 35 + .../mapper/mapper/ReferableMapper.java | 14 + .../mapper/mapper/ReferenceElementMapper.java | 28 + .../mapper/RelationshipElementMapper.java | 38 + .../SubmodelElementCollectionMapper.java | 16 + .../mapper/mapper/SubmodelElementMapper.java | 15 + .../mapper/mapper/SubmodelMapper.java | 18 + .../serialize/mapper/mapper/ViewMapper.java | 20 + .../mapper/util/FileConverterUtil.java | 46 + .../mapper/util/QualifierConverterUtil.java | 80 + .../mapper/util/ReferenceConverterUtil.java | 41 + .../src/main/resources/application.properties | 1 + .../resources/automation-ml-class-libs.txt | 2249 +++++ .../aml/deserialize/AmlDeserializerTest.java | 33 + .../dataformat/aml/fixtures/FullExample.java | 1575 +++ .../aml/serialize/AmlSerializerTest.java | 17 + .../test/resources/amlfile/example-motor.xml | 2889 ++++++ .../test/resources/amlfile/full-example.xml | 8921 +++++++++++++++++ pom.xml | 2 + 77 files changed, 18911 insertions(+) create mode 100644 dataformat-aml/.gitignore create mode 100644 dataformat-aml/LICENSE create mode 100644 dataformat-aml/license-header.txt create mode 100644 dataformat-aml/pom.xml create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlDeserializer.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlSerializer.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/AASNamespace.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/AdditionalInformation.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/AssetAdministrationShellInterfaceClassLib.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/AssetAdministrationShellRoleClassLib.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/Attribute.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/CAEXConstants.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/CAEXFile.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/ExternalInterface.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/InstanceHierarchy.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/InternalElement.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/RefSemantic.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/RoleRequirements.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/AdditionalInformationMixin.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/AttributeMixin.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/CAEXMixin.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/ExternalInterfaceMixin.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/InstanceHierarchyMixin.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/InternalElementMixin.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/RefSemanticMixin.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/RoleRequirementsMixin.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/AASEnvironmentMapper.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/AdministrativeInformationToAttributeConverter.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/AllowDuplicatesToAttributeConverter.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/AssetKindToAttributeConverter.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/BillOfMaterialToAttributeConverter.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/CategoryToAttributeConverter.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/DerivedFromToAttributeConverter.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/DescriptionToAttributeConverter.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/EntityTypeToAttributeConverter.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/IdShortToAttributeConverter.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/IdShortToNameConverter.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/IdentificationModelToAttributeConverter.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/IdentificationToAttributeConverter.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/ModelingKindToAttributeConverter.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/ObservedToAttributeConverter.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/OrderedToAttributeConverter.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/PropertyValueToAttributeConverter.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/SemanticIdToAttributeConverter.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/ValueIdToAttributeConverter.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/AnnotatedRelationshipElementMapper.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/AssetAdministrationShellMapper.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/AssetInformationMapper.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/AssetMapper.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/BasicEventMapper.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/BlobMapper.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/CapabilityMapper.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/EntityMapper.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/FileMapper.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/IdentifiableMapper.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/MultiLanguagePropertyMapper.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/OperationMapper.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/PropertyMapper.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/RangeMapper.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/ReferableMapper.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/ReferenceElementMapper.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/RelationshipElementMapper.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/SubmodelElementCollectionMapper.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/SubmodelElementMapper.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/SubmodelMapper.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/ViewMapper.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/util/FileConverterUtil.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/util/QualifierConverterUtil.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/util/ReferenceConverterUtil.java create mode 100644 dataformat-aml/src/main/resources/application.properties create mode 100644 dataformat-aml/src/main/resources/automation-ml-class-libs.txt create mode 100644 dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/deserialize/AmlDeserializerTest.java create mode 100644 dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/fixtures/FullExample.java create mode 100644 dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/serialize/AmlSerializerTest.java create mode 100644 dataformat-aml/src/test/resources/amlfile/example-motor.xml create mode 100644 dataformat-aml/src/test/resources/amlfile/full-example.xml diff --git a/dataformat-aml/.gitignore b/dataformat-aml/.gitignore new file mode 100644 index 00000000..298ee54d --- /dev/null +++ b/dataformat-aml/.gitignore @@ -0,0 +1,30 @@ +.idea/ +log/ +*.log +bin/ +target/ +pom.xml.tag +pom.xml.releaseBackup +pom.xml.versionsBackup +pom.xml.next +release.properties +dependency-reduced-pom.xml +buildNumber.properties +.mvn/timing.properties +.mvn/wrapper/maven-wrapper.jar +.metadata +bin/ +tmp/ +*.tmp +*.bak +*.swp +*~.nib +local.properties +.settings/ +.loadpath +.recommenders + +.classpath +.project + +testJsonSerialization.json diff --git a/dataformat-aml/LICENSE b/dataformat-aml/LICENSE new file mode 100644 index 00000000..e966af1a --- /dev/null +++ b/dataformat-aml/LICENSE @@ -0,0 +1,215 @@ +Copyright (C) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + +The AutomationML Serializer contained in this repository provide the functionalities to +serialize and deserialize instances of the Asset Administration Shell data model +from and to the AAS Java Model library. It is licensed under the Apache License +2.0 (Apache-2.0, see below). +The Model uses the concepts of the document "Details of the Asset +Administration Shell" published on www.plattform-i40.de which is licensed +under Creative Commons CC BY-ND 3.0 DE. + +------------------------------------------------------------------------------- + + + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2020 Fraunhofer IAIS + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/dataformat-aml/license-header.txt b/dataformat-aml/license-header.txt new file mode 100644 index 00000000..b531b74a --- /dev/null +++ b/dataformat-aml/license-header.txt @@ -0,0 +1,13 @@ +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. \ No newline at end of file diff --git a/dataformat-aml/pom.xml b/dataformat-aml/pom.xml new file mode 100644 index 00000000..02da8211 --- /dev/null +++ b/dataformat-aml/pom.xml @@ -0,0 +1,107 @@ + + + 4.0.0 + + io.admin-shell.aas + dataformat-parent + ${revision} + + dataformat-aml + + + io.admin-shell.aas + model + ${model.version} + compile + + + io.admin-shell.aas + dataformat-core + ${model.version} + compile + + + com.fasterxml.jackson.core + jackson-annotations + ${jackson.version} + compile + + + com.fasterxml.jackson.core + jackson-databind + ${jackson.version} + + + com.fasterxml.jackson.dataformat + jackson-dataformat-xml + ${jackson.version} + + + ma.glasnost.orika + orika-core + ${orika.version} + + + org.slf4j + slf4j-api + ${slf4j.version} + + + junit + junit + ${junit.version} + test + + + org.skyscreamer + jsonassert + ${jsonassert.version} + test + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + 11 + 11 + + + + org.codehaus.mojo + flatten-maven-plugin + ${plugin.flatten.version} + + true + + + + flatten + process-resources + + flatten + + + + flatten.clean + clean + + clean + + + + + + + + + eis-public-repo + maven-public + https://maven.iais.fraunhofer.de/artifactory/eis-ids-public + + + diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlDeserializer.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlDeserializer.java new file mode 100644 index 00000000..b9896951 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlDeserializer.java @@ -0,0 +1,78 @@ +package io.adminshell.aas.v3.dataformat.aml; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.dataformat.xml.XmlMapper; +import io.adminshell.aas.v3.dataformat.DeserializationException; +import io.adminshell.aas.v3.dataformat.Deserializer; +import io.adminshell.aas.v3.dataformat.aml.model.caex.AdditionalInformation; +import io.adminshell.aas.v3.dataformat.aml.model.caex.Attribute; +import io.adminshell.aas.v3.dataformat.aml.model.caex.CAEXFile; +import io.adminshell.aas.v3.dataformat.aml.model.caex.ExternalInterface; +import io.adminshell.aas.v3.dataformat.aml.model.caex.InstanceHierarchy; +import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElement; +import io.adminshell.aas.v3.dataformat.aml.model.caex.RefSemantic; +import io.adminshell.aas.v3.dataformat.aml.model.caex.RoleRequirements; +import io.adminshell.aas.v3.dataformat.aml.model.mixin.AdditionalInformationMixin; +import io.adminshell.aas.v3.dataformat.aml.model.mixin.AttributeMixin; +import io.adminshell.aas.v3.dataformat.aml.model.mixin.CAEXMixin; +import io.adminshell.aas.v3.dataformat.aml.model.mixin.ExternalInterfaceMixin; +import io.adminshell.aas.v3.dataformat.aml.model.mixin.InstanceHierarchyMixin; +import io.adminshell.aas.v3.dataformat.aml.model.mixin.InternalElementMixin; +import io.adminshell.aas.v3.dataformat.aml.model.mixin.RefSemanticMixin; +import io.adminshell.aas.v3.dataformat.aml.model.mixin.RoleRequirementsMixin; +import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.AASEnvironmentMapper; +import io.adminshell.aas.v3.model.AssetAdministrationShellEnvironment; +import ma.glasnost.orika.MapperFacade; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class AmlDeserializer implements Deserializer { + + private static final Logger log = LoggerFactory.getLogger(AmlDeserializer.class); + private final MapperFacade mapper = new AASEnvironmentMapper(); + + public CAEXMixin convertXMLToCAEX(String xml) { + XmlMapper xmlMapper = XmlMapper.builder() + // .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false) + .addMixIn(CAEXFile.class, CAEXMixin.class) + .addMixIn(ExternalInterface.class, ExternalInterfaceMixin.class) + .addMixIn(AdditionalInformation.class, AdditionalInformationMixin.class) + .addMixIn(InstanceHierarchy.class, InstanceHierarchyMixin.class) + .addMixIn(InternalElement.class, InternalElementMixin.class) + .addMixIn(Attribute.class, AttributeMixin.class) + .addMixIn(RefSemantic.class, RefSemanticMixin.class) + .addMixIn(RoleRequirements.class, RoleRequirementsMixin.class) + .build(); + + CAEXMixin caex = null; + try { + caex = xmlMapper.readValue(xml, CAEXMixin.class); + } catch (JsonProcessingException e) { + e.printStackTrace(); + } + + //log.debug(caex.toString()); + //System.out.println(JSON.); + return caex; + } + + public AssetAdministrationShellEnvironment modelTransformation(CAEXFile caex) { + AssetAdministrationShellEnvironment environment = null; + + return environment; + } + + @Override + public AssetAdministrationShellEnvironment read(String value) throws DeserializationException { + // XML --> CAEX + CAEXMixin caex = this.convertXMLToCAEX(value); + // CAEX --> AAS +// return this.modelTransformation(caex); + return null; + } + + @Override + public void useImplementation(Class aasInterface, Class implementation) { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlSerializer.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlSerializer.java new file mode 100644 index 00000000..f0e14183 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlSerializer.java @@ -0,0 +1,198 @@ +package io.adminshell.aas.v3.dataformat.aml; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializationFeature; +import com.fasterxml.jackson.dataformat.xml.XmlMapper; +import io.adminshell.aas.v3.dataformat.SerializationException; +import io.adminshell.aas.v3.dataformat.Serializer; +import io.adminshell.aas.v3.dataformat.aml.model.caex.AdditionalInformation; +import io.adminshell.aas.v3.dataformat.aml.model.caex.Attribute; +import io.adminshell.aas.v3.dataformat.aml.model.caex.CAEXConstants; +import io.adminshell.aas.v3.dataformat.aml.model.caex.CAEXFile; +import io.adminshell.aas.v3.dataformat.aml.model.caex.ExternalInterface; +import io.adminshell.aas.v3.dataformat.aml.model.caex.InstanceHierarchy; +import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElement; +import io.adminshell.aas.v3.dataformat.aml.model.caex.RefSemantic; +import io.adminshell.aas.v3.dataformat.aml.model.caex.RoleRequirements; +import io.adminshell.aas.v3.dataformat.aml.model.mixin.AdditionalInformationMixin; +import io.adminshell.aas.v3.dataformat.aml.model.mixin.AttributeMixin; +import io.adminshell.aas.v3.dataformat.aml.model.mixin.CAEXMixin; +import io.adminshell.aas.v3.dataformat.aml.model.mixin.ExternalInterfaceMixin; +import io.adminshell.aas.v3.dataformat.aml.model.mixin.InstanceHierarchyMixin; +import io.adminshell.aas.v3.dataformat.aml.model.mixin.InternalElementMixin; +import io.adminshell.aas.v3.dataformat.aml.model.mixin.RefSemanticMixin; +import io.adminshell.aas.v3.dataformat.aml.model.mixin.RoleRequirementsMixin; +import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.AASEnvironmentMapper; +import io.adminshell.aas.v3.model.AssetAdministrationShell; +import io.adminshell.aas.v3.model.AssetAdministrationShellEnvironment; +import io.adminshell.aas.v3.model.AssetInformation; +import io.adminshell.aas.v3.model.Submodel; +import io.adminshell.aas.v3.model.SubmodelElementCollection; +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.util.ArrayList; +import java.util.List; +import java.util.function.BiConsumer; +import java.util.logging.Level; +import ma.glasnost.orika.MapperFacade; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class AmlSerializer implements Serializer { + + private static final Logger log = LoggerFactory.getLogger(AmlSerializer.class); + private final MapperFacade mapper = new AASEnvironmentMapper(); + + private boolean enableClassLibs = false; + + public AmlSerializer() { + } + + public AmlSerializer(boolean enableClassLibs) { + this.enableClassLibs = enableClassLibs; + } + + @Override + public String write(AssetAdministrationShellEnvironment aasEnvironment) throws SerializationException { + try { + CAEXFile caexFile = modelTransformation(aasEnvironment); + String result = convertXml(caexFile); + if (enableClassLibs) { + result = addClassLibs(cleanUpXml(result)); + } + return result; + } catch (JsonProcessingException ex) { + throw new SerializationException("error serializing AssetAdministrationShellEnvironment", ex); + } + } + + private String addClassLibs(String xml) { + StringBuilder output = new StringBuilder(xml); + // Read class lib file + String path = "automation-ml-class-libs.txt"; + ClassLoader classLoader = getClass().getClassLoader(); + File file = new File(classLoader.getResource(path).getFile()); + String content = null; + try { + content = new String(Files.readAllBytes(file.toPath())); + } catch (IOException e) { + e.printStackTrace(); + } + // Delete CAEX closing tag + if (output.length() > 0) { + int last, prev = output.length() - 1; + while ((last = output.lastIndexOf("\n", prev)) == prev) { + prev = last - 1; + } + if (last >= 0) { + output.delete(last, output.length()); + } + } + // Add class libs to xml + if (content != null) { + output.append(content); + } + // Add new CAEX closing tag + output.append(""); + return output.toString(); + } + + private String cleanUpXml(String xml) { + String withoutEmptyAttributes = xml.replaceAll("", ""); + String withoutEmptyLines = withoutEmptyAttributes.replaceAll("(?m)^[ \t]*\r?\n", ""); + return withoutEmptyLines; + } + + private String convertXml(CAEXFile caexFile) throws JsonProcessingException { + XmlMapper xmlMapper = XmlMapper.builder() + .disable(SerializationFeature.FAIL_ON_EMPTY_BEANS) + .enable(SerializationFeature.INDENT_OUTPUT) + .addMixIn(CAEXFile.class, CAEXMixin.class) + .addMixIn(ExternalInterface.class, ExternalInterfaceMixin.class) + .addMixIn(AdditionalInformation.class, AdditionalInformationMixin.class) + .addMixIn(InstanceHierarchy.class, InstanceHierarchyMixin.class) + .addMixIn(InternalElement.class, InternalElementMixin.class) + .addMixIn(Attribute.class, AttributeMixin.class) + .addMixIn(RefSemantic.class, RefSemanticMixin.class) + .addMixIn(RoleRequirements.class, RoleRequirementsMixin.class) + .build(); + + return xmlMapper.writeValueAsString(caexFile); + } + + private CAEXFile modelTransformation(AssetAdministrationShellEnvironment environment) { + CAEXFile caexFile = mapper.map(environment, CAEXFile.class); + caexFile.setSchemaVersion(CAEXConstants.SCHEMA_VERSION); + caexFile.setXmlns(CAEXConstants.XMLNS); + caexFile.setXsi(CAEXConstants.XSI); + // Add additional information to CAEX + AdditionalInformation additionalInformation = new AdditionalInformation(); + additionalInformation.setAutomationMLVersion(CAEXConstants.AUTOMATION_ML_VERSION); + caexFile.setAdditionalInformation(additionalInformation); + // Add instance hierarchy to CAEX + InstanceHierarchy instanceHierarchy = new InstanceHierarchy(); + instanceHierarchy.setName("AssetAdministrationShellInstanceHierarchy"); + instanceHierarchy.setVersion("0"); + caexFile.setInstanceHierarchy(instanceHierarchy); + // Map all asset administration shells to internal elements + List administrationShells = new ArrayList<>(environment.getAssetAdministrationShells()); + List shellInternalElements = mapper.mapAsList(administrationShells, InternalElement.class); + // Inside shell loop + forEachWithCounter(administrationShells, (i, administrationShell) -> { + // Map asset info to internal element + AssetInformation asset = administrationShell.getAssetInformation(); + InternalElement assetInternalElement = mapper.map(asset, InternalElement.class); + shellInternalElements.get(i).setInternalElements(new ArrayList() { + { + add(assetInternalElement); + } + }); + +// // Map all submodels to internal elements +// forEachWithCounter(administrationShell.getSubmodels(), (j, submodel) -> { +// InternalElement submodelInternalElement = mapper.map(submodel, InternalElement.class); +// shellInternalElements.get(i).getInternalElements().add(submodelInternalElement); +// }); + }); + // Inside environment loop + shellInternalElements.forEach(shellInternalElement -> { + // Map all submodels to internal elements + List submodels = new ArrayList<>(environment.getSubmodels()); + submodels.forEach(submodel -> { + InternalElement submodelInternalElement = mapper.map(submodel, InternalElement.class); + submodelInternalElement.setInternalElements(new ArrayList<>()); + // Map all submodel elements + submodel.getSubmodelElements().forEach(submodelElement -> { + // Submodels that are not SubmodelElementCollections + if (!(submodelElement instanceof SubmodelElementCollection)) { + InternalElement internalElement = mapper.map(submodelElement, InternalElement.class); + submodelInternalElement.getInternalElements().add(internalElement); + } + // SubmodelElementCollection + if (submodelElement instanceof SubmodelElementCollection) { + InternalElement submodelElementInternalElement = mapper.map(submodelElement, InternalElement.class); + submodelElementInternalElement.setInternalElements(new ArrayList<>()); + ((SubmodelElementCollection) submodelElement).getValues().forEach(value -> { + InternalElement submodelElementCollectionInternalElement = mapper.map(value, InternalElement.class); + submodelElementInternalElement.getInternalElements().add(submodelElementCollectionInternalElement); + }); + submodelInternalElement.getInternalElements().add(submodelElementInternalElement); + } + }); + shellInternalElement.getInternalElements().add(submodelInternalElement); + }); + }); + instanceHierarchy.setInternalElements(shellInternalElements); + return caexFile; + } + + private static void forEachWithCounter(Iterable source, BiConsumer consumer) { + int i = 0; + for (T item : source) { + consumer.accept(i, item); + i++; + } + } + +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/AASNamespace.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/AASNamespace.java new file mode 100644 index 00000000..a9ced96d --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/AASNamespace.java @@ -0,0 +1,61 @@ +package io.adminshell.aas.v3.dataformat.aml.model.caex; + +public enum AASNamespace { + Referable_IdShort("Referable/idShort"), + Referable_Category("Referable/category"), + Referable_Description("Referable/description"), + Asset_Kind("AssetInformation/kind"), + Asset_GlobalAssetId("AssetInformation/globalAssetId"), + Asset_DefaultThumbnail("AssetInformation/defaultThumbnail"), + Asset_SpecificAssetId("AssetInformation/specificAssetId"), + Asset_BillOfMaterial("AssetInformation/billOfMaterial"), + HasKind_Kind("HasKind/kind"), + HasSemantics_SemanticId("HasSemantics/semanticId"), + Identifiable_Identification("Identifiable/identification"), + Identifier_IdType("Identifier/idType"), + Identifier_Id("Identifier/id"), + Identifiable_Administration("Identifiable/administration"), + AdministrationInformation_Version("AdministrationInformation/version"), + AdministrationInformation_Revision("AdministrationInformation/revision"), + HasDataSpecification_DataSpecification("HasDataSpecification/dataSpecification"), + Qualifiable_Qualifier("Qualifiable/qualifier"), + Qualifier_Qualifier("Qualifier/qualifier"), + Qualifier_Type("Qualifier/type"), + Qualifier_Value("Qualifier/value"), + Entity_Type("Entity/type"), + Entity_Asset("Entity/asset"), + BasicEvent_Observed("BasicEvent/observed"), + Qualifier_ValueId("Qualifier/valueId"), + AssetAdministrationShell_DerivedFrom("AssetAdministrationShell/derivedFrom"), + Asset_AssetIdentificationModel("Asset/assetIdentificationModel"), + AssetAdministrationShell_Submodels("AssetAdministrationShell/submodels"), + Property_Value("Property/value"), + MultiLanguageProperty_Value("MultiLanguageProperty/value"), + MultiLanguageProperty_ValueId("MultiLanguageProperty/valueId"), + Blob_Value("Blob/value"), + Blob_MimeType("Blob/mimeType"), + File_Value("File/value"), + File_MimeType("File/mimeType"), + Range_Max("Range/max"), + Range_Min("Range/min"), + ReferenceElement_Value("ReferenceElement/value"), + Property_ValueId("Property/valueId"), + AnnotationRelationshipElement_Annotations("AnnotationRelationshipElement/annotations"), + ConceptDescription_IsCaseOf("ConceptDescription/isCaseOf"), + ConceptDescription_DataSpecification("ConceptDescription/dataSpecification"), + RelationshipElement_First("RelationshipElement/first"), + RelationshipElement_Second("RelationshipElement/second"), + IdentifierKeyValuePair_Key("IdentifierKeyValuePair/key"), + IdentifierKeyValuePair_Value("IdentifierKeyValuePair/value"), + BillOfMaterial_Reference("BillOfMaterial/reference"); + + private String refSemantic; + + AASNamespace(String refSemantic) { + this.refSemantic = refSemantic; + } + + public String getRefSemantic() { + return "AAS:" + refSemantic; + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/AdditionalInformation.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/AdditionalInformation.java new file mode 100644 index 00000000..b9224de9 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/AdditionalInformation.java @@ -0,0 +1,21 @@ +package io.adminshell.aas.v3.dataformat.aml.model.caex; + +public class AdditionalInformation { + + private String automationMLVersion; + + public AdditionalInformation() { + } + + public AdditionalInformation(String automationMLVersion) { + this.automationMLVersion = automationMLVersion; + } + + public String getAutomationMLVersion() { + return automationMLVersion; + } + + public void setAutomationMLVersion(String automationMLVersion) { + this.automationMLVersion = automationMLVersion; + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/AssetAdministrationShellInterfaceClassLib.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/AssetAdministrationShellInterfaceClassLib.java new file mode 100644 index 00000000..32f80c93 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/AssetAdministrationShellInterfaceClassLib.java @@ -0,0 +1,16 @@ +package io.adminshell.aas.v3.dataformat.aml.model.caex; + +public enum AssetAdministrationShellInterfaceClassLib { + FileDataReference("FileDataReference"); + + + private String refBaseRoleClassPath; + + AssetAdministrationShellInterfaceClassLib(String refBaseRoleClassPath) { + this.refBaseRoleClassPath = refBaseRoleClassPath; + } + + public String getRefBaseRoleClassPath() { + return "AssetAdministrationShellInterfaceClassLib/" + refBaseRoleClassPath; + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/AssetAdministrationShellRoleClassLib.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/AssetAdministrationShellRoleClassLib.java new file mode 100644 index 00000000..6195dbb8 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/AssetAdministrationShellRoleClassLib.java @@ -0,0 +1,35 @@ +package io.adminshell.aas.v3.dataformat.aml.model.caex; + +public enum AssetAdministrationShellRoleClassLib { + AssetAdministrationShell("AssetAdministrationShell"), + Asset("Asset"), + AssetInformation("AssetInformation"), + File("File"), + Range("Range"), + Entity("Entity"), + View("View"), + BasicEvent("BasicEvent"), + Capability("Capability"), + Operation("Operation"), + OperationInputVar("OperationInputVariables"), + OperationOutputVar("OperationOutputVariables"), + OperationInOutputVar("OperationInoutputVariables"), + Property("Property"), + SubmodelElementCollection("SubmodelElementCollection"), + Submodel("Submodel"), + ReferenceElement("ReferenceElement"), + MultiLanguageProperty("MultiLanguageProperty"), + RelationshipElementMapper("RelationshipElement"), + AnnotatedRelationshipElement("AnnotatedRelationshipElement"), + Blob("Blob"); + + private String refBaseRoleClassPath; + + AssetAdministrationShellRoleClassLib(String refBaseRoleClassPath) { + this.refBaseRoleClassPath = refBaseRoleClassPath; + } + + public String getRefBaseRoleClassPath() { + return "AssetAdministrationShellRoleClassLib/" + refBaseRoleClassPath; + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/Attribute.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/Attribute.java new file mode 100644 index 00000000..9a441573 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/Attribute.java @@ -0,0 +1,75 @@ +package io.adminshell.aas.v3.dataformat.aml.model.caex; + +import java.util.List; + +public class Attribute { + + public Attribute(String name, String attributeDataType, String description, String value, RefSemantic refSemantic, List attributes) { + this.name = name; + this.attributeDataType = attributeDataType; + this.description = description; + this.value = value; + this.refSemantic = refSemantic; + this.attributes = attributes; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getAttributeDataType() { + return attributeDataType; + } + + public void setAttributeDataType(String attributeDataType) { + this.attributeDataType = attributeDataType; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public RefSemantic getRefSemantic() { + return refSemantic; + } + + public void setRefSemantic(RefSemantic refSemantic) { + this.refSemantic = refSemantic; + } + + public List getAttributes() { + return attributes; + } + + public void setAttributes(List attributes) { + this.attributes = attributes; + } + + private String name; + + private String attributeDataType; + + private String description; + + private String value; + + private RefSemantic refSemantic; + + private List attributes; +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/CAEXConstants.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/CAEXConstants.java new file mode 100644 index 00000000..ff2a6edf --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/CAEXConstants.java @@ -0,0 +1,8 @@ +package io.adminshell.aas.v3.dataformat.aml.model.caex; + +public class CAEXConstants { + public final static String SCHEMA_VERSION = "2.15"; + public final static String XMLNS = "http://www.w3.org/2001/XMLSchema-instance"; + public final static String XSI = "CAEX_ClassModel_V2.15.xsd"; + public final static String AUTOMATION_ML_VERSION = "2.0"; +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/CAEXFile.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/CAEXFile.java new file mode 100644 index 00000000..49f16149 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/CAEXFile.java @@ -0,0 +1,67 @@ +package io.adminshell.aas.v3.dataformat.aml.model.caex; + +public class CAEXFile { + + public CAEXFile() { + } + + public CAEXFile(String xmlns, String xsi, String schemaVersion, AdditionalInformation additionalInformation, InstanceHierarchy instanceHierarchy) { + this.xmlns = xmlns; + this.xsi = xsi; + this.schemaVersion = schemaVersion; + this.additionalInformation = additionalInformation; + this.instanceHierarchy = instanceHierarchy; + } + + private String xmlns; + + private String xsi; + + private String fileName; + + private String schemaVersion; + + private AdditionalInformation additionalInformation; + + private InstanceHierarchy instanceHierarchy; + + public String getXmlns() { + return xmlns; + } + + public void setXmlns(String xmlns) { + this.xmlns = xmlns; + } + + public String getXsi() { + return xsi; + } + + public void setXsi(String xsi) { + this.xsi = xsi; + } + + public String getSchemaVersion() { + return schemaVersion; + } + + public void setSchemaVersion(String schemaVersion) { + this.schemaVersion = schemaVersion; + } + + public AdditionalInformation getAdditionalInformation() { + return additionalInformation; + } + + public void setAdditionalInformation(AdditionalInformation additionalInformation) { + this.additionalInformation = additionalInformation; + } + + public InstanceHierarchy getInstanceHierarchy() { + return instanceHierarchy; + } + + public void setInstanceHierarchy(InstanceHierarchy instanceHierarchy) { + this.instanceHierarchy = instanceHierarchy; + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/ExternalInterface.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/ExternalInterface.java new file mode 100644 index 00000000..35873527 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/ExternalInterface.java @@ -0,0 +1,58 @@ +package io.adminshell.aas.v3.dataformat.aml.model.caex; + +import java.util.List; +import java.util.UUID; + +public class ExternalInterface { + + private String id; + + public ExternalInterface(String id, String name, String refBaseClassPath, List attributes) { + this.id = id; + this.name = name; + this.refBaseClassPath = refBaseClassPath; + this.attributes = attributes; + } + + private String name; + + private String refBaseClassPath; + + private List attributes; + + public ExternalInterface() { + id = UUID.randomUUID().toString(); + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getRefBaseClassPath() { + return refBaseClassPath; + } + + public void setRefBaseClassPath(String refBaseClassPath) { + this.refBaseClassPath = refBaseClassPath; + } + + public List getAttributes() { + return attributes; + } + + public void setAttributes(List attributes) { + this.attributes = attributes; + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/InstanceHierarchy.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/InstanceHierarchy.java new file mode 100644 index 00000000..20ab3bb0 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/InstanceHierarchy.java @@ -0,0 +1,45 @@ +package io.adminshell.aas.v3.dataformat.aml.model.caex; + +import java.util.List; + +public class InstanceHierarchy { + + public InstanceHierarchy() { + } + + public InstanceHierarchy(String name, String version, List internalElements) { + this.name = name; + this.version = version; + this.internalElements = internalElements; + } + + private String name; + + private String version; + + private List internalElements; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + public List getInternalElements() { + return internalElements; + } + + public void setInternalElements(List internalElements) { + this.internalElements = internalElements; + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/InternalElement.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/InternalElement.java new file mode 100644 index 00000000..5d69aa91 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/InternalElement.java @@ -0,0 +1,80 @@ +package io.adminshell.aas.v3.dataformat.aml.model.caex; + +import java.util.List; +import java.util.UUID; + +public class InternalElement { + + public InternalElement(String id, String name, RoleRequirements roleRequirements, List internalElements, List attributes, List externalInterfaces) { + this.id = id; + this.name = name; + this.roleRequirements = roleRequirements; + this.internalElements = internalElements; + this.attributes = attributes; + this.externalInterfaces = externalInterfaces; + } + + private String id; + + private String name; + + private RoleRequirements roleRequirements; + + private List internalElements; + + private List attributes; + + private List externalInterfaces; + + public InternalElement() { + id = UUID.randomUUID().toString(); + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public RoleRequirements getRoleRequirements() { + return roleRequirements; + } + + public void setRoleRequirements(RoleRequirements roleRequirements) { + this.roleRequirements = roleRequirements; + } + + public List getInternalElements() { + return internalElements; + } + + public void setInternalElements(List internalElements) { + this.internalElements = internalElements; + } + + public List getAttributes() { + return attributes; + } + + public void setAttributes(List attributes) { + this.attributes = attributes; + } + + public List getExternalInterfaces() { + return externalInterfaces; + } + + public void setExternalInterfaces(List externalInterfaces) { + this.externalInterfaces = externalInterfaces; + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/RefSemantic.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/RefSemantic.java new file mode 100644 index 00000000..9dd54db2 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/RefSemantic.java @@ -0,0 +1,18 @@ +package io.adminshell.aas.v3.dataformat.aml.model.caex; + +public class RefSemantic { + + public RefSemantic(String correspondingAttributePath) { + this.correspondingAttributePath = correspondingAttributePath; + } + + private String correspondingAttributePath; + + public String getCorrespondingAttributePath() { + return correspondingAttributePath; + } + + public void setCorrespondingAttributePath(String correspondingAttributePath) { + this.correspondingAttributePath = correspondingAttributePath; + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/RoleRequirements.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/RoleRequirements.java new file mode 100644 index 00000000..ce29ed28 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/RoleRequirements.java @@ -0,0 +1,38 @@ +package io.adminshell.aas.v3.dataformat.aml.model.caex; + +import java.util.List; + +public class RoleRequirements { + + private String refBaseRoleClassPath; + + private List attributes; + + public RoleRequirements() { + } + + public RoleRequirements(String refBaseRoleClassPath) { + this.refBaseRoleClassPath = refBaseRoleClassPath; + } + + public RoleRequirements(String refBaseRoleClassPath, List attributes) { + this.refBaseRoleClassPath = refBaseRoleClassPath; + this.attributes = attributes; + } + + public String getRefBaseRoleClassPath() { + return refBaseRoleClassPath; + } + + public void setRefBaseRoleClassPath(String refBaseRoleClassPath) { + this.refBaseRoleClassPath = refBaseRoleClassPath; + } + + public List getAttributes() { + return attributes; + } + + public void setAttributes(List attributes) { + this.attributes = attributes; + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/AdditionalInformationMixin.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/AdditionalInformationMixin.java new file mode 100644 index 00000000..d6a718ce --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/AdditionalInformationMixin.java @@ -0,0 +1,25 @@ +package io.adminshell.aas.v3.dataformat.aml.model.mixin; + +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; + +public class AdditionalInformationMixin { + + public AdditionalInformationMixin() { + } + + public AdditionalInformationMixin(String automationMLVersion) { + this.automationMLVersion = automationMLVersion; + } + + @JacksonXmlProperty(localName = "AutomationMLVersion", isAttribute = true) + private String automationMLVersion; + + public String getAutomationMLVersion() { + return automationMLVersion; + } + + public void setAutomationMLVersion(String automationMLVersion) { + this.automationMLVersion = automationMLVersion; + } + +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/AttributeMixin.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/AttributeMixin.java new file mode 100644 index 00000000..a36ee116 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/AttributeMixin.java @@ -0,0 +1,91 @@ +package io.adminshell.aas.v3.dataformat.aml.model.mixin; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import io.adminshell.aas.v3.dataformat.aml.model.caex.RefSemantic; + +import java.util.List; + +@JsonInclude(JsonInclude.Include.NON_NULL) +public class AttributeMixin { + + public AttributeMixin(String name, String attributeDataType, String description, String value, RefSemantic refSemantic, List attributes) { + this.name = name; + this.attributeDataType = attributeDataType; + this.description = description; + this.value = value; + this.refSemantic = refSemantic; + this.attributes = attributes; + } + + public AttributeMixin() { + } + + @JacksonXmlProperty(localName = "Name", isAttribute = true) + private String name; + + @JacksonXmlProperty(localName = "AttributeDataType", isAttribute = true) + private String attributeDataType; + + @JacksonXmlProperty(localName = "Description") + private String description; + + @JacksonXmlProperty(localName = "Value") + private String value; + + @JacksonXmlProperty(localName = "RefSemantic") + private RefSemantic refSemantic; + + @JacksonXmlProperty(localName = "Attribute") + @JacksonXmlElementWrapper(useWrapping = false) + private List attributes; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getAttributeDataType() { + return attributeDataType; + } + + public void setAttributeDataType(String attributeDataType) { + this.attributeDataType = attributeDataType; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public RefSemantic getRefSemantic() { + return refSemantic; + } + + public void setRefSemantic(RefSemantic refSemantic) { + this.refSemantic = refSemantic; + } + + public List getAttributes() { + return attributes; + } + + public void setAttributes(List attributes) { + this.attributes = attributes; + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/CAEXMixin.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/CAEXMixin.java new file mode 100644 index 00000000..676fb04e --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/CAEXMixin.java @@ -0,0 +1,84 @@ +package io.adminshell.aas.v3.dataformat.aml.model.mixin; + +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; + +public class CAEXMixin { + + public CAEXMixin(String xmlns, String xsi, String fileName, String schemaVersion, AdditionalInformationMixin additionalInformation, InstanceHierarchyMixin instanceHierarchy) { + this.xmlns = xmlns; + this.xsi = xsi; + this.fileName = fileName; + this.schemaVersion = schemaVersion; + this.additionalInformation = additionalInformation; + this.instanceHierarchy = instanceHierarchy; + } + + public CAEXMixin() { + } + + @JacksonXmlProperty(localName = "xmlns:xsi", isAttribute = true) + private String xmlns; + + @JacksonXmlProperty(localName = "xsi:noNamespaceSchemaLocation", isAttribute = true) + private String xsi; + + @JacksonXmlProperty(localName = "FileName", isAttribute = true) + private String fileName; + + @JacksonXmlProperty(localName = "SchemaVersion", isAttribute = true) + private String schemaVersion; + + @JacksonXmlProperty(localName = "AdditionalInformation") + private AdditionalInformationMixin additionalInformation; + + @JacksonXmlProperty(localName = "InstanceHierarchy") + private InstanceHierarchyMixin instanceHierarchy; + + public String getXmlns() { + return xmlns; + } + + public void setXmlns(String xmlns) { + this.xmlns = xmlns; + } + + public String getXsi() { + return xsi; + } + + public void setXsi(String xsi) { + this.xsi = xsi; + } + + public String getFileName() { + return fileName; + } + + public void setFileName(String fileName) { + this.fileName = fileName; + } + + public String getSchemaVersion() { + return schemaVersion; + } + + public void setSchemaVersion(String schemaVersion) { + this.schemaVersion = schemaVersion; + } + + public AdditionalInformationMixin getAdditionalInformation() { + return additionalInformation; + } + + public void setAdditionalInformation(AdditionalInformationMixin additionalInformation) { + this.additionalInformation = additionalInformation; + } + + public InstanceHierarchyMixin getInstanceHierarchy() { + return instanceHierarchy; + } + + public void setInstanceHierarchy(InstanceHierarchyMixin instanceHierarchy) { + this.instanceHierarchy = instanceHierarchy; + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/ExternalInterfaceMixin.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/ExternalInterfaceMixin.java new file mode 100644 index 00000000..7f32ef76 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/ExternalInterfaceMixin.java @@ -0,0 +1,64 @@ +package io.adminshell.aas.v3.dataformat.aml.model.mixin; + +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; + +import java.util.List; + +public class ExternalInterfaceMixin { + + public ExternalInterfaceMixin(String name, String id, String refBaseClassPath, List attributes) { + this.name = name; + this.id = id; + this.refBaseClassPath = refBaseClassPath; + this.attributes = attributes; + } + + public ExternalInterfaceMixin() { + } + + @JacksonXmlProperty(localName = "Name", isAttribute = true) + private String name; + + @JacksonXmlProperty(localName = "Id", isAttribute = true) + private String id; + + @JacksonXmlProperty(localName = "RefBaseClassPath", isAttribute = true) + private String refBaseClassPath; + + @JacksonXmlProperty(localName = "Attribute") + @JacksonXmlElementWrapper(useWrapping = false) + private List attributes; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getRefBaseClassPath() { + return refBaseClassPath; + } + + public void setRefBaseClassPath(String refBaseClassPath) { + this.refBaseClassPath = refBaseClassPath; + } + + public List getAttributes() { + return attributes; + } + + public void setAttributes(List attributes) { + this.attributes = attributes; + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/InstanceHierarchyMixin.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/InstanceHierarchyMixin.java new file mode 100644 index 00000000..cf752089 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/InstanceHierarchyMixin.java @@ -0,0 +1,52 @@ +package io.adminshell.aas.v3.dataformat.aml.model.mixin; + +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; + +import java.util.List; + +public class InstanceHierarchyMixin { + + public InstanceHierarchyMixin(String name, String version, List internalElements) { + this.name = name; + this.version = version; + this.internalElements = internalElements; + } + + public InstanceHierarchyMixin() { + } + + @JacksonXmlProperty(localName = "Name", isAttribute = true) + private String name; + + @JacksonXmlProperty(localName = "Version") + private String version; + + @JacksonXmlProperty(localName = "InternalElement") + @JacksonXmlElementWrapper(useWrapping = false) + private List internalElements; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + public List getInternalElements() { + return internalElements; + } + + public void setInternalElements(List internalElements) { + this.internalElements = internalElements; + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/InternalElementMixin.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/InternalElementMixin.java new file mode 100644 index 00000000..60b22ba0 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/InternalElementMixin.java @@ -0,0 +1,92 @@ +package io.adminshell.aas.v3.dataformat.aml.model.mixin; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; + +import java.util.List; + +@JsonInclude(JsonInclude.Include.NON_NULL) +public class InternalElementMixin { + + public InternalElementMixin(String name, String id, RoleRequirementsMixin roleRequirements, List internalElements, List attributes, List externalInterfaces) { + this.name = name; + this.id = id; + this.roleRequirements = roleRequirements; + this.internalElements = internalElements; + this.attributes = attributes; + this.externalInterfaces = externalInterfaces; + } + + public InternalElementMixin() { + } + + @JacksonXmlProperty(localName = "Name", isAttribute = true) + private String name; + + @JacksonXmlProperty(localName = "Id", isAttribute = true) + private String id; + + @JacksonXmlProperty(localName = "RoleRequirements") + private RoleRequirementsMixin roleRequirements; + + @JacksonXmlProperty(localName = "InternalElement") + @JacksonXmlElementWrapper(useWrapping = false) + private List internalElements; + + @JacksonXmlProperty(localName = "Attribute") + @JacksonXmlElementWrapper(useWrapping = false) + private List attributes; + + @JacksonXmlProperty(localName = "ExternalInterface") + @JacksonXmlElementWrapper(useWrapping = false) + private List externalInterfaces; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public RoleRequirementsMixin getRoleRequirements() { + return roleRequirements; + } + + public void setRoleRequirements(RoleRequirementsMixin roleRequirements) { + this.roleRequirements = roleRequirements; + } + + public List getInternalElements() { + return internalElements; + } + + public void setInternalElements(List internalElements) { + this.internalElements = internalElements; + } + + public List getAttributes() { + return attributes; + } + + public void setAttributes(List attributes) { + this.attributes = attributes; + } + + public List getExternalInterfaces() { + return externalInterfaces; + } + + public void setExternalInterfaces(List externalInterfaces) { + this.externalInterfaces = externalInterfaces; + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/RefSemanticMixin.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/RefSemanticMixin.java new file mode 100644 index 00000000..1d7b8434 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/RefSemanticMixin.java @@ -0,0 +1,24 @@ +package io.adminshell.aas.v3.dataformat.aml.model.mixin; + +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; + +public class RefSemanticMixin { + + public RefSemanticMixin(String correspondingAttributePath) { + this.correspondingAttributePath = correspondingAttributePath; + } + + public RefSemanticMixin() { + } + + @JacksonXmlProperty(localName = "CorrespondingAttributePath", isAttribute = true) + private String correspondingAttributePath; + + public String getCorrespondingAttributePath() { + return correspondingAttributePath; + } + + public void setCorrespondingAttributePath(String correspondingAttributePath) { + this.correspondingAttributePath = correspondingAttributePath; + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/RoleRequirementsMixin.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/RoleRequirementsMixin.java new file mode 100644 index 00000000..b0831c0a --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/RoleRequirementsMixin.java @@ -0,0 +1,40 @@ +package io.adminshell.aas.v3.dataformat.aml.model.mixin; + +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; + +import java.util.List; + +public class RoleRequirementsMixin { + + public RoleRequirementsMixin(String refBaseRoleClassPath, List attributes) { + this.refBaseRoleClassPath = refBaseRoleClassPath; + this.attributes = attributes; + } + + public RoleRequirementsMixin() { + } + + @JacksonXmlProperty(localName = "RefBaseRoleClassPath", isAttribute = true) + private String refBaseRoleClassPath; + + @JacksonXmlProperty(localName = "Attribute") + @JacksonXmlElementWrapper(useWrapping = false) + private List attributes; + + public String getRefBaseRoleClassPath() { + return refBaseRoleClassPath; + } + + public void setRefBaseRoleClassPath(String refBaseRoleClassPath) { + this.refBaseRoleClassPath = refBaseRoleClassPath; + } + + public List getAttributes() { + return attributes; + } + + public void setAttributes(List attributes) { + this.attributes = attributes; + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/AASEnvironmentMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/AASEnvironmentMapper.java new file mode 100644 index 00000000..72b9f6f7 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/AASEnvironmentMapper.java @@ -0,0 +1,276 @@ +package io.adminshell.aas.v3.dataformat.aml.serialize.mapper; + +import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElement; +import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter.AdministrativeInformationToAttributeConverter; +import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter.AllowDuplicatesToAttributeConverter; +import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter.AssetKindToAttributeConverter; +import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter.BillOfMaterialToAttributeConverter; +import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter.CategoryToAttributeConverter; +import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter.DerivedFromToAttributeConverter; +import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter.DescriptionToAttributeConverter; +import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter.EntityTypeToAttributeConverter; +import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter.IdShortToAttributeConverter; +import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter.IdShortToNameConverter; +import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter.IdentificationModelToAttributeConverter; +import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter.IdentificationToAttributeConverter; +import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter.ModelingKindToAttributeConverter; +import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter.ObservedToAttributeConverter; +import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter.OrderedToAttributeConverter; +import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter.SemanticIdToAttributeConverter; +import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter.ValueIdToAttributeConverter; +import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper.AnnotatedRelationshipElementMapper; +import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper.AssetAdministrationShellMapper; +import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper.BasicEventMapper; +import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper.BlobMapper; +import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper.CapabilityMapper; +import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper.EntityMapper; +import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper.FileMapper; +import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper.IdentifiableMapper; +import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper.MultiLanguagePropertyMapper; +import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper.OperationMapper; +import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper.PropertyMapper; +import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper.RangeMapper; +import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper.ReferableMapper; +import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper.ReferenceElementMapper; +import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper.RelationshipElementMapper; +import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper.SubmodelElementCollectionMapper; +import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper.SubmodelElementMapper; +import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper.SubmodelMapper; +import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper.ViewMapper; +import io.adminshell.aas.v3.model.*; +import ma.glasnost.orika.MapperFactory; +import ma.glasnost.orika.impl.ConfigurableMapper; + + +public class AASEnvironmentMapper extends ConfigurableMapper { + + @Override + protected void configure(MapperFactory factory) { + // Register converter + factory.getConverterFactory() + .registerConverter(IdShortToNameConverter.class.getName(), new IdShortToNameConverter()); + factory.getConverterFactory() + .registerConverter(IdentificationToAttributeConverter.class.getName(), new IdentificationToAttributeConverter()); + factory.getConverterFactory() + .registerConverter(IdShortToAttributeConverter.class.getName(), new IdShortToAttributeConverter()); + factory.getConverterFactory() + .registerConverter(AssetKindToAttributeConverter.class.getName(), new AssetKindToAttributeConverter()); + factory.getConverterFactory() + .registerConverter(CategoryToAttributeConverter.class.getName(), new CategoryToAttributeConverter()); + factory.getConverterFactory() + .registerConverter(IdentificationModelToAttributeConverter.class.getName(), new IdentificationModelToAttributeConverter()); + factory.getConverterFactory() + .registerConverter(AdministrativeInformationToAttributeConverter.class.getName(), new AdministrativeInformationToAttributeConverter()); + factory.getConverterFactory() + .registerConverter(DescriptionToAttributeConverter.class.getName(), new DescriptionToAttributeConverter()); + factory.getConverterFactory() + .registerConverter(DerivedFromToAttributeConverter.class.getName(), new DerivedFromToAttributeConverter()); + factory.getConverterFactory() + .registerConverter(ModelingKindToAttributeConverter.class.getName(), new ModelingKindToAttributeConverter()); + factory.getConverterFactory() + .registerConverter(SemanticIdToAttributeConverter.class.getName(), new SemanticIdToAttributeConverter()); + factory.getConverterFactory() + .registerConverter(ValueIdToAttributeConverter.class.getName(), new ValueIdToAttributeConverter()); + factory.getConverterFactory() + .registerConverter(AllowDuplicatesToAttributeConverter.class.getName(), new AllowDuplicatesToAttributeConverter()); + factory.getConverterFactory() + .registerConverter(OrderedToAttributeConverter.class.getName(), new OrderedToAttributeConverter()); + factory.getConverterFactory() + .registerConverter(BillOfMaterialToAttributeConverter.class.getName(), new BillOfMaterialToAttributeConverter()); + factory.getConverterFactory() + .registerConverter(EntityTypeToAttributeConverter.class.getName(), new EntityTypeToAttributeConverter()); + factory.getConverterFactory() + .registerConverter(ObservedToAttributeConverter.class.getName(), new ObservedToAttributeConverter()); + + // Referable mapping + factory.classMap(Referable.class, InternalElement.class) + .mapNulls(true) + .fieldMap("idShort", "name") + .converter(IdShortToNameConverter.class.getName()).add() + .fieldMap("idShort", "attributes[0]") + .converter(IdShortToAttributeConverter.class.getName()).add() + .fieldMap("category", "attributes[1]") + .converter(CategoryToAttributeConverter.class.getName()).add() + .fieldMap("descriptions", "attributes[2]") + .converter(DescriptionToAttributeConverter.class.getName()).add() + .byDefault() + .customize(new ReferableMapper()) + .register(); + + // Identifiable mapping + factory.classMap(Identifiable.class, InternalElement.class) + .mapNulls(true) + .fieldMap("identification", "attributes[0]") + .converter(IdentificationToAttributeConverter.class.getName()).add() + .fieldMap("administration", "attributes[1]") + .converter(AdministrativeInformationToAttributeConverter.class.getName()).add() + .byDefault() + .customize(new IdentifiableMapper()) + .register(); + + // AssetAdministrationShell mapping + factory.classMap(AssetAdministrationShell.class, InternalElement.class) + .mapNulls(true) + .fieldMap("derivedFrom", "attributes[0]") + .converter(DerivedFromToAttributeConverter.class.getName()).add() + .byDefault() + .customize(new AssetAdministrationShellMapper()) + .register(); + + // View mapping + factory.classMap(View.class, InternalElement.class) + .mapNulls(true) + .fieldMap("semanticId", "attributes[0]") + .converter(SemanticIdToAttributeConverter.class.getName()).add() + .byDefault() + .customize(new ViewMapper()) + .register(); + +// // Asset information mapping +// factory.classMap(AssetInformation.class, InternalElement.class) +// .mapNulls(true) +// .fieldMap("assetKind", "attributes[0]") +// .converter(AssetKindToAttributeConverter.class.getName()).add() +// .byDefault() +// .customize(new AssetInformationMapper()) +// .register(); + + // Deprecated since v3 + // Asset mapping +// factory.classMap(Asset.class, InternalElement.class) +// .mapNulls(true) +// .fieldMap("kind", "attributes[0]") +// .converter(AssetKindToAttributeConverter.class.getName()).add() +// .fieldMap("assetIdentificationModel", "attributes[1]") +// .converter(IdentificationModelToAttributeConverter.class.getName()).add() +// .fieldMap("billOfMaterial", "attributes[2]") +// .converter(BillOfMaterialToAttributeConverter.class.getName()).add() +// .byDefault() +// .customize(new AssetMapper()) +// .register(); + + // Submodel mapping + factory.classMap(Submodel.class, InternalElement.class) + .mapNulls(true) + .fieldMap("kind", "attributes[0]") + .converter(ModelingKindToAttributeConverter.class.getName()).add() + .fieldMap("semanticId", "attributes[1]") + .converter(SemanticIdToAttributeConverter.class.getName()).add() + .byDefault() + .customize(new SubmodelMapper()) + .register(); + + // SubmodelElement mapping + factory.classMap(SubmodelElement.class, InternalElement.class) + .mapNulls(true) + .fieldMap("kind", "attributes[0]") + .converter(ModelingKindToAttributeConverter.class.getName()).add() + .fieldMap("semanticId", "attributes[1]") + .converter(SemanticIdToAttributeConverter.class.getName()).add() + .byDefault() + .customize(new SubmodelElementMapper()) + .register(); + + // SubmodelElementCollection mapping + factory.classMap(SubmodelElementCollection.class, InternalElement.class) + .mapNulls(true) + .fieldMap("ordered", "attributes[0]") + .converter(OrderedToAttributeConverter.class.getName()).add() + .fieldMap("allowDuplicates", "attributes[1]") + .converter(AllowDuplicatesToAttributeConverter.class.getName()).add() + .byDefault() + .customize(new SubmodelElementCollectionMapper()) + .register(); + + // Operation mapping + factory.classMap(Operation.class, InternalElement.class) + .mapNulls(true) + .byDefault() + .customize(new OperationMapper()) + .register(); + + // File mapping + factory.classMap(File.class, InternalElement.class) + .mapNulls(true) + .byDefault() + .customize(new FileMapper()) + .register(); + + // Capability mapping + factory.classMap(Capability.class, InternalElement.class) + .mapNulls(true) + .byDefault() + .customize(new CapabilityMapper()) + .register(); + + // Entity mapping + factory.classMap(Entity.class, InternalElement.class) + .mapNulls(true) + .fieldMap("entityType", "attributes[0]") + .converter(EntityTypeToAttributeConverter.class.getName()).add() + .byDefault() + .customize(new EntityMapper()) + .register(); + + // Property mapping + factory.classMap(Property.class, InternalElement.class) + .mapNulls(true) + .fieldMap("valueId", "attributes[0]") + .converter(ValueIdToAttributeConverter.class.getName()).add() + .byDefault() + .customize(new PropertyMapper()) + .register(); + + // Event mapping + factory.classMap(BasicEvent.class, InternalElement.class) + .mapNulls(true) + .fieldMap("observed", "attributes[0]") + .converter(ObservedToAttributeConverter.class.getName()).add() + .byDefault() + .customize(new BasicEventMapper()) + .register(); + + // Blob mapping + factory.classMap(Blob.class, InternalElement.class) + .mapNulls(true) + .byDefault() + .customize(new BlobMapper()) + .register(); + + // Range mapping + factory.classMap(Range.class, InternalElement.class) + .mapNulls(true) + .byDefault() + .customize(new RangeMapper()) + .register(); + + // ReferenceElement mapping + factory.classMap(ReferenceElement.class, InternalElement.class) + .mapNulls(true) + .byDefault() + .customize(new ReferenceElementMapper()) + .register(); + + // ReferenceElement mapping + factory.classMap(MultiLanguageProperty.class, InternalElement.class) + .mapNulls(true) + .byDefault() + .customize(new MultiLanguagePropertyMapper()) + .register(); + + // RelationshipElement mapping + factory.classMap(RelationshipElement.class, InternalElement.class) + .mapNulls(true) + .byDefault() + .customize(new RelationshipElementMapper()) + .register(); + + // AnnotatedRelationshipElement mapping + factory.classMap(AnnotatedRelationshipElement.class, InternalElement.class) + .mapNulls(true) + .byDefault() + .customize(new AnnotatedRelationshipElementMapper()) + .register(); + + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/AdministrativeInformationToAttributeConverter.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/AdministrativeInformationToAttributeConverter.java new file mode 100644 index 00000000..581ea4f1 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/AdministrativeInformationToAttributeConverter.java @@ -0,0 +1,49 @@ +package io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter; + +import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; +import io.adminshell.aas.v3.dataformat.aml.model.caex.Attribute; +import io.adminshell.aas.v3.dataformat.aml.model.caex.RefSemantic; +import io.adminshell.aas.v3.model.AdministrativeInformation; +import java.util.ArrayList; +import java.util.List; +import ma.glasnost.orika.CustomConverter; +import ma.glasnost.orika.MappingContext; +import ma.glasnost.orika.metadata.Type; + +public class AdministrativeInformationToAttributeConverter extends CustomConverter { + + @Override + public Attribute convert(AdministrativeInformation source, Type destinationType, MappingContext mappingContext) { + // Root attribute + Attribute attribute = new Attribute( + "administration", + null, + null, + null, + new RefSemantic(AASNamespace.Identifiable_Administration.getRefSemantic()), + null + ); + + // Nested attributes + List nestedAttributes = new ArrayList<>(); + nestedAttributes.add(new Attribute( + "version", + null, + null, + source.getVersion(), + new RefSemantic(AASNamespace.AdministrationInformation_Version.getRefSemantic()), + null + )); + nestedAttributes.add(new Attribute( + "revision", + null, + null, + source.getRevision(), + new RefSemantic(AASNamespace.AdministrationInformation_Revision.getRefSemantic()), + null) + ); + attribute.setAttributes(nestedAttributes); + + return attribute; + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/AllowDuplicatesToAttributeConverter.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/AllowDuplicatesToAttributeConverter.java new file mode 100644 index 00000000..b6b3efec --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/AllowDuplicatesToAttributeConverter.java @@ -0,0 +1,22 @@ +package io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter; + +import io.adminshell.aas.v3.dataformat.aml.model.caex.Attribute; +import io.adminshell.aas.v3.dataformat.aml.model.caex.RefSemantic; +import ma.glasnost.orika.CustomConverter; +import ma.glasnost.orika.MappingContext; +import ma.glasnost.orika.metadata.Type; + +public class AllowDuplicatesToAttributeConverter extends CustomConverter { + + @Override + public Attribute convert(Boolean source, Type destinationType, MappingContext mappingContext) { + return new Attribute( + "allowDuplicates", + "xs:boolean", + null, + source.toString(), + new RefSemantic("AAS:SubmodelElementCollection/allowDuplicates"), + null + ); + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/AssetKindToAttributeConverter.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/AssetKindToAttributeConverter.java new file mode 100644 index 00000000..95e497f4 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/AssetKindToAttributeConverter.java @@ -0,0 +1,25 @@ +package io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter; + +import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; +import io.adminshell.aas.v3.dataformat.aml.model.caex.Attribute; +import io.adminshell.aas.v3.dataformat.aml.model.caex.RefSemantic; +import io.adminshell.aas.v3.model.*; +import ma.glasnost.orika.CustomConverter; +import ma.glasnost.orika.MappingContext; +import ma.glasnost.orika.metadata.Type; + +public class AssetKindToAttributeConverter extends CustomConverter { + + @Override + public Attribute convert(AssetKind source, Type destinationType, MappingContext mappingContext) { + return new Attribute( + "assetKind", + null, + null, + source.toString(), + new RefSemantic(AASNamespace.Asset_Kind.getRefSemantic()), + null); + } + + +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/BillOfMaterialToAttributeConverter.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/BillOfMaterialToAttributeConverter.java new file mode 100644 index 00000000..0c8566a0 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/BillOfMaterialToAttributeConverter.java @@ -0,0 +1,25 @@ +package io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter; + +import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; +import io.adminshell.aas.v3.dataformat.aml.model.caex.Attribute; +import io.adminshell.aas.v3.dataformat.aml.model.caex.RefSemantic; +import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.util.ReferenceConverterUtil; +import io.adminshell.aas.v3.model.*; +import ma.glasnost.orika.CustomConverter; +import ma.glasnost.orika.MappingContext; +import ma.glasnost.orika.metadata.Type; + +public class BillOfMaterialToAttributeConverter extends CustomConverter { + + @Override + public Attribute convert(Reference source, Type destinationType, MappingContext mappingContext) { + return new Attribute( + "billOfMaterial", + null, + null, + ReferenceConverterUtil.convert(source), + new RefSemantic(AASNamespace.Asset_BillOfMaterial.getRefSemantic()), + null + ); + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/CategoryToAttributeConverter.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/CategoryToAttributeConverter.java new file mode 100644 index 00000000..a3825aec --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/CategoryToAttributeConverter.java @@ -0,0 +1,23 @@ +package io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter; + +import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; +import io.adminshell.aas.v3.dataformat.aml.model.caex.Attribute; +import io.adminshell.aas.v3.dataformat.aml.model.caex.RefSemantic; +import ma.glasnost.orika.CustomConverter; +import ma.glasnost.orika.MappingContext; +import ma.glasnost.orika.metadata.Type; + +public class CategoryToAttributeConverter extends CustomConverter { + + @Override + public Attribute convert(String source, Type destinationType, MappingContext mappingContext) { + return new Attribute( + "category", + null, + null, + source, + new RefSemantic(AASNamespace.Referable_Category.getRefSemantic()), + null + ); + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/DerivedFromToAttributeConverter.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/DerivedFromToAttributeConverter.java new file mode 100644 index 00000000..c53c2183 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/DerivedFromToAttributeConverter.java @@ -0,0 +1,25 @@ +package io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter; + +import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; +import io.adminshell.aas.v3.dataformat.aml.model.caex.Attribute; +import io.adminshell.aas.v3.dataformat.aml.model.caex.RefSemantic; +import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.util.ReferenceConverterUtil; +import io.adminshell.aas.v3.model.*; +import ma.glasnost.orika.CustomConverter; +import ma.glasnost.orika.MappingContext; +import ma.glasnost.orika.metadata.Type; + +public class DerivedFromToAttributeConverter extends CustomConverter { + + @Override + public Attribute convert(Reference source, Type destinationType, MappingContext mappingContext) { + return new Attribute( + "derivedFrom", + null, + null, + ReferenceConverterUtil.convert(source), + new RefSemantic(AASNamespace.AssetAdministrationShell_DerivedFrom.getRefSemantic()), + null + ); + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/DescriptionToAttributeConverter.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/DescriptionToAttributeConverter.java new file mode 100644 index 00000000..420373d0 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/DescriptionToAttributeConverter.java @@ -0,0 +1,49 @@ +package io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter; + +import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; +import io.adminshell.aas.v3.dataformat.aml.model.caex.Attribute; +import io.adminshell.aas.v3.dataformat.aml.model.caex.RefSemantic; +import io.adminshell.aas.v3.model.LangString; +import ma.glasnost.orika.CustomConverter; +import ma.glasnost.orika.MappingContext; +import ma.glasnost.orika.metadata.Type; + +import java.util.ArrayList; +import java.util.List; + +public class DescriptionToAttributeConverter extends CustomConverter, Attribute> { + + @Override + public Attribute convert(List source, Type destinationType, MappingContext mappingContext) { + if(source.isEmpty()) { + return null; + } + + // Root attribute + Attribute attribute = new Attribute( + "description", + null, + null, + null, + new RefSemantic(AASNamespace.Referable_Description.getRefSemantic()), + null + ); + + // Nested attributes + List nestedAttributes = new ArrayList<>(); + attribute.setAttributes(nestedAttributes); + + source.forEach(langString -> { + nestedAttributes.add(new Attribute( + "aml-lang=" + langString.getLanguage(), + null, + null, + langString.getValue(), + null, + null + ));; + }); + + return attribute; + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/EntityTypeToAttributeConverter.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/EntityTypeToAttributeConverter.java new file mode 100644 index 00000000..0540a620 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/EntityTypeToAttributeConverter.java @@ -0,0 +1,24 @@ +package io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter; + +import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; +import io.adminshell.aas.v3.dataformat.aml.model.caex.Attribute; +import io.adminshell.aas.v3.dataformat.aml.model.caex.RefSemantic; +import io.adminshell.aas.v3.model.*; +import ma.glasnost.orika.CustomConverter; +import ma.glasnost.orika.MappingContext; +import ma.glasnost.orika.metadata.Type; + +public class EntityTypeToAttributeConverter extends CustomConverter { + + @Override + public Attribute convert(EntityType source, Type destinationType, MappingContext mappingContext) { + return new Attribute( + "entityType", + null, + null, + source.name(), + new RefSemantic(AASNamespace.Entity_Type.getRefSemantic()), + null + ); + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/IdShortToAttributeConverter.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/IdShortToAttributeConverter.java new file mode 100644 index 00000000..eeb89067 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/IdShortToAttributeConverter.java @@ -0,0 +1,23 @@ +package io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter; + +import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; +import io.adminshell.aas.v3.dataformat.aml.model.caex.Attribute; +import io.adminshell.aas.v3.dataformat.aml.model.caex.RefSemantic; +import ma.glasnost.orika.CustomConverter; +import ma.glasnost.orika.MappingContext; +import ma.glasnost.orika.metadata.Type; + +public class IdShortToAttributeConverter extends CustomConverter { + + @Override + public Attribute convert(String source, Type destinationType, MappingContext mappingContext) { + return new Attribute( + "idShort", + null, + null, + source, + new RefSemantic(AASNamespace.Referable_IdShort.getRefSemantic()), + null + ); + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/IdShortToNameConverter.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/IdShortToNameConverter.java new file mode 100644 index 00000000..71a05ae7 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/IdShortToNameConverter.java @@ -0,0 +1,19 @@ +package io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter; + +import ma.glasnost.orika.CustomConverter; +import ma.glasnost.orika.MappingContext; +import ma.glasnost.orika.metadata.Type; + +import java.util.UUID; + +public class IdShortToNameConverter extends CustomConverter { + + @Override + public String convert(String source, Type destinationType, MappingContext mappingContext) { + if (source == null) { + return UUID.randomUUID().toString(); + } + + return source; + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/IdentificationModelToAttributeConverter.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/IdentificationModelToAttributeConverter.java new file mode 100644 index 00000000..6ffce326 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/IdentificationModelToAttributeConverter.java @@ -0,0 +1,25 @@ +package io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter; + +import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; +import io.adminshell.aas.v3.dataformat.aml.model.caex.Attribute; +import io.adminshell.aas.v3.dataformat.aml.model.caex.RefSemantic; +import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.util.ReferenceConverterUtil; +import io.adminshell.aas.v3.model.*; +import ma.glasnost.orika.CustomConverter; +import ma.glasnost.orika.MappingContext; +import ma.glasnost.orika.metadata.Type; + +public class IdentificationModelToAttributeConverter extends CustomConverter { + + @Override + public Attribute convert(Reference source, Type destinationType, MappingContext mappingContext) { + return new Attribute( + "assetIdentificationModelRef", + null, + null, + ReferenceConverterUtil.convert(source), + new RefSemantic(AASNamespace.Asset_AssetIdentificationModel.getRefSemantic()), + null + ); + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/IdentificationToAttributeConverter.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/IdentificationToAttributeConverter.java new file mode 100644 index 00000000..6341f3e3 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/IdentificationToAttributeConverter.java @@ -0,0 +1,50 @@ +package io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter; + +import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; +import io.adminshell.aas.v3.dataformat.aml.model.caex.Attribute; +import io.adminshell.aas.v3.dataformat.aml.model.caex.RefSemantic; +import io.adminshell.aas.v3.model.*; +import ma.glasnost.orika.CustomConverter; +import ma.glasnost.orika.MappingContext; +import ma.glasnost.orika.metadata.Type; + +import java.util.ArrayList; +import java.util.List; + +public class IdentificationToAttributeConverter extends CustomConverter { + + @Override + public Attribute convert(Identifier source, Type destinationType, MappingContext mappingContext) { + // Root attribute + Attribute attribute = new Attribute( + "identification", + null, + null, + null, + new RefSemantic(AASNamespace.Identifiable_Identification.getRefSemantic()), + null + ); + + // Nested attributes + List nestedAttributes = new ArrayList<>(); + nestedAttributes.add(new Attribute( + "idType", + null, + null, + source.getIdType().toString(), + new RefSemantic(AASNamespace.Identifier_IdType.getRefSemantic()), + null + )); + nestedAttributes.add(new Attribute( + "id", + null, + null, + source.getIdentifier(), + new RefSemantic(AASNamespace.Identifier_Id.getRefSemantic()), + null) + ); + attribute.setAttributes(nestedAttributes); + + return attribute; + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/ModelingKindToAttributeConverter.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/ModelingKindToAttributeConverter.java new file mode 100644 index 00000000..676a3c78 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/ModelingKindToAttributeConverter.java @@ -0,0 +1,23 @@ +package io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter; + +import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; +import io.adminshell.aas.v3.dataformat.aml.model.caex.Attribute; +import io.adminshell.aas.v3.dataformat.aml.model.caex.RefSemantic; +import io.adminshell.aas.v3.model.*; +import ma.glasnost.orika.CustomConverter; +import ma.glasnost.orika.MappingContext; +import ma.glasnost.orika.metadata.Type; + +public class ModelingKindToAttributeConverter extends CustomConverter { + + @Override + public Attribute convert(ModelingKind source, Type destinationType, MappingContext mappingContext) { + return new Attribute( + "kind", + null, + null, + source.toString(), + new RefSemantic(AASNamespace.HasKind_Kind.getRefSemantic()), + null); + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/ObservedToAttributeConverter.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/ObservedToAttributeConverter.java new file mode 100644 index 00000000..0e6a71b8 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/ObservedToAttributeConverter.java @@ -0,0 +1,25 @@ +package io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter; + +import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; +import io.adminshell.aas.v3.dataformat.aml.model.caex.Attribute; +import io.adminshell.aas.v3.dataformat.aml.model.caex.RefSemantic; +import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.util.ReferenceConverterUtil; +import io.adminshell.aas.v3.model.*; +import ma.glasnost.orika.CustomConverter; +import ma.glasnost.orika.MappingContext; +import ma.glasnost.orika.metadata.Type; + +public class ObservedToAttributeConverter extends CustomConverter { + + @Override + public Attribute convert(Reference source, Type destinationType, MappingContext mappingContext) { + return new Attribute( + "observed", + null, + null, + ReferenceConverterUtil.convert(source), + new RefSemantic(AASNamespace.BasicEvent_Observed.getRefSemantic()), + null + ); + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/OrderedToAttributeConverter.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/OrderedToAttributeConverter.java new file mode 100644 index 00000000..86b41305 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/OrderedToAttributeConverter.java @@ -0,0 +1,22 @@ +package io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter; + +import io.adminshell.aas.v3.dataformat.aml.model.caex.Attribute; +import io.adminshell.aas.v3.dataformat.aml.model.caex.RefSemantic; +import ma.glasnost.orika.CustomConverter; +import ma.glasnost.orika.MappingContext; +import ma.glasnost.orika.metadata.Type; + +public class OrderedToAttributeConverter extends CustomConverter { + + @Override + public Attribute convert(Boolean source, Type destinationType, MappingContext mappingContext) { + return new Attribute( + "ordered", + "xs:boolean", + null, + source.toString(), + new RefSemantic("AAS:SubmodelElementCollection/ordered"), + null + ); + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/PropertyValueToAttributeConverter.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/PropertyValueToAttributeConverter.java new file mode 100644 index 00000000..d77cb73c --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/PropertyValueToAttributeConverter.java @@ -0,0 +1,24 @@ +package io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter; + +import io.adminshell.aas.v3.dataformat.aml.model.caex.Attribute; +import io.adminshell.aas.v3.dataformat.aml.model.caex.RefSemantic; +import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.util.ReferenceConverterUtil; +import io.adminshell.aas.v3.model.*; +import ma.glasnost.orika.CustomConverter; +import ma.glasnost.orika.MappingContext; +import ma.glasnost.orika.metadata.Type; + +public class PropertyValueToAttributeConverter extends CustomConverter { + + @Override + public Attribute convert(Reference source, Type destinationType, MappingContext mappingContext) { + return new Attribute( + "semanticId", + null, + null, + ReferenceConverterUtil.convert(source), + new RefSemantic("AAS:HasSemantics/semanticId"), + null + ); + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/SemanticIdToAttributeConverter.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/SemanticIdToAttributeConverter.java new file mode 100644 index 00000000..551c27c2 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/SemanticIdToAttributeConverter.java @@ -0,0 +1,25 @@ +package io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter; + +import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; +import io.adminshell.aas.v3.dataformat.aml.model.caex.Attribute; +import io.adminshell.aas.v3.dataformat.aml.model.caex.RefSemantic; +import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.util.ReferenceConverterUtil; +import io.adminshell.aas.v3.model.*; +import ma.glasnost.orika.CustomConverter; +import ma.glasnost.orika.MappingContext; +import ma.glasnost.orika.metadata.Type; + +public class SemanticIdToAttributeConverter extends CustomConverter { + + @Override + public Attribute convert(Reference source, Type destinationType, MappingContext mappingContext) { + return new Attribute( + "semanticId", + null, + null, + ReferenceConverterUtil.convert(source), + new RefSemantic(AASNamespace.HasSemantics_SemanticId.getRefSemantic()), + null + ); + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/ValueIdToAttributeConverter.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/ValueIdToAttributeConverter.java new file mode 100644 index 00000000..67579b8f --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/ValueIdToAttributeConverter.java @@ -0,0 +1,25 @@ +package io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter; + +import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; +import io.adminshell.aas.v3.dataformat.aml.model.caex.Attribute; +import io.adminshell.aas.v3.dataformat.aml.model.caex.RefSemantic; +import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.util.ReferenceConverterUtil; +import io.adminshell.aas.v3.model.*; +import ma.glasnost.orika.CustomConverter; +import ma.glasnost.orika.MappingContext; +import ma.glasnost.orika.metadata.Type; + +public class ValueIdToAttributeConverter extends CustomConverter { + + @Override + public Attribute convert(Reference source, Type destinationType, MappingContext mappingContext) { + return new Attribute( + "valueId", + null, + null, + ReferenceConverterUtil.convert(source), + new RefSemantic(AASNamespace.Property_ValueId.getRefSemantic()), + null + ); + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/AnnotatedRelationshipElementMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/AnnotatedRelationshipElementMapper.java new file mode 100644 index 00000000..90cc5487 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/AnnotatedRelationshipElementMapper.java @@ -0,0 +1,16 @@ +package io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper; + +import io.adminshell.aas.v3.dataformat.aml.model.caex.AssetAdministrationShellRoleClassLib; +import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElement; +import io.adminshell.aas.v3.dataformat.aml.model.caex.RoleRequirements; +import io.adminshell.aas.v3.model.*; +import ma.glasnost.orika.CustomMapper; +import ma.glasnost.orika.MappingContext; + +public class AnnotatedRelationshipElementMapper extends CustomMapper { + + @Override + public void mapAtoB(AnnotatedRelationshipElement annotatedRelationshipElement, InternalElement internalElement, MappingContext context) { + internalElement.setRoleRequirements(new RoleRequirements(AssetAdministrationShellRoleClassLib.AnnotatedRelationshipElement.getRefBaseRoleClassPath())); + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/AssetAdministrationShellMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/AssetAdministrationShellMapper.java new file mode 100644 index 00000000..c30dca37 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/AssetAdministrationShellMapper.java @@ -0,0 +1,45 @@ +package io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper; + +import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; +import io.adminshell.aas.v3.dataformat.aml.model.caex.AssetAdministrationShellRoleClassLib; +import io.adminshell.aas.v3.dataformat.aml.model.caex.Attribute; +import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElement; +import io.adminshell.aas.v3.dataformat.aml.model.caex.RefSemantic; +import io.adminshell.aas.v3.dataformat.aml.model.caex.RoleRequirements; +import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.util.ReferenceConverterUtil; +import io.adminshell.aas.v3.model.*; +import ma.glasnost.orika.CustomMapper; +import ma.glasnost.orika.MappingContext; + +import java.util.ArrayList; + +public class AssetAdministrationShellMapper extends CustomMapper { + + @Override + public void mapAtoB(AssetAdministrationShell assetAdministrationShell, InternalElement internalElement, MappingContext context) { + internalElement.setRoleRequirements(new RoleRequirements(AssetAdministrationShellRoleClassLib.AssetAdministrationShell.getRefBaseRoleClassPath())); + + // asset information + // submodel references + Attribute submodels = new Attribute( + "submodels", + null, + null, + null, + new RefSemantic(AASNamespace.AssetAdministrationShell_Submodels.getRefSemantic()), + null + ); + submodels.setAttributes(new ArrayList<>()); + assetAdministrationShell.getSubmodels().forEach(submodel -> { + submodels.getAttributes().add(new Attribute( + "reference", + null, + null, + ReferenceConverterUtil.convert(submodel), + new RefSemantic(AASNamespace.ReferenceElement_Value.getRefSemantic()), + null + )); + }); + internalElement.getAttributes().add(submodels); + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/AssetInformationMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/AssetInformationMapper.java new file mode 100644 index 00000000..6cdaf575 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/AssetInformationMapper.java @@ -0,0 +1,93 @@ +package io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper; + +import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; +import io.adminshell.aas.v3.dataformat.aml.model.caex.AssetAdministrationShellRoleClassLib; +import io.adminshell.aas.v3.dataformat.aml.model.caex.Attribute; +import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElement; +import io.adminshell.aas.v3.dataformat.aml.model.caex.RefSemantic; +import io.adminshell.aas.v3.dataformat.aml.model.caex.RoleRequirements; +import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.util.FileConverterUtil; +import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.util.ReferenceConverterUtil; +import io.adminshell.aas.v3.model.AssetInformation; +import ma.glasnost.orika.CustomMapper; +import ma.glasnost.orika.MappingContext; + +import java.util.ArrayList; + +public class AssetInformationMapper extends CustomMapper { + + @Override + public void mapAtoB(AssetInformation assetInformation, InternalElement internalElement, MappingContext context) { + internalElement.setRoleRequirements(new RoleRequirements(AssetAdministrationShellRoleClassLib.AssetInformation.getRefBaseRoleClassPath())); + + // globalAssetId + internalElement.getAttributes().add(new Attribute( + "globalAssetId", + null, + null, + ReferenceConverterUtil.convert(assetInformation.getGlobalAssetId()), + new RefSemantic(AASNamespace.Asset_GlobalAssetId.getRefSemantic()), + null + )); + + // specificAssetId + Attribute attributeSpecificAssetId = new Attribute( + "specificAssetId", + null, + null, + null, + new RefSemantic(AASNamespace.Asset_GlobalAssetId.getRefSemantic()), + null + ); + attributeSpecificAssetId.setAttributes(new ArrayList<>()); + assetInformation.getSpecificAssetIds().forEach(specificAssetId -> { + attributeSpecificAssetId.getAttributes().add(new Attribute( + "key", + null, + null, + specificAssetId.getKey(), + new RefSemantic(AASNamespace.IdentifierKeyValuePair_Key.getRefSemantic()), + null + )); + attributeSpecificAssetId.getAttributes().add(new Attribute( + "value", + null, + null, + specificAssetId.getValue(), + new RefSemantic(AASNamespace.IdentifierKeyValuePair_Value.getRefSemantic()), + null + )); + internalElement.getAttributes().add(attributeSpecificAssetId); + }); + + // bill of material + Attribute attributeBillOfMaterial = new Attribute( + "billOfMaterial", + null, + null, + null, + new RefSemantic(AASNamespace.Asset_BillOfMaterial.getRefSemantic()), + null + ); + attributeBillOfMaterial.setAttributes(new ArrayList<>()); + assetInformation.getBillOfMaterials().forEach(bill -> { + attributeBillOfMaterial.getAttributes().add(new Attribute( + "reference", + null, + null, + ReferenceConverterUtil.convert(bill), + new RefSemantic(AASNamespace.BillOfMaterial_Reference.getRefSemantic()), + null + )); + internalElement.getAttributes().add(attributeBillOfMaterial); + }); + + // file + internalElement.getAttributes().add(FileConverterUtil.convert( + assetInformation.getDefaultThumbnail(), + "defaultThumbnail", + new RefSemantic(AASNamespace.Asset_DefaultThumbnail.getRefSemantic()) + )); + + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/AssetMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/AssetMapper.java new file mode 100644 index 00000000..a1db0e87 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/AssetMapper.java @@ -0,0 +1,16 @@ +package io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper; + +import io.adminshell.aas.v3.dataformat.aml.model.caex.AssetAdministrationShellRoleClassLib; +import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElement; +import io.adminshell.aas.v3.dataformat.aml.model.caex.RoleRequirements; +import io.adminshell.aas.v3.model.*; +import ma.glasnost.orika.CustomMapper; +import ma.glasnost.orika.MappingContext; + +public class AssetMapper extends CustomMapper { + + @Override + public void mapAtoB(Asset asset, InternalElement internalElement, MappingContext context) { + internalElement.setRoleRequirements(new RoleRequirements(AssetAdministrationShellRoleClassLib.Asset.getRefBaseRoleClassPath())); + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/BasicEventMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/BasicEventMapper.java new file mode 100644 index 00000000..8396092b --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/BasicEventMapper.java @@ -0,0 +1,17 @@ +package io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper; + +import io.adminshell.aas.v3.dataformat.aml.model.caex.AssetAdministrationShellRoleClassLib; +import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElement; +import io.adminshell.aas.v3.dataformat.aml.model.caex.RoleRequirements; +import io.adminshell.aas.v3.model.*; +import ma.glasnost.orika.CustomMapper; +import ma.glasnost.orika.MappingContext; + +public class BasicEventMapper extends CustomMapper { + + @Override + public void mapAtoB(BasicEvent basicEvent, InternalElement internalElement, MappingContext context) { + internalElement.setRoleRequirements(new RoleRequirements(AssetAdministrationShellRoleClassLib.BasicEvent.getRefBaseRoleClassPath())); + + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/BlobMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/BlobMapper.java new file mode 100644 index 00000000..590b5d31 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/BlobMapper.java @@ -0,0 +1,50 @@ +package io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper; + +import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; +import io.adminshell.aas.v3.dataformat.aml.model.caex.AssetAdministrationShellInterfaceClassLib; +import io.adminshell.aas.v3.dataformat.aml.model.caex.AssetAdministrationShellRoleClassLib; +import io.adminshell.aas.v3.dataformat.aml.model.caex.Attribute; +import io.adminshell.aas.v3.dataformat.aml.model.caex.ExternalInterface; +import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElement; +import io.adminshell.aas.v3.dataformat.aml.model.caex.RefSemantic; +import io.adminshell.aas.v3.dataformat.aml.model.caex.RoleRequirements; +import io.adminshell.aas.v3.model.*; +import ma.glasnost.orika.CustomMapper; +import ma.glasnost.orika.MappingContext; + +import java.util.ArrayList; +import java.util.Arrays; + +public class BlobMapper extends CustomMapper { + + @Override + public void mapAtoB(Blob blob, InternalElement internalElement, MappingContext context) { + internalElement.setRoleRequirements(new RoleRequirements(AssetAdministrationShellRoleClassLib.Blob.getRefBaseRoleClassPath())); + + ExternalInterface externalInterface = new ExternalInterface(); + externalInterface.setName("FileDataReference"); + externalInterface.setRefBaseClassPath(AssetAdministrationShellInterfaceClassLib.FileDataReference.getRefBaseRoleClassPath()); + externalInterface.setAttributes(new ArrayList<>()); + externalInterface.getAttributes().add(new Attribute( + "MIMEType", + "xs:anyURI", + null, + blob.getMimeType(), + new RefSemantic(AASNamespace.Blob_MimeType.getRefSemantic()), + null + )); + externalInterface.getAttributes().add(new Attribute( + "refURI", + "xs:string", + null, + Arrays.toString(blob.getValue()), + new RefSemantic(AASNamespace.Blob_Value.getRefSemantic()), + null + )); + + if (internalElement.getExternalInterfaces() == null) { + internalElement.setExternalInterfaces(new ArrayList<>()); + } + internalElement.getExternalInterfaces().add(externalInterface); + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/CapabilityMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/CapabilityMapper.java new file mode 100644 index 00000000..aafb0215 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/CapabilityMapper.java @@ -0,0 +1,17 @@ +package io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper; + +import io.adminshell.aas.v3.dataformat.aml.model.caex.AssetAdministrationShellRoleClassLib; +import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElement; +import io.adminshell.aas.v3.dataformat.aml.model.caex.RoleRequirements; +import io.adminshell.aas.v3.model.*; +import ma.glasnost.orika.CustomMapper; +import ma.glasnost.orika.MappingContext; + +public class CapabilityMapper extends CustomMapper { + + @Override + public void mapAtoB(Capability capability, InternalElement internalElement, MappingContext context) { + internalElement.setRoleRequirements(new RoleRequirements(AssetAdministrationShellRoleClassLib.Capability.getRefBaseRoleClassPath())); + } +} + diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/EntityMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/EntityMapper.java new file mode 100644 index 00000000..283772d1 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/EntityMapper.java @@ -0,0 +1,28 @@ +package io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper; + +import io.adminshell.aas.v3.dataformat.aml.model.caex.AssetAdministrationShellRoleClassLib; +import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElement; +import io.adminshell.aas.v3.dataformat.aml.model.caex.RoleRequirements; +import io.adminshell.aas.v3.model.*; +import ma.glasnost.orika.CustomMapper; +import ma.glasnost.orika.MappingContext; + +import java.util.ArrayList; +import java.util.List; + +public class EntityMapper extends CustomMapper { + + @Override + public void mapAtoB(Entity entity, InternalElement internalElement, MappingContext context) { + internalElement.setRoleRequirements(new RoleRequirements(AssetAdministrationShellRoleClassLib.Entity.getRefBaseRoleClassPath())); + + List nested = new ArrayList<>(); + + entity.getStatements().forEach(submodelElement -> { + InternalElement statementInternalElement = new InternalElement(); + nested.add(statementInternalElement); + }); + + internalElement.setInternalElements(nested); + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/FileMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/FileMapper.java new file mode 100644 index 00000000..48369ba4 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/FileMapper.java @@ -0,0 +1,49 @@ +package io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper; + +import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; +import io.adminshell.aas.v3.dataformat.aml.model.caex.AssetAdministrationShellInterfaceClassLib; +import io.adminshell.aas.v3.dataformat.aml.model.caex.AssetAdministrationShellRoleClassLib; +import io.adminshell.aas.v3.dataformat.aml.model.caex.Attribute; +import io.adminshell.aas.v3.dataformat.aml.model.caex.ExternalInterface; +import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElement; +import io.adminshell.aas.v3.dataformat.aml.model.caex.RefSemantic; +import io.adminshell.aas.v3.dataformat.aml.model.caex.RoleRequirements; +import io.adminshell.aas.v3.model.*; +import ma.glasnost.orika.CustomMapper; +import ma.glasnost.orika.MappingContext; + +import java.util.ArrayList; + +public class FileMapper extends CustomMapper { + + @Override + public void mapAtoB(File file, InternalElement internalElement, MappingContext context) { + internalElement.setRoleRequirements(new RoleRequirements(AssetAdministrationShellRoleClassLib.File.getRefBaseRoleClassPath())); + + ExternalInterface externalInterface = new ExternalInterface(); + externalInterface.setName("FileDataReference"); + externalInterface.setRefBaseClassPath(AssetAdministrationShellInterfaceClassLib.FileDataReference.getRefBaseRoleClassPath()); + externalInterface.setAttributes(new ArrayList<>()); + externalInterface.getAttributes().add(new Attribute( + "MIMEType", + "xs:anyURI", + null, + file.getMimeType(), + new RefSemantic(AASNamespace.File_MimeType.getRefSemantic()), + null + )); + externalInterface.getAttributes().add(new Attribute( + "refURI", + "xs:string", + null, + file.getValue(), + new RefSemantic(AASNamespace.File_Value.getRefSemantic()), + null + )); + + if (internalElement.getExternalInterfaces() == null) { + internalElement.setExternalInterfaces(new ArrayList<>()); + } + internalElement.getExternalInterfaces().add(externalInterface); + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/IdentifiableMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/IdentifiableMapper.java new file mode 100644 index 00000000..ee7ffbb1 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/IdentifiableMapper.java @@ -0,0 +1,14 @@ +package io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper; + +import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElement; +import io.adminshell.aas.v3.model.Identifiable; +import ma.glasnost.orika.CustomMapper; +import ma.glasnost.orika.MappingContext; + +public class IdentifiableMapper extends CustomMapper { + + @Override + public void mapAtoB(Identifiable identifiable, InternalElement internalElement, MappingContext context) { + + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/MultiLanguagePropertyMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/MultiLanguagePropertyMapper.java new file mode 100644 index 00000000..e680102b --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/MultiLanguagePropertyMapper.java @@ -0,0 +1,56 @@ +package io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper; + +import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; +import io.adminshell.aas.v3.dataformat.aml.model.caex.AssetAdministrationShellRoleClassLib; +import io.adminshell.aas.v3.dataformat.aml.model.caex.Attribute; +import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElement; +import io.adminshell.aas.v3.dataformat.aml.model.caex.RefSemantic; +import io.adminshell.aas.v3.dataformat.aml.model.caex.RoleRequirements; +import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.util.ReferenceConverterUtil; +import io.adminshell.aas.v3.model.MultiLanguageProperty; +import ma.glasnost.orika.CustomMapper; +import ma.glasnost.orika.MappingContext; +import java.util.ArrayList; +import java.util.List; + +public class MultiLanguagePropertyMapper extends CustomMapper { + + @Override + public void mapAtoB(MultiLanguageProperty multiLanguageProperty, InternalElement internalElement, MappingContext context) { + internalElement.setRoleRequirements(new RoleRequirements(AssetAdministrationShellRoleClassLib.MultiLanguageProperty.getRefBaseRoleClassPath())); + + internalElement.getAttributes().add(new Attribute( + "valueId", + null, + null, + ReferenceConverterUtil.convert(multiLanguageProperty.getValueId()), + new RefSemantic(AASNamespace.MultiLanguageProperty_ValueId.getRefSemantic()), + null + )); + + // Language root attribute + Attribute valueAttribute = new Attribute( + "value", + null, + null, + null, + new RefSemantic(AASNamespace.MultiLanguageProperty_Value.getRefSemantic()), + null + ); + internalElement.getAttributes().add(valueAttribute); + + // Language nested attributes + List nestedAttributes = new ArrayList<>(); + valueAttribute.setAttributes(nestedAttributes); + multiLanguageProperty.getValues().forEach(langString -> { + nestedAttributes.add(new Attribute( + "aml-lang=" + langString.getLanguage(), + null, + null, + langString.getValue(), + null, + null + )); + }); + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/OperationMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/OperationMapper.java new file mode 100644 index 00000000..4fca056a --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/OperationMapper.java @@ -0,0 +1,31 @@ +package io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper; + +import io.adminshell.aas.v3.dataformat.aml.model.caex.AssetAdministrationShellRoleClassLib; +import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElement; +import io.adminshell.aas.v3.dataformat.aml.model.caex.RoleRequirements; +import io.adminshell.aas.v3.model.Operation; +import ma.glasnost.orika.CustomMapper; +import ma.glasnost.orika.MappingContext; +import java.util.ArrayList; + +public class OperationMapper extends CustomMapper { + + @Override + public void mapAtoB(Operation operation, InternalElement internalElement, MappingContext context) { + internalElement.setRoleRequirements(new RoleRequirements(AssetAdministrationShellRoleClassLib.Operation.getRefBaseRoleClassPath())); + + InternalElement inputVar = new InternalElement(); + inputVar.setRoleRequirements(new RoleRequirements(AssetAdministrationShellRoleClassLib.OperationInputVar.getRefBaseRoleClassPath())); + + InternalElement outputVar = new InternalElement(); + outputVar.setRoleRequirements(new RoleRequirements(AssetAdministrationShellRoleClassLib.OperationOutputVar.getRefBaseRoleClassPath())); + + InternalElement inoutVar = new InternalElement(); + inoutVar.setRoleRequirements(new RoleRequirements(AssetAdministrationShellRoleClassLib.OperationInOutputVar.getRefBaseRoleClassPath())); + + internalElement.setInternalElements(new ArrayList<>()); + internalElement.getInternalElements().add(inputVar); + internalElement.getInternalElements().add(outputVar); + internalElement.getInternalElements().add(inoutVar); + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/PropertyMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/PropertyMapper.java new file mode 100644 index 00000000..879a04bd --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/PropertyMapper.java @@ -0,0 +1,27 @@ +package io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper; + +import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; +import io.adminshell.aas.v3.dataformat.aml.model.caex.AssetAdministrationShellRoleClassLib; +import io.adminshell.aas.v3.dataformat.aml.model.caex.Attribute; +import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElement; +import io.adminshell.aas.v3.dataformat.aml.model.caex.RefSemantic; +import io.adminshell.aas.v3.dataformat.aml.model.caex.RoleRequirements; +import io.adminshell.aas.v3.model.Property; +import ma.glasnost.orika.CustomMapper; +import ma.glasnost.orika.MappingContext; + +public class PropertyMapper extends CustomMapper { + + @Override + public void mapAtoB(Property property, InternalElement internalElement, MappingContext context) { + internalElement.setRoleRequirements(new RoleRequirements(AssetAdministrationShellRoleClassLib.Property.getRefBaseRoleClassPath())); + internalElement.getAttributes().add(new Attribute( + "value", + "xs:" + property.getValueType(), + null, + property.getValue(), + new RefSemantic(AASNamespace.Property_Value.getRefSemantic()), + null + )); + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/RangeMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/RangeMapper.java new file mode 100644 index 00000000..f228285c --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/RangeMapper.java @@ -0,0 +1,35 @@ +package io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper; + +import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; +import io.adminshell.aas.v3.dataformat.aml.model.caex.AssetAdministrationShellRoleClassLib; +import io.adminshell.aas.v3.dataformat.aml.model.caex.Attribute; +import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElement; +import io.adminshell.aas.v3.dataformat.aml.model.caex.RefSemantic; +import io.adminshell.aas.v3.dataformat.aml.model.caex.RoleRequirements; +import io.adminshell.aas.v3.model.Range; +import ma.glasnost.orika.CustomMapper; +import ma.glasnost.orika.MappingContext; + +public class RangeMapper extends CustomMapper { + + @Override + public void mapAtoB(Range range, InternalElement internalElement, MappingContext context) { + internalElement.setRoleRequirements(new RoleRequirements(AssetAdministrationShellRoleClassLib.Range.getRefBaseRoleClassPath())); + internalElement.getAttributes().add(new Attribute( + "max", + "xs:" + range.getValueType(), + null, + range.getMax(), + new RefSemantic(AASNamespace.Range_Max.getRefSemantic()), + null + )); + internalElement.getAttributes().add(new Attribute( + "min", + "xs:" + range.getValueType(), + null, + range.getMin(), + new RefSemantic(AASNamespace.Range_Min.getRefSemantic()), + null + )); + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/ReferableMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/ReferableMapper.java new file mode 100644 index 00000000..800da259 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/ReferableMapper.java @@ -0,0 +1,14 @@ +package io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper; + +import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElement; +import io.adminshell.aas.v3.model.Referable; +import ma.glasnost.orika.CustomMapper; +import ma.glasnost.orika.MappingContext; + +public class ReferableMapper extends CustomMapper { + + @Override + public void mapAtoB(Referable referable, InternalElement internalElement, MappingContext context) { + + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/ReferenceElementMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/ReferenceElementMapper.java new file mode 100644 index 00000000..d63baf5f --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/ReferenceElementMapper.java @@ -0,0 +1,28 @@ +package io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper; + +import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; +import io.adminshell.aas.v3.dataformat.aml.model.caex.AssetAdministrationShellRoleClassLib; +import io.adminshell.aas.v3.dataformat.aml.model.caex.Attribute; +import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElement; +import io.adminshell.aas.v3.dataformat.aml.model.caex.RefSemantic; +import io.adminshell.aas.v3.dataformat.aml.model.caex.RoleRequirements; +import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.util.ReferenceConverterUtil; +import io.adminshell.aas.v3.model.ReferenceElement; +import ma.glasnost.orika.CustomMapper; +import ma.glasnost.orika.MappingContext; + +public class ReferenceElementMapper extends CustomMapper { + + @Override + public void mapAtoB(ReferenceElement referenceElement, InternalElement internalElement, MappingContext context) { + internalElement.setRoleRequirements(new RoleRequirements(AssetAdministrationShellRoleClassLib.ReferenceElement.getRefBaseRoleClassPath())); + internalElement.getAttributes().add(new Attribute( + "value", + null, + null, + ReferenceConverterUtil.convert(referenceElement.getValue()), + new RefSemantic(AASNamespace.ReferenceElement_Value.getRefSemantic()), + null + )); + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/RelationshipElementMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/RelationshipElementMapper.java new file mode 100644 index 00000000..bbc528b1 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/RelationshipElementMapper.java @@ -0,0 +1,38 @@ +package io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper; + +import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; +import io.adminshell.aas.v3.dataformat.aml.model.caex.AssetAdministrationShellRoleClassLib; +import io.adminshell.aas.v3.dataformat.aml.model.caex.Attribute; +import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElement; +import io.adminshell.aas.v3.dataformat.aml.model.caex.RefSemantic; +import io.adminshell.aas.v3.dataformat.aml.model.caex.RoleRequirements; +import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.util.ReferenceConverterUtil; +import io.adminshell.aas.v3.model.RelationshipElement; +import ma.glasnost.orika.CustomMapper; +import ma.glasnost.orika.MappingContext; + +public class RelationshipElementMapper extends CustomMapper { + + @Override + public void mapAtoB(RelationshipElement relationshipElement, InternalElement internalElement, MappingContext context) { + internalElement.setRoleRequirements(new RoleRequirements(AssetAdministrationShellRoleClassLib.RelationshipElementMapper.getRefBaseRoleClassPath())); + + internalElement.getAttributes().add(new Attribute( + "first", + null, + null, + ReferenceConverterUtil.convert(relationshipElement.getFirst()), + new RefSemantic(AASNamespace.RelationshipElement_First.getRefSemantic()), + null + )); + + internalElement.getAttributes().add(new Attribute( + "second", + null, + null, + ReferenceConverterUtil.convert(relationshipElement.getSecond()), + new RefSemantic(AASNamespace.RelationshipElement_Second.getRefSemantic()), + null + )); + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/SubmodelElementCollectionMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/SubmodelElementCollectionMapper.java new file mode 100644 index 00000000..80734817 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/SubmodelElementCollectionMapper.java @@ -0,0 +1,16 @@ +package io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper; + +import io.adminshell.aas.v3.dataformat.aml.model.caex.AssetAdministrationShellRoleClassLib; +import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElement; +import io.adminshell.aas.v3.dataformat.aml.model.caex.RoleRequirements; +import io.adminshell.aas.v3.model.SubmodelElementCollection; +import ma.glasnost.orika.CustomMapper; +import ma.glasnost.orika.MappingContext; + +public class SubmodelElementCollectionMapper extends CustomMapper { + + @Override + public void mapAtoB(SubmodelElementCollection submodelElementCollection, InternalElement internalElement, MappingContext context) { + internalElement.setRoleRequirements(new RoleRequirements(AssetAdministrationShellRoleClassLib.SubmodelElementCollection.getRefBaseRoleClassPath())); + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/SubmodelElementMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/SubmodelElementMapper.java new file mode 100644 index 00000000..22b6e7ff --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/SubmodelElementMapper.java @@ -0,0 +1,15 @@ +package io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper; + +import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElement; +import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.util.QualifierConverterUtil; +import io.adminshell.aas.v3.model.SubmodelElement; +import ma.glasnost.orika.CustomMapper; +import ma.glasnost.orika.MappingContext; + +public class SubmodelElementMapper extends CustomMapper { + + @Override + public void mapAtoB(SubmodelElement submodelElement, InternalElement internalElement, MappingContext context) { + QualifierConverterUtil.createQualifierAttributesForSubmodelElement(submodelElement, internalElement); + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/SubmodelMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/SubmodelMapper.java new file mode 100644 index 00000000..7022390a --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/SubmodelMapper.java @@ -0,0 +1,18 @@ +package io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper; + +import io.adminshell.aas.v3.dataformat.aml.model.caex.AssetAdministrationShellRoleClassLib; +import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElement; +import io.adminshell.aas.v3.dataformat.aml.model.caex.RoleRequirements; +import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.util.QualifierConverterUtil; +import io.adminshell.aas.v3.model.Submodel; +import ma.glasnost.orika.CustomMapper; +import ma.glasnost.orika.MappingContext; + +public class SubmodelMapper extends CustomMapper { + + @Override + public void mapAtoB(Submodel submodel, InternalElement internalElement, MappingContext context) { + internalElement.setRoleRequirements(new RoleRequirements(AssetAdministrationShellRoleClassLib.Submodel.getRefBaseRoleClassPath())); + QualifierConverterUtil.createQualifierAttributesForSubmodel(submodel, internalElement); + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/ViewMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/ViewMapper.java new file mode 100644 index 00000000..cdca5a64 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/ViewMapper.java @@ -0,0 +1,20 @@ +package io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper; + +import io.adminshell.aas.v3.dataformat.aml.model.caex.AssetAdministrationShellRoleClassLib; +import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElement; +import io.adminshell.aas.v3.dataformat.aml.model.caex.RoleRequirements; +import io.adminshell.aas.v3.model.View; +import ma.glasnost.orika.CustomMapper; +import ma.glasnost.orika.MappingContext; + +public class ViewMapper extends CustomMapper { + + @Override + public void mapAtoB(View view, InternalElement internalElement, MappingContext context) { + internalElement.setRoleRequirements(new RoleRequirements(AssetAdministrationShellRoleClassLib.View.getRefBaseRoleClassPath())); + + view.getContainedElements().forEach(containedElement -> { + + }); + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/util/FileConverterUtil.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/util/FileConverterUtil.java new file mode 100644 index 00000000..7d24a2fb --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/util/FileConverterUtil.java @@ -0,0 +1,46 @@ +package io.adminshell.aas.v3.dataformat.aml.serialize.mapper.util; + +import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; +import io.adminshell.aas.v3.dataformat.aml.model.caex.Attribute; +import io.adminshell.aas.v3.dataformat.aml.model.caex.RefSemantic; +import io.adminshell.aas.v3.model.File; + +import java.util.ArrayList; + +public class FileConverterUtil { + + public static Attribute convert(File file, String rootName, RefSemantic rootRefSemantic) { + if (file == null) { + return null; + } + + Attribute attribute = new Attribute( + rootName, + null, + null, + null, + rootRefSemantic, + null + ); + attribute.setAttributes(new ArrayList<>()); + + attribute.getAttributes().add(new Attribute( + "MIMEType", + "xs:anyURI", + null, + file.getMimeType(), + new RefSemantic(AASNamespace.File_MimeType.getRefSemantic()), + null + )); + attribute.getAttributes().add(new Attribute( + "refURI", + "xs:string", + null, + file.getValue(), + new RefSemantic(AASNamespace.File_Value.getRefSemantic()), + null + )); + + return attribute; + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/util/QualifierConverterUtil.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/util/QualifierConverterUtil.java new file mode 100644 index 00000000..6a49fe71 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/util/QualifierConverterUtil.java @@ -0,0 +1,80 @@ +package io.adminshell.aas.v3.dataformat.aml.serialize.mapper.util; + +import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; +import io.adminshell.aas.v3.dataformat.aml.model.caex.Attribute; +import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElement; +import io.adminshell.aas.v3.dataformat.aml.model.caex.RefSemantic; +import io.adminshell.aas.v3.model.Constraint; +import io.adminshell.aas.v3.model.Qualifier; +import io.adminshell.aas.v3.model.Submodel; +import io.adminshell.aas.v3.model.SubmodelElement; +import java.util.ArrayList; + +public class QualifierConverterUtil { + + public static void createQualifierAttributesForSubmodelElement(SubmodelElement submodelElement, InternalElement internalElement) { + if (submodelElement.getQualifiers() == null) { + return; + } + submodelElement.getQualifiers().forEach(qualifier -> { + createAttributes(qualifier, internalElement); + }); + } + + public static void createQualifierAttributesForSubmodel(Submodel submodel, InternalElement internalElement) { + if (submodel.getQualifiers() == null) { + return; + } + submodel.getQualifiers().forEach(qualifier -> { + createAttributes(qualifier, internalElement); + }); + } + + private static void createAttributes(Constraint constraint, InternalElement internalElement) { + if (constraint instanceof Qualifier) { + + // Root qualifier attribute + Attribute rootAttribute = new Attribute( + String.format("qualifier:%s=%s", + ((Qualifier) constraint).getType(), + ((Qualifier) constraint).getValue()), + null, + null, + null, + new RefSemantic(AASNamespace.Qualifier_Qualifier.getRefSemantic()), + null + ); + rootAttribute.setAttributes(new ArrayList<>()); + + // Nested attributes + rootAttribute.getAttributes().add(new Attribute( + "type", + null, + null, + "xs:" + ((Qualifier) constraint).getValueType(), + new RefSemantic(AASNamespace.Qualifier_Type.getRefSemantic()), + null + ) + ); + rootAttribute.getAttributes().add(new Attribute( + "value", + null, + null, + ((Qualifier) constraint).getValue(), + new RefSemantic(AASNamespace.Qualifier_Value.getRefSemantic()), + null + ) + ); + rootAttribute.getAttributes().add(new Attribute( + "semanticId", + null, + null, + ReferenceConverterUtil.convert(((Qualifier) constraint).getSemanticId()), + new RefSemantic(AASNamespace.HasSemantics_SemanticId.getRefSemantic()), + null + )); + + internalElement.getAttributes().add(rootAttribute); + } + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/util/ReferenceConverterUtil.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/util/ReferenceConverterUtil.java new file mode 100644 index 00000000..128da9bb --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/util/ReferenceConverterUtil.java @@ -0,0 +1,41 @@ +package io.adminshell.aas.v3.dataformat.aml.serialize.mapper.util; + +//import de.fraunhofer.iosb.ilt.aas.service.model.common.types.reference.Key; +//import de.fraunhofer.iosb.ilt.aas.service.model.common.types.reference.Reference; +import io.adminshell.aas.v3.model.*; + +import java.util.Iterator; + +public class ReferenceConverterUtil { + + public static String convert(Reference reference) { + if(reference == null) { + return null; + } + + StringBuilder builder = new StringBuilder(); + + Iterator stringIterator = reference.getKeys().iterator(); + while (stringIterator.hasNext()) { + Key key = stringIterator.next(); + builder.append("("); + builder.append(key.getType()); + builder.append(")"); + + // No local attr. in v3 +// builder.append("("); +// builder.append(key.isLocal() ? "local" : "no-local"); +// builder.append(")"); + + builder.append("["); + builder.append(key.getIdType()); + builder.append("]"); + + builder.append(key.getValue()); + + builder.append(stringIterator.hasNext() ? "," : ""); + } + + return builder.toString(); + } +} diff --git a/dataformat-aml/src/main/resources/application.properties b/dataformat-aml/src/main/resources/application.properties new file mode 100644 index 00000000..91a2f342 --- /dev/null +++ b/dataformat-aml/src/main/resources/application.properties @@ -0,0 +1 @@ +logging.level.serialize=DEBUG diff --git a/dataformat-aml/src/main/resources/automation-ml-class-libs.txt b/dataformat-aml/src/main/resources/automation-ml-class-libs.txt new file mode 100644 index 00000000..673c2797 --- /dev/null +++ b/dataformat-aml/src/main/resources/automation-ml-class-libs.txt @@ -0,0 +1,2249 @@ + + Interface Class Library according to Details of the Asset Administration Shell V2.0. + 1.0.0 + + A FileDataReference represents the address to a File. FileDataReference is derived from the + AutomationML Interface Class ExternalDataReference that is defined in AutomationML + BPR_005E_ExternalDataReference_v1.0.0_2:The interface class “ExternalDataReference” shall be used in order + to reference external documents out of the scope of AutomationML. + + + + Reference to any other referable element of the same of any other AAS or a reference to an external + object or entity. For local references inside the same Asset Administration Shell an InternalLink between + two objects with this interface "ReferableReference" shall be set. In this case the attribute value has to + be empty. For references between different Asset Administration Shells or external objects or entities the + attribute value shall be used and no InternalLink shall be set. + + + Reference to any other referable element of any other AAS or a reference to an external object + or entity. Note: For references to any other referable element of the same AAS InternalLinks are used + and this attribute value shall be empty. + + + + + + +1.0.0 + + + Mime type of the content of the File. + + + + +Standard Automation Markup Language Interface Class Library - Part 1 Content extended with Part 3 and Part + 4 Content + +2.2.2 + + + + + + + + + + The attribute refURI is an IRI that can represent an absolute or relative path to an L + document. An added fragment (with #) references inside the document + + + + + + + + + + + + + + + + + + true + + + + + + + + + + + + +Role Class Library according to Details of the Asset Administration Shell V2.0. +1.0.0 + + An Asset Administration Shell. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a + referable element not being an identifiable element this id is mandatory and used for referring to the + element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore + ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. + Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used + for unique reference in its name space and thus allows better usability and a more performant + implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + + 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. + + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + + + + + + + Abstract attribute class for identification. Has the subattributes id and idType. + + + Identifier of the element. Its type is defined in idType. Id is a subproperty of + identification. + + + + + + Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the + enumeration “IdentifierType”. IdType is a subproperty of identification. + + + + + + + Abstract attribute for administration. Has the subattributes revision and version. + + + Revision of the element. Constraint AASd-005: A revision requires a version. This means, if + there is no version there is no revision neither. Revision is a subproperty of administration. + + + + + + Version of the element. Version is a subproperty of administration. + + + + + + Global reference to the data specification template used by the element. + + + + + The derivedFrom attribute is used to establish a relationship between two Asset Administration + Shells that are derived from each other. + + + + + + + An Asset describes meta data of an asset that is represented by an AAS. The asset may either represent + an asset type or an asset instance. The asset has a globally unique identifier plus – if needed – additional + domain specific (proprietary) identifiers. + + + Identifying string of the element within its name space. Constraint AASd-001: In case of a + referable element not being an identifiable element this id is mandatory and used for referring to the + element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore + ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. + Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used + for unique reference in its name space and thus allows better usability and a more performant + implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + + 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. + + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + + Abstract attribute class for identification. Has the subattributes id and idType. + + + Identifier of the element. Its type is defined in idType. + + + + + Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the + enumeration “IdentifierType”. IdType is a subproperty of identification. + + + + + + + Abstract attribute for administration. Has the subattributes revision and version. + + + Revision of the element. Constraint AASd-005: A revision requires a version. This means, if + there is no version there is no revision neither. Revision is a subproperty of administration. + + + + + + Version of the element. Version is a subproperty of administration. + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either type or instance. + Instance + Instance + + + + Instance + Type + + + + + + A Submodel defines a specific aspect of the asset represented by the AAS. A submodel is used to + structure the virtual representation and technical functionality of an Administration Shell into distinguishable + parts. Each submodel refers to a well-defined domain or subject matter. Submodels can become standardized and + thus become submodels types. Submodels can have different life-cycles. + + + Identifying string of the element within its name space. Constraint AASd-001: In case of a + referable element not being an identifiable element this id is mandatory and used for referring to the + element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore + ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. + Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used + for unique reference in its name space and thus allows better usability and a more performant + implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + + 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. + + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + + Abstract attribute class for identification. Has the subattributes id and idType. + + + Identifier of the element. Its type is defined in idType. Id is a subproperty of + identification. + + + + + + Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the + enumeration “IdentifierType”. IdType is a subproperty of identification. + + + + + + + Abstract attribute for administration. Has the subattributes revision and version. + + + Revision of the element. Constraint AASd-005: A revision requires a version. This means, if + there is no version there is no revision neither. Revision is a subproperty of administration. + + + + + + Version of the element. Version of the element. Version is a subproperty of administration. + + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This + attribute has the name of the label and has a value with the label written in the default language. The + individual languages are modelled as child attributes. The names of the child attributes are the prefix + “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child + attributes are the labels within the respective language. + + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. + [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and + the valueId are present then the value needs to be identical to the value of the referenced coded value + in valueId. + + + + + + Reference to the global unqiue id of a coded value. + + + + + + + A submodel element collection is a set or list of submodel elements. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a + referable element not being an identifiable element this id is mandatory and used for referring to the + element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore + ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. + Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used + for unique reference in its name space and thus allows better usability and a more performant + implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + + 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. + + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This + attribute has the name of the label and has a value with the label written in the default language. The + individual languages are modelled as child attributes. The names of the child attributes are the prefix + “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child + attributes are the labels within the respective language. + + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. + [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and + the valueId are present then the value needs to be identical to the value of the referenced coded value + in valueId. + + + + + + Reference to the global unqiue id of a coded value. + + + + + + If allowDuplicates=true, then it is allowed that the collection contains the same element several + times. + + false + + + + If ordered=false, then the elements in the property collection are not ordered. If ordered=true + then the elements in the collection are ordered. Default = false. Note: An ordered submodel element + collection is typically implemented as an indexed array. + + false + + + + Submodel element contained in the collection. + + + + + A BLOB is a data element that represents a file that is contained with its source code in the value + attribute. + + + Identifying string of the element within its name space. Constraint AASd-001: In case of a + referable element not being an identifiable element this id is mandatory and used for referring to the + element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore + ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. + Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used + for unique reference in its name space and thus allows better usability and a more performant + implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + + 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. + + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This + attribute has the name of the label and has a value with the label written in the default language. The + individual languages are modelled as child attributes. The names of the child attributes are the prefix + “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child + attributes are the labels within the respective language. + + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. + [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and + the valueId are present then the value needs to be identical to the value of the referenced coded value + in valueId. + + + + + + Reference to the global unqiue id of a coded value. + + + + + + Mime type of the content of the BLOB. The mime type states which file extension the file has. Valid + values are e.g. “application/json”, “application/xls”, ”image/jpg”. The allowed values are defined as in + RFC2046. + + + + + + The value of the BLOB instance of a blob data element. Note: In contrast to the file property the + file content is stored directly as value in the Blob data element. + + + + + + + A capability is the implementation-independent description of the potential of an asset to achieve a + certain effect in the physical or virtual world. + + + Identifying string of the element within its name space. Constraint AASd-001: In case of a + referable element not being an identifiable element this id is mandatory and used for referring to the + element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore + ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. + Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used + for unique reference in its name space and thus allows better usability and a more performant + implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + + 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. + + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This + attribute has the name of the label and has a value with the label written in the default language. The + individual languages are modelled as child attributes. The names of the child attributes are the prefix + “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child + attributes are the labels within the respective language. + + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. + [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and + the valueId are present then the value needs to be identical to the value of the referenced coded value + in valueId. + + + + + + Reference to the global unqiue id of a coded value. + + + + + + + A role class for a File that a data element that represents an address to a file. It is derived from + the AutomationML role class ExternalData that is an role type for a document type and the base class for all + document type roles. It describes different document types. ExternalData is defined in AutomationML + BPR_005E_ExternalDataReference_v1.0.0_2. + + + Identifying string of the element within its name space. Constraint AASd-001: In case of a + referable element not being an identifiable element this id is mandatory and used for referring to the + element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore + ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. + Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used + for unique reference in its name space and thus allows better usability and a more performant + implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + + 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. + + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This + attribute has the name of the label and has a value with the label written in the default language. The + individual languages are modelled as child attributes. The names of the child attributes are the prefix + “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child + attributes are the labels within the respective language. + + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. + [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and + the valueId are present then the value needs to be identical to the value of the referenced coded value + in valueId. + + + + + + Reference to the global unqiue id of a coded value. + + + + + + + The attribute refURI is an IRI that can represent an absolute or relative path to an L + document. An added fragment (with #) references inside the document + + + + Mime type of the content of the File. + + + + + A property is a data element that has a single value. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a + referable element not being an identifiable element this id is mandatory and used for referring to the + element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore + ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. + Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used + for unique reference in its name space and thus allows better usability and a more performant + implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + + 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. + + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This + attribute has the name of the label and has a value with the label written in the default language. The + individual languages are modelled as child attributes. The names of the child attributes are the prefix + “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child + attributes are the labels within the respective language. + + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. + [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and + the valueId are present then the value needs to be identical to the value of the referenced coded value + in valueId. + + + + + + Reference to the global unqiue id of a coded value. + + + + + + The value of the property instance. + + + + Reference to the global unique id if a coded value. + + + + + A reference element is a data element that defines a logical reference to another element within the + same or another AAS or a reference to an external object or entity. + + + Identifying string of the element within its name space. Constraint AASd-001: In case of a + referable element not being an identifiable element this id is mandatory and used for referring to the + element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore + ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. + Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used + for unique reference in its name space and thus allows better usability and a more performant + implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + + 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. + + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This + attribute has the name of the label and has a value with the label written in the default language. The + individual languages are modelled as child attributes. The names of the child attributes are the prefix + “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child + attributes are the labels within the respective language. + + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. + [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and + the valueId are present then the value needs to be identical to the value of the referenced coded value + in valueId. + + + + + + Reference to the global unqiue id of a coded value. + + + + + + + Reference to any other referable element of any other AAS or a reference to an external object + or entity. Note: For references to any other referable elment of the same AAS InternalLinks are used and + this attribute value shall be empty. + + + + + + + A relationship element is used to define a relationship between two referable elements. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a + referable element not being an identifiable element this id is mandatory and used for referring to the + element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore + ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. + Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used + for unique reference in its name space and thus allows better usability and a more performant + implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + + 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. + + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This + attribute has the name of the label and has a value with the label written in the default language. The + individual languages are modelled as child attributes. The names of the child attributes are the prefix + “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child + attributes are the labels within the respective language. + + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. + [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and + the valueId are present then the value needs to be identical to the value of the referenced coded value + in valueId. + + + + + + Reference to the global unqiue id of a coded value. + + + + + + + Reference to any other referable element of any other AAS or a reference to an external object + or entity. Note: For references to any other referable elment of the same AAS InternalLinks are used and + this attribute value shall be empty. + + + + + + Reference to any other referable element of any other AAS or a reference to an external object + or entity. Note: For references to any other referable elment of the same AAS InternalLinks are used and + this attribute value shall be empty. + + + + + + An annotated relationship element is an relationship element that can be annotated with additional data + elements. + + + Annotations that hold for the relationships between the two elements. + + + + + An operation is a submodel element with input and output variables. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a + referable element not being an identifiable element this id is mandatory and used for referring to the + element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore + ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. + Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used + for unique reference in its name space and thus allows better usability and a more performant + implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + + 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. + + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This + attribute has the name of the label and has a value with the label written in the default language. The + individual languages are modelled as child attributes. The names of the child attributes are the prefix + “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child + attributes are the labels within the respective language. + + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. + [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and + the valueId are present then the value needs to be identical to the value of the referenced coded value + in valueId. + + + + + + Reference to the global unqiue id of a coded value. + + + + + + + The list of AAS OperationVariableIn entities. In AML, the corresponding InternalElement with this role + is a child of the InternalElement with the Operation role. + + + + The list of AAS OperationVariableOut entities. In AML, the corresponding InternalElement with this role + is a child of the InternalElement with the Operation role. + + + + The list of AAS OperationVariableOut entities. In AML, the corresponding InternalElement with this role + is a child of the InternalElement with the Operation role. + + + + A view is a collection of referable elements w.r.t. to a specific viewpoint of one or more + stakeholders. + + + Identifying string of the element within its name space. Constraint AASd-001: In case of a + referable element not being an identifiable element this id is mandatory and used for referring to the + element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore + ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. + Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used + for unique reference in its name space and thus allows better usability and a more performant + implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + + 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. + + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + + Global reference to the data specification template used by the element. + + + + + Description or comments on the element. The description can be provided in several languages. This + attribute has the name of the label and has a value with the label written in the default language. The + individual languages are modelled as child attributes. The names of the child attributes are the prefix + “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child + attributes are the labels within the respective language. + + + + + + + A dictionary contains elements that can be reused. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a + referable element not being an identifiable element this id is mandatory and used for referring to the + element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore + ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. + Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used + for unique reference in its name space and thus allows better usability and a more performant + implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + + 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. + + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + + + + + + + + Explanation: The semantics of a property or other elements that may have a semantic description is + defined by a concept description. The description of the concept should follow a standardized schema (realized + as data specification template). + + + Identifying string of the element within its name space. Constraint AASd-001: In case of a + referable element not being an identifiable element this id is mandatory and used for referring to the + element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore + ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. + Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used + for unique reference in its name space and thus allows better usability and a more performant + implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + + Abstract attribute class for identification. Has the subattributes id and idType. + + + Identifier of the element. Its type is defined in idType. Id is a subproperty of + identification. + + + + + + Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the + enumeration “IdentifierType”. IdType is a subproperty of identification. + + + + + + + Abstract attribute for administration. Has the subattributes revision and version. + + + Revision of the element. Constraint AASd-005: A revision requires a version. This means, if + there is no version there is no revision neither. Revision is a subproperty of administration. + + + + + + Version of the element. Version is a subproperty of administration. + + + + + + Global reference to the data specification template used by the element. + + + + Global reference to an external definition the concept is compatible to or was derived from. + + + + + + + Description Role class of an element that has a data specification template. A template defines the + additional attributes an element may or shall have. + + + Identifying string of the element within its name space. Constraint AASd-001: In case of a + referable element not being an identifiable element this id is mandatory and used for referring to the + element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore + ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. + Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used + for unique reference in its name space and thus allows better usability and a more performant + implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + + 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. + + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + + + + + + + Abstract attribute class for identification. Has the subattributes id and idType. + + + Identifier of the element. Its type is defined in idType. Id is a subproperty of + identification. + + + + + + Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the + enumeration “IdentifierType”. IdType is a subproperty of identification. + + + + + + + Abstract attribute for administration. Has the subattributes revision and version. + + + Revision of the element. Constraint AASd-005: A revision requires a version. This means, if + there is no version there is no revision neither. Revision is a subproperty of administration. + + + + + + Version of the element. Version is a subproperty of administration. + + + + + + + Content of the data specification template. + + + +1.0.0 + + + +Automation Markup Language Base Role Class Library - Part 1 Content extended with Part 3 and Part 4 + Content + +2.2.2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0 + + An AAS Data Specification template for IEC61369. A template consists of the DataSpecificationContent + containing the additional attributes to be added to the element instance that references the data specification + template and meta information about the template itself (this is why DataSpecification inherits from + Identifiable). In UML these are two separated classes. + + + Identifying string of the element within its name space. Constraint AASd-001: In case of a + referable element not being an identifiable element this id is mandatory and used for referring to the + element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore + ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. + Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used + for unique reference in its name space and thus allows better usability and a more performant + implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + + 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. + + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + + + + + + + Abstract attribute class for identification. Has the subattributes id and idType. + + + Identifier of the element. Its type is defined in idType. Id is a subproperty of + identification. + + http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360 + + + + Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the + enumeration “IdentifierType”. IdType is a subproperty of identification. + + IRI + + + + + Abstract attribute for administration. Has the subattributes revision and version. + + + Revision of the element. Constraint AASd-005: A revision requires a version. This means, if + there is no version there is no revision neither. Revision is a subproperty of administration. + + + + + + Version of the element. Version is a subproperty of administration. + + + + + + + The content of an AAS Data Specification template for IEC61360. + + Identifies the attribute hierarchy for preferredName in above attribute hierachy. Subordinate + attributes are designated by the country code information (see aml-lang literal). + + + + + Identifies the attribute for shortName in above attribute hierarchy. + + + + Identifies the attribute for unit in above attribute hierarchy. + + + + Identifies the attribute for unitId in above attribute hierarchy in its string serialization. + + + + + Identifies the attribute for sourceOfDefinition in above attribute hierachy. Subordinate + attributes are designated by the country code information (see aml-lang literal). + + + + + Identifies the attribute for symbol in above attribute hierarchy. + + + + Identifies the attribute for dataType in above attribute hierarchy. + + + + Identifies the attribute for definition in above attribute hierachy. Subordinate attributes are + designated by the country code information (see aml-lang literal). + + + + + Identifies the attribute for valueFormat in above attribute hierarchy. + + + + Identifies the attribute for valueList in above attribute hierarchy. + + + + The attribute value. + + + + The id for the value. + + + + + + + +0 + diff --git a/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/deserialize/AmlDeserializerTest.java b/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/deserialize/AmlDeserializerTest.java new file mode 100644 index 00000000..188052ae --- /dev/null +++ b/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/deserialize/AmlDeserializerTest.java @@ -0,0 +1,33 @@ +package io.adminshell.aas.v3.dataformat.aml.deserialize; + +import com.fasterxml.jackson.dataformat.xml.XmlMapper; +import io.adminshell.aas.v3.dataformat.DeserializationException; +import io.adminshell.aas.v3.dataformat.aml.AmlDeserializer; +import org.junit.Test; + +import java.io.*; + +public class AmlDeserializerTest { + + private final AmlDeserializer deserializer = new AmlDeserializer(); + + private final XmlMapper xmlMapper = new XmlMapper(); + + @Test + public void testCoffeeBeanExample() throws IOException, DeserializationException { + final String file = "src/test/resources/amlfile/coffee-bean.xml"; + String xml = inputStreamToString(new FileInputStream(file)); + deserializer.read(xml); + } + + private String inputStreamToString(InputStream inputStream) throws IOException { + StringBuilder stringBuilder = new StringBuilder(); + String line; + BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream)); + while ((line = reader.readLine()) != null) { + stringBuilder.append(line); + } + reader.close(); + return stringBuilder.toString(); + } +} diff --git a/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/fixtures/FullExample.java b/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/fixtures/FullExample.java new file mode 100644 index 00000000..94cd8bb9 --- /dev/null +++ b/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/fixtures/FullExample.java @@ -0,0 +1,1575 @@ +package io.adminshell.aas.v3.dataformat.aml.fixtures; + +import io.adminshell.aas.v3.model.*; +import io.adminshell.aas.v3.model.impl.*; + +import java.util.Arrays; +import java.util.Base64; + +public class FullExample { + + public static final java.io.File FILE = new java.io.File("src/test/resources/test_demo_full_example.json"); + + public static final AssetAdministrationShell AAS_1 = new DefaultAssetAdministrationShell.Builder() + .idShort("TestAssetAdministrationShell") + .description(new LangString("An Example Asset Administration Shell for the test application", "en-us")) + .description(new LangString("Ein Beispiel-Verwaltungsschale für eine Test-Anwendung", "de")) + .identification(new DefaultIdentifier.Builder() + .idType(IdentifierType.IRI) + .identifier("https://acplt.org/Test_AssetAdministrationShell") + .build()) + .administration(new DefaultAdministrativeInformation.Builder() + .version("0.9") + .revision("0") + .build()) + .derivedFrom(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.ASSET_ADMINISTRATION_SHELL) + .idType(KeyType.IRI) + .value("https://acplt.org/TestAssetAdministrationShell2") + .build()) + .build()) + .assetInformation(new DefaultAssetInformation.Builder() + .assetKind(AssetKind.INSTANCE) + .globalAssetId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.ASSET) + .idType(KeyType.IRI) + .value("https://acplt.org/Test_Asset") + .build()) + .build()) + .billOfMaterial((new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.SUBMODEL) + .idType(KeyType.IRI) + .value("http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial") + .build())) + .build()) + .build()) + .submodel(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.SUBMODEL) + .value("https://acplt.org/Test_Submodel") + .idType(KeyType.IRI) + .build()) + .build()) + .submodel(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.SUBMODEL) + .value("http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial") + .idType(KeyType.IRI) + .build()) + .build()) + .submodel(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.SUBMODEL) + .value("http://acplt.org/Submodels/Assets/TestAsset/Identification") + .idType(KeyType.IRI) + .build()) + .build()) + .build(); + + public static final AssetAdministrationShell AAS_2 = new DefaultAssetAdministrationShell.Builder() + .idShort("") + .identification(new DefaultIdentifier.Builder() + .idType(IdentifierType.IRI) + .identifier("https://acplt.org/Test_AssetAdministrationShell_Mandatory") + .build()) + .assetInformation(new DefaultAssetInformation.Builder() + .assetKind(AssetKind.INSTANCE) + .globalAssetId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.ASSET) + .idType(KeyType.IRI) + .value("https://acplt.org/Test_Asset_Mandatory") + .build()) + .build()) + .build()) + .submodel(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.SUBMODEL) + .value("https://acplt.org/Test_Submodel_Mandatory") + .idType(KeyType.IRI) + .build()) + .build()) + .submodel(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.SUBMODEL) + .value("https://acplt.org/Test_Submodel2_Mandatory") + .idType(KeyType.IRI) + .build()) + .build()) + .build(); + + public static final AssetAdministrationShell AAS_3 = new DefaultAssetAdministrationShell.Builder() + .idShort("") + .identification(new DefaultIdentifier.Builder() + .idType(IdentifierType.IRI) + .identifier("https://acplt.org/Test_AssetAdministrationShell2_Mandatory") + .build()) + .assetInformation(new DefaultAssetInformation.Builder() + .assetKind(AssetKind.INSTANCE) + .globalAssetId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.ASSET) + .idType(KeyType.IRI) + .value("https://acplt.org/Test_Asset_Mandatory") + .build()) + .build()) + .build()) + .build(); + + public static final AssetAdministrationShell AAS_4 = new DefaultAssetAdministrationShell.Builder() + .idShort("TestAssetAdministrationShell") + .description(new LangString("An Example Asset Administration Shell for the test application", "en-us")) + .description(new LangString("Ein Beispiel-Verwaltungsschale für eine Test-Anwendung", "de")) + .identification(new DefaultIdentifier.Builder() + .idType(IdentifierType.IRI) + .identifier("https://acplt.org/Test_AssetAdministrationShell_Missing") + .build()) + .administration(new DefaultAdministrativeInformation.Builder() + .version("0.9") + .revision("0") + .build()) + .assetInformation(new DefaultAssetInformation.Builder() + .assetKind(AssetKind.INSTANCE) + .globalAssetId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.ASSET) + .idType(KeyType.IRI) + .value("https://acplt.org/Test_Asset_Missing") + .build()) + .build()) + .build()) + .submodel(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.SUBMODEL) + .value("https://acplt.org/Test_Submodel_Missing") + .idType(KeyType.IRI) + .build()) + .build()) + .view(new DefaultView.Builder() + .idShort("ExampleView") + .containedElement((new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.SUBMODEL) + .value("https://acplt.org/Test_Submodel_Missing") + .idType(KeyType.IRI) + .build())) + .build()) + .build()) + .view(new DefaultView.Builder() + .idShort("ExampleView2") + .build()) + .build(); + + public static final Submodel SUBMODEL_1 = new DefaultSubmodel.Builder() + .idShort("Identification") + .description(new LangString("An example asset identification submodel for the test application", "en-us")) + .description(new LangString("Ein Beispiel-Identifikations-Submodel für eine Test-Anwendung", "de")) + .identification(new DefaultIdentifier.Builder() + .idType(IdentifierType.IRI) + .identifier("http://acplt.org/Submodels/Assets/TestAsset/Identification") + .build()) + .administration(new DefaultAdministrativeInformation.Builder() + .version("0.9") + .revision("0") + .build()) + .semanticId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.SUBMODEL) + .idType(KeyType.IRI) + .value("http://acplt.org/SubmodelTemplates/AssetIdentification") + .build()) + .build()) + .submodelElement(new DefaultProperty.Builder() + .idShort("ManufacturerName") + .description(new LangString("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.", "en-us")) + .description(new LangString("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", "de")) + .semanticId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .value("0173-1#02-AAO677#002") + .idType(KeyType.IRI) + .build()) + .build()) + .qualifier(new DefaultQualifier.Builder() + .value("100") + .valueId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .idType(KeyType.IRI) + .value("http://acplt.org/ValueId/ExampleValueId") + .build()) + .build()) + .valueType("int") + .type("http://acplt.org/Qualifier/ExampleQualifier") + .build()) + .qualifier(new DefaultQualifier.Builder() + .value("50") + .valueId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .idType(KeyType.IRI) + .value("http://acplt.org/ValueId/ExampleValueId") + .build()) + .build()) + .valueType("int") + .type("http://acplt.org/Qualifier/ExampleQualifier2") + .build()) + .value("ACPLT") + .valueId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .idType(KeyType.IRI) + .value("http://acplt.org/ValueId/ExampleValueId") + .build()) + .build()) + .valueType("string") + .build()) + .submodelElement(new DefaultProperty.Builder() + .idShort("InstanceId") + .description(new LangString("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.", "en-us")) + .description(new LangString("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", "de")) + .semanticId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .value("http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber") + .idType(KeyType.IRI) + .build()) + .build()) + .value("978-8234-234-342") + .valueId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .idType(KeyType.IRI) + .value("http://acplt.org/ValueId/ExampleValueId") + .build()) + .build()) + .valueType("string") + .build()) + .build(); + + public static final Submodel SUBMODEL_2 = new DefaultSubmodel.Builder() + .idShort("BillOfMaterial") + .description(new LangString("An example bill of material submodel for the test application", "en-us")) + .description(new LangString("Ein Beispiel-BillofMaterial-Submodel für eine Test-Anwendung", "de")) + .identification(new DefaultIdentifier.Builder() + .idType(IdentifierType.IRI) + .identifier("http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial") + .build()) + .administration(new DefaultAdministrativeInformation.Builder() + .version("0.9") + .build()) + .semanticId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.SUBMODEL) + .idType(KeyType.IRI) + .value("http://acplt.org/SubmodelTemplates/BillOfMaterial") + .build()) + .build()) + .submodelElement(new DefaultEntity.Builder() + .idShort("ExampleEntity") + .description(new LangString("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.", "en-us")) + .description(new LangString("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", "de")) + .semanticId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .value("http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber") + .idType(KeyType.IRI) + .build()) + .build()) + .statement(new DefaultProperty.Builder() + .idShort("ExampleProperty2") + .category("Constant") + .description(new LangString("Example Property object", "en-us")) + .description(new LangString("Beispiel Property Element", "de")) + .semanticId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .value("http://acplt.org/Properties/ExampleProperty") + .idType(KeyType.IRI) + .build()) + .build()) + .value("exampleValue2") + .valueId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .idType(KeyType.IRI) + .value("http://acplt.org/ValueId/ExampleValueId") + .build()) + .build()) + .valueType("string") + .build()) + .statement(new DefaultProperty.Builder() + .idShort("ExampleProperty") + .category("Constant") + .description(new LangString("Example Property object", "en-us")) + .description(new LangString("Beispiel Property Element", "de")) + .semanticId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .value("http://acplt.org/Properties/ExampleProperty") + .idType(KeyType.IRI) + .build()) + .build()) + .value("exampleValue") + .valueId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .idType(KeyType.IRI) + .value("http://acplt.org/ValueId/ExampleValueId") + .build()) + .build()) + .valueType("string") + .build()) + .entityType(EntityType.CO_MANAGED_ENTITY) + .build()) + .submodelElement(new DefaultEntity.Builder() + .idShort("ExampleEntity2") + .description(new LangString("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.", "en-us")) + .description(new LangString("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", "de")) + .semanticId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .value("http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber") + .idType(KeyType.IRI) + .build()) + .build()) + .entityType(EntityType.SELF_MANAGED_ENTITY) + .globalAssetId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.ASSET) + .idType(KeyType.IRI) + .value("https://acplt.org/Test_Asset2") + .build()) + .build()) + .build()) + .build(); + + public static final Submodel SUBMODEL_3 = new DefaultSubmodel.Builder() + .idShort("TestSubmodel") + .description(new LangString("An example submodel for the test application", "en-us")) + .description(new LangString("Ein Beispiel-Teilmodell für eine Test-Anwendung", "de")) + .identification(new DefaultIdentifier.Builder() + .idType(IdentifierType.IRI) + .identifier("https://acplt.org/Test_Submodel") + .build()) + .administration(new DefaultAdministrativeInformation.Builder() + .version("0.9") + .revision("0") + .build()) + .semanticId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .idType(KeyType.IRI) + .value("http://acplt.org/SubmodelTemplates/ExampleSubmodel") + .build()) + .build()) + .submodelElement(new DefaultRelationshipElement.Builder() + .idShort("ExampleRelationshipElement") + .category("Parameter") + .description(new LangString("Example RelationshipElement object", "en-us")) + .description(new LangString("Beispiel RelationshipElement Element", "de")) + .semanticId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .value("http://acplt.org/RelationshipElements/ExampleRelationshipElement") + .idType(KeyType.IRI) + .build()) + .build()) + .first(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.PROPERTY) + .value("ExampleProperty") + .idType(KeyType.ID_SHORT) + .build()) + .build()) + .second(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.PROPERTY) + .value("ExampleProperty2") + .idType(KeyType.ID_SHORT) + .build()) + .build()) + .build()) + .submodelElement(new DefaultAnnotatedRelationshipElement.Builder() + .idShort("ExampleAnnotatedRelationshipElement") + .category("Parameter") + .description(new LangString("Example AnnotatedRelationshipElement object", "en-us")) + .description(new LangString("Beispiel AnnotatedRelationshipElement Element", "de")) + .semanticId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .value("http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement") + .idType(KeyType.IRI) + .build()) + .build()) + .first(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.PROPERTY) + .value("ExampleProperty") + .idType(KeyType.ID_SHORT) + .build()) + .build()) + .second(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.PROPERTY) + .value("ExampleProperty2") + .idType(KeyType.ID_SHORT) + .build()) + .build()) + .annotation(new DefaultProperty.Builder() + .kind(ModelingKind.INSTANCE) + .idShort("ExampleProperty3") + .category("Parameter") + .value("some example annotation") + .valueType("string") + .build()) + .build()) + .submodelElement(new DefaultOperation.Builder() + .idShort("ExampleOperation") + .category("Parameter") + .description(new LangString("Example Operation object", "en-us")) + .description(new LangString("Beispiel Operation Element", "de")) + .semanticId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .value("http://acplt.org/Operations/ExampleOperation") + .idType(KeyType.IRI) + .build()) + .build()) + .inputVariable(new DefaultOperationVariable.Builder() + .value(new DefaultProperty.Builder() + .idShort("ExampleProperty") + .category("Constant") + .description(new LangString("Example Property object", "en-us")) + .description(new LangString("Beispiel Property Element", "de")) + .semanticId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .value("http://acplt.org/Properties/ExampleProperty") + .idType(KeyType.IRI) + .build()) + .build()) + .value("exampleValue") + .valueId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .idType(KeyType.IRI) + .value("http://acplt.org/ValueId/ExampleValueId") + .build()) + .build()) + .valueType("string") + .build()) + .build()) + .outputVariable(new DefaultOperationVariable.Builder() + .value(new DefaultProperty.Builder() + .idShort("ExampleProperty") + .category("Constant") + .description(new LangString("Example Property object", "en-us")) + .description(new LangString("Beispiel Property Element", "de")) + .semanticId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .value("http://acplt.org/Properties/ExampleProperty") + .idType(KeyType.IRI) + .build()) + .build()) + .value("exampleValue") + .valueId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .idType(KeyType.IRI) + .value("http://acplt.org/ValueId/ExampleValueId") + .build()) + .build()) + .valueType("string") + .build()) + .build()) + .inoutputVariable(new DefaultOperationVariable.Builder() + .value(new DefaultProperty.Builder() + .idShort("ExampleProperty") + .category("Constant") + .description(new LangString("Example Property object", "en-us")) + .description(new LangString("Beispiel Property Element", "de")) + .semanticId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .value("http://acplt.org/Properties/ExampleProperty") + .idType(KeyType.IRI) + .build()) + .build()) + .value("exampleValue") + .valueId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .idType(KeyType.IRI) + .value("http://acplt.org/ValueId/ExampleValueId") + .build()) + .build()) + .valueType("string") + .build()) + .build()) + .build()) + .submodelElement(new DefaultCapability.Builder() + .idShort("ExampleCapability") + .category("Parameter") + .description(new LangString("Example Capability object", "en-us")) + .description(new LangString("Beispiel Capability Element", "de")) + .semanticId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .value("http://acplt.org/Capabilities/ExampleCapability") + .idType(KeyType.IRI) + .build()) + .build()) + .build()) + .submodelElement(new DefaultBasicEvent.Builder() + .idShort("ExampleBasicEvent") + .category("Parameter") + .description(new LangString("Example BasicEvent object", "en-us")) + .description(new LangString("Beispiel BasicEvent Element", "de")) + .semanticId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .value("http://acplt.org/Events/ExampleBasicEvent") + .idType(KeyType.IRI) + .build()) + .build()) + .observed(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.PROPERTY) + .idType(KeyType.ID_SHORT) + .value("ExampleProperty") + .build()) + .build()) + .build()) + .submodelElement(new DefaultSubmodelElementCollection.Builder() + .idShort("ExampleSubmodelCollectionOrdered") + .category("Parameter") + .description(new LangString("Example SubmodelElementCollectionOrdered object", "en-us")) + .description(new LangString("Beispiel SubmodelElementCollectionOrdered Element", "de")) + .semanticId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .value("http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered") + .idType(KeyType.IRI) + .build()) + .build()) + .value(new DefaultProperty.Builder() + .idShort("ExampleProperty") + .category("Constant") + .description(new LangString("Example Property object", "en-us")) + .description(new LangString("Beispiel Property Element", "de")) + .semanticId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .value("http://acplt.org/Properties/ExampleProperty") + .idType(KeyType.IRI) + .build()) + .build()) + .value("exampleValue") + .valueId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .idType(KeyType.IRI) + .value("http://acplt.org/ValueId/ExampleValueId") + .build()) + .build()) + .valueType("string") + .build()) + .value(new DefaultMultiLanguageProperty.Builder() + .idShort("ExampleMultiLanguageProperty") + .category("Constant") + .description(new LangString("Example MultiLanguageProperty object", "en-us")) + .description(new LangString("Beispiel MulitLanguageProperty Element", "de")) + .semanticId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .value("http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty") + .idType(KeyType.IRI) + .build()) + .build()) + .value(new LangString("Example value of a MultiLanguageProperty element", "en-us")) + .value(new LangString("Beispielswert für ein MulitLanguageProperty-Element", "de")) + .valueId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .idType(KeyType.IRI) + .value("http://acplt.org/ValueId/ExampleMultiLanguageValueId") + .build()) + .build()) + .build()) + .value(new DefaultRange.Builder() + .idShort("ExampleRange") + .category("Parameter") + .description(new LangString("Example Range object", "en-us")) + .description(new LangString("Beispiel Range Element", "de")) + .semanticId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .value("http://acplt.org/Ranges/ExampleRange") + .idType(KeyType.IRI) + .build()) + .build()) + .valueType("int") + .min("0") + .max("100") + .build()) + .ordered(true) + .build()) + .submodelElement(new DefaultSubmodelElementCollection.Builder() + .idShort("ExampleSubmodelCollectionUnordered") + .category("Parameter") + .description(new LangString("Example SubmodelElementCollectionUnordered object", "en-us")) + .description(new LangString("Beispiel SubmodelElementCollectionUnordered Element", "de")) + .semanticId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .value("http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered") + .idType(KeyType.IRI) + .build()) + .build()) + .value(new DefaultBlob.Builder() + .idShort("ExampleBlob") + .category("Parameter") + .description(new LangString("Example Blob object", "en-us")) + .description(new LangString("Beispiel Blob Element", "de")) + .semanticId(new DefaultReference.Builder() + .key(new DefaultKey.Builder().type(KeyElements.GLOBAL_REFERENCE) + .value("http://acplt.org/Blobs/ExampleBlob") + .idType(KeyType.IRI) + .build()) + .build()) + .mimeType("application/pdf") + .value(Base64.getDecoder().decode("AQIDBAU=")) + .build()) + .value(new DefaultFile.Builder() + .idShort("ExampleFile") + .category("Parameter") + .description(new LangString("Example File object", "en-us")) + .description(new LangString("Beispiel File Element", "de")) + .semanticId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .value("http://acplt.org/Files/ExampleFile") + .idType(KeyType.IRI) + .build()) + .build()) + .value("/TestFile.pdf") + .mimeType("application/pdf") + .build()) + .value(new DefaultReferenceElement.Builder() + .idShort("ExampleReferenceElement") + .category("Parameter") + .description(new LangString("Example Reference Element object", "en-us")) + .description(new LangString("Beispiel Reference Element Element", "de")) + .semanticId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE).value( + "http://acplt.org/ReferenceElements/ExampleReferenceElement") + .idType(KeyType.IRI) + .build()) + .build()) + .value(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.PROPERTY) + .idType(KeyType.ID_SHORT) + .value("ExampleProperty") + .build()) + .build()) + .build()) + .ordered(false) + .build()) + .build(); + + public static final Submodel SUBMODEL_4 = new DefaultSubmodel.Builder() + .idShort("") + .identification(new DefaultIdentifier.Builder() + .idType(IdentifierType.IRI) + .identifier("https://acplt.org/Test_Submodel_Mandatory") + .build()) + .submodelElement(new DefaultRelationshipElement.Builder() + .idShort("ExampleRelationshipElement") + .first(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.PROPERTY) + .value("ExampleProperty") + .idType(KeyType.ID_SHORT) + .build()) + .build()) + .second(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.PROPERTY) + .value("ExampleProperty") + .idType(KeyType.ID_SHORT) + .build()) + .build()) + .build()) + .submodelElement(new DefaultAnnotatedRelationshipElement.Builder() + .idShort("ExampleAnnotatedRelationshipElement") + .first(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.PROPERTY) + .value("ExampleProperty") + .idType(KeyType.ID_SHORT) + .build()) + .build()) + .second(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.PROPERTY) + .value("ExampleProperty") + .idType(KeyType.ID_SHORT) + .build()) + .build()) + .build()) + .submodelElement(new DefaultOperation.Builder() + .idShort("ExampleOperation") + .build()) + .submodelElement(new DefaultCapability.Builder() + .idShort("ExampleCapability") + .build()) + .submodelElement(new DefaultBasicEvent.Builder() + .idShort("ExampleBasicEvent") + .observed(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.PROPERTY) + .idType(KeyType.ID_SHORT) + .value("ExampleProperty") + .build()) + .build()) + .build()) + .submodelElement(new DefaultSubmodelElementCollection.Builder() + .idShort("ExampleSubmodelCollectionOrdered") + .value(new DefaultProperty.Builder() + .idShort("ExampleProperty") + .value(null) + .valueType("string") + .build()) + .value(new DefaultMultiLanguageProperty.Builder() + .idShort("ExampleMultiLanguageProperty") + .build()) + .value(new DefaultRange.Builder() + .idShort("ExampleRange") + .valueType("int") + .min(null) + .max(null) + .build()) + .ordered(true) + .build()) + .submodelElement(new DefaultSubmodelElementCollection.Builder() + .idShort("ExampleSubmodelCollectionUnordered") + .value(new DefaultBlob.Builder() + .idShort("ExampleBlob") + .mimeType("application/pdf") + .build()) + .value(new DefaultFile.Builder() + .idShort("ExampleFile") + .value(null) + .mimeType("application/pdf") + .build()) + .value(new DefaultReferenceElement.Builder() + .idShort("ExampleReferenceElement") + .build()) + .ordered(false) + .build()) + .submodelElement(new DefaultSubmodelElementCollection.Builder() + .idShort("ExampleSubmodelCollectionUnordered2") + .ordered(false) + .build()) + .build(); + + public static final Submodel SUBMODEL_5 = new DefaultSubmodel.Builder() + .idShort("") + .identification(new DefaultIdentifier.Builder() + .idType(IdentifierType.IRI) + .identifier("https://acplt.org/Test_Submodel2_Mandatory") + .build()) + .build(); + + public static final Submodel SUBMODEL_6 = new DefaultSubmodel.Builder() + .idShort("TestSubmodel") + .description(new LangString("An example submodel for the test application", "en-us")) + .description(new LangString("Ein Beispiel-Teilmodell für eine Test-Anwendung", "de")) + .identification(new DefaultIdentifier.Builder() + .idType(IdentifierType.IRI) + .identifier("https://acplt.org/Test_Submodel_Missing") + .build()) + .administration(new DefaultAdministrativeInformation.Builder() + .version("0.9") + .revision("0").build()) + .semanticId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .idType(KeyType.IRI) + .value("http://acplt.org/SubmodelTemplates/ExampleSubmodel") + .build()) + .build()) + .submodelElement(new DefaultRelationshipElement.Builder() + .idShort("ExampleRelationshipElement") + .category("Parameter") + .description(new LangString("Example RelationshipElement object", "en-us")) + .description(new LangString("Beispiel RelationshipElement Element", "de")) + .semanticId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .value("http://acplt.org/RelationshipElements/ExampleRelationshipElement") + .idType(KeyType.IRI) + .build()) + .build()) + .first(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.PROPERTY) + .value("ExampleProperty") + .idType(KeyType.ID_SHORT) + .build()) + .build()) + .second(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.PROPERTY) + .value("ExampleProperty") + .idType(KeyType.ID_SHORT) + .build()) + .build()) + .build()) + .submodelElement(new DefaultAnnotatedRelationshipElement.Builder() + .idShort("ExampleAnnotatedRelationshipElement") + .category("Parameter") + .description(new LangString("Example AnnotatedRelationshipElement object", "en-us")) + .description(new LangString("Beispiel AnnotatedRelationshipElement Element", "de")) + .semanticId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .value("http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement") + .idType(KeyType.IRI) + .build()) + .build()) + .first(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.PROPERTY) + .value("ExampleProperty") + .idType(KeyType.ID_SHORT) + .build()) + .build()) + .second(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.PROPERTY) + .value("ExampleProperty") + .idType(KeyType.ID_SHORT) + .build()) + .build()) + .annotation(new DefaultProperty.Builder() + .kind(ModelingKind.INSTANCE) + .idShort("ExampleProperty") + .category("Parameter") + .value("some example annotation") + .valueType("string") + .build()) + .build()) + .submodelElement(new DefaultOperation.Builder() + .idShort("ExampleOperation") + .category("Parameter") + .description(new LangString("Example Operation object", "en-us")) + .description(new LangString("Beispiel Operation Element", "de")) + .semanticId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .value("http://acplt.org/Operations/ExampleOperation") + .idType(KeyType.IRI) + .build()) + .build()) + .inputVariable(new DefaultOperationVariable.Builder() + .value(new DefaultProperty.Builder() + .idShort("ExampleProperty") + .category("Constant") + .description(new LangString("Example Property object", "en-us")) + .description(new LangString("Beispiel Property Element", "de")) + .semanticId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .value("http://acplt.org/Properties/ExampleProperty") + .idType(KeyType.IRI) + .build()) + .build()) + .qualifier(new DefaultQualifier.Builder() + .valueType("string") + .type("http://acplt.org/Qualifier/ExampleQualifier") + .build()) + .value("exampleValue") + .valueType("string") + .build()) + .build()) + .outputVariable(new DefaultOperationVariable.Builder() + .value(new DefaultProperty.Builder() + .idShort("ExampleProperty") + .category("Constant") + .description(new LangString("Example Property object", "en-us")) + .description(new LangString("Beispiel Property Element", "de")) + .semanticId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .value("http://acplt.org/Properties/ExampleProperty") + .idType(KeyType.IRI) + .build()) + .build()) + .qualifier(new DefaultQualifier.Builder() + .valueType("string") + .type("http://acplt.org/Qualifier/ExampleQualifier") + .build()) + .value("exampleValue") + .valueType("string") + .build()) + .build()) + .inoutputVariable(new DefaultOperationVariable.Builder() + .value(new DefaultProperty.Builder() + .idShort("ExampleProperty") + .category("Constant") + .description(new LangString("Example Property object", "en-us")) + .description(new LangString("Beispiel Property Element", "de")) + .semanticId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .value("http://acplt.org/Properties/ExampleProperty") + .idType(KeyType.IRI) + .build()) + .build()) + .qualifier(new DefaultQualifier.Builder() + .valueType("string") + .type("http://acplt.org/Qualifier/ExampleQualifier") + .build()) + .value("exampleValue") + .valueType("string") + .build()) + .build()) + .build()) + .submodelElement(new DefaultCapability.Builder() + .idShort("ExampleCapability") + .category("Parameter") + .description(new LangString("Example Capability object", "en-us")) + .description(new LangString("Beispiel Capability Element", "de")) + .semanticId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .value("http://acplt.org/Capabilities/ExampleCapability") + .idType(KeyType.IRI) + .build()) + .build()) + .build()) + .submodelElement(new DefaultBasicEvent.Builder() + .idShort("ExampleBasicEvent") + .category("Parameter") + .description(new LangString("Example BasicEvent object", "en-us")) + .description(new LangString("Beispiel BasicEvent Element", "de")) + .semanticId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .value("http://acplt.org/Events/ExampleBasicEvent") + .idType(KeyType.IRI) + .build()) + .build()) + .observed(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.PROPERTY) + .idType(KeyType.ID_SHORT) + .value("ExampleProperty") + .build()) + .build()) + .build()) + .submodelElement(new DefaultSubmodelElementCollection.Builder() + .idShort("ExampleSubmodelCollectionOrdered") + .category("Parameter") + .description(new LangString("Example SubmodelElementCollectionOrdered object", "en-us")) + .description(new LangString("Beispiel SubmodelElementCollectionOrdered Element", "de")) + .semanticId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .value("http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered") + .idType(KeyType.IRI) + .build()) + .build()) + .value(new DefaultProperty.Builder() + .idShort("ExampleProperty") + .category("Constant") + .description(new LangString("Example Property object", "en-us")) + .description(new LangString("Beispiel Property Element", "de")) + .semanticId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .value("http://acplt.org/Properties/ExampleProperty") + .idType(KeyType.IRI) + .build()) + .build()) + .qualifier(new DefaultQualifier.Builder() + .valueType("string") + .type("http://acplt.org/Qualifier/ExampleQualifier") + .build()) + .value("exampleValue") + .valueType("string") + .build()) + .value(new DefaultMultiLanguageProperty.Builder() + .idShort("ExampleMultiLanguageProperty") + .category("Constant") + .description(new LangString("Example MultiLanguageProperty object", "en-us")) + .description(new LangString("Beispiel MulitLanguageProperty Element", "de")) + .semanticId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .value("http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty") + .idType(KeyType.IRI) + .build()) + .build()) + .value(new LangString("Example value of a MultiLanguageProperty element", "en-us")) + .value(new LangString("Beispielswert für ein MulitLanguageProperty-Element", "de")) + .build()) + .value(new DefaultRange.Builder() + .idShort("ExampleRange") + .category("Parameter") + .description(new LangString("Example Range object", "en-us")) + .description(new LangString("Beispiel Range Element", "de")) + .semanticId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .value("http://acplt.org/Ranges/ExampleRange") + .idType(KeyType.IRI) + .build()) + .build()) + .valueType("int") + .min("0") + .max("100") + .build()) + .ordered(true) + .build()) + .submodelElement(new DefaultSubmodelElementCollection.Builder() + .idShort("ExampleSubmodelCollectionUnordered") + .category("Parameter") + .description(new LangString("Example SubmodelElementCollectionUnordered object", "en-us")) + .description(new LangString("Beispiel SubmodelElementCollectionUnordered Element", "de")) + .semanticId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .value("http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered") + .idType(KeyType.IRI) + .build()) + .build()) + .value(new DefaultBlob.Builder() + .idShort("ExampleBlob") + .category("Parameter") + .description(new LangString("Example Blob object", "en-us")) + .description(new LangString("Beispiel Blob Element", "de")) + .semanticId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .value("http://acplt.org/Blobs/ExampleBlob") + .idType(KeyType.IRI) + .build()) + .build()) + .mimeType("application/pdf") + .value(Base64.getDecoder().decode("AQIDBAU=")) + .build()) + .value(new DefaultFile.Builder() + .idShort("ExampleFile") + .category("Parameter") + .description(new LangString("Example File object", "en-us")) + .description(new LangString("Beispiel File Element", "de")) + .semanticId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .value("http://acplt.org/Files/ExampleFile") + .idType(KeyType.IRI) + .build()) + .build()) + .value("/TestFile.pdf") + .mimeType("application/pdf") + .build()) + .value(new DefaultReferenceElement.Builder() + .idShort("ExampleReferenceElement") + .category("Parameter") + .description(new LangString("Example Reference Element object", "en-us")) + .description(new LangString("Beispiel Reference Element Element", "de")) + .semanticId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .value("http://acplt.org/ReferenceElements/ExampleReferenceElement") + .idType(KeyType.IRI) + .build()) + .build()) + .value(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.PROPERTY) + .idType(KeyType.ID_SHORT) + .value("ExampleProperty") + .build()) + .build()) + .build()) + .ordered(false) + .build()) + .build(); + + public static final Submodel SUBMODEL_7 = new DefaultSubmodel.Builder() + .idShort("TestSubmodel") + .description(new LangString("An example submodel for the test application", "en-us")) + .description(new LangString("Ein Beispiel-Teilmodell für eine Test-Anwendung", "de")) + .identification(new DefaultIdentifier.Builder() + .idType(IdentifierType.IRI) + .identifier("https://acplt.org/Test_Submodel_Template") + .build()) + .administration(new DefaultAdministrativeInformation.Builder() + .version("0.9") + .revision("0") + .build()) + .semanticId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .idType(KeyType.IRI) + .value("http://acplt.org/SubmodelTemplates/ExampleSubmodel") + .build()) + .build()) + .kind(ModelingKind.TEMPLATE) + .submodelElement(new DefaultRelationshipElement.Builder() + .idShort("ExampleRelationshipElement") + .category("Parameter") + .description(new LangString("Example RelationshipElement object", "en-us")) + .description(new LangString("Beispiel RelationshipElement Element", "de")) + .semanticId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .value("http://acplt.org/RelationshipElements/ExampleRelationshipElement") + .idType(KeyType.IRI) + .build()) + .build()) + .kind(ModelingKind.TEMPLATE) + .first(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.PROPERTY) + .value("ExampleProperty") + .idType(KeyType.ID_SHORT) + .build()) + .build()) + .second(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.PROPERTY) + .value("ExampleProperty") + .idType(KeyType.ID_SHORT) + .build()) + .build()) + .build()) + .submodelElement(new DefaultAnnotatedRelationshipElement.Builder().idShort("ExampleAnnotatedRelationshipElement") + .category("Parameter") + .description(new LangString("Example AnnotatedRelationshipElement object", "en-us")) + .description(new LangString("Beispiel AnnotatedRelationshipElement Element", "de")) + .semanticId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .value("http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement") + .idType(KeyType.IRI) + .build()) + .build()) + .kind(ModelingKind.TEMPLATE) + .first(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.PROPERTY) + .value("ExampleProperty") + .idType(KeyType.ID_SHORT) + .build()) + .build()) + .second(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.PROPERTY) + .value("ExampleProperty") + .idType(KeyType.ID_SHORT) + .build()) + .build()) + .build()) + .submodelElement(new DefaultOperation.Builder() + .idShort("ExampleOperation") + .category("Parameter") + .description(new LangString("Example Operation object", "en-us")) + .description(new LangString("Beispiel Operation Element", "de")) + .semanticId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .value("http://acplt.org/Operations/ExampleOperation") + .idType(KeyType.IRI) + .build()) + .build()) + .kind(ModelingKind.TEMPLATE) + .inputVariable(new DefaultOperationVariable.Builder() + .value(new DefaultProperty.Builder() + .idShort("ExampleProperty") + .category("Constant") + .description(new LangString("Example Property object", "en-us")) + .description(new LangString("Beispiel Property Element", "de")) + .semanticId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .value("http://acplt.org/Properties/ExampleProperty") + .idType(KeyType.IRI) + .build()) + .build()) + .kind(ModelingKind.TEMPLATE) + .value(null) + .valueType("string") + .build()) + .build()) + .outputVariable(new DefaultOperationVariable.Builder() + .value(new DefaultProperty.Builder() + .idShort("ExampleProperty") + .category("Constant") + .description(new LangString("Example Property object", "en-us")) + .description(new LangString("Beispiel Property Element", "de")) + .semanticId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .value("http://acplt.org/Properties/ExampleProperty") + .idType(KeyType.IRI) + .build()) + .build()) + .kind(ModelingKind.TEMPLATE) + .value(null) + .valueType("string") + .build()) + .build()) + .inoutputVariable(new DefaultOperationVariable.Builder() + .value(new DefaultProperty.Builder() + .idShort("ExampleProperty") + .category("Constant") + .description(new LangString("Example Property object", "en-us")) + .description(new LangString("Beispiel Property Element", "de")) + .semanticId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .value("http://acplt.org/Properties/ExampleProperty") + .idType(KeyType.IRI) + .build()) + .build()) + .kind(ModelingKind.TEMPLATE) + .value(null) + .valueType("string") + .build()) + .build()) + .build()) + .submodelElement(new DefaultCapability.Builder() + .idShort("ExampleCapability") + .category("Parameter") + .description(new LangString("Example Capability object", "en-us")) + .description(new LangString("Beispiel Capability Element", "de")) + .semanticId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .value("http://acplt.org/Capabilities/ExampleCapability") + .idType(KeyType.IRI) + .build()) + .build()) + .kind(ModelingKind.TEMPLATE) + .build()) + .submodelElement(new DefaultBasicEvent.Builder() + .idShort("ExampleBasicEvent") + .category("Parameter") + .description(new LangString("Example BasicEvent object", "en-us")) + .description(new LangString("Beispiel BasicEvent Element", "de")) + .semanticId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .value("http://acplt.org/Events/ExampleBasicEvent") + .idType(KeyType.IRI) + .build()) + .build()) + .kind(ModelingKind.TEMPLATE) + .observed(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.PROPERTY) + .idType(KeyType.ID_SHORT) + .value("ExampleProperty") + .build()) + .build()) + .build()) + .submodelElement(new DefaultSubmodelElementCollection.Builder() + .idShort("ExampleSubmodelCollectionOrdered") + .category("Parameter") + .description(new LangString("Example SubmodelElementCollectionOrdered object", "en-us")) + .description(new LangString("Beispiel SubmodelElementCollectionOrdered Element", "de")) + .semanticId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .value("http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered") + .idType(KeyType.IRI) + .build()) + .build()) + .kind(ModelingKind.TEMPLATE) + .value(new DefaultProperty.Builder() + .idShort("ExampleProperty") + .category("Constant") + .description(new LangString("Example Property object", "en-us")) + .description(new LangString("Beispiel Property Element", "de")) + .semanticId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .value("http://acplt.org/Properties/ExampleProperty") + .idType(KeyType.IRI) + .build()) + .build()) + .kind(ModelingKind.TEMPLATE) + .value(null) + .valueType("string") + .build()) + .value(new DefaultMultiLanguageProperty.Builder() + .idShort("ExampleMultiLanguageProperty") + .category("Constant") + .description(new LangString("Example MultiLanguageProperty object", "en-us")) + .description(new LangString("Beispiel MulitLanguageProperty Element", "de")) + .semanticId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE).value( + "http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty") + .idType(KeyType.IRI) + .build()) + .build()) + .kind(ModelingKind.TEMPLATE) + .build()) + .value(new DefaultRange.Builder() + .idShort("ExampleRange") + .category("Parameter") + .description(new LangString("Example Range object", "en-us")) + .description(new LangString("Beispiel Range Element", "de")) + .semanticId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .value("http://acplt.org/Ranges/ExampleRange") + .idType(KeyType.IRI) + .build()) + .build()) + .kind(ModelingKind.TEMPLATE) + .valueType("int") + .min(null) + .max("100") + .build()) + .value(new DefaultRange.Builder() + .idShort("ExampleRange2") + .category("Parameter") + .description(new LangString("Example Range object", "en-us")) + .description(new LangString("Beispiel Range Element", "de")) + .semanticId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .value("http://acplt.org/Ranges/ExampleRange") + .idType(KeyType.IRI) + .build()) + .build()) + .kind(ModelingKind.TEMPLATE) + .valueType("int") + .min("0") + .max(null) + .build()) + .ordered(true) + .build()) + .submodelElement(new DefaultSubmodelElementCollection.Builder() + .idShort("ExampleSubmodelCollectionUnordered") + .category("Parameter") + .description(new LangString("Example SubmodelElementCollectionUnordered object", "en-us")) + .description(new LangString("Beispiel SubmodelElementCollectionUnordered Element", "de")) + .semanticId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .value("http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered") + .idType(KeyType.IRI) + .build()) + .build()) + .kind(ModelingKind.TEMPLATE) + .value(new DefaultBlob.Builder() + .idShort("ExampleBlob") + .category("Parameter") + .description(new LangString("Example Blob object", "en-us")) + .description(new LangString("Beispiel Blob Element", "de")) + .semanticId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .value("http://acplt.org/Blobs/ExampleBlob") + .idType(KeyType.IRI) + .build()) + .build()) + .kind(ModelingKind.TEMPLATE) + .mimeType("application/pdf") + .build()) + .value(new DefaultFile.Builder() + .idShort("ExampleFile") + .category("Parameter") + .description(new LangString("Example File object", "en-us")) + .description(new LangString("Beispiel File Element", "de")) + .semanticId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .value("http://acplt.org/Files/ExampleFile") + .idType(KeyType.IRI) + .build()) + .build()) + .kind(ModelingKind.TEMPLATE) + .value(null) + .mimeType("application/pdf") + .build()) + .value(new DefaultReferenceElement.Builder() + .idShort("ExampleReferenceElement") + .category("Parameter") + .description(new LangString("Example Reference Element object", "en-us")) + .description(new LangString("Beispiel Reference Element Element", "de")) + .semanticId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .value("http://acplt.org/ReferenceElements/ExampleReferenceElement") + .idType(KeyType.IRI) + .build()) + .build()) + .kind(ModelingKind.TEMPLATE) + .build()) + .ordered(false) + .build()) + .submodelElement(new DefaultSubmodelElementCollection.Builder() + .idShort("ExampleSubmodelCollectionUnordered2") + .category("Parameter") + .description(new LangString("Example SubmodelElementCollectionUnordered object", "en-us")) + .description(new LangString("Beispiel SubmodelElementCollectionUnordered Element", "de")) + .semanticId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .value("http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered") + .idType(KeyType.IRI) + .build()) + .build()) + .kind(ModelingKind.TEMPLATE) + .ordered(false) + .build()) + .build(); + + public final static ConceptDescription CONCEPT_DESCRIPTION_1 = new DefaultConceptDescription.Builder() + .idShort("TestConceptDescription") + .description(new LangString("An example concept description for the test application", "en-us")) + .description(new LangString("Ein Beispiel-ConceptDescription für eine Test-Anwendung", "de")) + .identification(new DefaultIdentifier.Builder() + .idType(IdentifierType.IRI) + .identifier("https://acplt.org/Test_ConceptDescription") + .build()) + .administration(new DefaultAdministrativeInformation.Builder() + .version("0.9") + .revision("0") + .build()) + .isCaseOf(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .idType(KeyType.IRI) + .value("http://acplt.org/DataSpecifications/ConceptDescriptions/TestConceptDescription") + .build()) + .build()) + .build(); + + public final static ConceptDescription CONCEPT_DESCRIPTION_2 = new DefaultConceptDescription.Builder() + .idShort("") + .identification(new DefaultIdentifier.Builder() + .idType(IdentifierType.IRI) + .identifier("https://acplt.org/Test_ConceptDescription_Mandatory") + .build()) + .build(); + + public final static ConceptDescription CONCEPT_DESCRIPTION_3 = new DefaultConceptDescription.Builder() + .idShort("TestConceptDescription") + .description(new LangString("An example concept description for the test application", "en-us")) + .description(new LangString("Ein Beispiel-ConceptDescription für eine Test-Anwendung", "de")) + .identification(new DefaultIdentifier.Builder() + .idType(IdentifierType.IRI) + .identifier("https://acplt.org/Test_ConceptDescription_Missing") + .build()) + .administration(new DefaultAdministrativeInformation.Builder() + .version("0.9") + .revision("0") + .build()) + .build(); + + public final static ConceptDescription CONCEPT_DESCRIPTION_4 = new DefaultConceptDescription.Builder() + .idShort("TestSpec_01") + .identification(new DefaultIdentifier.Builder() + .idType(IdentifierType.IRI) + .identifier("http://acplt.org/DataSpecifciations/Example/Identification") + .build()) + .administration(new DefaultAdministrativeInformation.Builder() + .version("0.9") + .revision("0") + .build()) + .isCaseOf(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .idType(KeyType.IRI) + .value("http://acplt.org/ReferenceElements/ConceptDescriptionX") + .build()) + .build()) + .embeddedDataSpecification(new DefaultEmbeddedDataSpecification.Builder() + .dataSpecificationContent(new DefaultDataSpecificationIEC61360.Builder() + .preferredName(new LangString("Test Specification", "de")) + .preferredName(new LangString("TestSpecification", "en-us")) + .dataType(DataTypeIEC61360.REAL_MEASURE) + .definition(new LangString("Dies ist eine Data Specification für Testzwecke", "de")) + .definition(new LangString("This is a DataSpecification for testing purposes", "en-us")) + .shortName(new LangString("Test Spec", "de")) + .shortName(new LangString("TestSpec", "en-us")) + .unit("SpaceUnit") + .unitId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .idType(KeyType.IRI) + .value("http://acplt.org/Units/SpaceUnit") + .build()) + .build()) + .sourceOfDefinition("http://acplt.org/DataSpec/ExampleDef") + .symbol("SU") + .valueFormat("string") + .value("TEST") + .levelType(LevelType.MIN) + .levelType(LevelType.MAX) + .valueList(new DefaultValueList.Builder() + .valueReferencePairTypes(new DefaultValueReferencePair.Builder() + .value("exampleValue") + .valueId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .idType(KeyType.IRI) + .value("http://acplt.org/ValueId/ExampleValueId") + .build()) + .build()) + // TODO valueType + .build()) + .valueReferencePairTypes(new DefaultValueReferencePair.Builder() + .value("exampleValue2") + .valueId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .idType(KeyType.IRI) + .value("http://acplt.org/ValueId/ExampleValueId2") + .build()) + .build()) + // TODO valueType + .build()) + .build()) + .build()) + .build() + ) + .build(); + + public static final AssetAdministrationShellEnvironment ENVIRONMENT = new DefaultAssetAdministrationShellEnvironment.Builder() + .assetAdministrationShells(Arrays.asList( + AAS_1, + AAS_2, + AAS_3, + AAS_4)) + .submodels(Arrays.asList( + SUBMODEL_1, + SUBMODEL_2, + SUBMODEL_3, + SUBMODEL_4, + SUBMODEL_5, + SUBMODEL_6, + SUBMODEL_7)) + .conceptDescriptions(Arrays.asList( + CONCEPT_DESCRIPTION_1, + CONCEPT_DESCRIPTION_2, + CONCEPT_DESCRIPTION_3, + CONCEPT_DESCRIPTION_4)) + .build(); +} diff --git a/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/serialize/AmlSerializerTest.java b/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/serialize/AmlSerializerTest.java new file mode 100644 index 00000000..22729264 --- /dev/null +++ b/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/serialize/AmlSerializerTest.java @@ -0,0 +1,17 @@ +package io.adminshell.aas.v3.dataformat.aml.serialize; + +import io.adminshell.aas.v3.dataformat.aml.fixtures.FullExample; +import io.adminshell.aas.v3.dataformat.SerializationException; +import io.adminshell.aas.v3.dataformat.aml.AmlSerializer; +import org.junit.Test; + +public class AmlSerializerTest { + + private final AmlSerializer serializer = new AmlSerializer(); + + @Test + public void testSAPFullExample() throws SerializationException { + String actual = serializer.write(FullExample.ENVIRONMENT); + System.err.println(actual); + } +} diff --git a/dataformat-aml/src/test/resources/amlfile/example-motor.xml b/dataformat-aml/src/test/resources/amlfile/example-motor.xml new file mode 100644 index 00000000..edac76c6 --- /dev/null +++ b/dataformat-aml/src/test/resources/amlfile/example-motor.xml @@ -0,0 +1,2889 @@ + + + + 0 + + + + + + + + Instance + + + + (Submodel)(local)[IRI]i40.customer.com/type/1/1/F13E8576F6488342 + + + + + + IRI + + + + http://customer.com/assets/KHBVZJSQKIY + + + + + ServoDCMotor + + + + + + + + + + + Instance + + + + (GlobalReference)(no-local)[IRDI]0173-1#02-AAO677#002 + + + + Manufacturer + + + + CONSTANT + + + + CUSTOMER GmbH + + + + + + + + Instance + + + + (GlobalReference)(no-local)[IRDI]0173-1#02-AAY812#001 + + + + GLN + + + + CONSTANT + + + + 10101010 + + + + + + + + Instance + + + + (GlobalReference)(no-local)[IRDI]0173-1#02-AAW338#001 + + + + ProductDesignation + + + + CONSTANT + + + + I40 Capable Servo Motor (EN) + + + + + + + + Instance + + + + (GlobalReference)(no-local)[IRDI]0173-1#02-AAM556#002 + + + + SerialNumber + + + + CONSTANT + + + + P12345678I40 + + + + + Instance + + + + (GlobalReference)(no-local)[IRDI]0173-1#01-ADN198#009 + + + + + + IRI + + + + http://i40.customer.com/type/1/1/F13E8576F6488342 + + + + + Identification + + + + CONSTANT + + + + + + Identification from Manufacturer + + + Hersteller-Identifikation + + + + + + + + + + + Instance + + + + (ConceptDescription)(local)[IRI]http://customer.com/cd/1/1/18EBD56F6B43D89 + + + + RotationSpeed + + + + VARIABLE + + + + + + open circuit, external cooling + + + + 4370 + + + + + + + + Instance + + + + (ConceptDescription)(local)[IRI]http://customer.com/cd/1/1/18EBD56F6B43D896 + + + + Torque + + + + VARIABLE + + + + + + open circuit, external cooling + + + + 117.4 + + + + + Instance + + + + (GlobalReference)(no-local)[IRDI]0173-1#01-AFZ615#016 + + + + + + IRI + + + + http://i40.customer.com/instance/1/1/AC69B1CB44F07935 + + + + + OperationalData + + + + VARIABLE + + + + + + + + + + + + + + Instance + + + + (ConceptDescription)(local)[IRI]www.vdi2770.com/blatt1/Entwurf/Okt18/cd/DocumentId/Val + + + + DocumentId + + + + CONSTANT + + + + 3 608 870 A47 + + + + + + + + Instance + + + + (ConceptDescription)(local)[IRI]www.vdi2770.com/blatt1/Entwurf/Okt18/cd/DocumentClassification/ClassId + + + + DocumentClassId + + + + 03-02 + + + + + + + + Instance + + + + (ConceptDescription)(local)[IRI]www.vdi2770.com/blatt1/Entwurf/Okt18/cd/DocumentClassification/ClassName + + + + DocumentClassName + + + + Operation (EN) Bedienung (DE) + + + + + + + + Instance + + + + (ConceptDescription)(local)[IRI]www.vdi2770.com/blatt1/Entwurf/Okt18/cd/DocumentClassification/ClassificationSystem + + + + DocumentClassificationSystem + + + + VDI2770:2018 + + + + + + + + Instance + + + + (ConceptDescription)(local)[IRI]www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Organization/OrganizationName + + + + OrganizationName + + + + CUSTOMER + + + + + + + + Instance + + + + (ConceptDescription)(local)[IRI]www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Organization/OrganizationOfficialName + + + + OrganizationOfficialName + + + + CUSTOMER GmbH + + + + + + + + Instance + + + + (ConceptDescription)(local)[IRI]www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Description/Title + + + + Title + + + + Operating Manual + + + + + + + + Instance + + + + (ConceptDescription)(local)[IRI]www.vdi2770.com/blatt1/Entwurf/Okt18/cd/DocumentVersion/Language + + + + Language + + + + en-US + + + + + + + + Instance + + + + (ConceptDescription)(local)[IRI]www.vdi2770.com/blatt1/Entwurf/Okt18/cd/StoredDocumentRepresentation/DigitalFile + + + + DigitalFile_PDF + + + + PARAMETER + + + + + application/pdf + + + + /aasx/OperatingManual.pdf + + + + + + false + + + + false + + + + Instance + + + + (ConceptDescription)(local)[IRI]www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Document + + + + OperatingManual + + + + + Instance + + + + + + IRI + + + + http://i40.customer.com/type/1/1/1A7B62B529F1915 + + + + + Documentation + + + + CONSTANT + + + + + + + + + + + Instance + + + + (ConceptDescription)(local)[IRDI]0173-1#02-BAA120#008 + + + + MaxRotationSpeed + + + + PARAMETER + + + + 5000 + + + + + + + + Instance + + + + (ConceptDescription)(local)[IRDI]0173-1#02-BAE098#004 + + + + MaxTorque + + + + PARAMETER + + + + 200 + + + + + + + + (ConceptDescription)(local)[IRDI]0173-1#07-BAB657#003 + + + + Instance + + + + (ConceptDescription)(local)[IRDI]0173-1#02-BAE122#006 + + + + CoolingType + + + + PARAMETER + + + + + + open circuit, external cooling + + + + BAB657 + + + + + Instance + + + + (GlobalReference)(no-local)[IRDI]0173-1#01-AFZ615#016 + + + + + + IRI + + + + http.//i40.customer.com/type/1/1/7A7104BDAB57E184 + + + + + TechnicalData + + + + CONSTANT + + + + + + + IRI + + + + http://customer.com/aas/9175_7013_7091_9168 + + + + + ExampleMotor + + + + CONSTANT + + + + + Interface Class Library according to Details of the Asset Administration Shell V2.0. + 1.0.0 + + A FileDataReference represents the address to a File. FileDataReference is derived from the + AutomationML Interface Class ExternalDataReference that is defined in AutomationML + BPR_005E_ExternalDataReference_v1.0.0_2:The interface class “ExternalDataReference? shall be used in order + to reference external documents out of the scope of AutomationML. + + + + Reference to any other referable element of the same of any other AAS or a reference to an external + object or entity. For local references inside the same Asset Administration Shell an InternalLink between + two objects with this interface "ReferableReference" shall be set. In this case the attribute value has to + be empty. For references between different Asset Administration Shells or external objects or entities the + attribute value shall be used and no InternalLink shall be set. + + + Reference to any other referable element of any other AAS or a reference to an external object + or entity. Note: For references to any other referable element of the same AAS InternalLinks are used + and this attribute value shall be empty. + + + + + + +1.0.0 + + + Mime type of the content of the File. + + + + +Standard Automation Markup Language Interface Class Library - Part 1 Content extended with Part 3 and Part + 4 Content + +2.2.2 + + + + + + + + + + The attribute refURI is an IRI that can represent an absolute or relative path to an L + document. An added fragment (with #) references inside the document + + + + + + + + + + + + + + + + + + true + + + + + + + + + + + + +Role Class Library according to Details of the Asset Administration Shell V2.0. +1.0.0 + + An Asset Administration Shell. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a + referable element not being an identifiable element this id is mandatory and used for referring to the + element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore + ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. + Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used + for unique reference in its name space and thus allows better usability and a more performant + implementation. In this case it is similar to the “BrowserPath? in OPC UA. + + + + + 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. + + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + + + + + + + Abstract attribute class for identification. Has the subattributes id and idType. + + + Identifier of the element. Its type is defined in idType. Id is a subproperty of + identification. + + + + + + Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the + enumeration “IdentifierType?. IdType is a subproperty of identification. + + + + + + + Abstract attribute for administration. Has the subattributes revision and version. + + + Revision of the element. Constraint AASd-005: A revision requires a version. This means, if + there is no version there is no revision neither. Revision is a subproperty of administration. + + + + + + Version of the element. Version is a subproperty of administration. + + + + + + Global reference to the data specification template used by the element. + + + + + The derivedFrom attribute is used to establish a relationship between two Asset Administration + Shells that are derived from each other. + + + + + + + An Asset describes meta data of an asset that is represented by an AAS. The asset may either represent + an asset type or an asset instance. The asset has a globally unique identifier plus – if needed – additional + domain specific (proprietary) identifiers. + + + Identifying string of the element within its name space. Constraint AASd-001: In case of a + referable element not being an identifiable element this id is mandatory and used for referring to the + element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore + ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. + Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used + for unique reference in its name space and thus allows better usability and a more performant + implementation. In this case it is similar to the “BrowserPath? in OPC UA. + + + + + 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. + + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + + Abstract attribute class for identification. Has the subattributes id and idType. + + + Identifier of the element. Its type is defined in idType. + + + + + Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the + enumeration “IdentifierType?. IdType is a subproperty of identification. + + + + + + + Abstract attribute for administration. Has the subattributes revision and version. + + + Revision of the element. Constraint AASd-005: A revision requires a version. This means, if + there is no version there is no revision neither. Revision is a subproperty of administration. + + + + + + Version of the element. Version is a subproperty of administration. + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either type or instance. + Instance + Instance + + + + Instance + Type + + + + + + A Submodel defines a specific aspect of the asset represented by the AAS. A submodel is used to + structure the virtual representation and technical functionality of an Administration Shell into distinguishable + parts. Each submodel refers to a well-defined domain or subject matter. Submodels can become standardized and + thus become submodels types. Submodels can have different life-cycles. + + + Identifying string of the element within its name space. Constraint AASd-001: In case of a + referable element not being an identifiable element this id is mandatory and used for referring to the + element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore + ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. + Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used + for unique reference in its name space and thus allows better usability and a more performant + implementation. In this case it is similar to the “BrowserPath? in OPC UA. + + + + + 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. + + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + + Abstract attribute class for identification. Has the subattributes id and idType. + + + Identifier of the element. Its type is defined in idType. Id is a subproperty of + identification. + + + + + + Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the + enumeration “IdentifierType?. IdType is a subproperty of identification. + + + + + + + Abstract attribute for administration. Has the subattributes revision and version. + + + Revision of the element. Constraint AASd-005: A revision requires a version. This means, if + there is no version there is no revision neither. Revision is a subproperty of administration. + + + + + + Version of the element. Version of the element. Version is a subproperty of administration. + + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This + attribute has the name of the label and has a value with the label written in the default language. The + individual languages are modelled as child attributes. The names of the child attributes are the prefix + “aml-lang=? with the expression of the language in compliance with RFC5646. At it, the values of the child + attributes are the labels within the respective language. + + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. + [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and + the valueId are present then the value needs to be identical to the value of the referenced coded value + in valueId. + + + + + + Reference to the global unqiue id of a coded value. + + + + + + + A submodel element collection is a set or list of submodel elements. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a + referable element not being an identifiable element this id is mandatory and used for referring to the + element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore + ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. + Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used + for unique reference in its name space and thus allows better usability and a more performant + implementation. In this case it is similar to the “BrowserPath? in OPC UA. + + + + + 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. + + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This + attribute has the name of the label and has a value with the label written in the default language. The + individual languages are modelled as child attributes. The names of the child attributes are the prefix + “aml-lang=? with the expression of the language in compliance with RFC5646. At it, the values of the child + attributes are the labels within the respective language. + + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. + [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and + the valueId are present then the value needs to be identical to the value of the referenced coded value + in valueId. + + + + + + Reference to the global unqiue id of a coded value. + + + + + + If allowDuplicates=true, then it is allowed that the collection contains the same element several + times. + + false + + + + If ordered=false, then the elements in the property collection are not ordered. If ordered=true + then the elements in the collection are ordered. Default = false. Note: An ordered submodel element + collection is typically implemented as an indexed array. + + false + + + + Submodel element contained in the collection. + + + + + A BLOB is a data element that represents a file that is contained with its source code in the value + attribute. + + + Identifying string of the element within its name space. Constraint AASd-001: In case of a + referable element not being an identifiable element this id is mandatory and used for referring to the + element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore + ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. + Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used + for unique reference in its name space and thus allows better usability and a more performant + implementation. In this case it is similar to the “BrowserPath? in OPC UA. + + + + + 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. + + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This + attribute has the name of the label and has a value with the label written in the default language. The + individual languages are modelled as child attributes. The names of the child attributes are the prefix + “aml-lang=? with the expression of the language in compliance with RFC5646. At it, the values of the child + attributes are the labels within the respective language. + + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. + [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and + the valueId are present then the value needs to be identical to the value of the referenced coded value + in valueId. + + + + + + Reference to the global unqiue id of a coded value. + + + + + + Mime type of the content of the BLOB. The mime type states which file extension the file has. Valid + values are e.g. “application/json?, “application/xls?, ?image/jpg?. The allowed values are defined as in + RFC2046. + + + + + + The value of the BLOB instance of a blob data element. Note: In contrast to the file property the + file content is stored directly as value in the Blob data element. + + + + + + + A capability is the implementation-independent description of the potential of an asset to achieve a + certain effect in the physical or virtual world. + + + Identifying string of the element within its name space. Constraint AASd-001: In case of a + referable element not being an identifiable element this id is mandatory and used for referring to the + element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore + ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. + Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used + for unique reference in its name space and thus allows better usability and a more performant + implementation. In this case it is similar to the “BrowserPath? in OPC UA. + + + + + 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. + + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This + attribute has the name of the label and has a value with the label written in the default language. The + individual languages are modelled as child attributes. The names of the child attributes are the prefix + “aml-lang=? with the expression of the language in compliance with RFC5646. At it, the values of the child + attributes are the labels within the respective language. + + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. + [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and + the valueId are present then the value needs to be identical to the value of the referenced coded value + in valueId. + + + + + + Reference to the global unqiue id of a coded value. + + + + + + + A role class for a File that a data element that represents an address to a file. It is derived from + the AutomationML role class ExternalData that is an role type for a document type and the base class for all + document type roles. It describes different document types. ExternalData is defined in AutomationML + BPR_005E_ExternalDataReference_v1.0.0_2. + + + Identifying string of the element within its name space. Constraint AASd-001: In case of a + referable element not being an identifiable element this id is mandatory and used for referring to the + element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore + ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. + Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used + for unique reference in its name space and thus allows better usability and a more performant + implementation. In this case it is similar to the “BrowserPath? in OPC UA. + + + + + 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. + + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This + attribute has the name of the label and has a value with the label written in the default language. The + individual languages are modelled as child attributes. The names of the child attributes are the prefix + “aml-lang=? with the expression of the language in compliance with RFC5646. At it, the values of the child + attributes are the labels within the respective language. + + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. + [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and + the valueId are present then the value needs to be identical to the value of the referenced coded value + in valueId. + + + + + + Reference to the global unqiue id of a coded value. + + + + + + + The attribute refURI is an IRI that can represent an absolute or relative path to an L + document. An added fragment (with #) references inside the document + + + + Mime type of the content of the File. + + + + + A property is a data element that has a single value. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a + referable element not being an identifiable element this id is mandatory and used for referring to the + element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore + ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. + Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used + for unique reference in its name space and thus allows better usability and a more performant + implementation. In this case it is similar to the “BrowserPath? in OPC UA. + + + + + 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. + + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This + attribute has the name of the label and has a value with the label written in the default language. The + individual languages are modelled as child attributes. The names of the child attributes are the prefix + “aml-lang=? with the expression of the language in compliance with RFC5646. At it, the values of the child + attributes are the labels within the respective language. + + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. + [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and + the valueId are present then the value needs to be identical to the value of the referenced coded value + in valueId. + + + + + + Reference to the global unqiue id of a coded value. + + + + + + The value of the property instance. + + + + Reference to the global unique id if a coded value. + + + + + A reference element is a data element that defines a logical reference to another element within the + same or another AAS or a reference to an external object or entity. + + + Identifying string of the element within its name space. Constraint AASd-001: In case of a + referable element not being an identifiable element this id is mandatory and used for referring to the + element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore + ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. + Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used + for unique reference in its name space and thus allows better usability and a more performant + implementation. In this case it is similar to the “BrowserPath? in OPC UA. + + + + + 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. + + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This + attribute has the name of the label and has a value with the label written in the default language. The + individual languages are modelled as child attributes. The names of the child attributes are the prefix + “aml-lang=? with the expression of the language in compliance with RFC5646. At it, the values of the child + attributes are the labels within the respective language. + + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. + [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and + the valueId are present then the value needs to be identical to the value of the referenced coded value + in valueId. + + + + + + Reference to the global unqiue id of a coded value. + + + + + + + Reference to any other referable element of any other AAS or a reference to an external object + or entity. Note: For references to any other referable elment of the same AAS InternalLinks are used and + this attribute value shall be empty. + + + + + + + A relationship element is used to define a relationship between two referable elements. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a + referable element not being an identifiable element this id is mandatory and used for referring to the + element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore + ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. + Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used + for unique reference in its name space and thus allows better usability and a more performant + implementation. In this case it is similar to the “BrowserPath? in OPC UA. + + + + + 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. + + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This + attribute has the name of the label and has a value with the label written in the default language. The + individual languages are modelled as child attributes. The names of the child attributes are the prefix + “aml-lang=? with the expression of the language in compliance with RFC5646. At it, the values of the child + attributes are the labels within the respective language. + + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. + [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and + the valueId are present then the value needs to be identical to the value of the referenced coded value + in valueId. + + + + + + Reference to the global unqiue id of a coded value. + + + + + + + Reference to any other referable element of any other AAS or a reference to an external object + or entity. Note: For references to any other referable elment of the same AAS InternalLinks are used and + this attribute value shall be empty. + + + + + + Reference to any other referable element of any other AAS or a reference to an external object + or entity. Note: For references to any other referable elment of the same AAS InternalLinks are used and + this attribute value shall be empty. + + + + + + An annotated relationship element is an relationship element that can be annotated with additional data + elements. + + + Annotations that hold for the relationships between the two elements. + + + + + An operation is a submodel element with input and output variables. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a + referable element not being an identifiable element this id is mandatory and used for referring to the + element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore + ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. + Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used + for unique reference in its name space and thus allows better usability and a more performant + implementation. In this case it is similar to the “BrowserPath? in OPC UA. + + + + + 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. + + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This + attribute has the name of the label and has a value with the label written in the default language. The + individual languages are modelled as child attributes. The names of the child attributes are the prefix + “aml-lang=? with the expression of the language in compliance with RFC5646. At it, the values of the child + attributes are the labels within the respective language. + + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. + [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and + the valueId are present then the value needs to be identical to the value of the referenced coded value + in valueId. + + + + + + Reference to the global unqiue id of a coded value. + + + + + + + The list of AAS OperationVariableIn entities. In AML, the corresponding InternalElement with this role + is a child of the InternalElement with the Operation role. + + + + The list of AAS OperationVariableOut entities. In AML, the corresponding InternalElement with this role + is a child of the InternalElement with the Operation role. + + + + The list of AAS OperationVariableOut entities. In AML, the corresponding InternalElement with this role + is a child of the InternalElement with the Operation role. + + + + A view is a collection of referable elements w.r.t. to a specific viewpoint of one or more + stakeholders. + + + Identifying string of the element within its name space. Constraint AASd-001: In case of a + referable element not being an identifiable element this id is mandatory and used for referring to the + element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore + ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. + Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used + for unique reference in its name space and thus allows better usability and a more performant + implementation. In this case it is similar to the “BrowserPath? in OPC UA. + + + + + 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. + + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + + Global reference to the data specification template used by the element. + + + + + Description or comments on the element. The description can be provided in several languages. This + attribute has the name of the label and has a value with the label written in the default language. The + individual languages are modelled as child attributes. The names of the child attributes are the prefix + “aml-lang=? with the expression of the language in compliance with RFC5646. At it, the values of the child + attributes are the labels within the respective language. + + + + + + + A dictionary contains elements that can be reused. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a + referable element not being an identifiable element this id is mandatory and used for referring to the + element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore + ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. + Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used + for unique reference in its name space and thus allows better usability and a more performant + implementation. In this case it is similar to the “BrowserPath? in OPC UA. + + + + + 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. + + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + + + + + + + + Explanation: The semantics of a property or other elements that may have a semantic description is + defined by a concept description. The description of the concept should follow a standardized schema (realized + as data specification template). + + + Identifying string of the element within its name space. Constraint AASd-001: In case of a + referable element not being an identifiable element this id is mandatory and used for referring to the + element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore + ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. + Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used + for unique reference in its name space and thus allows better usability and a more performant + implementation. In this case it is similar to the “BrowserPath? in OPC UA. + + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + + Abstract attribute class for identification. Has the subattributes id and idType. + + + Identifier of the element. Its type is defined in idType. Id is a subproperty of + identification. + + + + + + Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the + enumeration “IdentifierType?. IdType is a subproperty of identification. + + + + + + + Abstract attribute for administration. Has the subattributes revision and version. + + + Revision of the element. Constraint AASd-005: A revision requires a version. This means, if + there is no version there is no revision neither. Revision is a subproperty of administration. + + + + + + Version of the element. Version is a subproperty of administration. + + + + + + Global reference to the data specification template used by the element. + + + + Global reference to an external definition the concept is compatible to or was derived from. + + + + + + + Description Role class of an element that has a data specification template. A template defines the + additional attributes an element may or shall have. + + + Identifying string of the element within its name space. Constraint AASd-001: In case of a + referable element not being an identifiable element this id is mandatory and used for referring to the + element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore + ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. + Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used + for unique reference in its name space and thus allows better usability and a more performant + implementation. In this case it is similar to the “BrowserPath? in OPC UA. + + + + + 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. + + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + + + + + + + Abstract attribute class for identification. Has the subattributes id and idType. + + + Identifier of the element. Its type is defined in idType. Id is a subproperty of + identification. + + + + + + Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the + enumeration “IdentifierType?. IdType is a subproperty of identification. + + + + + + + Abstract attribute for administration. Has the subattributes revision and version. + + + Revision of the element. Constraint AASd-005: A revision requires a version. This means, if + there is no version there is no revision neither. Revision is a subproperty of administration. + + + + + + Version of the element. Version is a subproperty of administration. + + + + + + + Content of the data specification template. + + + +1.0.0 + + + +Automation Markup Language Base Role Class Library - Part 1 Content extended with Part 3 and Part 4 + Content + +2.2.2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0 + + An AAS Data Specification template for IEC61369. A template consists of the DataSpecificationContent + containing the additional attributes to be added to the element instance that references the data specification + template and meta information about the template itself (this is why DataSpecification inherits from + Identifiable). In UML these are two separated classes. + + + Identifying string of the element within its name space. Constraint AASd-001: In case of a + referable element not being an identifiable element this id is mandatory and used for referring to the + element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore + ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. + Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used + for unique reference in its name space and thus allows better usability and a more performant + implementation. In this case it is similar to the “BrowserPath? in OPC UA. + + + + + 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. + + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + + + + + + + Abstract attribute class for identification. Has the subattributes id and idType. + + + Identifier of the element. Its type is defined in idType. Id is a subproperty of + identification. + + http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360 + + + + Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the + enumeration “IdentifierType?. IdType is a subproperty of identification. + + IRI + + + + + Abstract attribute for administration. Has the subattributes revision and version. + + + Revision of the element. Constraint AASd-005: A revision requires a version. This means, if + there is no version there is no revision neither. Revision is a subproperty of administration. + + + + + + Version of the element. Version is a subproperty of administration. + + + + + + + The content of an AAS Data Specification template for IEC61360. + + Identifies the attribute hierarchy for preferredName in above attribute hierachy. Subordinate + attributes are designated by the country code information (see aml-lang literal). + + + + + Identifies the attribute for shortName in above attribute hierarchy. + + + + Identifies the attribute for unit in above attribute hierarchy. + + + + Identifies the attribute for unitId in above attribute hierarchy in its string serialization. + + + + + Identifies the attribute for sourceOfDefinition in above attribute hierachy. Subordinate + attributes are designated by the country code information (see aml-lang literal). + + + + + Identifies the attribute for symbol in above attribute hierarchy. + + + + Identifies the attribute for dataType in above attribute hierarchy. + + + + Identifies the attribute for definition in above attribute hierachy. Subordinate attributes are + designated by the country code information (see aml-lang literal). + + + + + Identifies the attribute for valueFormat in above attribute hierarchy. + + + + Identifies the attribute for valueList in above attribute hierarchy. + + + + The attribute value. + + + + The id for the value. + + + + + + + +0 + + \ No newline at end of file diff --git a/dataformat-aml/src/test/resources/amlfile/full-example.xml b/dataformat-aml/src/test/resources/amlfile/full-example.xml new file mode 100644 index 00000000..88b1275a --- /dev/null +++ b/dataformat-aml/src/test/resources/amlfile/full-example.xml @@ -0,0 +1,8921 @@ + + + + 0 + + + + + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + + (GLOBAL_REFERENCE)[IRI]0173-1#02-AAO677#002 + + + + ManufacturerName + + + + + + + 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. + + + 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 + + + + + + xs:int + + + + 100 + + + + + + + + + + xs:int + + + + 50 + + + + + + + + ACPLT + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + + (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber + + + + InstanceId + + + + + + + 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. + + + 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 + + + + 978-8234-234-342 + + + + + + (SUBMODEL)[IRI]http://acplt.org/SubmodelTemplates/AssetIdentification + + + + + + IRI + + + + http://acplt.org/Submodels/Assets/TestAsset/Identification + + + + + + + 0.9 + + + + 0 + + + + + Identification + + + + + + + An example asset identification submodel for the test application + + + Ein Beispiel-Identifikations-Submodel für eine Test-Anwendung + + + + + + + + + + + + + + + CO_MANAGED_ENTITY + + + + + (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber + + + + ExampleEntity + + + + + + + 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. + + + 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 + + + + + + + + + SELF_MANAGED_ENTITY + + + + + (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber + + + + ExampleEntity2 + + + + + + + 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. + + + 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 + + + + + + (SUBMODEL)[IRI]http://acplt.org/SubmodelTemplates/BillOfMaterial + + + + + + IRI + + + + http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial + + + + + + + 0.9 + + + + + + + + BillOfMaterial + + + + + + + An example bill of material submodel for the test application + + + Ein Beispiel-BillofMaterial-Submodel für eine Test-Anwendung + + + + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleRelationshipElement + + + + ExampleRelationshipElement + + + + Parameter + + + + + + Example RelationshipElement object + + + Beispiel RelationshipElement Element + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + (PROPERTY)[ID_SHORT]ExampleProperty2 + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement + + + + ExampleAnnotatedRelationshipElement + + + + Parameter + + + + + + Example AnnotatedRelationshipElement object + + + Beispiel AnnotatedRelationshipElement Element + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + (PROPERTY)[ID_SHORT]ExampleProperty2 + + + + + + + + + + + + + + + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Operations/ExampleOperation + + + + ExampleOperation + + + + Parameter + + + + + + Example Operation object + + + Beispiel Operation Element + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Capabilities/ExampleCapability + + + + ExampleCapability + + + + Parameter + + + + + + Example Capability object + + + Beispiel Capability Element + + + + + + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Events/ExampleBasicEvent + + + + ExampleBasicEvent + + + + Parameter + + + + + + Example BasicEvent object + + + Beispiel BasicEvent Element + + + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty + + + + ExampleProperty + + + + Constant + + + + + + Example Property object + + + Beispiel Property Element + + + + exampleValue + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty + + + + ExampleMultiLanguageProperty + + + + Constant + + + + + + Example MultiLanguageProperty object + + + Beispiel MulitLanguageProperty Element + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleMultiLanguageValueId + + + + + + Example value of a MultiLanguageProperty element + + + Beispielswert für ein MulitLanguageProperty-Element + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Ranges/ExampleRange + + + + ExampleRange + + + + Parameter + + + + + + Example Range object + + + Beispiel Range Element + + + + 100 + + + + 0 + + + + + true + + + + false + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered + + + + ExampleSubmodelCollectionOrdered + + + + Parameter + + + + + + Example SubmodelElementCollectionOrdered object + + + Beispiel SubmodelElementCollectionOrdered Element + + + + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Blobs/ExampleBlob + + + + ExampleBlob + + + + Parameter + + + + + + Example Blob object + + + Beispiel Blob Element + + + + + application/pdf + + + + [1, 2, 3, 4, 5] + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Files/ExampleFile + + + + ExampleFile + + + + Parameter + + + + + + Example File object + + + Beispiel File Element + + + + + application/pdf + + + + /TestFile.pdf + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ReferenceElements/ExampleReferenceElement + + + + ExampleReferenceElement + + + + Parameter + + + + + + Example Reference Element object + + + Beispiel Reference Element Element + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + false + + + + false + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered + + + + ExampleSubmodelCollectionUnordered + + + + Parameter + + + + + + Example SubmodelElementCollectionUnordered object + + + Beispiel SubmodelElementCollectionUnordered Element + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelTemplates/ExampleSubmodel + + + + + + IRI + + + + https://acplt.org/Test_Submodel + + + + + + + 0.9 + + + + 0 + + + + + TestSubmodel + + + + + + + An example submodel for the test application + + + Ein Beispiel-Teilmodell für eine Test-Anwendung + + + + + + + + + + + + + + + ExampleRelationshipElement + + + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + + + + + + + ExampleAnnotatedRelationshipElement + + + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + + + + + + + + + + + + + + + + + + + + + + ExampleOperation + + + + + + + + + + + + + ExampleCapability + + + + + + + + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + + ExampleBasicEvent + + + + + + + + + + + + + + + + + + ExampleProperty + + + + + + + + + + + + + + + + ExampleMultiLanguageProperty + + + + + + + + + + + + + + + + + + + ExampleRange + + + + + + + + + + + + + true + + + + false + + + + + + ExampleSubmodelCollectionOrdered + + + + + + + + + + + + + + + + + ExampleBlob + + + + + + + application/pdf + + + + null + + + + + + + + + + + + ExampleFile + + + + + + + application/pdf + + + + + + + + + + + + + + + ExampleReferenceElement + + + + + + + + + + false + + + + false + + + + + + ExampleSubmodelCollectionUnordered + + + + + + + + + + + false + + + + false + + + + + + ExampleSubmodelCollectionUnordered2 + + + + + + + + + + + IRI + + + + https://acplt.org/Test_Submodel_Mandatory + + + + + + + + + + + + + + + + + + + + + IRI + + + + https://acplt.org/Test_Submodel2_Mandatory + + + + + + + + + + + + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleRelationshipElement + + + + ExampleRelationshipElement + + + + Parameter + + + + + + Example RelationshipElement object + + + Beispiel RelationshipElement Element + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement + + + + ExampleAnnotatedRelationshipElement + + + + Parameter + + + + + + Example AnnotatedRelationshipElement object + + + Beispiel AnnotatedRelationshipElement Element + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + + + + + + + + + + + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Operations/ExampleOperation + + + + ExampleOperation + + + + Parameter + + + + + + Example Operation object + + + Beispiel Operation Element + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Capabilities/ExampleCapability + + + + ExampleCapability + + + + Parameter + + + + + + Example Capability object + + + Beispiel Capability Element + + + + + + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Events/ExampleBasicEvent + + + + ExampleBasicEvent + + + + Parameter + + + + + + Example BasicEvent object + + + Beispiel BasicEvent Element + + + + + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty + + + + ExampleProperty + + + + Constant + + + + + + Example Property object + + + Beispiel Property Element + + + + + + xs:string + + + + + + + + + + + exampleValue + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty + + + + ExampleMultiLanguageProperty + + + + Constant + + + + + + Example MultiLanguageProperty object + + + Beispiel MulitLanguageProperty Element + + + + + + + + + Example value of a MultiLanguageProperty element + + + Beispielswert für ein MulitLanguageProperty-Element + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Ranges/ExampleRange + + + + ExampleRange + + + + Parameter + + + + + + Example Range object + + + Beispiel Range Element + + + + 100 + + + + 0 + + + + + true + + + + false + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered + + + + ExampleSubmodelCollectionOrdered + + + + Parameter + + + + + + Example SubmodelElementCollectionOrdered object + + + Beispiel SubmodelElementCollectionOrdered Element + + + + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Blobs/ExampleBlob + + + + ExampleBlob + + + + Parameter + + + + + + Example Blob object + + + Beispiel Blob Element + + + + + application/pdf + + + + [1, 2, 3, 4, 5] + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Files/ExampleFile + + + + ExampleFile + + + + Parameter + + + + + + Example File object + + + Beispiel File Element + + + + + application/pdf + + + + /TestFile.pdf + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ReferenceElements/ExampleReferenceElement + + + + ExampleReferenceElement + + + + Parameter + + + + + + Example Reference Element object + + + Beispiel Reference Element Element + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + false + + + + false + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered + + + + ExampleSubmodelCollectionUnordered + + + + Parameter + + + + + + Example SubmodelElementCollectionUnordered object + + + Beispiel SubmodelElementCollectionUnordered Element + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelTemplates/ExampleSubmodel + + + + + + IRI + + + + https://acplt.org/Test_Submodel_Missing + + + + + + + 0.9 + + + + 0 + + + + + TestSubmodel + + + + + + + An example submodel for the test application + + + Ein Beispiel-Teilmodell für eine Test-Anwendung + + + + + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleRelationshipElement + + + + ExampleRelationshipElement + + + + Parameter + + + + + + Example RelationshipElement object + + + Beispiel RelationshipElement Element + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement + + + + ExampleAnnotatedRelationshipElement + + + + Parameter + + + + + + Example AnnotatedRelationshipElement object + + + Beispiel AnnotatedRelationshipElement Element + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + + + + + + + + + + + + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Operations/ExampleOperation + + + + ExampleOperation + + + + Parameter + + + + + + Example Operation object + + + Beispiel Operation Element + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Capabilities/ExampleCapability + + + + ExampleCapability + + + + Parameter + + + + + + Example Capability object + + + Beispiel Capability Element + + + + + + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Events/ExampleBasicEvent + + + + ExampleBasicEvent + + + + Parameter + + + + + + Example BasicEvent object + + + Beispiel BasicEvent Element + + + + + + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty + + + + ExampleProperty + + + + Constant + + + + + + Example Property object + + + Beispiel Property Element + + + + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty + + + + ExampleMultiLanguageProperty + + + + Constant + + + + + + Example MultiLanguageProperty object + + + Beispiel MulitLanguageProperty Element + + + + + + + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Ranges/ExampleRange + + + + ExampleRange + + + + Parameter + + + + + + Example Range object + + + Beispiel Range Element + + + + 100 + + + + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Ranges/ExampleRange + + + + ExampleRange2 + + + + Parameter + + + + + + Example Range object + + + Beispiel Range Element + + + + + + + 0 + + + + + true + + + + false + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered + + + + ExampleSubmodelCollectionOrdered + + + + Parameter + + + + + + Example SubmodelElementCollectionOrdered object + + + Beispiel SubmodelElementCollectionOrdered Element + + + + + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Blobs/ExampleBlob + + + + ExampleBlob + + + + Parameter + + + + + + Example Blob object + + + Beispiel Blob Element + + + + + application/pdf + + + + null + + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Files/ExampleFile + + + + ExampleFile + + + + Parameter + + + + + + Example File object + + + Beispiel File Element + + + + + application/pdf + + + + + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ReferenceElements/ExampleReferenceElement + + + + ExampleReferenceElement + + + + Parameter + + + + + + Example Reference Element object + + + Beispiel Reference Element Element + + + + + + + + false + + + + false + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered + + + + ExampleSubmodelCollectionUnordered + + + + Parameter + + + + + + Example SubmodelElementCollectionUnordered object + + + Beispiel SubmodelElementCollectionUnordered Element + + + + + + + + + false + + + + false + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered + + + + ExampleSubmodelCollectionUnordered2 + + + + Parameter + + + + + + Example SubmodelElementCollectionUnordered object + + + Beispiel SubmodelElementCollectionUnordered Element + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelTemplates/ExampleSubmodel + + + + + + IRI + + + + https://acplt.org/Test_Submodel_Template + + + + + + + 0.9 + + + + 0 + + + + + TestSubmodel + + + + + + + An example submodel for the test application + + + Ein Beispiel-Teilmodell für eine Test-Anwendung + + + + + (ASSET_ADMINISTRATION_SHELL)[IRI]https://acplt.org/TestAssetAdministrationShell2 + + + + + + IRI + + + + https://acplt.org/Test_AssetAdministrationShell + + + + + + + 0.9 + + + + 0 + + + + + TestAssetAdministrationShell + + + + + + + An Example Asset Administration Shell for the test application + + + Ein Beispiel-Verwaltungsschale für eine Test-Anwendung + + + + + + (SUBMODEL)[IRI]https://acplt.org/Test_Submodel + + + + (SUBMODEL)[IRI]http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial + + + + (SUBMODEL)[IRI]http://acplt.org/Submodels/Assets/TestAsset/Identification + + + + + + + + + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + + (GLOBAL_REFERENCE)[IRI]0173-1#02-AAO677#002 + + + + ManufacturerName + + + + + + + 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. + + + 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 + + + + + + xs:int + + + + 100 + + + + + + + + + + xs:int + + + + 50 + + + + + + + + ACPLT + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + + (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber + + + + InstanceId + + + + + + + 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. + + + 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 + + + + 978-8234-234-342 + + + + + + (SUBMODEL)[IRI]http://acplt.org/SubmodelTemplates/AssetIdentification + + + + + + IRI + + + + http://acplt.org/Submodels/Assets/TestAsset/Identification + + + + + + + 0.9 + + + + 0 + + + + + Identification + + + + + + + An example asset identification submodel for the test application + + + Ein Beispiel-Identifikations-Submodel für eine Test-Anwendung + + + + + + + + + + + + + + + CO_MANAGED_ENTITY + + + + + (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber + + + + ExampleEntity + + + + + + + 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. + + + 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 + + + + + + + + + SELF_MANAGED_ENTITY + + + + + (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber + + + + ExampleEntity2 + + + + + + + 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. + + + 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 + + + + + + (SUBMODEL)[IRI]http://acplt.org/SubmodelTemplates/BillOfMaterial + + + + + + IRI + + + + http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial + + + + + + + 0.9 + + + + + + + + BillOfMaterial + + + + + + + An example bill of material submodel for the test application + + + Ein Beispiel-BillofMaterial-Submodel für eine Test-Anwendung + + + + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleRelationshipElement + + + + ExampleRelationshipElement + + + + Parameter + + + + + + Example RelationshipElement object + + + Beispiel RelationshipElement Element + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + (PROPERTY)[ID_SHORT]ExampleProperty2 + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement + + + + ExampleAnnotatedRelationshipElement + + + + Parameter + + + + + + Example AnnotatedRelationshipElement object + + + Beispiel AnnotatedRelationshipElement Element + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + (PROPERTY)[ID_SHORT]ExampleProperty2 + + + + + + + + + + + + + + + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Operations/ExampleOperation + + + + ExampleOperation + + + + Parameter + + + + + + Example Operation object + + + Beispiel Operation Element + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Capabilities/ExampleCapability + + + + ExampleCapability + + + + Parameter + + + + + + Example Capability object + + + Beispiel Capability Element + + + + + + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Events/ExampleBasicEvent + + + + ExampleBasicEvent + + + + Parameter + + + + + + Example BasicEvent object + + + Beispiel BasicEvent Element + + + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty + + + + ExampleProperty + + + + Constant + + + + + + Example Property object + + + Beispiel Property Element + + + + exampleValue + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty + + + + ExampleMultiLanguageProperty + + + + Constant + + + + + + Example MultiLanguageProperty object + + + Beispiel MulitLanguageProperty Element + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleMultiLanguageValueId + + + + + + Example value of a MultiLanguageProperty element + + + Beispielswert für ein MulitLanguageProperty-Element + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Ranges/ExampleRange + + + + ExampleRange + + + + Parameter + + + + + + Example Range object + + + Beispiel Range Element + + + + 100 + + + + 0 + + + + + true + + + + false + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered + + + + ExampleSubmodelCollectionOrdered + + + + Parameter + + + + + + Example SubmodelElementCollectionOrdered object + + + Beispiel SubmodelElementCollectionOrdered Element + + + + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Blobs/ExampleBlob + + + + ExampleBlob + + + + Parameter + + + + + + Example Blob object + + + Beispiel Blob Element + + + + + application/pdf + + + + [1, 2, 3, 4, 5] + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Files/ExampleFile + + + + ExampleFile + + + + Parameter + + + + + + Example File object + + + Beispiel File Element + + + + + application/pdf + + + + /TestFile.pdf + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ReferenceElements/ExampleReferenceElement + + + + ExampleReferenceElement + + + + Parameter + + + + + + Example Reference Element object + + + Beispiel Reference Element Element + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + false + + + + false + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered + + + + ExampleSubmodelCollectionUnordered + + + + Parameter + + + + + + Example SubmodelElementCollectionUnordered object + + + Beispiel SubmodelElementCollectionUnordered Element + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelTemplates/ExampleSubmodel + + + + + + IRI + + + + https://acplt.org/Test_Submodel + + + + + + + 0.9 + + + + 0 + + + + + TestSubmodel + + + + + + + An example submodel for the test application + + + Ein Beispiel-Teilmodell für eine Test-Anwendung + + + + + + + + + + + + + + + ExampleRelationshipElement + + + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + + + + + + + ExampleAnnotatedRelationshipElement + + + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + + + + + + + + + + + + + + + + + + + + + + ExampleOperation + + + + + + + + + + + + + ExampleCapability + + + + + + + + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + + ExampleBasicEvent + + + + + + + + + + + + + + + + + + ExampleProperty + + + + + + + + + + + + + + + + ExampleMultiLanguageProperty + + + + + + + + + + + + + + + + + + + ExampleRange + + + + + + + + + + + + + true + + + + false + + + + + + ExampleSubmodelCollectionOrdered + + + + + + + + + + + + + + + + + ExampleBlob + + + + + + + application/pdf + + + + null + + + + + + + + + + + + ExampleFile + + + + + + + application/pdf + + + + + + + + + + + + + + + ExampleReferenceElement + + + + + + + + + + false + + + + false + + + + + + ExampleSubmodelCollectionUnordered + + + + + + + + + + + false + + + + false + + + + + + ExampleSubmodelCollectionUnordered2 + + + + + + + + + + + IRI + + + + https://acplt.org/Test_Submodel_Mandatory + + + + + + + + + + + + + + + + + + + + + IRI + + + + https://acplt.org/Test_Submodel2_Mandatory + + + + + + + + + + + + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleRelationshipElement + + + + ExampleRelationshipElement + + + + Parameter + + + + + + Example RelationshipElement object + + + Beispiel RelationshipElement Element + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement + + + + ExampleAnnotatedRelationshipElement + + + + Parameter + + + + + + Example AnnotatedRelationshipElement object + + + Beispiel AnnotatedRelationshipElement Element + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + + + + + + + + + + + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Operations/ExampleOperation + + + + ExampleOperation + + + + Parameter + + + + + + Example Operation object + + + Beispiel Operation Element + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Capabilities/ExampleCapability + + + + ExampleCapability + + + + Parameter + + + + + + Example Capability object + + + Beispiel Capability Element + + + + + + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Events/ExampleBasicEvent + + + + ExampleBasicEvent + + + + Parameter + + + + + + Example BasicEvent object + + + Beispiel BasicEvent Element + + + + + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty + + + + ExampleProperty + + + + Constant + + + + + + Example Property object + + + Beispiel Property Element + + + + + + xs:string + + + + + + + + + + + exampleValue + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty + + + + ExampleMultiLanguageProperty + + + + Constant + + + + + + Example MultiLanguageProperty object + + + Beispiel MulitLanguageProperty Element + + + + + + + + + Example value of a MultiLanguageProperty element + + + Beispielswert für ein MulitLanguageProperty-Element + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Ranges/ExampleRange + + + + ExampleRange + + + + Parameter + + + + + + Example Range object + + + Beispiel Range Element + + + + 100 + + + + 0 + + + + + true + + + + false + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered + + + + ExampleSubmodelCollectionOrdered + + + + Parameter + + + + + + Example SubmodelElementCollectionOrdered object + + + Beispiel SubmodelElementCollectionOrdered Element + + + + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Blobs/ExampleBlob + + + + ExampleBlob + + + + Parameter + + + + + + Example Blob object + + + Beispiel Blob Element + + + + + application/pdf + + + + [1, 2, 3, 4, 5] + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Files/ExampleFile + + + + ExampleFile + + + + Parameter + + + + + + Example File object + + + Beispiel File Element + + + + + application/pdf + + + + /TestFile.pdf + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ReferenceElements/ExampleReferenceElement + + + + ExampleReferenceElement + + + + Parameter + + + + + + Example Reference Element object + + + Beispiel Reference Element Element + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + false + + + + false + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered + + + + ExampleSubmodelCollectionUnordered + + + + Parameter + + + + + + Example SubmodelElementCollectionUnordered object + + + Beispiel SubmodelElementCollectionUnordered Element + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelTemplates/ExampleSubmodel + + + + + + IRI + + + + https://acplt.org/Test_Submodel_Missing + + + + + + + 0.9 + + + + 0 + + + + + TestSubmodel + + + + + + + An example submodel for the test application + + + Ein Beispiel-Teilmodell für eine Test-Anwendung + + + + + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleRelationshipElement + + + + ExampleRelationshipElement + + + + Parameter + + + + + + Example RelationshipElement object + + + Beispiel RelationshipElement Element + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement + + + + ExampleAnnotatedRelationshipElement + + + + Parameter + + + + + + Example AnnotatedRelationshipElement object + + + Beispiel AnnotatedRelationshipElement Element + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + + + + + + + + + + + + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Operations/ExampleOperation + + + + ExampleOperation + + + + Parameter + + + + + + Example Operation object + + + Beispiel Operation Element + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Capabilities/ExampleCapability + + + + ExampleCapability + + + + Parameter + + + + + + Example Capability object + + + Beispiel Capability Element + + + + + + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Events/ExampleBasicEvent + + + + ExampleBasicEvent + + + + Parameter + + + + + + Example BasicEvent object + + + Beispiel BasicEvent Element + + + + + + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty + + + + ExampleProperty + + + + Constant + + + + + + Example Property object + + + Beispiel Property Element + + + + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty + + + + ExampleMultiLanguageProperty + + + + Constant + + + + + + Example MultiLanguageProperty object + + + Beispiel MulitLanguageProperty Element + + + + + + + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Ranges/ExampleRange + + + + ExampleRange + + + + Parameter + + + + + + Example Range object + + + Beispiel Range Element + + + + 100 + + + + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Ranges/ExampleRange + + + + ExampleRange2 + + + + Parameter + + + + + + Example Range object + + + Beispiel Range Element + + + + + + + 0 + + + + + true + + + + false + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered + + + + ExampleSubmodelCollectionOrdered + + + + Parameter + + + + + + Example SubmodelElementCollectionOrdered object + + + Beispiel SubmodelElementCollectionOrdered Element + + + + + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Blobs/ExampleBlob + + + + ExampleBlob + + + + Parameter + + + + + + Example Blob object + + + Beispiel Blob Element + + + + + application/pdf + + + + null + + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Files/ExampleFile + + + + ExampleFile + + + + Parameter + + + + + + Example File object + + + Beispiel File Element + + + + + application/pdf + + + + + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ReferenceElements/ExampleReferenceElement + + + + ExampleReferenceElement + + + + Parameter + + + + + + Example Reference Element object + + + Beispiel Reference Element Element + + + + + + + + false + + + + false + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered + + + + ExampleSubmodelCollectionUnordered + + + + Parameter + + + + + + Example SubmodelElementCollectionUnordered object + + + Beispiel SubmodelElementCollectionUnordered Element + + + + + + + + + false + + + + false + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered + + + + ExampleSubmodelCollectionUnordered2 + + + + Parameter + + + + + + Example SubmodelElementCollectionUnordered object + + + Beispiel SubmodelElementCollectionUnordered Element + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelTemplates/ExampleSubmodel + + + + + + IRI + + + + https://acplt.org/Test_Submodel_Template + + + + + + + 0.9 + + + + 0 + + + + + TestSubmodel + + + + + + + An example submodel for the test application + + + Ein Beispiel-Teilmodell für eine Test-Anwendung + + + + + + + + IRI + + + + https://acplt.org/Test_AssetAdministrationShell_Mandatory + + + + + + + + + + + + + + (SUBMODEL)[IRI]https://acplt.org/Test_Submodel_Mandatory + + + + (SUBMODEL)[IRI]https://acplt.org/Test_Submodel2_Mandatory + + + + + + + + + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + + (GLOBAL_REFERENCE)[IRI]0173-1#02-AAO677#002 + + + + ManufacturerName + + + + + + + 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. + + + 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 + + + + + + xs:int + + + + 100 + + + + + + + + + + xs:int + + + + 50 + + + + + + + + ACPLT + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + + (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber + + + + InstanceId + + + + + + + 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. + + + 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 + + + + 978-8234-234-342 + + + + + + (SUBMODEL)[IRI]http://acplt.org/SubmodelTemplates/AssetIdentification + + + + + + IRI + + + + http://acplt.org/Submodels/Assets/TestAsset/Identification + + + + + + + 0.9 + + + + 0 + + + + + Identification + + + + + + + An example asset identification submodel for the test application + + + Ein Beispiel-Identifikations-Submodel für eine Test-Anwendung + + + + + + + + + + + + + + + CO_MANAGED_ENTITY + + + + + (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber + + + + ExampleEntity + + + + + + + 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. + + + 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 + + + + + + + + + SELF_MANAGED_ENTITY + + + + + (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber + + + + ExampleEntity2 + + + + + + + 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. + + + 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 + + + + + + (SUBMODEL)[IRI]http://acplt.org/SubmodelTemplates/BillOfMaterial + + + + + + IRI + + + + http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial + + + + + + + 0.9 + + + + + + + + BillOfMaterial + + + + + + + An example bill of material submodel for the test application + + + Ein Beispiel-BillofMaterial-Submodel für eine Test-Anwendung + + + + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleRelationshipElement + + + + ExampleRelationshipElement + + + + Parameter + + + + + + Example RelationshipElement object + + + Beispiel RelationshipElement Element + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + (PROPERTY)[ID_SHORT]ExampleProperty2 + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement + + + + ExampleAnnotatedRelationshipElement + + + + Parameter + + + + + + Example AnnotatedRelationshipElement object + + + Beispiel AnnotatedRelationshipElement Element + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + (PROPERTY)[ID_SHORT]ExampleProperty2 + + + + + + + + + + + + + + + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Operations/ExampleOperation + + + + ExampleOperation + + + + Parameter + + + + + + Example Operation object + + + Beispiel Operation Element + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Capabilities/ExampleCapability + + + + ExampleCapability + + + + Parameter + + + + + + Example Capability object + + + Beispiel Capability Element + + + + + + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Events/ExampleBasicEvent + + + + ExampleBasicEvent + + + + Parameter + + + + + + Example BasicEvent object + + + Beispiel BasicEvent Element + + + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty + + + + ExampleProperty + + + + Constant + + + + + + Example Property object + + + Beispiel Property Element + + + + exampleValue + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty + + + + ExampleMultiLanguageProperty + + + + Constant + + + + + + Example MultiLanguageProperty object + + + Beispiel MulitLanguageProperty Element + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleMultiLanguageValueId + + + + + + Example value of a MultiLanguageProperty element + + + Beispielswert für ein MulitLanguageProperty-Element + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Ranges/ExampleRange + + + + ExampleRange + + + + Parameter + + + + + + Example Range object + + + Beispiel Range Element + + + + 100 + + + + 0 + + + + + true + + + + false + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered + + + + ExampleSubmodelCollectionOrdered + + + + Parameter + + + + + + Example SubmodelElementCollectionOrdered object + + + Beispiel SubmodelElementCollectionOrdered Element + + + + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Blobs/ExampleBlob + + + + ExampleBlob + + + + Parameter + + + + + + Example Blob object + + + Beispiel Blob Element + + + + + application/pdf + + + + [1, 2, 3, 4, 5] + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Files/ExampleFile + + + + ExampleFile + + + + Parameter + + + + + + Example File object + + + Beispiel File Element + + + + + application/pdf + + + + /TestFile.pdf + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ReferenceElements/ExampleReferenceElement + + + + ExampleReferenceElement + + + + Parameter + + + + + + Example Reference Element object + + + Beispiel Reference Element Element + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + false + + + + false + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered + + + + ExampleSubmodelCollectionUnordered + + + + Parameter + + + + + + Example SubmodelElementCollectionUnordered object + + + Beispiel SubmodelElementCollectionUnordered Element + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelTemplates/ExampleSubmodel + + + + + + IRI + + + + https://acplt.org/Test_Submodel + + + + + + + 0.9 + + + + 0 + + + + + TestSubmodel + + + + + + + An example submodel for the test application + + + Ein Beispiel-Teilmodell für eine Test-Anwendung + + + + + + + + + + + + + + + ExampleRelationshipElement + + + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + + + + + + + ExampleAnnotatedRelationshipElement + + + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + + + + + + + + + + + + + + + + + + + + + + ExampleOperation + + + + + + + + + + + + + ExampleCapability + + + + + + + + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + + ExampleBasicEvent + + + + + + + + + + + + + + + + + + ExampleProperty + + + + + + + + + + + + + + + + ExampleMultiLanguageProperty + + + + + + + + + + + + + + + + + + + ExampleRange + + + + + + + + + + + + + true + + + + false + + + + + + ExampleSubmodelCollectionOrdered + + + + + + + + + + + + + + + + + ExampleBlob + + + + + + + application/pdf + + + + null + + + + + + + + + + + + ExampleFile + + + + + + + application/pdf + + + + + + + + + + + + + + + ExampleReferenceElement + + + + + + + + + + false + + + + false + + + + + + ExampleSubmodelCollectionUnordered + + + + + + + + + + + false + + + + false + + + + + + ExampleSubmodelCollectionUnordered2 + + + + + + + + + + + IRI + + + + https://acplt.org/Test_Submodel_Mandatory + + + + + + + + + + + + + + + + + + + + + IRI + + + + https://acplt.org/Test_Submodel2_Mandatory + + + + + + + + + + + + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleRelationshipElement + + + + ExampleRelationshipElement + + + + Parameter + + + + + + Example RelationshipElement object + + + Beispiel RelationshipElement Element + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement + + + + ExampleAnnotatedRelationshipElement + + + + Parameter + + + + + + Example AnnotatedRelationshipElement object + + + Beispiel AnnotatedRelationshipElement Element + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + + + + + + + + + + + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Operations/ExampleOperation + + + + ExampleOperation + + + + Parameter + + + + + + Example Operation object + + + Beispiel Operation Element + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Capabilities/ExampleCapability + + + + ExampleCapability + + + + Parameter + + + + + + Example Capability object + + + Beispiel Capability Element + + + + + + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Events/ExampleBasicEvent + + + + ExampleBasicEvent + + + + Parameter + + + + + + Example BasicEvent object + + + Beispiel BasicEvent Element + + + + + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty + + + + ExampleProperty + + + + Constant + + + + + + Example Property object + + + Beispiel Property Element + + + + + + xs:string + + + + + + + + + + + exampleValue + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty + + + + ExampleMultiLanguageProperty + + + + Constant + + + + + + Example MultiLanguageProperty object + + + Beispiel MulitLanguageProperty Element + + + + + + + + + Example value of a MultiLanguageProperty element + + + Beispielswert für ein MulitLanguageProperty-Element + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Ranges/ExampleRange + + + + ExampleRange + + + + Parameter + + + + + + Example Range object + + + Beispiel Range Element + + + + 100 + + + + 0 + + + + + true + + + + false + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered + + + + ExampleSubmodelCollectionOrdered + + + + Parameter + + + + + + Example SubmodelElementCollectionOrdered object + + + Beispiel SubmodelElementCollectionOrdered Element + + + + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Blobs/ExampleBlob + + + + ExampleBlob + + + + Parameter + + + + + + Example Blob object + + + Beispiel Blob Element + + + + + application/pdf + + + + [1, 2, 3, 4, 5] + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Files/ExampleFile + + + + ExampleFile + + + + Parameter + + + + + + Example File object + + + Beispiel File Element + + + + + application/pdf + + + + /TestFile.pdf + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ReferenceElements/ExampleReferenceElement + + + + ExampleReferenceElement + + + + Parameter + + + + + + Example Reference Element object + + + Beispiel Reference Element Element + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + false + + + + false + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered + + + + ExampleSubmodelCollectionUnordered + + + + Parameter + + + + + + Example SubmodelElementCollectionUnordered object + + + Beispiel SubmodelElementCollectionUnordered Element + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelTemplates/ExampleSubmodel + + + + + + IRI + + + + https://acplt.org/Test_Submodel_Missing + + + + + + + 0.9 + + + + 0 + + + + + TestSubmodel + + + + + + + An example submodel for the test application + + + Ein Beispiel-Teilmodell für eine Test-Anwendung + + + + + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleRelationshipElement + + + + ExampleRelationshipElement + + + + Parameter + + + + + + Example RelationshipElement object + + + Beispiel RelationshipElement Element + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement + + + + ExampleAnnotatedRelationshipElement + + + + Parameter + + + + + + Example AnnotatedRelationshipElement object + + + Beispiel AnnotatedRelationshipElement Element + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + + + + + + + + + + + + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Operations/ExampleOperation + + + + ExampleOperation + + + + Parameter + + + + + + Example Operation object + + + Beispiel Operation Element + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Capabilities/ExampleCapability + + + + ExampleCapability + + + + Parameter + + + + + + Example Capability object + + + Beispiel Capability Element + + + + + + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Events/ExampleBasicEvent + + + + ExampleBasicEvent + + + + Parameter + + + + + + Example BasicEvent object + + + Beispiel BasicEvent Element + + + + + + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty + + + + ExampleProperty + + + + Constant + + + + + + Example Property object + + + Beispiel Property Element + + + + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty + + + + ExampleMultiLanguageProperty + + + + Constant + + + + + + Example MultiLanguageProperty object + + + Beispiel MulitLanguageProperty Element + + + + + + + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Ranges/ExampleRange + + + + ExampleRange + + + + Parameter + + + + + + Example Range object + + + Beispiel Range Element + + + + 100 + + + + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Ranges/ExampleRange + + + + ExampleRange2 + + + + Parameter + + + + + + Example Range object + + + Beispiel Range Element + + + + + + + 0 + + + + + true + + + + false + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered + + + + ExampleSubmodelCollectionOrdered + + + + Parameter + + + + + + Example SubmodelElementCollectionOrdered object + + + Beispiel SubmodelElementCollectionOrdered Element + + + + + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Blobs/ExampleBlob + + + + ExampleBlob + + + + Parameter + + + + + + Example Blob object + + + Beispiel Blob Element + + + + + application/pdf + + + + null + + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Files/ExampleFile + + + + ExampleFile + + + + Parameter + + + + + + Example File object + + + Beispiel File Element + + + + + application/pdf + + + + + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ReferenceElements/ExampleReferenceElement + + + + ExampleReferenceElement + + + + Parameter + + + + + + Example Reference Element object + + + Beispiel Reference Element Element + + + + + + + + false + + + + false + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered + + + + ExampleSubmodelCollectionUnordered + + + + Parameter + + + + + + Example SubmodelElementCollectionUnordered object + + + Beispiel SubmodelElementCollectionUnordered Element + + + + + + + + + false + + + + false + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered + + + + ExampleSubmodelCollectionUnordered2 + + + + Parameter + + + + + + Example SubmodelElementCollectionUnordered object + + + Beispiel SubmodelElementCollectionUnordered Element + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelTemplates/ExampleSubmodel + + + + + + IRI + + + + https://acplt.org/Test_Submodel_Template + + + + + + + 0.9 + + + + 0 + + + + + TestSubmodel + + + + + + + An example submodel for the test application + + + Ein Beispiel-Teilmodell für eine Test-Anwendung + + + + + + + + IRI + + + + https://acplt.org/Test_AssetAdministrationShell2_Mandatory + + + + + + + + + + + + + + + + + + + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + + (GLOBAL_REFERENCE)[IRI]0173-1#02-AAO677#002 + + + + ManufacturerName + + + + + + + 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. + + + 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 + + + + + + xs:int + + + + 100 + + + + + + + + + + xs:int + + + + 50 + + + + + + + + ACPLT + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + + (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber + + + + InstanceId + + + + + + + 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. + + + 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 + + + + 978-8234-234-342 + + + + + + (SUBMODEL)[IRI]http://acplt.org/SubmodelTemplates/AssetIdentification + + + + + + IRI + + + + http://acplt.org/Submodels/Assets/TestAsset/Identification + + + + + + + 0.9 + + + + 0 + + + + + Identification + + + + + + + An example asset identification submodel for the test application + + + Ein Beispiel-Identifikations-Submodel für eine Test-Anwendung + + + + + + + + + + + + + + + CO_MANAGED_ENTITY + + + + + (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber + + + + ExampleEntity + + + + + + + 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. + + + 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 + + + + + + + + + SELF_MANAGED_ENTITY + + + + + (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber + + + + ExampleEntity2 + + + + + + + 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. + + + 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 + + + + + + (SUBMODEL)[IRI]http://acplt.org/SubmodelTemplates/BillOfMaterial + + + + + + IRI + + + + http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial + + + + + + + 0.9 + + + + + + + + BillOfMaterial + + + + + + + An example bill of material submodel for the test application + + + Ein Beispiel-BillofMaterial-Submodel für eine Test-Anwendung + + + + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleRelationshipElement + + + + ExampleRelationshipElement + + + + Parameter + + + + + + Example RelationshipElement object + + + Beispiel RelationshipElement Element + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + (PROPERTY)[ID_SHORT]ExampleProperty2 + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement + + + + ExampleAnnotatedRelationshipElement + + + + Parameter + + + + + + Example AnnotatedRelationshipElement object + + + Beispiel AnnotatedRelationshipElement Element + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + (PROPERTY)[ID_SHORT]ExampleProperty2 + + + + + + + + + + + + + + + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Operations/ExampleOperation + + + + ExampleOperation + + + + Parameter + + + + + + Example Operation object + + + Beispiel Operation Element + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Capabilities/ExampleCapability + + + + ExampleCapability + + + + Parameter + + + + + + Example Capability object + + + Beispiel Capability Element + + + + + + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Events/ExampleBasicEvent + + + + ExampleBasicEvent + + + + Parameter + + + + + + Example BasicEvent object + + + Beispiel BasicEvent Element + + + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty + + + + ExampleProperty + + + + Constant + + + + + + Example Property object + + + Beispiel Property Element + + + + exampleValue + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty + + + + ExampleMultiLanguageProperty + + + + Constant + + + + + + Example MultiLanguageProperty object + + + Beispiel MulitLanguageProperty Element + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleMultiLanguageValueId + + + + + + Example value of a MultiLanguageProperty element + + + Beispielswert für ein MulitLanguageProperty-Element + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Ranges/ExampleRange + + + + ExampleRange + + + + Parameter + + + + + + Example Range object + + + Beispiel Range Element + + + + 100 + + + + 0 + + + + + true + + + + false + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered + + + + ExampleSubmodelCollectionOrdered + + + + Parameter + + + + + + Example SubmodelElementCollectionOrdered object + + + Beispiel SubmodelElementCollectionOrdered Element + + + + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Blobs/ExampleBlob + + + + ExampleBlob + + + + Parameter + + + + + + Example Blob object + + + Beispiel Blob Element + + + + + application/pdf + + + + [1, 2, 3, 4, 5] + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Files/ExampleFile + + + + ExampleFile + + + + Parameter + + + + + + Example File object + + + Beispiel File Element + + + + + application/pdf + + + + /TestFile.pdf + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ReferenceElements/ExampleReferenceElement + + + + ExampleReferenceElement + + + + Parameter + + + + + + Example Reference Element object + + + Beispiel Reference Element Element + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + false + + + + false + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered + + + + ExampleSubmodelCollectionUnordered + + + + Parameter + + + + + + Example SubmodelElementCollectionUnordered object + + + Beispiel SubmodelElementCollectionUnordered Element + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelTemplates/ExampleSubmodel + + + + + + IRI + + + + https://acplt.org/Test_Submodel + + + + + + + 0.9 + + + + 0 + + + + + TestSubmodel + + + + + + + An example submodel for the test application + + + Ein Beispiel-Teilmodell für eine Test-Anwendung + + + + + + + + + + + + + + + ExampleRelationshipElement + + + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + + + + + + + ExampleAnnotatedRelationshipElement + + + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + + + + + + + + + + + + + + + + + + + + + + ExampleOperation + + + + + + + + + + + + + ExampleCapability + + + + + + + + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + + ExampleBasicEvent + + + + + + + + + + + + + + + + + + ExampleProperty + + + + + + + + + + + + + + + + ExampleMultiLanguageProperty + + + + + + + + + + + + + + + + + + + ExampleRange + + + + + + + + + + + + + true + + + + false + + + + + + ExampleSubmodelCollectionOrdered + + + + + + + + + + + + + + + + + ExampleBlob + + + + + + + application/pdf + + + + null + + + + + + + + + + + + ExampleFile + + + + + + + application/pdf + + + + + + + + + + + + + + + ExampleReferenceElement + + + + + + + + + + false + + + + false + + + + + + ExampleSubmodelCollectionUnordered + + + + + + + + + + + false + + + + false + + + + + + ExampleSubmodelCollectionUnordered2 + + + + + + + + + + + IRI + + + + https://acplt.org/Test_Submodel_Mandatory + + + + + + + + + + + + + + + + + + + + + IRI + + + + https://acplt.org/Test_Submodel2_Mandatory + + + + + + + + + + + + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleRelationshipElement + + + + ExampleRelationshipElement + + + + Parameter + + + + + + Example RelationshipElement object + + + Beispiel RelationshipElement Element + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement + + + + ExampleAnnotatedRelationshipElement + + + + Parameter + + + + + + Example AnnotatedRelationshipElement object + + + Beispiel AnnotatedRelationshipElement Element + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + + + + + + + + + + + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Operations/ExampleOperation + + + + ExampleOperation + + + + Parameter + + + + + + Example Operation object + + + Beispiel Operation Element + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Capabilities/ExampleCapability + + + + ExampleCapability + + + + Parameter + + + + + + Example Capability object + + + Beispiel Capability Element + + + + + + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Events/ExampleBasicEvent + + + + ExampleBasicEvent + + + + Parameter + + + + + + Example BasicEvent object + + + Beispiel BasicEvent Element + + + + + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty + + + + ExampleProperty + + + + Constant + + + + + + Example Property object + + + Beispiel Property Element + + + + + + xs:string + + + + + + + + + + + exampleValue + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty + + + + ExampleMultiLanguageProperty + + + + Constant + + + + + + Example MultiLanguageProperty object + + + Beispiel MulitLanguageProperty Element + + + + + + + + + Example value of a MultiLanguageProperty element + + + Beispielswert für ein MulitLanguageProperty-Element + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Ranges/ExampleRange + + + + ExampleRange + + + + Parameter + + + + + + Example Range object + + + Beispiel Range Element + + + + 100 + + + + 0 + + + + + true + + + + false + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered + + + + ExampleSubmodelCollectionOrdered + + + + Parameter + + + + + + Example SubmodelElementCollectionOrdered object + + + Beispiel SubmodelElementCollectionOrdered Element + + + + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Blobs/ExampleBlob + + + + ExampleBlob + + + + Parameter + + + + + + Example Blob object + + + Beispiel Blob Element + + + + + application/pdf + + + + [1, 2, 3, 4, 5] + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Files/ExampleFile + + + + ExampleFile + + + + Parameter + + + + + + Example File object + + + Beispiel File Element + + + + + application/pdf + + + + /TestFile.pdf + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ReferenceElements/ExampleReferenceElement + + + + ExampleReferenceElement + + + + Parameter + + + + + + Example Reference Element object + + + Beispiel Reference Element Element + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + false + + + + false + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered + + + + ExampleSubmodelCollectionUnordered + + + + Parameter + + + + + + Example SubmodelElementCollectionUnordered object + + + Beispiel SubmodelElementCollectionUnordered Element + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelTemplates/ExampleSubmodel + + + + + + IRI + + + + https://acplt.org/Test_Submodel_Missing + + + + + + + 0.9 + + + + 0 + + + + + TestSubmodel + + + + + + + An example submodel for the test application + + + Ein Beispiel-Teilmodell für eine Test-Anwendung + + + + + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleRelationshipElement + + + + ExampleRelationshipElement + + + + Parameter + + + + + + Example RelationshipElement object + + + Beispiel RelationshipElement Element + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement + + + + ExampleAnnotatedRelationshipElement + + + + Parameter + + + + + + Example AnnotatedRelationshipElement object + + + Beispiel AnnotatedRelationshipElement Element + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + + + + + + + + + + + + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Operations/ExampleOperation + + + + ExampleOperation + + + + Parameter + + + + + + Example Operation object + + + Beispiel Operation Element + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Capabilities/ExampleCapability + + + + ExampleCapability + + + + Parameter + + + + + + Example Capability object + + + Beispiel Capability Element + + + + + + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Events/ExampleBasicEvent + + + + ExampleBasicEvent + + + + Parameter + + + + + + Example BasicEvent object + + + Beispiel BasicEvent Element + + + + + + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty + + + + ExampleProperty + + + + Constant + + + + + + Example Property object + + + Beispiel Property Element + + + + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty + + + + ExampleMultiLanguageProperty + + + + Constant + + + + + + Example MultiLanguageProperty object + + + Beispiel MulitLanguageProperty Element + + + + + + + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Ranges/ExampleRange + + + + ExampleRange + + + + Parameter + + + + + + Example Range object + + + Beispiel Range Element + + + + 100 + + + + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Ranges/ExampleRange + + + + ExampleRange2 + + + + Parameter + + + + + + Example Range object + + + Beispiel Range Element + + + + + + + 0 + + + + + true + + + + false + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered + + + + ExampleSubmodelCollectionOrdered + + + + Parameter + + + + + + Example SubmodelElementCollectionOrdered object + + + Beispiel SubmodelElementCollectionOrdered Element + + + + + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Blobs/ExampleBlob + + + + ExampleBlob + + + + Parameter + + + + + + Example Blob object + + + Beispiel Blob Element + + + + + application/pdf + + + + null + + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Files/ExampleFile + + + + ExampleFile + + + + Parameter + + + + + + Example File object + + + Beispiel File Element + + + + + application/pdf + + + + + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ReferenceElements/ExampleReferenceElement + + + + ExampleReferenceElement + + + + Parameter + + + + + + Example Reference Element object + + + Beispiel Reference Element Element + + + + + + + + false + + + + false + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered + + + + ExampleSubmodelCollectionUnordered + + + + Parameter + + + + + + Example SubmodelElementCollectionUnordered object + + + Beispiel SubmodelElementCollectionUnordered Element + + + + + + + + + false + + + + false + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered + + + + ExampleSubmodelCollectionUnordered2 + + + + Parameter + + + + + + Example SubmodelElementCollectionUnordered object + + + Beispiel SubmodelElementCollectionUnordered Element + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelTemplates/ExampleSubmodel + + + + + + IRI + + + + https://acplt.org/Test_Submodel_Template + + + + + + + 0.9 + + + + 0 + + + + + TestSubmodel + + + + + + + An example submodel for the test application + + + Ein Beispiel-Teilmodell für eine Test-Anwendung + + + + + + + + IRI + + + + https://acplt.org/Test_AssetAdministrationShell_Missing + + + + + + + 0.9 + + + + 0 + + + + + TestAssetAdministrationShell + + + + + + + An Example Asset Administration Shell for the test application + + + Ein Beispiel-Verwaltungsschale für eine Test-Anwendung + + + + + + (SUBMODEL)[IRI]https://acplt.org/Test_Submodel_Missing + + + + + + diff --git a/pom.xml b/pom.xml index 6a66f79b..88d7f620 100644 --- a/pom.xml +++ b/pom.xml @@ -9,6 +9,7 @@ pom dataformat-aasx + dataformat-aml dataformat-core dataformat-json dataformat-xml @@ -33,6 +34,7 @@ 1.0.56 4.13 1.1.1 + 1.5.4 4.1.2 1.7.31 2.8.2 From f534c3cf53448ac4483f156d188271c80a9d8c6a Mon Sep 17 00:00:00 2001 From: Jacoby Date: Thu, 8 Jul 2021 10:12:13 +0200 Subject: [PATCH 02/18] add license headers to aml --- .../v3/dataformat/aml/AmlDeserializer.java | 15 ++++++++++++ .../aas/v3/dataformat/aml/AmlSerializer.java | 15 ++++++++++++ .../aml/model/caex/AASNamespace.java | 15 ++++++++++++ .../aml/model/caex/AdditionalInformation.java | 15 ++++++++++++ ...tAdministrationShellInterfaceClassLib.java | 15 ++++++++++++ .../AssetAdministrationShellRoleClassLib.java | 15 ++++++++++++ .../dataformat/aml/model/caex/Attribute.java | 15 ++++++++++++ .../aml/model/caex/CAEXConstants.java | 15 ++++++++++++ .../dataformat/aml/model/caex/CAEXFile.java | 15 ++++++++++++ .../aml/model/caex/ExternalInterface.java | 15 ++++++++++++ .../aml/model/caex/InstanceHierarchy.java | 15 ++++++++++++ .../aml/model/caex/InternalElement.java | 15 ++++++++++++ .../aml/model/caex/RefSemantic.java | 15 ++++++++++++ .../aml/model/caex/RoleRequirements.java | 15 ++++++++++++ .../mixin/AdditionalInformationMixin.java | 15 ++++++++++++ .../aml/model/mixin/AttributeMixin.java | 15 ++++++++++++ .../dataformat/aml/model/mixin/CAEXMixin.java | 15 ++++++++++++ .../model/mixin/ExternalInterfaceMixin.java | 15 ++++++++++++ .../model/mixin/InstanceHierarchyMixin.java | 15 ++++++++++++ .../aml/model/mixin/InternalElementMixin.java | 15 ++++++++++++ .../aml/model/mixin/RefSemanticMixin.java | 15 ++++++++++++ .../model/mixin/RoleRequirementsMixin.java | 15 ++++++++++++ .../mapper/AASEnvironmentMapper.java | 15 ++++++++++++ ...rativeInformationToAttributeConverter.java | 15 ++++++++++++ .../AllowDuplicatesToAttributeConverter.java | 15 ++++++++++++ .../AssetKindToAttributeConverter.java | 15 ++++++++++++ .../BillOfMaterialToAttributeConverter.java | 15 ++++++++++++ .../CategoryToAttributeConverter.java | 15 ++++++++++++ .../DerivedFromToAttributeConverter.java | 15 ++++++++++++ .../DescriptionToAttributeConverter.java | 15 ++++++++++++ .../EntityTypeToAttributeConverter.java | 15 ++++++++++++ .../IdShortToAttributeConverter.java | 15 ++++++++++++ .../converter/IdShortToNameConverter.java | 15 ++++++++++++ ...entificationModelToAttributeConverter.java | 15 ++++++++++++ .../IdentificationToAttributeConverter.java | 15 ++++++++++++ .../ModelingKindToAttributeConverter.java | 15 ++++++++++++ .../ObservedToAttributeConverter.java | 15 ++++++++++++ .../OrderedToAttributeConverter.java | 15 ++++++++++++ .../PropertyValueToAttributeConverter.java | 15 ++++++++++++ .../SemanticIdToAttributeConverter.java | 15 ++++++++++++ .../ValueIdToAttributeConverter.java | 15 ++++++++++++ .../AnnotatedRelationshipElementMapper.java | 15 ++++++++++++ .../AssetAdministrationShellMapper.java | 15 ++++++++++++ .../mapper/mapper/AssetInformationMapper.java | 15 ++++++++++++ .../serialize/mapper/mapper/AssetMapper.java | 15 ++++++++++++ .../mapper/mapper/BasicEventMapper.java | 15 ++++++++++++ .../serialize/mapper/mapper/BlobMapper.java | 15 ++++++++++++ .../mapper/mapper/CapabilityMapper.java | 15 ++++++++++++ .../serialize/mapper/mapper/EntityMapper.java | 15 ++++++++++++ .../serialize/mapper/mapper/FileMapper.java | 15 ++++++++++++ .../mapper/mapper/IdentifiableMapper.java | 15 ++++++++++++ .../mapper/MultiLanguagePropertyMapper.java | 15 ++++++++++++ .../mapper/mapper/OperationMapper.java | 15 ++++++++++++ .../mapper/mapper/PropertyMapper.java | 15 ++++++++++++ .../serialize/mapper/mapper/RangeMapper.java | 15 ++++++++++++ .../mapper/mapper/ReferableMapper.java | 15 ++++++++++++ .../mapper/mapper/ReferenceElementMapper.java | 15 ++++++++++++ .../mapper/RelationshipElementMapper.java | 15 ++++++++++++ .../SubmodelElementCollectionMapper.java | 15 ++++++++++++ .../mapper/mapper/SubmodelElementMapper.java | 15 ++++++++++++ .../mapper/mapper/SubmodelMapper.java | 15 ++++++++++++ .../serialize/mapper/mapper/ViewMapper.java | 15 ++++++++++++ .../mapper/util/FileConverterUtil.java | 15 ++++++++++++ .../mapper/util/QualifierConverterUtil.java | 15 ++++++++++++ .../mapper/util/ReferenceConverterUtil.java | 15 ++++++++++++ .../aml/deserialize/AmlDeserializerTest.java | 24 ++++++++++++------- .../dataformat/aml/fixtures/FullExample.java | 15 ++++++++++++ .../aml/serialize/AmlSerializerTest.java | 15 ++++++++++++ 68 files changed, 1020 insertions(+), 9 deletions(-) diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlDeserializer.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlDeserializer.java index b9896951..f1e2a18c 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlDeserializer.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlDeserializer.java @@ -1,3 +1,18 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml; import com.fasterxml.jackson.core.JsonProcessingException; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlSerializer.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlSerializer.java index f0e14183..7b09c0a6 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlSerializer.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlSerializer.java @@ -1,3 +1,18 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml; import com.fasterxml.jackson.core.JsonProcessingException; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/AASNamespace.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/AASNamespace.java index a9ced96d..aee6985a 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/AASNamespace.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/AASNamespace.java @@ -1,3 +1,18 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.model.caex; public enum AASNamespace { diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/AdditionalInformation.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/AdditionalInformation.java index b9224de9..121638a5 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/AdditionalInformation.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/AdditionalInformation.java @@ -1,3 +1,18 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.model.caex; public class AdditionalInformation { diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/AssetAdministrationShellInterfaceClassLib.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/AssetAdministrationShellInterfaceClassLib.java index 32f80c93..949bdb44 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/AssetAdministrationShellInterfaceClassLib.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/AssetAdministrationShellInterfaceClassLib.java @@ -1,3 +1,18 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.model.caex; public enum AssetAdministrationShellInterfaceClassLib { diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/AssetAdministrationShellRoleClassLib.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/AssetAdministrationShellRoleClassLib.java index 6195dbb8..d3cf3590 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/AssetAdministrationShellRoleClassLib.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/AssetAdministrationShellRoleClassLib.java @@ -1,3 +1,18 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.model.caex; public enum AssetAdministrationShellRoleClassLib { diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/Attribute.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/Attribute.java index 9a441573..de736bc7 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/Attribute.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/Attribute.java @@ -1,3 +1,18 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.model.caex; import java.util.List; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/CAEXConstants.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/CAEXConstants.java index ff2a6edf..8a9ac8b2 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/CAEXConstants.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/CAEXConstants.java @@ -1,3 +1,18 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.model.caex; public class CAEXConstants { diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/CAEXFile.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/CAEXFile.java index 49f16149..115deb6a 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/CAEXFile.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/CAEXFile.java @@ -1,3 +1,18 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.model.caex; public class CAEXFile { diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/ExternalInterface.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/ExternalInterface.java index 35873527..8f66f890 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/ExternalInterface.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/ExternalInterface.java @@ -1,3 +1,18 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.model.caex; import java.util.List; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/InstanceHierarchy.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/InstanceHierarchy.java index 20ab3bb0..0ed8b8dc 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/InstanceHierarchy.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/InstanceHierarchy.java @@ -1,3 +1,18 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.model.caex; import java.util.List; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/InternalElement.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/InternalElement.java index 5d69aa91..a776d998 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/InternalElement.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/InternalElement.java @@ -1,3 +1,18 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.model.caex; import java.util.List; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/RefSemantic.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/RefSemantic.java index 9dd54db2..e6df4e23 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/RefSemantic.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/RefSemantic.java @@ -1,3 +1,18 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.model.caex; public class RefSemantic { diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/RoleRequirements.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/RoleRequirements.java index ce29ed28..31ddf13b 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/RoleRequirements.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/RoleRequirements.java @@ -1,3 +1,18 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.model.caex; import java.util.List; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/AdditionalInformationMixin.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/AdditionalInformationMixin.java index d6a718ce..3c68b580 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/AdditionalInformationMixin.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/AdditionalInformationMixin.java @@ -1,3 +1,18 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.model.mixin; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/AttributeMixin.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/AttributeMixin.java index a36ee116..a0356c55 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/AttributeMixin.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/AttributeMixin.java @@ -1,3 +1,18 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.model.mixin; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/CAEXMixin.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/CAEXMixin.java index 676fb04e..7269167f 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/CAEXMixin.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/CAEXMixin.java @@ -1,3 +1,18 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.model.mixin; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/ExternalInterfaceMixin.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/ExternalInterfaceMixin.java index 7f32ef76..d3782b95 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/ExternalInterfaceMixin.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/ExternalInterfaceMixin.java @@ -1,3 +1,18 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.model.mixin; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/InstanceHierarchyMixin.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/InstanceHierarchyMixin.java index cf752089..da602b45 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/InstanceHierarchyMixin.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/InstanceHierarchyMixin.java @@ -1,3 +1,18 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.model.mixin; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/InternalElementMixin.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/InternalElementMixin.java index 60b22ba0..31d7d55c 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/InternalElementMixin.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/InternalElementMixin.java @@ -1,3 +1,18 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.model.mixin; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/RefSemanticMixin.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/RefSemanticMixin.java index 1d7b8434..e25331ae 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/RefSemanticMixin.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/RefSemanticMixin.java @@ -1,3 +1,18 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.model.mixin; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/RoleRequirementsMixin.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/RoleRequirementsMixin.java index b0831c0a..d2a6adce 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/RoleRequirementsMixin.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/RoleRequirementsMixin.java @@ -1,3 +1,18 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.model.mixin; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/AASEnvironmentMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/AASEnvironmentMapper.java index 72b9f6f7..89efb5f5 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/AASEnvironmentMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/AASEnvironmentMapper.java @@ -1,3 +1,18 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper; import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElement; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/AdministrativeInformationToAttributeConverter.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/AdministrativeInformationToAttributeConverter.java index 581ea4f1..56ac90f3 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/AdministrativeInformationToAttributeConverter.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/AdministrativeInformationToAttributeConverter.java @@ -1,3 +1,18 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter; import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/AllowDuplicatesToAttributeConverter.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/AllowDuplicatesToAttributeConverter.java index b6b3efec..a1a0e7f4 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/AllowDuplicatesToAttributeConverter.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/AllowDuplicatesToAttributeConverter.java @@ -1,3 +1,18 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter; import io.adminshell.aas.v3.dataformat.aml.model.caex.Attribute; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/AssetKindToAttributeConverter.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/AssetKindToAttributeConverter.java index 95e497f4..75c345e0 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/AssetKindToAttributeConverter.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/AssetKindToAttributeConverter.java @@ -1,3 +1,18 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter; import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/BillOfMaterialToAttributeConverter.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/BillOfMaterialToAttributeConverter.java index 0c8566a0..9b61701f 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/BillOfMaterialToAttributeConverter.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/BillOfMaterialToAttributeConverter.java @@ -1,3 +1,18 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter; import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/CategoryToAttributeConverter.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/CategoryToAttributeConverter.java index a3825aec..e7048c4b 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/CategoryToAttributeConverter.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/CategoryToAttributeConverter.java @@ -1,3 +1,18 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter; import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/DerivedFromToAttributeConverter.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/DerivedFromToAttributeConverter.java index c53c2183..b318b88e 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/DerivedFromToAttributeConverter.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/DerivedFromToAttributeConverter.java @@ -1,3 +1,18 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter; import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/DescriptionToAttributeConverter.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/DescriptionToAttributeConverter.java index 420373d0..b8dcc05f 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/DescriptionToAttributeConverter.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/DescriptionToAttributeConverter.java @@ -1,3 +1,18 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter; import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/EntityTypeToAttributeConverter.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/EntityTypeToAttributeConverter.java index 0540a620..642e22e5 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/EntityTypeToAttributeConverter.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/EntityTypeToAttributeConverter.java @@ -1,3 +1,18 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter; import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/IdShortToAttributeConverter.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/IdShortToAttributeConverter.java index eeb89067..a6c1eda7 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/IdShortToAttributeConverter.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/IdShortToAttributeConverter.java @@ -1,3 +1,18 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter; import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/IdShortToNameConverter.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/IdShortToNameConverter.java index 71a05ae7..0182525b 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/IdShortToNameConverter.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/IdShortToNameConverter.java @@ -1,3 +1,18 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter; import ma.glasnost.orika.CustomConverter; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/IdentificationModelToAttributeConverter.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/IdentificationModelToAttributeConverter.java index 6ffce326..bdb8dc3c 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/IdentificationModelToAttributeConverter.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/IdentificationModelToAttributeConverter.java @@ -1,3 +1,18 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter; import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/IdentificationToAttributeConverter.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/IdentificationToAttributeConverter.java index 6341f3e3..447cc545 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/IdentificationToAttributeConverter.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/IdentificationToAttributeConverter.java @@ -1,3 +1,18 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter; import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/ModelingKindToAttributeConverter.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/ModelingKindToAttributeConverter.java index 676a3c78..53ef6030 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/ModelingKindToAttributeConverter.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/ModelingKindToAttributeConverter.java @@ -1,3 +1,18 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter; import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/ObservedToAttributeConverter.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/ObservedToAttributeConverter.java index 0e6a71b8..7948b1ac 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/ObservedToAttributeConverter.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/ObservedToAttributeConverter.java @@ -1,3 +1,18 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter; import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/OrderedToAttributeConverter.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/OrderedToAttributeConverter.java index 86b41305..462187b8 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/OrderedToAttributeConverter.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/OrderedToAttributeConverter.java @@ -1,3 +1,18 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter; import io.adminshell.aas.v3.dataformat.aml.model.caex.Attribute; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/PropertyValueToAttributeConverter.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/PropertyValueToAttributeConverter.java index d77cb73c..cc68d3b8 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/PropertyValueToAttributeConverter.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/PropertyValueToAttributeConverter.java @@ -1,3 +1,18 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter; import io.adminshell.aas.v3.dataformat.aml.model.caex.Attribute; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/SemanticIdToAttributeConverter.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/SemanticIdToAttributeConverter.java index 551c27c2..cba70f83 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/SemanticIdToAttributeConverter.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/SemanticIdToAttributeConverter.java @@ -1,3 +1,18 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter; import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/ValueIdToAttributeConverter.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/ValueIdToAttributeConverter.java index 67579b8f..af692051 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/ValueIdToAttributeConverter.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/ValueIdToAttributeConverter.java @@ -1,3 +1,18 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter; import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/AnnotatedRelationshipElementMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/AnnotatedRelationshipElementMapper.java index 90cc5487..8d77546f 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/AnnotatedRelationshipElementMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/AnnotatedRelationshipElementMapper.java @@ -1,3 +1,18 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper; import io.adminshell.aas.v3.dataformat.aml.model.caex.AssetAdministrationShellRoleClassLib; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/AssetAdministrationShellMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/AssetAdministrationShellMapper.java index c30dca37..133891df 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/AssetAdministrationShellMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/AssetAdministrationShellMapper.java @@ -1,3 +1,18 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper; import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/AssetInformationMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/AssetInformationMapper.java index 6cdaf575..cbbd8c10 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/AssetInformationMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/AssetInformationMapper.java @@ -1,3 +1,18 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper; import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/AssetMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/AssetMapper.java index a1db0e87..40a51025 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/AssetMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/AssetMapper.java @@ -1,3 +1,18 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper; import io.adminshell.aas.v3.dataformat.aml.model.caex.AssetAdministrationShellRoleClassLib; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/BasicEventMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/BasicEventMapper.java index 8396092b..fe242dd3 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/BasicEventMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/BasicEventMapper.java @@ -1,3 +1,18 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper; import io.adminshell.aas.v3.dataformat.aml.model.caex.AssetAdministrationShellRoleClassLib; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/BlobMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/BlobMapper.java index 590b5d31..bf26c6b3 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/BlobMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/BlobMapper.java @@ -1,3 +1,18 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper; import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/CapabilityMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/CapabilityMapper.java index aafb0215..37691a29 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/CapabilityMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/CapabilityMapper.java @@ -1,3 +1,18 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper; import io.adminshell.aas.v3.dataformat.aml.model.caex.AssetAdministrationShellRoleClassLib; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/EntityMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/EntityMapper.java index 283772d1..36ae8e31 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/EntityMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/EntityMapper.java @@ -1,3 +1,18 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper; import io.adminshell.aas.v3.dataformat.aml.model.caex.AssetAdministrationShellRoleClassLib; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/FileMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/FileMapper.java index 48369ba4..9aece7f7 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/FileMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/FileMapper.java @@ -1,3 +1,18 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper; import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/IdentifiableMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/IdentifiableMapper.java index ee7ffbb1..f6ae73ea 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/IdentifiableMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/IdentifiableMapper.java @@ -1,3 +1,18 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper; import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElement; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/MultiLanguagePropertyMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/MultiLanguagePropertyMapper.java index e680102b..8e27c6d4 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/MultiLanguagePropertyMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/MultiLanguagePropertyMapper.java @@ -1,3 +1,18 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper; import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/OperationMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/OperationMapper.java index 4fca056a..616b40d6 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/OperationMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/OperationMapper.java @@ -1,3 +1,18 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper; import io.adminshell.aas.v3.dataformat.aml.model.caex.AssetAdministrationShellRoleClassLib; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/PropertyMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/PropertyMapper.java index 879a04bd..96a7f495 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/PropertyMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/PropertyMapper.java @@ -1,3 +1,18 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper; import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/RangeMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/RangeMapper.java index f228285c..d05139ac 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/RangeMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/RangeMapper.java @@ -1,3 +1,18 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper; import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/ReferableMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/ReferableMapper.java index 800da259..4ae4106c 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/ReferableMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/ReferableMapper.java @@ -1,3 +1,18 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper; import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElement; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/ReferenceElementMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/ReferenceElementMapper.java index d63baf5f..ac301da3 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/ReferenceElementMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/ReferenceElementMapper.java @@ -1,3 +1,18 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper; import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/RelationshipElementMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/RelationshipElementMapper.java index bbc528b1..c1c9c8d6 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/RelationshipElementMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/RelationshipElementMapper.java @@ -1,3 +1,18 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper; import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/SubmodelElementCollectionMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/SubmodelElementCollectionMapper.java index 80734817..4a5267bb 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/SubmodelElementCollectionMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/SubmodelElementCollectionMapper.java @@ -1,3 +1,18 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper; import io.adminshell.aas.v3.dataformat.aml.model.caex.AssetAdministrationShellRoleClassLib; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/SubmodelElementMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/SubmodelElementMapper.java index 22b6e7ff..99f5873c 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/SubmodelElementMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/SubmodelElementMapper.java @@ -1,3 +1,18 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper; import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElement; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/SubmodelMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/SubmodelMapper.java index 7022390a..902a59c2 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/SubmodelMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/SubmodelMapper.java @@ -1,3 +1,18 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper; import io.adminshell.aas.v3.dataformat.aml.model.caex.AssetAdministrationShellRoleClassLib; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/ViewMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/ViewMapper.java index cdca5a64..a798a1f0 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/ViewMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/ViewMapper.java @@ -1,3 +1,18 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper; import io.adminshell.aas.v3.dataformat.aml.model.caex.AssetAdministrationShellRoleClassLib; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/util/FileConverterUtil.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/util/FileConverterUtil.java index 7d24a2fb..abf0fbc6 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/util/FileConverterUtil.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/util/FileConverterUtil.java @@ -1,3 +1,18 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.util; import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/util/QualifierConverterUtil.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/util/QualifierConverterUtil.java index 6a49fe71..d51cdbba 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/util/QualifierConverterUtil.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/util/QualifierConverterUtil.java @@ -1,3 +1,18 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.util; import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/util/ReferenceConverterUtil.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/util/ReferenceConverterUtil.java index 128da9bb..7220c899 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/util/ReferenceConverterUtil.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/util/ReferenceConverterUtil.java @@ -1,3 +1,18 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.util; //import de.fraunhofer.iosb.ilt.aas.service.model.common.types.reference.Key; diff --git a/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/deserialize/AmlDeserializerTest.java b/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/deserialize/AmlDeserializerTest.java index 188052ae..2399b2b5 100644 --- a/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/deserialize/AmlDeserializerTest.java +++ b/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/deserialize/AmlDeserializerTest.java @@ -1,9 +1,22 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.deserialize; import com.fasterxml.jackson.dataformat.xml.XmlMapper; -import io.adminshell.aas.v3.dataformat.DeserializationException; import io.adminshell.aas.v3.dataformat.aml.AmlDeserializer; -import org.junit.Test; import java.io.*; @@ -13,13 +26,6 @@ public class AmlDeserializerTest { private final XmlMapper xmlMapper = new XmlMapper(); - @Test - public void testCoffeeBeanExample() throws IOException, DeserializationException { - final String file = "src/test/resources/amlfile/coffee-bean.xml"; - String xml = inputStreamToString(new FileInputStream(file)); - deserializer.read(xml); - } - private String inputStreamToString(InputStream inputStream) throws IOException { StringBuilder stringBuilder = new StringBuilder(); String line; diff --git a/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/fixtures/FullExample.java b/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/fixtures/FullExample.java index 94cd8bb9..d7144fb4 100644 --- a/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/fixtures/FullExample.java +++ b/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/fixtures/FullExample.java @@ -1,3 +1,18 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.fixtures; import io.adminshell.aas.v3.model.*; diff --git a/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/serialize/AmlSerializerTest.java b/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/serialize/AmlSerializerTest.java index 22729264..9147ca13 100644 --- a/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/serialize/AmlSerializerTest.java +++ b/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/serialize/AmlSerializerTest.java @@ -1,3 +1,18 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.serialize; import io.adminshell.aas.v3.dataformat.aml.fixtures.FullExample; From 2b54799ae2de545c3f08da2125e5b5bdb3ca3f5f Mon Sep 17 00:00:00 2001 From: Jacoby Date: Tue, 13 Jul 2021 16:36:59 +0200 Subject: [PATCH 03/18] added AmlMapper --- .../aas/v3/dataformat/aml/AmlMapper.java | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlMapper.java diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlMapper.java new file mode 100644 index 00000000..0735a763 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlMapper.java @@ -0,0 +1,34 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml; + +import io.adminshell.aas.v3.dataformat.aml.model.caex.AdditionalInformation; +import io.adminshell.aas.v3.dataformat.aml.model.caex.CAEXFile; +import io.adminshell.aas.v3.model.AssetAdministrationShellEnvironment; + +public class AmlMapper { + + public AssetAdministrationShellEnvironment map(CAEXFile aml) { + return null; + } + + public CAEXFile map(AssetAdministrationShellEnvironment aas) { +// return CAEXFile.builder() +// .additionalInformation(new AdditionalInformation() ) +// .build(); + return null; + } +} From 5106685816f7ad55e5bc4b94cb291d57c9a9c08e Mon Sep 17 00:00:00 2001 From: David T Date: Mon, 19 Jul 2021 00:27:18 +0200 Subject: [PATCH 04/18] Add view mapping --- .../aas/v3/dataformat/aml/AmlSerializer.java | 24 +- .../aml/model/caex/AASNamespace.java | 9 +- .../mapper/AASEnvironmentMapper.java | 10 - .../IdShortToAttributeConverter.java | 5 + .../converter/IdShortToNameConverter.java | 4 +- .../AssetAdministrationShellMapper.java | 73 +- .../mapper/mapper/ReferableMapper.java | 3 + .../serialize/mapper/mapper/ViewMapper.java | 35 - .../serialize/mapper/util/UrlEncoderUtil.java | 11 + .../dataformat/aml/fixtures/FullExample.java | 33 +- .../aml/serialize/AmlSerializerTest.java | 18 +- .../test/resources/amlfile/full-example.xml | 8921 ----------------- 12 files changed, 144 insertions(+), 9002 deletions(-) delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/ViewMapper.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/util/UrlEncoderUtil.java delete mode 100644 dataformat-aml/src/test/resources/amlfile/full-example.xml diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlSerializer.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlSerializer.java index 7b09c0a6..62ae874c 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlSerializer.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlSerializer.java @@ -72,9 +72,11 @@ public AmlSerializer(boolean enableClassLibs) { public String write(AssetAdministrationShellEnvironment aasEnvironment) throws SerializationException { try { CAEXFile caexFile = modelTransformation(aasEnvironment); - String result = convertXml(caexFile); + String xml = convertXml(caexFile); + String cleanUp = cleanUpXml(xml); + String result = cleanUp; if (enableClassLibs) { - result = addClassLibs(cleanUpXml(result)); + result = addClassLibs(cleanUp); } return result; } catch (JsonProcessingException ex) { @@ -156,13 +158,17 @@ private CAEXFile modelTransformation(AssetAdministrationShellEnvironment environ // Inside shell loop forEachWithCounter(administrationShells, (i, administrationShell) -> { // Map asset info to internal element - AssetInformation asset = administrationShell.getAssetInformation(); - InternalElement assetInternalElement = mapper.map(asset, InternalElement.class); - shellInternalElements.get(i).setInternalElements(new ArrayList() { - { - add(assetInternalElement); - } - }); +// AssetInformation asset = administrationShell.getAssetInformation(); +// InternalElement assetInternalElement = mapper.map(asset, InternalElement.class); +// shellInternalElements.get(i).setInternalElements(new ArrayList<>() { +// { +// add(assetInternalElement); +// } +// }); + +// // Map view +// List viewInternalElements = mapper.mapAsList(administrationShell.getViews(), InternalElement.class); +// shellInternalElements.addAll(viewInternalElements); // // Map all submodels to internal elements // forEachWithCounter(administrationShell.getSubmodels(), (j, submodel) -> { diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/AASNamespace.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/AASNamespace.java index aee6985a..5a6b1cff 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/AASNamespace.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/AASNamespace.java @@ -43,6 +43,9 @@ public enum AASNamespace { Qualifier_ValueId("Qualifier/valueId"), AssetAdministrationShell_DerivedFrom("AssetAdministrationShell/derivedFrom"), Asset_AssetIdentificationModel("Asset/assetIdentificationModel"), + AssetAdministrationShell_AssetInformation("AssetAdministrationShell/assetInformation"), + AssetInformation_AssetKind("AssetInformation/assetKind"), + AssetInformation_GlobalAssetId("AssetInformation/globalAssetId"), AssetAdministrationShell_Submodels("AssetAdministrationShell/submodels"), Property_Value("Property/value"), MultiLanguageProperty_Value("MultiLanguageProperty/value"), @@ -62,7 +65,11 @@ public enum AASNamespace { RelationshipElement_Second("RelationshipElement/second"), IdentifierKeyValuePair_Key("IdentifierKeyValuePair/key"), IdentifierKeyValuePair_Value("IdentifierKeyValuePair/value"), - BillOfMaterial_Reference("BillOfMaterial/reference"); + BillOfMaterial_Reference("BillOfMaterial/reference"), + // View + AssetAdministrationShell_View("AssetAdministrationShell/view"), + View_ContainedElement("View/containedElement"), + View_IdShort("View/idShort"); private String refSemantic; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/AASEnvironmentMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/AASEnvironmentMapper.java index 89efb5f5..52cce6f7 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/AASEnvironmentMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/AASEnvironmentMapper.java @@ -51,7 +51,6 @@ import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper.SubmodelElementCollectionMapper; import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper.SubmodelElementMapper; import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper.SubmodelMapper; -import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper.ViewMapper; import io.adminshell.aas.v3.model.*; import ma.glasnost.orika.MapperFactory; import ma.glasnost.orika.impl.ConfigurableMapper; @@ -132,15 +131,6 @@ protected void configure(MapperFactory factory) { .customize(new AssetAdministrationShellMapper()) .register(); - // View mapping - factory.classMap(View.class, InternalElement.class) - .mapNulls(true) - .fieldMap("semanticId", "attributes[0]") - .converter(SemanticIdToAttributeConverter.class.getName()).add() - .byDefault() - .customize(new ViewMapper()) - .register(); - // // Asset information mapping // factory.classMap(AssetInformation.class, InternalElement.class) // .mapNulls(true) diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/IdShortToAttributeConverter.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/IdShortToAttributeConverter.java index a6c1eda7..5c6daded 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/IdShortToAttributeConverter.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/IdShortToAttributeConverter.java @@ -18,6 +18,7 @@ import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; import io.adminshell.aas.v3.dataformat.aml.model.caex.Attribute; import io.adminshell.aas.v3.dataformat.aml.model.caex.RefSemantic; +import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.util.UrlEncoderUtil; import ma.glasnost.orika.CustomConverter; import ma.glasnost.orika.MappingContext; import ma.glasnost.orika.metadata.Type; @@ -26,6 +27,10 @@ public class IdShortToAttributeConverter extends CustomConverter destinationType, MappingContext mappingContext) { + if(source == null) { + return null; + } + return new Attribute( "idShort", null, diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/IdShortToNameConverter.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/IdShortToNameConverter.java index 0182525b..5f4171c9 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/IdShortToNameConverter.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/IdShortToNameConverter.java @@ -25,8 +25,8 @@ public class IdShortToNameConverter extends CustomConverter { @Override public String convert(String source, Type destinationType, MappingContext mappingContext) { - if (source == null) { - return UUID.randomUUID().toString(); + if(source == null) { + return null; } return source; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/AssetAdministrationShellMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/AssetAdministrationShellMapper.java index 133891df..805bc599 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/AssetAdministrationShellMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/AssetAdministrationShellMapper.java @@ -34,18 +34,45 @@ public class AssetAdministrationShellMapper extends CustomMapper()); + assetInformation.setAttributes(new ArrayList<>()); + assetInformation.getAttributes().add(new Attribute( + "assetKind", + null, + null, + assetAdministrationShell.getAssetInformation().getAssetKind().name(), + new RefSemantic(AASNamespace.AssetInformation_AssetKind.getRefSemantic()), + null + )); + assetInformation.getAttributes().add(new Attribute( + "globalAssetId", + null, + null, + ReferenceConverterUtil.convert(assetAdministrationShell.getAssetInformation().getGlobalAssetId()), + new RefSemantic(AASNamespace.AssetInformation_GlobalAssetId.getRefSemantic()), + null + )); + internalElement.getAttributes().add(assetInformation); + + // Submodels assetAdministrationShell.getSubmodels().forEach(submodel -> { + Attribute submodels = new Attribute( + "submodel", + null, + null, + null, + new RefSemantic(AASNamespace.AssetAdministrationShell_Submodels.getRefSemantic()), + null + ); + submodels.setAttributes(new ArrayList<>()); submodels.getAttributes().add(new Attribute( "reference", null, @@ -54,7 +81,39 @@ public void mapAtoB(AssetAdministrationShell assetAdministrationShell, InternalE new RefSemantic(AASNamespace.ReferenceElement_Value.getRefSemantic()), null )); + internalElement.getAttributes().add(submodels); + }); + + // View + assetAdministrationShell.getViews().forEach(view -> { + Attribute views = new Attribute( + "view", + null, + null, + null, + new RefSemantic(AASNamespace.AssetAdministrationShell_View.getRefSemantic()), + null + ); + views.setAttributes(new ArrayList<>()); + views.getAttributes().add(new Attribute( + "idShort", + null, + null, + view.getIdShort(), + new RefSemantic(AASNamespace.View_IdShort.getRefSemantic()), + null + )); + if(!view.getContainedElements().isEmpty()) { + views.getAttributes().add(new Attribute( + "containedElement", + null, + null, + ReferenceConverterUtil.convert(view.getContainedElements().get(0)), + new RefSemantic(AASNamespace.View_ContainedElement.getRefSemantic()), + null + )); + } + internalElement.getAttributes().add(views); }); - internalElement.getAttributes().add(submodels); } } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/ReferableMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/ReferableMapper.java index 4ae4106c..7eb30082 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/ReferableMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/ReferableMapper.java @@ -15,7 +15,10 @@ */ package io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper; +import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; +import io.adminshell.aas.v3.dataformat.aml.model.caex.Attribute; import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElement; +import io.adminshell.aas.v3.dataformat.aml.model.caex.RefSemantic; import io.adminshell.aas.v3.model.Referable; import ma.glasnost.orika.CustomMapper; import ma.glasnost.orika.MappingContext; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/ViewMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/ViewMapper.java deleted file mode 100644 index a798a1f0..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/ViewMapper.java +++ /dev/null @@ -1,35 +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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper; - -import io.adminshell.aas.v3.dataformat.aml.model.caex.AssetAdministrationShellRoleClassLib; -import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElement; -import io.adminshell.aas.v3.dataformat.aml.model.caex.RoleRequirements; -import io.adminshell.aas.v3.model.View; -import ma.glasnost.orika.CustomMapper; -import ma.glasnost.orika.MappingContext; - -public class ViewMapper extends CustomMapper { - - @Override - public void mapAtoB(View view, InternalElement internalElement, MappingContext context) { - internalElement.setRoleRequirements(new RoleRequirements(AssetAdministrationShellRoleClassLib.View.getRefBaseRoleClassPath())); - - view.getContainedElements().forEach(containedElement -> { - - }); - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/util/UrlEncoderUtil.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/util/UrlEncoderUtil.java new file mode 100644 index 00000000..077b7790 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/util/UrlEncoderUtil.java @@ -0,0 +1,11 @@ +package io.adminshell.aas.v3.dataformat.aml.serialize.mapper.util; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; + +public class UrlEncoderUtil { + + public static String encode(String url) { + return URLEncoder.encode(url, StandardCharsets.UTF_8); + } +} diff --git a/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/fixtures/FullExample.java b/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/fixtures/FullExample.java index d7144fb4..398cb10f 100644 --- a/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/fixtures/FullExample.java +++ b/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/fixtures/FullExample.java @@ -1569,22 +1569,25 @@ public class FullExample { public static final AssetAdministrationShellEnvironment ENVIRONMENT = new DefaultAssetAdministrationShellEnvironment.Builder() .assetAdministrationShells(Arrays.asList( - AAS_1, - AAS_2, - AAS_3, - AAS_4)) +// AAS_1, +// AAS_2, + AAS_3 +// AAS_4 + )) .submodels(Arrays.asList( - SUBMODEL_1, - SUBMODEL_2, - SUBMODEL_3, - SUBMODEL_4, - SUBMODEL_5, - SUBMODEL_6, - SUBMODEL_7)) +// SUBMODEL_1, +// SUBMODEL_2, +// SUBMODEL_3, +// SUBMODEL_4, +// SUBMODEL_5, +// SUBMODEL_6, +// SUBMODEL_7 + )) .conceptDescriptions(Arrays.asList( - CONCEPT_DESCRIPTION_1, - CONCEPT_DESCRIPTION_2, - CONCEPT_DESCRIPTION_3, - CONCEPT_DESCRIPTION_4)) +// CONCEPT_DESCRIPTION_1, +// CONCEPT_DESCRIPTION_2, +// CONCEPT_DESCRIPTION_3, +// CONCEPT_DESCRIPTION_4 + )) .build(); } diff --git a/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/serialize/AmlSerializerTest.java b/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/serialize/AmlSerializerTest.java index 9147ca13..aa1fd6f6 100644 --- a/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/serialize/AmlSerializerTest.java +++ b/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/serialize/AmlSerializerTest.java @@ -20,13 +20,27 @@ import io.adminshell.aas.v3.dataformat.aml.AmlSerializer; import org.junit.Test; +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; + public class AmlSerializerTest { private final AmlSerializer serializer = new AmlSerializer(); @Test public void testSAPFullExample() throws SerializationException { - String actual = serializer.write(FullExample.ENVIRONMENT); - System.err.println(actual); + String aml = serializer.write(FullExample.ENVIRONMENT); + + try { + File xmlOutput = new File("src/test/resources/amlfile/full-example.xml"); + FileWriter fileWriter = new FileWriter(xmlOutput); + fileWriter.write(aml); + fileWriter.close(); + } catch (IOException e) { + e.printStackTrace(); + } + + // System.err.println(actual); } } diff --git a/dataformat-aml/src/test/resources/amlfile/full-example.xml b/dataformat-aml/src/test/resources/amlfile/full-example.xml deleted file mode 100644 index 88b1275a..00000000 --- a/dataformat-aml/src/test/resources/amlfile/full-example.xml +++ /dev/null @@ -1,8921 +0,0 @@ - - - - 0 - - - - - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId - - - - - (GLOBAL_REFERENCE)[IRI]0173-1#02-AAO677#002 - - - - ManufacturerName - - - - - - - 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. - - - 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 - - - - - - xs:int - - - - 100 - - - - - - - - - - xs:int - - - - 50 - - - - - - - - ACPLT - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId - - - - - (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber - - - - InstanceId - - - - - - - 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. - - - 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 - - - - 978-8234-234-342 - - - - - - (SUBMODEL)[IRI]http://acplt.org/SubmodelTemplates/AssetIdentification - - - - - - IRI - - - - http://acplt.org/Submodels/Assets/TestAsset/Identification - - - - - - - 0.9 - - - - 0 - - - - - Identification - - - - - - - An example asset identification submodel for the test application - - - Ein Beispiel-Identifikations-Submodel für eine Test-Anwendung - - - - - - - - - - - - - - - CO_MANAGED_ENTITY - - - - - (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber - - - - ExampleEntity - - - - - - - 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. - - - 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 - - - - - - - - - SELF_MANAGED_ENTITY - - - - - (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber - - - - ExampleEntity2 - - - - - - - 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. - - - 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 - - - - - - (SUBMODEL)[IRI]http://acplt.org/SubmodelTemplates/BillOfMaterial - - - - - - IRI - - - - http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial - - - - - - - 0.9 - - - - - - - - BillOfMaterial - - - - - - - An example bill of material submodel for the test application - - - Ein Beispiel-BillofMaterial-Submodel für eine Test-Anwendung - - - - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleRelationshipElement - - - - ExampleRelationshipElement - - - - Parameter - - - - - - Example RelationshipElement object - - - Beispiel RelationshipElement Element - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - (PROPERTY)[ID_SHORT]ExampleProperty2 - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement - - - - ExampleAnnotatedRelationshipElement - - - - Parameter - - - - - - Example AnnotatedRelationshipElement object - - - Beispiel AnnotatedRelationshipElement Element - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - (PROPERTY)[ID_SHORT]ExampleProperty2 - - - - - - - - - - - - - - - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Operations/ExampleOperation - - - - ExampleOperation - - - - Parameter - - - - - - Example Operation object - - - Beispiel Operation Element - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Capabilities/ExampleCapability - - - - ExampleCapability - - - - Parameter - - - - - - Example Capability object - - - Beispiel Capability Element - - - - - - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Events/ExampleBasicEvent - - - - ExampleBasicEvent - - - - Parameter - - - - - - Example BasicEvent object - - - Beispiel BasicEvent Element - - - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty - - - - ExampleProperty - - - - Constant - - - - - - Example Property object - - - Beispiel Property Element - - - - exampleValue - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty - - - - ExampleMultiLanguageProperty - - - - Constant - - - - - - Example MultiLanguageProperty object - - - Beispiel MulitLanguageProperty Element - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleMultiLanguageValueId - - - - - - Example value of a MultiLanguageProperty element - - - Beispielswert für ein MulitLanguageProperty-Element - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Ranges/ExampleRange - - - - ExampleRange - - - - Parameter - - - - - - Example Range object - - - Beispiel Range Element - - - - 100 - - - - 0 - - - - - true - - - - false - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered - - - - ExampleSubmodelCollectionOrdered - - - - Parameter - - - - - - Example SubmodelElementCollectionOrdered object - - - Beispiel SubmodelElementCollectionOrdered Element - - - - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Blobs/ExampleBlob - - - - ExampleBlob - - - - Parameter - - - - - - Example Blob object - - - Beispiel Blob Element - - - - - application/pdf - - - - [1, 2, 3, 4, 5] - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Files/ExampleFile - - - - ExampleFile - - - - Parameter - - - - - - Example File object - - - Beispiel File Element - - - - - application/pdf - - - - /TestFile.pdf - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ReferenceElements/ExampleReferenceElement - - - - ExampleReferenceElement - - - - Parameter - - - - - - Example Reference Element object - - - Beispiel Reference Element Element - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - false - - - - false - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered - - - - ExampleSubmodelCollectionUnordered - - - - Parameter - - - - - - Example SubmodelElementCollectionUnordered object - - - Beispiel SubmodelElementCollectionUnordered Element - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelTemplates/ExampleSubmodel - - - - - - IRI - - - - https://acplt.org/Test_Submodel - - - - - - - 0.9 - - - - 0 - - - - - TestSubmodel - - - - - - - An example submodel for the test application - - - Ein Beispiel-Teilmodell für eine Test-Anwendung - - - - - - - - - - - - - - - ExampleRelationshipElement - - - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - - - - - - - ExampleAnnotatedRelationshipElement - - - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - - - - - - - - - - - - - - - - - - - - - - ExampleOperation - - - - - - - - - - - - - ExampleCapability - - - - - - - - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - - ExampleBasicEvent - - - - - - - - - - - - - - - - - - ExampleProperty - - - - - - - - - - - - - - - - ExampleMultiLanguageProperty - - - - - - - - - - - - - - - - - - - ExampleRange - - - - - - - - - - - - - true - - - - false - - - - - - ExampleSubmodelCollectionOrdered - - - - - - - - - - - - - - - - - ExampleBlob - - - - - - - application/pdf - - - - null - - - - - - - - - - - - ExampleFile - - - - - - - application/pdf - - - - - - - - - - - - - - - ExampleReferenceElement - - - - - - - - - - false - - - - false - - - - - - ExampleSubmodelCollectionUnordered - - - - - - - - - - - false - - - - false - - - - - - ExampleSubmodelCollectionUnordered2 - - - - - - - - - - - IRI - - - - https://acplt.org/Test_Submodel_Mandatory - - - - - - - - - - - - - - - - - - - - - IRI - - - - https://acplt.org/Test_Submodel2_Mandatory - - - - - - - - - - - - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleRelationshipElement - - - - ExampleRelationshipElement - - - - Parameter - - - - - - Example RelationshipElement object - - - Beispiel RelationshipElement Element - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement - - - - ExampleAnnotatedRelationshipElement - - - - Parameter - - - - - - Example AnnotatedRelationshipElement object - - - Beispiel AnnotatedRelationshipElement Element - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - - - - - - - - - - - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Operations/ExampleOperation - - - - ExampleOperation - - - - Parameter - - - - - - Example Operation object - - - Beispiel Operation Element - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Capabilities/ExampleCapability - - - - ExampleCapability - - - - Parameter - - - - - - Example Capability object - - - Beispiel Capability Element - - - - - - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Events/ExampleBasicEvent - - - - ExampleBasicEvent - - - - Parameter - - - - - - Example BasicEvent object - - - Beispiel BasicEvent Element - - - - - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty - - - - ExampleProperty - - - - Constant - - - - - - Example Property object - - - Beispiel Property Element - - - - - - xs:string - - - - - - - - - - - exampleValue - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty - - - - ExampleMultiLanguageProperty - - - - Constant - - - - - - Example MultiLanguageProperty object - - - Beispiel MulitLanguageProperty Element - - - - - - - - - Example value of a MultiLanguageProperty element - - - Beispielswert für ein MulitLanguageProperty-Element - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Ranges/ExampleRange - - - - ExampleRange - - - - Parameter - - - - - - Example Range object - - - Beispiel Range Element - - - - 100 - - - - 0 - - - - - true - - - - false - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered - - - - ExampleSubmodelCollectionOrdered - - - - Parameter - - - - - - Example SubmodelElementCollectionOrdered object - - - Beispiel SubmodelElementCollectionOrdered Element - - - - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Blobs/ExampleBlob - - - - ExampleBlob - - - - Parameter - - - - - - Example Blob object - - - Beispiel Blob Element - - - - - application/pdf - - - - [1, 2, 3, 4, 5] - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Files/ExampleFile - - - - ExampleFile - - - - Parameter - - - - - - Example File object - - - Beispiel File Element - - - - - application/pdf - - - - /TestFile.pdf - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ReferenceElements/ExampleReferenceElement - - - - ExampleReferenceElement - - - - Parameter - - - - - - Example Reference Element object - - - Beispiel Reference Element Element - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - false - - - - false - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered - - - - ExampleSubmodelCollectionUnordered - - - - Parameter - - - - - - Example SubmodelElementCollectionUnordered object - - - Beispiel SubmodelElementCollectionUnordered Element - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelTemplates/ExampleSubmodel - - - - - - IRI - - - - https://acplt.org/Test_Submodel_Missing - - - - - - - 0.9 - - - - 0 - - - - - TestSubmodel - - - - - - - An example submodel for the test application - - - Ein Beispiel-Teilmodell für eine Test-Anwendung - - - - - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleRelationshipElement - - - - ExampleRelationshipElement - - - - Parameter - - - - - - Example RelationshipElement object - - - Beispiel RelationshipElement Element - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement - - - - ExampleAnnotatedRelationshipElement - - - - Parameter - - - - - - Example AnnotatedRelationshipElement object - - - Beispiel AnnotatedRelationshipElement Element - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - - - - - - - - - - - - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Operations/ExampleOperation - - - - ExampleOperation - - - - Parameter - - - - - - Example Operation object - - - Beispiel Operation Element - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Capabilities/ExampleCapability - - - - ExampleCapability - - - - Parameter - - - - - - Example Capability object - - - Beispiel Capability Element - - - - - - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Events/ExampleBasicEvent - - - - ExampleBasicEvent - - - - Parameter - - - - - - Example BasicEvent object - - - Beispiel BasicEvent Element - - - - - - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty - - - - ExampleProperty - - - - Constant - - - - - - Example Property object - - - Beispiel Property Element - - - - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty - - - - ExampleMultiLanguageProperty - - - - Constant - - - - - - Example MultiLanguageProperty object - - - Beispiel MulitLanguageProperty Element - - - - - - - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Ranges/ExampleRange - - - - ExampleRange - - - - Parameter - - - - - - Example Range object - - - Beispiel Range Element - - - - 100 - - - - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Ranges/ExampleRange - - - - ExampleRange2 - - - - Parameter - - - - - - Example Range object - - - Beispiel Range Element - - - - - - - 0 - - - - - true - - - - false - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered - - - - ExampleSubmodelCollectionOrdered - - - - Parameter - - - - - - Example SubmodelElementCollectionOrdered object - - - Beispiel SubmodelElementCollectionOrdered Element - - - - - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Blobs/ExampleBlob - - - - ExampleBlob - - - - Parameter - - - - - - Example Blob object - - - Beispiel Blob Element - - - - - application/pdf - - - - null - - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Files/ExampleFile - - - - ExampleFile - - - - Parameter - - - - - - Example File object - - - Beispiel File Element - - - - - application/pdf - - - - - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ReferenceElements/ExampleReferenceElement - - - - ExampleReferenceElement - - - - Parameter - - - - - - Example Reference Element object - - - Beispiel Reference Element Element - - - - - - - - false - - - - false - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered - - - - ExampleSubmodelCollectionUnordered - - - - Parameter - - - - - - Example SubmodelElementCollectionUnordered object - - - Beispiel SubmodelElementCollectionUnordered Element - - - - - - - - - false - - - - false - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered - - - - ExampleSubmodelCollectionUnordered2 - - - - Parameter - - - - - - Example SubmodelElementCollectionUnordered object - - - Beispiel SubmodelElementCollectionUnordered Element - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelTemplates/ExampleSubmodel - - - - - - IRI - - - - https://acplt.org/Test_Submodel_Template - - - - - - - 0.9 - - - - 0 - - - - - TestSubmodel - - - - - - - An example submodel for the test application - - - Ein Beispiel-Teilmodell für eine Test-Anwendung - - - - - (ASSET_ADMINISTRATION_SHELL)[IRI]https://acplt.org/TestAssetAdministrationShell2 - - - - - - IRI - - - - https://acplt.org/Test_AssetAdministrationShell - - - - - - - 0.9 - - - - 0 - - - - - TestAssetAdministrationShell - - - - - - - An Example Asset Administration Shell for the test application - - - Ein Beispiel-Verwaltungsschale für eine Test-Anwendung - - - - - - (SUBMODEL)[IRI]https://acplt.org/Test_Submodel - - - - (SUBMODEL)[IRI]http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial - - - - (SUBMODEL)[IRI]http://acplt.org/Submodels/Assets/TestAsset/Identification - - - - - - - - - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId - - - - - (GLOBAL_REFERENCE)[IRI]0173-1#02-AAO677#002 - - - - ManufacturerName - - - - - - - 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. - - - 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 - - - - - - xs:int - - - - 100 - - - - - - - - - - xs:int - - - - 50 - - - - - - - - ACPLT - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId - - - - - (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber - - - - InstanceId - - - - - - - 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. - - - 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 - - - - 978-8234-234-342 - - - - - - (SUBMODEL)[IRI]http://acplt.org/SubmodelTemplates/AssetIdentification - - - - - - IRI - - - - http://acplt.org/Submodels/Assets/TestAsset/Identification - - - - - - - 0.9 - - - - 0 - - - - - Identification - - - - - - - An example asset identification submodel for the test application - - - Ein Beispiel-Identifikations-Submodel für eine Test-Anwendung - - - - - - - - - - - - - - - CO_MANAGED_ENTITY - - - - - (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber - - - - ExampleEntity - - - - - - - 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. - - - 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 - - - - - - - - - SELF_MANAGED_ENTITY - - - - - (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber - - - - ExampleEntity2 - - - - - - - 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. - - - 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 - - - - - - (SUBMODEL)[IRI]http://acplt.org/SubmodelTemplates/BillOfMaterial - - - - - - IRI - - - - http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial - - - - - - - 0.9 - - - - - - - - BillOfMaterial - - - - - - - An example bill of material submodel for the test application - - - Ein Beispiel-BillofMaterial-Submodel für eine Test-Anwendung - - - - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleRelationshipElement - - - - ExampleRelationshipElement - - - - Parameter - - - - - - Example RelationshipElement object - - - Beispiel RelationshipElement Element - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - (PROPERTY)[ID_SHORT]ExampleProperty2 - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement - - - - ExampleAnnotatedRelationshipElement - - - - Parameter - - - - - - Example AnnotatedRelationshipElement object - - - Beispiel AnnotatedRelationshipElement Element - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - (PROPERTY)[ID_SHORT]ExampleProperty2 - - - - - - - - - - - - - - - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Operations/ExampleOperation - - - - ExampleOperation - - - - Parameter - - - - - - Example Operation object - - - Beispiel Operation Element - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Capabilities/ExampleCapability - - - - ExampleCapability - - - - Parameter - - - - - - Example Capability object - - - Beispiel Capability Element - - - - - - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Events/ExampleBasicEvent - - - - ExampleBasicEvent - - - - Parameter - - - - - - Example BasicEvent object - - - Beispiel BasicEvent Element - - - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty - - - - ExampleProperty - - - - Constant - - - - - - Example Property object - - - Beispiel Property Element - - - - exampleValue - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty - - - - ExampleMultiLanguageProperty - - - - Constant - - - - - - Example MultiLanguageProperty object - - - Beispiel MulitLanguageProperty Element - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleMultiLanguageValueId - - - - - - Example value of a MultiLanguageProperty element - - - Beispielswert für ein MulitLanguageProperty-Element - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Ranges/ExampleRange - - - - ExampleRange - - - - Parameter - - - - - - Example Range object - - - Beispiel Range Element - - - - 100 - - - - 0 - - - - - true - - - - false - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered - - - - ExampleSubmodelCollectionOrdered - - - - Parameter - - - - - - Example SubmodelElementCollectionOrdered object - - - Beispiel SubmodelElementCollectionOrdered Element - - - - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Blobs/ExampleBlob - - - - ExampleBlob - - - - Parameter - - - - - - Example Blob object - - - Beispiel Blob Element - - - - - application/pdf - - - - [1, 2, 3, 4, 5] - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Files/ExampleFile - - - - ExampleFile - - - - Parameter - - - - - - Example File object - - - Beispiel File Element - - - - - application/pdf - - - - /TestFile.pdf - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ReferenceElements/ExampleReferenceElement - - - - ExampleReferenceElement - - - - Parameter - - - - - - Example Reference Element object - - - Beispiel Reference Element Element - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - false - - - - false - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered - - - - ExampleSubmodelCollectionUnordered - - - - Parameter - - - - - - Example SubmodelElementCollectionUnordered object - - - Beispiel SubmodelElementCollectionUnordered Element - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelTemplates/ExampleSubmodel - - - - - - IRI - - - - https://acplt.org/Test_Submodel - - - - - - - 0.9 - - - - 0 - - - - - TestSubmodel - - - - - - - An example submodel for the test application - - - Ein Beispiel-Teilmodell für eine Test-Anwendung - - - - - - - - - - - - - - - ExampleRelationshipElement - - - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - - - - - - - ExampleAnnotatedRelationshipElement - - - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - - - - - - - - - - - - - - - - - - - - - - ExampleOperation - - - - - - - - - - - - - ExampleCapability - - - - - - - - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - - ExampleBasicEvent - - - - - - - - - - - - - - - - - - ExampleProperty - - - - - - - - - - - - - - - - ExampleMultiLanguageProperty - - - - - - - - - - - - - - - - - - - ExampleRange - - - - - - - - - - - - - true - - - - false - - - - - - ExampleSubmodelCollectionOrdered - - - - - - - - - - - - - - - - - ExampleBlob - - - - - - - application/pdf - - - - null - - - - - - - - - - - - ExampleFile - - - - - - - application/pdf - - - - - - - - - - - - - - - ExampleReferenceElement - - - - - - - - - - false - - - - false - - - - - - ExampleSubmodelCollectionUnordered - - - - - - - - - - - false - - - - false - - - - - - ExampleSubmodelCollectionUnordered2 - - - - - - - - - - - IRI - - - - https://acplt.org/Test_Submodel_Mandatory - - - - - - - - - - - - - - - - - - - - - IRI - - - - https://acplt.org/Test_Submodel2_Mandatory - - - - - - - - - - - - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleRelationshipElement - - - - ExampleRelationshipElement - - - - Parameter - - - - - - Example RelationshipElement object - - - Beispiel RelationshipElement Element - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement - - - - ExampleAnnotatedRelationshipElement - - - - Parameter - - - - - - Example AnnotatedRelationshipElement object - - - Beispiel AnnotatedRelationshipElement Element - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - - - - - - - - - - - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Operations/ExampleOperation - - - - ExampleOperation - - - - Parameter - - - - - - Example Operation object - - - Beispiel Operation Element - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Capabilities/ExampleCapability - - - - ExampleCapability - - - - Parameter - - - - - - Example Capability object - - - Beispiel Capability Element - - - - - - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Events/ExampleBasicEvent - - - - ExampleBasicEvent - - - - Parameter - - - - - - Example BasicEvent object - - - Beispiel BasicEvent Element - - - - - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty - - - - ExampleProperty - - - - Constant - - - - - - Example Property object - - - Beispiel Property Element - - - - - - xs:string - - - - - - - - - - - exampleValue - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty - - - - ExampleMultiLanguageProperty - - - - Constant - - - - - - Example MultiLanguageProperty object - - - Beispiel MulitLanguageProperty Element - - - - - - - - - Example value of a MultiLanguageProperty element - - - Beispielswert für ein MulitLanguageProperty-Element - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Ranges/ExampleRange - - - - ExampleRange - - - - Parameter - - - - - - Example Range object - - - Beispiel Range Element - - - - 100 - - - - 0 - - - - - true - - - - false - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered - - - - ExampleSubmodelCollectionOrdered - - - - Parameter - - - - - - Example SubmodelElementCollectionOrdered object - - - Beispiel SubmodelElementCollectionOrdered Element - - - - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Blobs/ExampleBlob - - - - ExampleBlob - - - - Parameter - - - - - - Example Blob object - - - Beispiel Blob Element - - - - - application/pdf - - - - [1, 2, 3, 4, 5] - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Files/ExampleFile - - - - ExampleFile - - - - Parameter - - - - - - Example File object - - - Beispiel File Element - - - - - application/pdf - - - - /TestFile.pdf - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ReferenceElements/ExampleReferenceElement - - - - ExampleReferenceElement - - - - Parameter - - - - - - Example Reference Element object - - - Beispiel Reference Element Element - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - false - - - - false - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered - - - - ExampleSubmodelCollectionUnordered - - - - Parameter - - - - - - Example SubmodelElementCollectionUnordered object - - - Beispiel SubmodelElementCollectionUnordered Element - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelTemplates/ExampleSubmodel - - - - - - IRI - - - - https://acplt.org/Test_Submodel_Missing - - - - - - - 0.9 - - - - 0 - - - - - TestSubmodel - - - - - - - An example submodel for the test application - - - Ein Beispiel-Teilmodell für eine Test-Anwendung - - - - - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleRelationshipElement - - - - ExampleRelationshipElement - - - - Parameter - - - - - - Example RelationshipElement object - - - Beispiel RelationshipElement Element - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement - - - - ExampleAnnotatedRelationshipElement - - - - Parameter - - - - - - Example AnnotatedRelationshipElement object - - - Beispiel AnnotatedRelationshipElement Element - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - - - - - - - - - - - - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Operations/ExampleOperation - - - - ExampleOperation - - - - Parameter - - - - - - Example Operation object - - - Beispiel Operation Element - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Capabilities/ExampleCapability - - - - ExampleCapability - - - - Parameter - - - - - - Example Capability object - - - Beispiel Capability Element - - - - - - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Events/ExampleBasicEvent - - - - ExampleBasicEvent - - - - Parameter - - - - - - Example BasicEvent object - - - Beispiel BasicEvent Element - - - - - - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty - - - - ExampleProperty - - - - Constant - - - - - - Example Property object - - - Beispiel Property Element - - - - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty - - - - ExampleMultiLanguageProperty - - - - Constant - - - - - - Example MultiLanguageProperty object - - - Beispiel MulitLanguageProperty Element - - - - - - - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Ranges/ExampleRange - - - - ExampleRange - - - - Parameter - - - - - - Example Range object - - - Beispiel Range Element - - - - 100 - - - - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Ranges/ExampleRange - - - - ExampleRange2 - - - - Parameter - - - - - - Example Range object - - - Beispiel Range Element - - - - - - - 0 - - - - - true - - - - false - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered - - - - ExampleSubmodelCollectionOrdered - - - - Parameter - - - - - - Example SubmodelElementCollectionOrdered object - - - Beispiel SubmodelElementCollectionOrdered Element - - - - - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Blobs/ExampleBlob - - - - ExampleBlob - - - - Parameter - - - - - - Example Blob object - - - Beispiel Blob Element - - - - - application/pdf - - - - null - - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Files/ExampleFile - - - - ExampleFile - - - - Parameter - - - - - - Example File object - - - Beispiel File Element - - - - - application/pdf - - - - - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ReferenceElements/ExampleReferenceElement - - - - ExampleReferenceElement - - - - Parameter - - - - - - Example Reference Element object - - - Beispiel Reference Element Element - - - - - - - - false - - - - false - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered - - - - ExampleSubmodelCollectionUnordered - - - - Parameter - - - - - - Example SubmodelElementCollectionUnordered object - - - Beispiel SubmodelElementCollectionUnordered Element - - - - - - - - - false - - - - false - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered - - - - ExampleSubmodelCollectionUnordered2 - - - - Parameter - - - - - - Example SubmodelElementCollectionUnordered object - - - Beispiel SubmodelElementCollectionUnordered Element - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelTemplates/ExampleSubmodel - - - - - - IRI - - - - https://acplt.org/Test_Submodel_Template - - - - - - - 0.9 - - - - 0 - - - - - TestSubmodel - - - - - - - An example submodel for the test application - - - Ein Beispiel-Teilmodell für eine Test-Anwendung - - - - - - - - IRI - - - - https://acplt.org/Test_AssetAdministrationShell_Mandatory - - - - - - - - - - - - - - (SUBMODEL)[IRI]https://acplt.org/Test_Submodel_Mandatory - - - - (SUBMODEL)[IRI]https://acplt.org/Test_Submodel2_Mandatory - - - - - - - - - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId - - - - - (GLOBAL_REFERENCE)[IRI]0173-1#02-AAO677#002 - - - - ManufacturerName - - - - - - - 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. - - - 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 - - - - - - xs:int - - - - 100 - - - - - - - - - - xs:int - - - - 50 - - - - - - - - ACPLT - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId - - - - - (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber - - - - InstanceId - - - - - - - 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. - - - 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 - - - - 978-8234-234-342 - - - - - - (SUBMODEL)[IRI]http://acplt.org/SubmodelTemplates/AssetIdentification - - - - - - IRI - - - - http://acplt.org/Submodels/Assets/TestAsset/Identification - - - - - - - 0.9 - - - - 0 - - - - - Identification - - - - - - - An example asset identification submodel for the test application - - - Ein Beispiel-Identifikations-Submodel für eine Test-Anwendung - - - - - - - - - - - - - - - CO_MANAGED_ENTITY - - - - - (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber - - - - ExampleEntity - - - - - - - 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. - - - 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 - - - - - - - - - SELF_MANAGED_ENTITY - - - - - (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber - - - - ExampleEntity2 - - - - - - - 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. - - - 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 - - - - - - (SUBMODEL)[IRI]http://acplt.org/SubmodelTemplates/BillOfMaterial - - - - - - IRI - - - - http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial - - - - - - - 0.9 - - - - - - - - BillOfMaterial - - - - - - - An example bill of material submodel for the test application - - - Ein Beispiel-BillofMaterial-Submodel für eine Test-Anwendung - - - - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleRelationshipElement - - - - ExampleRelationshipElement - - - - Parameter - - - - - - Example RelationshipElement object - - - Beispiel RelationshipElement Element - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - (PROPERTY)[ID_SHORT]ExampleProperty2 - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement - - - - ExampleAnnotatedRelationshipElement - - - - Parameter - - - - - - Example AnnotatedRelationshipElement object - - - Beispiel AnnotatedRelationshipElement Element - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - (PROPERTY)[ID_SHORT]ExampleProperty2 - - - - - - - - - - - - - - - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Operations/ExampleOperation - - - - ExampleOperation - - - - Parameter - - - - - - Example Operation object - - - Beispiel Operation Element - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Capabilities/ExampleCapability - - - - ExampleCapability - - - - Parameter - - - - - - Example Capability object - - - Beispiel Capability Element - - - - - - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Events/ExampleBasicEvent - - - - ExampleBasicEvent - - - - Parameter - - - - - - Example BasicEvent object - - - Beispiel BasicEvent Element - - - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty - - - - ExampleProperty - - - - Constant - - - - - - Example Property object - - - Beispiel Property Element - - - - exampleValue - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty - - - - ExampleMultiLanguageProperty - - - - Constant - - - - - - Example MultiLanguageProperty object - - - Beispiel MulitLanguageProperty Element - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleMultiLanguageValueId - - - - - - Example value of a MultiLanguageProperty element - - - Beispielswert für ein MulitLanguageProperty-Element - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Ranges/ExampleRange - - - - ExampleRange - - - - Parameter - - - - - - Example Range object - - - Beispiel Range Element - - - - 100 - - - - 0 - - - - - true - - - - false - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered - - - - ExampleSubmodelCollectionOrdered - - - - Parameter - - - - - - Example SubmodelElementCollectionOrdered object - - - Beispiel SubmodelElementCollectionOrdered Element - - - - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Blobs/ExampleBlob - - - - ExampleBlob - - - - Parameter - - - - - - Example Blob object - - - Beispiel Blob Element - - - - - application/pdf - - - - [1, 2, 3, 4, 5] - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Files/ExampleFile - - - - ExampleFile - - - - Parameter - - - - - - Example File object - - - Beispiel File Element - - - - - application/pdf - - - - /TestFile.pdf - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ReferenceElements/ExampleReferenceElement - - - - ExampleReferenceElement - - - - Parameter - - - - - - Example Reference Element object - - - Beispiel Reference Element Element - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - false - - - - false - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered - - - - ExampleSubmodelCollectionUnordered - - - - Parameter - - - - - - Example SubmodelElementCollectionUnordered object - - - Beispiel SubmodelElementCollectionUnordered Element - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelTemplates/ExampleSubmodel - - - - - - IRI - - - - https://acplt.org/Test_Submodel - - - - - - - 0.9 - - - - 0 - - - - - TestSubmodel - - - - - - - An example submodel for the test application - - - Ein Beispiel-Teilmodell für eine Test-Anwendung - - - - - - - - - - - - - - - ExampleRelationshipElement - - - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - - - - - - - ExampleAnnotatedRelationshipElement - - - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - - - - - - - - - - - - - - - - - - - - - - ExampleOperation - - - - - - - - - - - - - ExampleCapability - - - - - - - - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - - ExampleBasicEvent - - - - - - - - - - - - - - - - - - ExampleProperty - - - - - - - - - - - - - - - - ExampleMultiLanguageProperty - - - - - - - - - - - - - - - - - - - ExampleRange - - - - - - - - - - - - - true - - - - false - - - - - - ExampleSubmodelCollectionOrdered - - - - - - - - - - - - - - - - - ExampleBlob - - - - - - - application/pdf - - - - null - - - - - - - - - - - - ExampleFile - - - - - - - application/pdf - - - - - - - - - - - - - - - ExampleReferenceElement - - - - - - - - - - false - - - - false - - - - - - ExampleSubmodelCollectionUnordered - - - - - - - - - - - false - - - - false - - - - - - ExampleSubmodelCollectionUnordered2 - - - - - - - - - - - IRI - - - - https://acplt.org/Test_Submodel_Mandatory - - - - - - - - - - - - - - - - - - - - - IRI - - - - https://acplt.org/Test_Submodel2_Mandatory - - - - - - - - - - - - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleRelationshipElement - - - - ExampleRelationshipElement - - - - Parameter - - - - - - Example RelationshipElement object - - - Beispiel RelationshipElement Element - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement - - - - ExampleAnnotatedRelationshipElement - - - - Parameter - - - - - - Example AnnotatedRelationshipElement object - - - Beispiel AnnotatedRelationshipElement Element - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - - - - - - - - - - - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Operations/ExampleOperation - - - - ExampleOperation - - - - Parameter - - - - - - Example Operation object - - - Beispiel Operation Element - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Capabilities/ExampleCapability - - - - ExampleCapability - - - - Parameter - - - - - - Example Capability object - - - Beispiel Capability Element - - - - - - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Events/ExampleBasicEvent - - - - ExampleBasicEvent - - - - Parameter - - - - - - Example BasicEvent object - - - Beispiel BasicEvent Element - - - - - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty - - - - ExampleProperty - - - - Constant - - - - - - Example Property object - - - Beispiel Property Element - - - - - - xs:string - - - - - - - - - - - exampleValue - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty - - - - ExampleMultiLanguageProperty - - - - Constant - - - - - - Example MultiLanguageProperty object - - - Beispiel MulitLanguageProperty Element - - - - - - - - - Example value of a MultiLanguageProperty element - - - Beispielswert für ein MulitLanguageProperty-Element - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Ranges/ExampleRange - - - - ExampleRange - - - - Parameter - - - - - - Example Range object - - - Beispiel Range Element - - - - 100 - - - - 0 - - - - - true - - - - false - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered - - - - ExampleSubmodelCollectionOrdered - - - - Parameter - - - - - - Example SubmodelElementCollectionOrdered object - - - Beispiel SubmodelElementCollectionOrdered Element - - - - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Blobs/ExampleBlob - - - - ExampleBlob - - - - Parameter - - - - - - Example Blob object - - - Beispiel Blob Element - - - - - application/pdf - - - - [1, 2, 3, 4, 5] - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Files/ExampleFile - - - - ExampleFile - - - - Parameter - - - - - - Example File object - - - Beispiel File Element - - - - - application/pdf - - - - /TestFile.pdf - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ReferenceElements/ExampleReferenceElement - - - - ExampleReferenceElement - - - - Parameter - - - - - - Example Reference Element object - - - Beispiel Reference Element Element - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - false - - - - false - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered - - - - ExampleSubmodelCollectionUnordered - - - - Parameter - - - - - - Example SubmodelElementCollectionUnordered object - - - Beispiel SubmodelElementCollectionUnordered Element - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelTemplates/ExampleSubmodel - - - - - - IRI - - - - https://acplt.org/Test_Submodel_Missing - - - - - - - 0.9 - - - - 0 - - - - - TestSubmodel - - - - - - - An example submodel for the test application - - - Ein Beispiel-Teilmodell für eine Test-Anwendung - - - - - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleRelationshipElement - - - - ExampleRelationshipElement - - - - Parameter - - - - - - Example RelationshipElement object - - - Beispiel RelationshipElement Element - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement - - - - ExampleAnnotatedRelationshipElement - - - - Parameter - - - - - - Example AnnotatedRelationshipElement object - - - Beispiel AnnotatedRelationshipElement Element - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - - - - - - - - - - - - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Operations/ExampleOperation - - - - ExampleOperation - - - - Parameter - - - - - - Example Operation object - - - Beispiel Operation Element - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Capabilities/ExampleCapability - - - - ExampleCapability - - - - Parameter - - - - - - Example Capability object - - - Beispiel Capability Element - - - - - - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Events/ExampleBasicEvent - - - - ExampleBasicEvent - - - - Parameter - - - - - - Example BasicEvent object - - - Beispiel BasicEvent Element - - - - - - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty - - - - ExampleProperty - - - - Constant - - - - - - Example Property object - - - Beispiel Property Element - - - - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty - - - - ExampleMultiLanguageProperty - - - - Constant - - - - - - Example MultiLanguageProperty object - - - Beispiel MulitLanguageProperty Element - - - - - - - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Ranges/ExampleRange - - - - ExampleRange - - - - Parameter - - - - - - Example Range object - - - Beispiel Range Element - - - - 100 - - - - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Ranges/ExampleRange - - - - ExampleRange2 - - - - Parameter - - - - - - Example Range object - - - Beispiel Range Element - - - - - - - 0 - - - - - true - - - - false - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered - - - - ExampleSubmodelCollectionOrdered - - - - Parameter - - - - - - Example SubmodelElementCollectionOrdered object - - - Beispiel SubmodelElementCollectionOrdered Element - - - - - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Blobs/ExampleBlob - - - - ExampleBlob - - - - Parameter - - - - - - Example Blob object - - - Beispiel Blob Element - - - - - application/pdf - - - - null - - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Files/ExampleFile - - - - ExampleFile - - - - Parameter - - - - - - Example File object - - - Beispiel File Element - - - - - application/pdf - - - - - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ReferenceElements/ExampleReferenceElement - - - - ExampleReferenceElement - - - - Parameter - - - - - - Example Reference Element object - - - Beispiel Reference Element Element - - - - - - - - false - - - - false - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered - - - - ExampleSubmodelCollectionUnordered - - - - Parameter - - - - - - Example SubmodelElementCollectionUnordered object - - - Beispiel SubmodelElementCollectionUnordered Element - - - - - - - - - false - - - - false - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered - - - - ExampleSubmodelCollectionUnordered2 - - - - Parameter - - - - - - Example SubmodelElementCollectionUnordered object - - - Beispiel SubmodelElementCollectionUnordered Element - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelTemplates/ExampleSubmodel - - - - - - IRI - - - - https://acplt.org/Test_Submodel_Template - - - - - - - 0.9 - - - - 0 - - - - - TestSubmodel - - - - - - - An example submodel for the test application - - - Ein Beispiel-Teilmodell für eine Test-Anwendung - - - - - - - - IRI - - - - https://acplt.org/Test_AssetAdministrationShell2_Mandatory - - - - - - - - - - - - - - - - - - - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId - - - - - (GLOBAL_REFERENCE)[IRI]0173-1#02-AAO677#002 - - - - ManufacturerName - - - - - - - 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. - - - 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 - - - - - - xs:int - - - - 100 - - - - - - - - - - xs:int - - - - 50 - - - - - - - - ACPLT - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId - - - - - (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber - - - - InstanceId - - - - - - - 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. - - - 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 - - - - 978-8234-234-342 - - - - - - (SUBMODEL)[IRI]http://acplt.org/SubmodelTemplates/AssetIdentification - - - - - - IRI - - - - http://acplt.org/Submodels/Assets/TestAsset/Identification - - - - - - - 0.9 - - - - 0 - - - - - Identification - - - - - - - An example asset identification submodel for the test application - - - Ein Beispiel-Identifikations-Submodel für eine Test-Anwendung - - - - - - - - - - - - - - - CO_MANAGED_ENTITY - - - - - (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber - - - - ExampleEntity - - - - - - - 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. - - - 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 - - - - - - - - - SELF_MANAGED_ENTITY - - - - - (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber - - - - ExampleEntity2 - - - - - - - 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. - - - 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 - - - - - - (SUBMODEL)[IRI]http://acplt.org/SubmodelTemplates/BillOfMaterial - - - - - - IRI - - - - http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial - - - - - - - 0.9 - - - - - - - - BillOfMaterial - - - - - - - An example bill of material submodel for the test application - - - Ein Beispiel-BillofMaterial-Submodel für eine Test-Anwendung - - - - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleRelationshipElement - - - - ExampleRelationshipElement - - - - Parameter - - - - - - Example RelationshipElement object - - - Beispiel RelationshipElement Element - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - (PROPERTY)[ID_SHORT]ExampleProperty2 - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement - - - - ExampleAnnotatedRelationshipElement - - - - Parameter - - - - - - Example AnnotatedRelationshipElement object - - - Beispiel AnnotatedRelationshipElement Element - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - (PROPERTY)[ID_SHORT]ExampleProperty2 - - - - - - - - - - - - - - - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Operations/ExampleOperation - - - - ExampleOperation - - - - Parameter - - - - - - Example Operation object - - - Beispiel Operation Element - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Capabilities/ExampleCapability - - - - ExampleCapability - - - - Parameter - - - - - - Example Capability object - - - Beispiel Capability Element - - - - - - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Events/ExampleBasicEvent - - - - ExampleBasicEvent - - - - Parameter - - - - - - Example BasicEvent object - - - Beispiel BasicEvent Element - - - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty - - - - ExampleProperty - - - - Constant - - - - - - Example Property object - - - Beispiel Property Element - - - - exampleValue - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty - - - - ExampleMultiLanguageProperty - - - - Constant - - - - - - Example MultiLanguageProperty object - - - Beispiel MulitLanguageProperty Element - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleMultiLanguageValueId - - - - - - Example value of a MultiLanguageProperty element - - - Beispielswert für ein MulitLanguageProperty-Element - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Ranges/ExampleRange - - - - ExampleRange - - - - Parameter - - - - - - Example Range object - - - Beispiel Range Element - - - - 100 - - - - 0 - - - - - true - - - - false - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered - - - - ExampleSubmodelCollectionOrdered - - - - Parameter - - - - - - Example SubmodelElementCollectionOrdered object - - - Beispiel SubmodelElementCollectionOrdered Element - - - - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Blobs/ExampleBlob - - - - ExampleBlob - - - - Parameter - - - - - - Example Blob object - - - Beispiel Blob Element - - - - - application/pdf - - - - [1, 2, 3, 4, 5] - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Files/ExampleFile - - - - ExampleFile - - - - Parameter - - - - - - Example File object - - - Beispiel File Element - - - - - application/pdf - - - - /TestFile.pdf - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ReferenceElements/ExampleReferenceElement - - - - ExampleReferenceElement - - - - Parameter - - - - - - Example Reference Element object - - - Beispiel Reference Element Element - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - false - - - - false - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered - - - - ExampleSubmodelCollectionUnordered - - - - Parameter - - - - - - Example SubmodelElementCollectionUnordered object - - - Beispiel SubmodelElementCollectionUnordered Element - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelTemplates/ExampleSubmodel - - - - - - IRI - - - - https://acplt.org/Test_Submodel - - - - - - - 0.9 - - - - 0 - - - - - TestSubmodel - - - - - - - An example submodel for the test application - - - Ein Beispiel-Teilmodell für eine Test-Anwendung - - - - - - - - - - - - - - - ExampleRelationshipElement - - - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - - - - - - - ExampleAnnotatedRelationshipElement - - - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - - - - - - - - - - - - - - - - - - - - - - ExampleOperation - - - - - - - - - - - - - ExampleCapability - - - - - - - - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - - ExampleBasicEvent - - - - - - - - - - - - - - - - - - ExampleProperty - - - - - - - - - - - - - - - - ExampleMultiLanguageProperty - - - - - - - - - - - - - - - - - - - ExampleRange - - - - - - - - - - - - - true - - - - false - - - - - - ExampleSubmodelCollectionOrdered - - - - - - - - - - - - - - - - - ExampleBlob - - - - - - - application/pdf - - - - null - - - - - - - - - - - - ExampleFile - - - - - - - application/pdf - - - - - - - - - - - - - - - ExampleReferenceElement - - - - - - - - - - false - - - - false - - - - - - ExampleSubmodelCollectionUnordered - - - - - - - - - - - false - - - - false - - - - - - ExampleSubmodelCollectionUnordered2 - - - - - - - - - - - IRI - - - - https://acplt.org/Test_Submodel_Mandatory - - - - - - - - - - - - - - - - - - - - - IRI - - - - https://acplt.org/Test_Submodel2_Mandatory - - - - - - - - - - - - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleRelationshipElement - - - - ExampleRelationshipElement - - - - Parameter - - - - - - Example RelationshipElement object - - - Beispiel RelationshipElement Element - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement - - - - ExampleAnnotatedRelationshipElement - - - - Parameter - - - - - - Example AnnotatedRelationshipElement object - - - Beispiel AnnotatedRelationshipElement Element - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - - - - - - - - - - - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Operations/ExampleOperation - - - - ExampleOperation - - - - Parameter - - - - - - Example Operation object - - - Beispiel Operation Element - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Capabilities/ExampleCapability - - - - ExampleCapability - - - - Parameter - - - - - - Example Capability object - - - Beispiel Capability Element - - - - - - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Events/ExampleBasicEvent - - - - ExampleBasicEvent - - - - Parameter - - - - - - Example BasicEvent object - - - Beispiel BasicEvent Element - - - - - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty - - - - ExampleProperty - - - - Constant - - - - - - Example Property object - - - Beispiel Property Element - - - - - - xs:string - - - - - - - - - - - exampleValue - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty - - - - ExampleMultiLanguageProperty - - - - Constant - - - - - - Example MultiLanguageProperty object - - - Beispiel MulitLanguageProperty Element - - - - - - - - - Example value of a MultiLanguageProperty element - - - Beispielswert für ein MulitLanguageProperty-Element - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Ranges/ExampleRange - - - - ExampleRange - - - - Parameter - - - - - - Example Range object - - - Beispiel Range Element - - - - 100 - - - - 0 - - - - - true - - - - false - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered - - - - ExampleSubmodelCollectionOrdered - - - - Parameter - - - - - - Example SubmodelElementCollectionOrdered object - - - Beispiel SubmodelElementCollectionOrdered Element - - - - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Blobs/ExampleBlob - - - - ExampleBlob - - - - Parameter - - - - - - Example Blob object - - - Beispiel Blob Element - - - - - application/pdf - - - - [1, 2, 3, 4, 5] - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Files/ExampleFile - - - - ExampleFile - - - - Parameter - - - - - - Example File object - - - Beispiel File Element - - - - - application/pdf - - - - /TestFile.pdf - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ReferenceElements/ExampleReferenceElement - - - - ExampleReferenceElement - - - - Parameter - - - - - - Example Reference Element object - - - Beispiel Reference Element Element - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - false - - - - false - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered - - - - ExampleSubmodelCollectionUnordered - - - - Parameter - - - - - - Example SubmodelElementCollectionUnordered object - - - Beispiel SubmodelElementCollectionUnordered Element - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelTemplates/ExampleSubmodel - - - - - - IRI - - - - https://acplt.org/Test_Submodel_Missing - - - - - - - 0.9 - - - - 0 - - - - - TestSubmodel - - - - - - - An example submodel for the test application - - - Ein Beispiel-Teilmodell für eine Test-Anwendung - - - - - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleRelationshipElement - - - - ExampleRelationshipElement - - - - Parameter - - - - - - Example RelationshipElement object - - - Beispiel RelationshipElement Element - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement - - - - ExampleAnnotatedRelationshipElement - - - - Parameter - - - - - - Example AnnotatedRelationshipElement object - - - Beispiel AnnotatedRelationshipElement Element - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - - - - - - - - - - - - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Operations/ExampleOperation - - - - ExampleOperation - - - - Parameter - - - - - - Example Operation object - - - Beispiel Operation Element - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Capabilities/ExampleCapability - - - - ExampleCapability - - - - Parameter - - - - - - Example Capability object - - - Beispiel Capability Element - - - - - - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Events/ExampleBasicEvent - - - - ExampleBasicEvent - - - - Parameter - - - - - - Example BasicEvent object - - - Beispiel BasicEvent Element - - - - - - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty - - - - ExampleProperty - - - - Constant - - - - - - Example Property object - - - Beispiel Property Element - - - - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty - - - - ExampleMultiLanguageProperty - - - - Constant - - - - - - Example MultiLanguageProperty object - - - Beispiel MulitLanguageProperty Element - - - - - - - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Ranges/ExampleRange - - - - ExampleRange - - - - Parameter - - - - - - Example Range object - - - Beispiel Range Element - - - - 100 - - - - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Ranges/ExampleRange - - - - ExampleRange2 - - - - Parameter - - - - - - Example Range object - - - Beispiel Range Element - - - - - - - 0 - - - - - true - - - - false - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered - - - - ExampleSubmodelCollectionOrdered - - - - Parameter - - - - - - Example SubmodelElementCollectionOrdered object - - - Beispiel SubmodelElementCollectionOrdered Element - - - - - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Blobs/ExampleBlob - - - - ExampleBlob - - - - Parameter - - - - - - Example Blob object - - - Beispiel Blob Element - - - - - application/pdf - - - - null - - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Files/ExampleFile - - - - ExampleFile - - - - Parameter - - - - - - Example File object - - - Beispiel File Element - - - - - application/pdf - - - - - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ReferenceElements/ExampleReferenceElement - - - - ExampleReferenceElement - - - - Parameter - - - - - - Example Reference Element object - - - Beispiel Reference Element Element - - - - - - - - false - - - - false - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered - - - - ExampleSubmodelCollectionUnordered - - - - Parameter - - - - - - Example SubmodelElementCollectionUnordered object - - - Beispiel SubmodelElementCollectionUnordered Element - - - - - - - - - false - - - - false - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered - - - - ExampleSubmodelCollectionUnordered2 - - - - Parameter - - - - - - Example SubmodelElementCollectionUnordered object - - - Beispiel SubmodelElementCollectionUnordered Element - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelTemplates/ExampleSubmodel - - - - - - IRI - - - - https://acplt.org/Test_Submodel_Template - - - - - - - 0.9 - - - - 0 - - - - - TestSubmodel - - - - - - - An example submodel for the test application - - - Ein Beispiel-Teilmodell für eine Test-Anwendung - - - - - - - - IRI - - - - https://acplt.org/Test_AssetAdministrationShell_Missing - - - - - - - 0.9 - - - - 0 - - - - - TestAssetAdministrationShell - - - - - - - An Example Asset Administration Shell for the test application - - - Ein Beispiel-Verwaltungsschale für eine Test-Anwendung - - - - - - (SUBMODEL)[IRI]https://acplt.org/Test_Submodel_Missing - - - - - - From 484907a6ad724aa748c82ee00237e759afeb7c0a Mon Sep 17 00:00:00 2001 From: David T Date: Tue, 20 Jul 2021 12:17:23 +0200 Subject: [PATCH 05/18] Set identification for name and idShort if idShort is not given. Only serialize if kind != template --- .../AssetAdministrationShellMapper.java | 22 +++++++++++++------ .../mapper/mapper/SubmodelMapper.java | 20 +++++++++++++++++ 2 files changed, 35 insertions(+), 7 deletions(-) diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/AssetAdministrationShellMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/AssetAdministrationShellMapper.java index 805bc599..52c72aa0 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/AssetAdministrationShellMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/AssetAdministrationShellMapper.java @@ -15,18 +15,15 @@ */ package io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper; -import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; -import io.adminshell.aas.v3.dataformat.aml.model.caex.AssetAdministrationShellRoleClassLib; -import io.adminshell.aas.v3.dataformat.aml.model.caex.Attribute; -import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElement; -import io.adminshell.aas.v3.dataformat.aml.model.caex.RefSemantic; -import io.adminshell.aas.v3.dataformat.aml.model.caex.RoleRequirements; +import io.adminshell.aas.v3.dataformat.aml.model.caex.*; import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.util.ReferenceConverterUtil; -import io.adminshell.aas.v3.model.*; +import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.util.UrlEncoderUtil; +import io.adminshell.aas.v3.model.AssetAdministrationShell; import ma.glasnost.orika.CustomMapper; import ma.glasnost.orika.MappingContext; import java.util.ArrayList; +import java.util.Objects; public class AssetAdministrationShellMapper extends CustomMapper { @@ -34,6 +31,17 @@ public class AssetAdministrationShellMapper extends CustomMapper attribute.getName().equals("idShort")).findAny().get().setValue(idShort); + } + // AssetInformation Attribute assetInformation = new Attribute( "assetInformation", diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/SubmodelMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/SubmodelMapper.java index 902a59c2..77216465 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/SubmodelMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/SubmodelMapper.java @@ -19,15 +19,35 @@ import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElement; import io.adminshell.aas.v3.dataformat.aml.model.caex.RoleRequirements; import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.util.QualifierConverterUtil; +import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.util.UrlEncoderUtil; +import io.adminshell.aas.v3.model.ModelingKind; import io.adminshell.aas.v3.model.Submodel; import ma.glasnost.orika.CustomMapper; import ma.glasnost.orika.MappingContext; +import java.util.Objects; + public class SubmodelMapper extends CustomMapper { @Override public void mapAtoB(Submodel submodel, InternalElement internalElement, MappingContext context) { + if(submodel.getKind() == ModelingKind.TEMPLATE) { + return; + } + internalElement.setRoleRequirements(new RoleRequirements(AssetAdministrationShellRoleClassLib.Submodel.getRefBaseRoleClassPath())); + + // Set name and idShort by identification if idShort is not given + if (submodel.getIdShort().equals("") || submodel.getIdShort() == null) { + String idShort = UrlEncoderUtil.encode(submodel.getIdentification().getIdentifier()); + // Set AssetAdministrationShell name + internalElement.setName(idShort); + // Set idShort + internalElement.getAttributes().stream() + .filter(Objects::nonNull) + .filter(attribute -> attribute.getName().equals("idShort")).findAny().get().setValue(idShort); + } + QualifierConverterUtil.createQualifierAttributesForSubmodel(submodel, internalElement); } } From 35712cf650a711ce0ad10403c7ab2bef186479cd Mon Sep 17 00:00:00 2001 From: David T Date: Tue, 20 Jul 2021 14:13:56 +0200 Subject: [PATCH 06/18] Add class libs to automl output --- .../aas/v3/dataformat/aml/AmlSerializer.java | 214 +- .../aml/model/caex/CAEXConstants.java | 2 + .../dataformat/aml/model/caex/CAEXFile.java | 35 + .../dataformat/aml/model/mixin/CAEXMixin.java | 39 + .../resources/automation-ml-class-libs.txt | 2249 ----------------- .../resources/interface-class-lib_aas.automl | 34 + .../interface-class-lib_automl_bpr.automl | 14 + ...nterface-class-lib_automl_interface.automl | 93 + .../main/resources/role-class-lib_aas.automl | 1811 +++++++++++++ .../role-class-lib_automl_base.automl | 80 + .../role-class-lib_automl_bpr.automl | 7 + .../system-unit-class-lib_aas.automl | 4 + ...ib_aas_data_specification_templates.automl | 206 ++ .../dataformat/aml/fixtures/FullExample.java | 26 +- 14 files changed, 2405 insertions(+), 2409 deletions(-) delete mode 100644 dataformat-aml/src/main/resources/automation-ml-class-libs.txt create mode 100644 dataformat-aml/src/main/resources/interface-class-lib_aas.automl create mode 100644 dataformat-aml/src/main/resources/interface-class-lib_automl_bpr.automl create mode 100644 dataformat-aml/src/main/resources/interface-class-lib_automl_interface.automl create mode 100644 dataformat-aml/src/main/resources/role-class-lib_aas.automl create mode 100644 dataformat-aml/src/main/resources/role-class-lib_automl_base.automl create mode 100644 dataformat-aml/src/main/resources/role-class-lib_automl_bpr.automl create mode 100644 dataformat-aml/src/main/resources/system-unit-class-lib_aas.automl create mode 100644 dataformat-aml/src/main/resources/system-unit-class-lib_aas_data_specification_templates.automl diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlSerializer.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlSerializer.java index 62ae874c..650c5bf1 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlSerializer.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlSerializer.java @@ -20,108 +20,89 @@ import com.fasterxml.jackson.dataformat.xml.XmlMapper; import io.adminshell.aas.v3.dataformat.SerializationException; import io.adminshell.aas.v3.dataformat.Serializer; -import io.adminshell.aas.v3.dataformat.aml.model.caex.AdditionalInformation; -import io.adminshell.aas.v3.dataformat.aml.model.caex.Attribute; -import io.adminshell.aas.v3.dataformat.aml.model.caex.CAEXConstants; -import io.adminshell.aas.v3.dataformat.aml.model.caex.CAEXFile; -import io.adminshell.aas.v3.dataformat.aml.model.caex.ExternalInterface; -import io.adminshell.aas.v3.dataformat.aml.model.caex.InstanceHierarchy; -import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElement; -import io.adminshell.aas.v3.dataformat.aml.model.caex.RefSemantic; -import io.adminshell.aas.v3.dataformat.aml.model.caex.RoleRequirements; -import io.adminshell.aas.v3.dataformat.aml.model.mixin.AdditionalInformationMixin; -import io.adminshell.aas.v3.dataformat.aml.model.mixin.AttributeMixin; -import io.adminshell.aas.v3.dataformat.aml.model.mixin.CAEXMixin; -import io.adminshell.aas.v3.dataformat.aml.model.mixin.ExternalInterfaceMixin; -import io.adminshell.aas.v3.dataformat.aml.model.mixin.InstanceHierarchyMixin; -import io.adminshell.aas.v3.dataformat.aml.model.mixin.InternalElementMixin; -import io.adminshell.aas.v3.dataformat.aml.model.mixin.RefSemanticMixin; -import io.adminshell.aas.v3.dataformat.aml.model.mixin.RoleRequirementsMixin; +import io.adminshell.aas.v3.dataformat.aml.model.caex.*; +import io.adminshell.aas.v3.dataformat.aml.model.mixin.*; import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.AASEnvironmentMapper; import io.adminshell.aas.v3.model.AssetAdministrationShell; import io.adminshell.aas.v3.model.AssetAdministrationShellEnvironment; -import io.adminshell.aas.v3.model.AssetInformation; import io.adminshell.aas.v3.model.Submodel; -import io.adminshell.aas.v3.model.SubmodelElementCollection; +import ma.glasnost.orika.MapperFacade; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import java.io.File; import java.io.IOException; import java.nio.file.Files; import java.util.ArrayList; import java.util.List; -import java.util.function.BiConsumer; -import java.util.logging.Level; -import ma.glasnost.orika.MapperFacade; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; public class AmlSerializer implements Serializer { private static final Logger log = LoggerFactory.getLogger(AmlSerializer.class); - private final MapperFacade mapper = new AASEnvironmentMapper(); - - private boolean enableClassLibs = false; - - public AmlSerializer() { - } - public AmlSerializer(boolean enableClassLibs) { - this.enableClassLibs = enableClassLibs; - } + private final MapperFacade mapper = new AASEnvironmentMapper(); @Override public String write(AssetAdministrationShellEnvironment aasEnvironment) throws SerializationException { try { CAEXFile caexFile = modelTransformation(aasEnvironment); String xml = convertXml(caexFile); - String cleanUp = cleanUpXml(xml); - String result = cleanUp; - if (enableClassLibs) { - result = addClassLibs(cleanUp); - } + String result = cleanUpXml(xml); return result; } catch (JsonProcessingException ex) { throw new SerializationException("error serializing AssetAdministrationShellEnvironment", ex); } } - private String addClassLibs(String xml) { - StringBuilder output = new StringBuilder(xml); - // Read class lib file - String path = "automation-ml-class-libs.txt"; - ClassLoader classLoader = getClass().getClassLoader(); - File file = new File(classLoader.getResource(path).getFile()); - String content = null; - try { - content = new String(Files.readAllBytes(file.toPath())); - } catch (IOException e) { - e.printStackTrace(); - } - // Delete CAEX closing tag - if (output.length() > 0) { - int last, prev = output.length() - 1; - while ((last = output.lastIndexOf("\n", prev)) == prev) { - prev = last - 1; - } - if (last >= 0) { - output.delete(last, output.length()); - } - } - // Add class libs to xml - if (content != null) { - output.append(content); - } - // Add new CAEX closing tag - output.append(""); - return output.toString(); - } + private CAEXFile modelTransformation(AssetAdministrationShellEnvironment environment) { + // Map environment to CAEX file + CAEXFile caexFile = mapper.map(environment, CAEXFile.class); + caexFile.setSchemaVersion(CAEXConstants.SCHEMA_VERSION); + caexFile.setXmlns(CAEXConstants.XMLNS); + caexFile.setXsi(CAEXConstants.XSI); - private String cleanUpXml(String xml) { - String withoutEmptyAttributes = xml.replaceAll("", ""); - String withoutEmptyLines = withoutEmptyAttributes.replaceAll("(?m)^[ \t]*\r?\n", ""); - return withoutEmptyLines; + // Add additional information to CAEX + AdditionalInformation additionalInformation = new AdditionalInformation(); + additionalInformation.setAutomationMLVersion(CAEXConstants.AUTOMATION_ML_VERSION); + caexFile.setAdditionalInformation(additionalInformation); + + // Add AssetAdministrationShell instance hierarchy to CAEX + InstanceHierarchy instanceHierarchy = new InstanceHierarchy(); + instanceHierarchy.setName(CAEXConstants.AAS_INSTANCE_HIERARCHY); + instanceHierarchy.setVersion(CAEXConstants.AAS_INSTANCE_HIERARCHY_VERSION); + caexFile.setInstanceHierarchy(instanceHierarchy); + + // Map all asset administration shells to internal elements + List administrationShells = new ArrayList<>(environment.getAssetAdministrationShells()); + List shellInternalElements = mapper.mapAsList(administrationShells, InternalElement.class); + instanceHierarchy.setInternalElements(shellInternalElements); + + // Map all submodels to internal elements + List submodels = new ArrayList<>(environment.getSubmodels()); + List submodelInternalElements = mapper.mapAsList(submodels, InternalElement.class); + instanceHierarchy.getInternalElements().addAll(submodelInternalElements); + + return caexFile; } private String convertXml(CAEXFile caexFile) throws JsonProcessingException { + caexFile.setInterfaceClassLibs(new ArrayList<>(){{ + add(readClassLib("interface-class-lib_aas.automl")); + add(readClassLib("interface-class-lib_automl_interface.automl")); + add(readClassLib("interface-class-lib_automl_bpr.automl")); + }}); + + caexFile.setRoleClassLibs(new ArrayList<>(){{ + add(readClassLib("role-class-lib_aas.automl")); + add(readClassLib("role-class-lib_automl_base.automl")); + add(readClassLib("role-class-lib_automl_bpr.automl")); + }}); + + caexFile.setSystemUnitClassLibs(new ArrayList<>(){{ + add(readClassLib("system-unit-class-lib_aas.automl")); + add(readClassLib("system-unit-class-lib_aas_data_specification_templates.automl")); + }}); + XmlMapper xmlMapper = XmlMapper.builder() .disable(SerializationFeature.FAIL_ON_EMPTY_BEANS) .enable(SerializationFeature.INDENT_OUTPUT) @@ -138,82 +119,21 @@ private String convertXml(CAEXFile caexFile) throws JsonProcessingException { return xmlMapper.writeValueAsString(caexFile); } - private CAEXFile modelTransformation(AssetAdministrationShellEnvironment environment) { - CAEXFile caexFile = mapper.map(environment, CAEXFile.class); - caexFile.setSchemaVersion(CAEXConstants.SCHEMA_VERSION); - caexFile.setXmlns(CAEXConstants.XMLNS); - caexFile.setXsi(CAEXConstants.XSI); - // Add additional information to CAEX - AdditionalInformation additionalInformation = new AdditionalInformation(); - additionalInformation.setAutomationMLVersion(CAEXConstants.AUTOMATION_ML_VERSION); - caexFile.setAdditionalInformation(additionalInformation); - // Add instance hierarchy to CAEX - InstanceHierarchy instanceHierarchy = new InstanceHierarchy(); - instanceHierarchy.setName("AssetAdministrationShellInstanceHierarchy"); - instanceHierarchy.setVersion("0"); - caexFile.setInstanceHierarchy(instanceHierarchy); - // Map all asset administration shells to internal elements - List administrationShells = new ArrayList<>(environment.getAssetAdministrationShells()); - List shellInternalElements = mapper.mapAsList(administrationShells, InternalElement.class); - // Inside shell loop - forEachWithCounter(administrationShells, (i, administrationShell) -> { - // Map asset info to internal element -// AssetInformation asset = administrationShell.getAssetInformation(); -// InternalElement assetInternalElement = mapper.map(asset, InternalElement.class); -// shellInternalElements.get(i).setInternalElements(new ArrayList<>() { -// { -// add(assetInternalElement); -// } -// }); - -// // Map view -// List viewInternalElements = mapper.mapAsList(administrationShell.getViews(), InternalElement.class); -// shellInternalElements.addAll(viewInternalElements); - -// // Map all submodels to internal elements -// forEachWithCounter(administrationShell.getSubmodels(), (j, submodel) -> { -// InternalElement submodelInternalElement = mapper.map(submodel, InternalElement.class); -// shellInternalElements.get(i).getInternalElements().add(submodelInternalElement); -// }); - }); - // Inside environment loop - shellInternalElements.forEach(shellInternalElement -> { - // Map all submodels to internal elements - List submodels = new ArrayList<>(environment.getSubmodels()); - submodels.forEach(submodel -> { - InternalElement submodelInternalElement = mapper.map(submodel, InternalElement.class); - submodelInternalElement.setInternalElements(new ArrayList<>()); - // Map all submodel elements - submodel.getSubmodelElements().forEach(submodelElement -> { - // Submodels that are not SubmodelElementCollections - if (!(submodelElement instanceof SubmodelElementCollection)) { - InternalElement internalElement = mapper.map(submodelElement, InternalElement.class); - submodelInternalElement.getInternalElements().add(internalElement); - } - // SubmodelElementCollection - if (submodelElement instanceof SubmodelElementCollection) { - InternalElement submodelElementInternalElement = mapper.map(submodelElement, InternalElement.class); - submodelElementInternalElement.setInternalElements(new ArrayList<>()); - ((SubmodelElementCollection) submodelElement).getValues().forEach(value -> { - InternalElement submodelElementCollectionInternalElement = mapper.map(value, InternalElement.class); - submodelElementInternalElement.getInternalElements().add(submodelElementCollectionInternalElement); - }); - submodelInternalElement.getInternalElements().add(submodelElementInternalElement); - } - }); - shellInternalElement.getInternalElements().add(submodelInternalElement); - }); - }); - instanceHierarchy.setInternalElements(shellInternalElements); - return caexFile; - } - - private static void forEachWithCounter(Iterable source, BiConsumer consumer) { - int i = 0; - for (T item : source) { - consumer.accept(i, item); - i++; + private String readClassLib(String fileName) { + ClassLoader classLoader = getClass().getClassLoader(); + File file = new File(classLoader.getResource(fileName).getFile()); + String content = null; + try { + content = new String(Files.readAllBytes(file.toPath())); + } catch (IOException e) { + e.printStackTrace(); } + return content; } + private String cleanUpXml(String xml) { + String withoutEmptyAttributes = xml.replaceAll("", ""); + String withoutEmptyLines = withoutEmptyAttributes.replaceAll("(?m)^[ \t]*\r?\n", ""); + return withoutEmptyLines; + } } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/CAEXConstants.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/CAEXConstants.java index 8a9ac8b2..ad8d421f 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/CAEXConstants.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/CAEXConstants.java @@ -20,4 +20,6 @@ public class CAEXConstants { public final static String XMLNS = "http://www.w3.org/2001/XMLSchema-instance"; public final static String XSI = "CAEX_ClassModel_V2.15.xsd"; public final static String AUTOMATION_ML_VERSION = "2.0"; + public final static String AAS_INSTANCE_HIERARCHY = "AssetAdministrationShellInstanceHierarchy"; + public final static String AAS_INSTANCE_HIERARCHY_VERSION = "0"; } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/CAEXFile.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/CAEXFile.java index 115deb6a..e07d08b4 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/CAEXFile.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/CAEXFile.java @@ -15,6 +15,11 @@ */ package io.adminshell.aas.v3.dataformat.aml.model.caex; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; + +import java.util.List; + public class CAEXFile { public CAEXFile() { @@ -40,6 +45,12 @@ public CAEXFile(String xmlns, String xsi, String schemaVersion, AdditionalInform private InstanceHierarchy instanceHierarchy; + private List interfaceClassLibs; + + private List roleClassLibs; + + private List systemUnitClassLibs; + public String getXmlns() { return xmlns; } @@ -79,4 +90,28 @@ public InstanceHierarchy getInstanceHierarchy() { public void setInstanceHierarchy(InstanceHierarchy instanceHierarchy) { this.instanceHierarchy = instanceHierarchy; } + + public List getInterfaceClassLibs() { + return interfaceClassLibs; + } + + public void setInterfaceClassLibs(List interfaceClassLibs) { + this.interfaceClassLibs = interfaceClassLibs; + } + + public List getRoleClassLibs() { + return roleClassLibs; + } + + public void setRoleClassLibs(List roleClassLibs) { + this.roleClassLibs = roleClassLibs; + } + + public List getSystemUnitClassLibs() { + return systemUnitClassLibs; + } + + public void setSystemUnitClassLibs(List systemUnitClassLibs) { + this.systemUnitClassLibs = systemUnitClassLibs; + } } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/CAEXMixin.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/CAEXMixin.java index 7269167f..395e620d 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/CAEXMixin.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/CAEXMixin.java @@ -15,8 +15,11 @@ */ package io.adminshell.aas.v3.dataformat.aml.model.mixin; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import java.util.List; + public class CAEXMixin { public CAEXMixin(String xmlns, String xsi, String fileName, String schemaVersion, AdditionalInformationMixin additionalInformation, InstanceHierarchyMixin instanceHierarchy) { @@ -49,6 +52,18 @@ public CAEXMixin() { @JacksonXmlProperty(localName = "InstanceHierarchy") private InstanceHierarchyMixin instanceHierarchy; + @JacksonXmlProperty(localName = "InterfaceClassLib") + @JacksonXmlElementWrapper(useWrapping = false) + private List interfaceClassLibs; + + @JacksonXmlProperty(localName = "RoleClassLib") + @JacksonXmlElementWrapper(useWrapping = false) + private List roleClassLibs; + + @JacksonXmlProperty(localName = "SystemUnitClassLib") + @JacksonXmlElementWrapper(useWrapping = false) + private List systemUnitClassLibs; + public String getXmlns() { return xmlns; } @@ -96,4 +111,28 @@ public InstanceHierarchyMixin getInstanceHierarchy() { public void setInstanceHierarchy(InstanceHierarchyMixin instanceHierarchy) { this.instanceHierarchy = instanceHierarchy; } + + public List getInterfaceClassLibs() { + return interfaceClassLibs; + } + + public void setInterfaceClassLibs(List interfaceClassLibs) { + this.interfaceClassLibs = interfaceClassLibs; + } + + public List getRoleClassLibs() { + return roleClassLibs; + } + + public void setRoleClassLibs(List roleClassLibs) { + this.roleClassLibs = roleClassLibs; + } + + public List getSystemUnitClassLibs() { + return systemUnitClassLibs; + } + + public void setSystemUnitClassLibs(List systemUnitClassLibs) { + this.systemUnitClassLibs = systemUnitClassLibs; + } } diff --git a/dataformat-aml/src/main/resources/automation-ml-class-libs.txt b/dataformat-aml/src/main/resources/automation-ml-class-libs.txt deleted file mode 100644 index 673c2797..00000000 --- a/dataformat-aml/src/main/resources/automation-ml-class-libs.txt +++ /dev/null @@ -1,2249 +0,0 @@ - - Interface Class Library according to Details of the Asset Administration Shell V2.0. - 1.0.0 - - A FileDataReference represents the address to a File. FileDataReference is derived from the - AutomationML Interface Class ExternalDataReference that is defined in AutomationML - BPR_005E_ExternalDataReference_v1.0.0_2:The interface class “ExternalDataReference” shall be used in order - to reference external documents out of the scope of AutomationML. - - - - Reference to any other referable element of the same of any other AAS or a reference to an external - object or entity. For local references inside the same Asset Administration Shell an InternalLink between - two objects with this interface "ReferableReference" shall be set. In this case the attribute value has to - be empty. For references between different Asset Administration Shells or external objects or entities the - attribute value shall be used and no InternalLink shall be set. - - - Reference to any other referable element of any other AAS or a reference to an external object - or entity. Note: For references to any other referable element of the same AAS InternalLinks are used - and this attribute value shall be empty. - - - - - - -1.0.0 - - - Mime type of the content of the File. - - - - -Standard Automation Markup Language Interface Class Library - Part 1 Content extended with Part 3 and Part - 4 Content - -2.2.2 - - - - - - - - - - The attribute refURI is an IRI that can represent an absolute or relative path to an L - document. An added fragment (with #) references inside the document - - - - - - - - - - - - - - - - - - true - - - - - - - - - - - - -Role Class Library according to Details of the Asset Administration Shell V2.0. -1.0.0 - - An Asset Administration Shell. - - Identifying string of the element within its name space. Constraint AASd-001: In case of a - referable element not being an identifiable element this id is mandatory and used for referring to the - element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore - ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. - Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used - for unique reference in its name space and thus allows better usability and a more performant - implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - - 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. - - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - - - - - - Abstract attribute class for identification. Has the subattributes id and idType. - - - Identifier of the element. Its type is defined in idType. Id is a subproperty of - identification. - - - - - - Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the - enumeration “IdentifierType”. IdType is a subproperty of identification. - - - - - - - Abstract attribute for administration. Has the subattributes revision and version. - - - Revision of the element. Constraint AASd-005: A revision requires a version. This means, if - there is no version there is no revision neither. Revision is a subproperty of administration. - - - - - - Version of the element. Version is a subproperty of administration. - - - - - - Global reference to the data specification template used by the element. - - - - - The derivedFrom attribute is used to establish a relationship between two Asset Administration - Shells that are derived from each other. - - - - - - - An Asset describes meta data of an asset that is represented by an AAS. The asset may either represent - an asset type or an asset instance. The asset has a globally unique identifier plus – if needed – additional - domain specific (proprietary) identifiers. - - - Identifying string of the element within its name space. Constraint AASd-001: In case of a - referable element not being an identifiable element this id is mandatory and used for referring to the - element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore - ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. - Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used - for unique reference in its name space and thus allows better usability and a more performant - implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - - 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. - - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - Abstract attribute class for identification. Has the subattributes id and idType. - - - Identifier of the element. Its type is defined in idType. - - - - - Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the - enumeration “IdentifierType”. IdType is a subproperty of identification. - - - - - - - Abstract attribute for administration. Has the subattributes revision and version. - - - Revision of the element. Constraint AASd-005: A revision requires a version. This means, if - there is no version there is no revision neither. Revision is a subproperty of administration. - - - - - - Version of the element. Version is a subproperty of administration. - - - - - - Global reference to the data specification template used by the element. - - - - - Kind of the element: either type or instance. - Instance - Instance - - - - Instance - Type - - - - - - A Submodel defines a specific aspect of the asset represented by the AAS. A submodel is used to - structure the virtual representation and technical functionality of an Administration Shell into distinguishable - parts. Each submodel refers to a well-defined domain or subject matter. Submodels can become standardized and - thus become submodels types. Submodels can have different life-cycles. - - - Identifying string of the element within its name space. Constraint AASd-001: In case of a - referable element not being an identifiable element this id is mandatory and used for referring to the - element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore - ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. - Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used - for unique reference in its name space and thus allows better usability and a more performant - implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - - 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. - - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - Abstract attribute class for identification. Has the subattributes id and idType. - - - Identifier of the element. Its type is defined in idType. Id is a subproperty of - identification. - - - - - - Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the - enumeration “IdentifierType”. IdType is a subproperty of identification. - - - - - - - Abstract attribute for administration. Has the subattributes revision and version. - - - Revision of the element. Constraint AASd-005: A revision requires a version. This means, if - there is no version there is no revision neither. Revision is a subproperty of administration. - - - - - - Version of the element. Version of the element. Version is a subproperty of administration. - - - - - - - Global reference to the data specification template used by the element. - - - - - Kind of the element: either template or instance. - Instance - Instance - - - - Instance - Type - - - - - Description or comments on the element. The description can be provided in several languages. This - attribute has the name of the label and has a value with the label written in the default language. The - individual languages are modelled as child attributes. The names of the child attributes are the prefix - “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child - attributes are the labels within the respective language. - - - - - - A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. - [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. - - - - The type describes the type of the qualifier that is applied to the element. - - - - - The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and - the valueId are present then the value needs to be identical to the value of the referenced coded value - in valueId. - - - - - - Reference to the global unqiue id of a coded value. - - - - - - - A submodel element collection is a set or list of submodel elements. - - Identifying string of the element within its name space. Constraint AASd-001: In case of a - referable element not being an identifiable element this id is mandatory and used for referring to the - element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore - ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. - Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used - for unique reference in its name space and thus allows better usability and a more performant - implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - - 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. - - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - Global reference to the data specification template used by the element. - - - - - Kind of the element: either template or instance. - Instance - Instance - - - - Instance - Type - - - - - Description or comments on the element. The description can be provided in several languages. This - attribute has the name of the label and has a value with the label written in the default language. The - individual languages are modelled as child attributes. The names of the child attributes are the prefix - “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child - attributes are the labels within the respective language. - - - - - - A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. - [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. - - - - The type describes the type of the qualifier that is applied to the element. - - - - - The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and - the valueId are present then the value needs to be identical to the value of the referenced coded value - in valueId. - - - - - - Reference to the global unqiue id of a coded value. - - - - - - If allowDuplicates=true, then it is allowed that the collection contains the same element several - times. - - false - - - - If ordered=false, then the elements in the property collection are not ordered. If ordered=true - then the elements in the collection are ordered. Default = false. Note: An ordered submodel element - collection is typically implemented as an indexed array. - - false - - - - Submodel element contained in the collection. - - - - - A BLOB is a data element that represents a file that is contained with its source code in the value - attribute. - - - Identifying string of the element within its name space. Constraint AASd-001: In case of a - referable element not being an identifiable element this id is mandatory and used for referring to the - element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore - ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. - Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used - for unique reference in its name space and thus allows better usability and a more performant - implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - - 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. - - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - Global reference to the data specification template used by the element. - - - - - Kind of the element: either template or instance. - Instance - Instance - - - - Instance - Type - - - - - Description or comments on the element. The description can be provided in several languages. This - attribute has the name of the label and has a value with the label written in the default language. The - individual languages are modelled as child attributes. The names of the child attributes are the prefix - “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child - attributes are the labels within the respective language. - - - - - - A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. - [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. - - - - The type describes the type of the qualifier that is applied to the element. - - - - - The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and - the valueId are present then the value needs to be identical to the value of the referenced coded value - in valueId. - - - - - - Reference to the global unqiue id of a coded value. - - - - - - Mime type of the content of the BLOB. The mime type states which file extension the file has. Valid - values are e.g. “application/json”, “application/xls”, ”image/jpg”. The allowed values are defined as in - RFC2046. - - - - - - The value of the BLOB instance of a blob data element. Note: In contrast to the file property the - file content is stored directly as value in the Blob data element. - - - - - - - A capability is the implementation-independent description of the potential of an asset to achieve a - certain effect in the physical or virtual world. - - - Identifying string of the element within its name space. Constraint AASd-001: In case of a - referable element not being an identifiable element this id is mandatory and used for referring to the - element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore - ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. - Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used - for unique reference in its name space and thus allows better usability and a more performant - implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - - 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. - - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - Global reference to the data specification template used by the element. - - - - - Kind of the element: either template or instance. - Instance - Instance - - - - Instance - Type - - - - - Description or comments on the element. The description can be provided in several languages. This - attribute has the name of the label and has a value with the label written in the default language. The - individual languages are modelled as child attributes. The names of the child attributes are the prefix - “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child - attributes are the labels within the respective language. - - - - - - A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. - [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. - - - - The type describes the type of the qualifier that is applied to the element. - - - - - The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and - the valueId are present then the value needs to be identical to the value of the referenced coded value - in valueId. - - - - - - Reference to the global unqiue id of a coded value. - - - - - - - A role class for a File that a data element that represents an address to a file. It is derived from - the AutomationML role class ExternalData that is an role type for a document type and the base class for all - document type roles. It describes different document types. ExternalData is defined in AutomationML - BPR_005E_ExternalDataReference_v1.0.0_2. - - - Identifying string of the element within its name space. Constraint AASd-001: In case of a - referable element not being an identifiable element this id is mandatory and used for referring to the - element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore - ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. - Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used - for unique reference in its name space and thus allows better usability and a more performant - implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - - 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. - - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - Global reference to the data specification template used by the element. - - - - - Kind of the element: either template or instance. - Instance - Instance - - - - Instance - Type - - - - - Description or comments on the element. The description can be provided in several languages. This - attribute has the name of the label and has a value with the label written in the default language. The - individual languages are modelled as child attributes. The names of the child attributes are the prefix - “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child - attributes are the labels within the respective language. - - - - - - A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. - [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. - - - - The type describes the type of the qualifier that is applied to the element. - - - - - The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and - the valueId are present then the value needs to be identical to the value of the referenced coded value - in valueId. - - - - - - Reference to the global unqiue id of a coded value. - - - - - - - The attribute refURI is an IRI that can represent an absolute or relative path to an L - document. An added fragment (with #) references inside the document - - - - Mime type of the content of the File. - - - - - A property is a data element that has a single value. - - Identifying string of the element within its name space. Constraint AASd-001: In case of a - referable element not being an identifiable element this id is mandatory and used for referring to the - element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore - ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. - Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used - for unique reference in its name space and thus allows better usability and a more performant - implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - - 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. - - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - Global reference to the data specification template used by the element. - - - - - Kind of the element: either template or instance. - Instance - Instance - - - - Instance - Type - - - - - Description or comments on the element. The description can be provided in several languages. This - attribute has the name of the label and has a value with the label written in the default language. The - individual languages are modelled as child attributes. The names of the child attributes are the prefix - “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child - attributes are the labels within the respective language. - - - - - - A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. - [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. - - - - The type describes the type of the qualifier that is applied to the element. - - - - - The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and - the valueId are present then the value needs to be identical to the value of the referenced coded value - in valueId. - - - - - - Reference to the global unqiue id of a coded value. - - - - - - The value of the property instance. - - - - Reference to the global unique id if a coded value. - - - - - A reference element is a data element that defines a logical reference to another element within the - same or another AAS or a reference to an external object or entity. - - - Identifying string of the element within its name space. Constraint AASd-001: In case of a - referable element not being an identifiable element this id is mandatory and used for referring to the - element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore - ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. - Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used - for unique reference in its name space and thus allows better usability and a more performant - implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - - 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. - - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - Global reference to the data specification template used by the element. - - - - - Kind of the element: either template or instance. - Instance - Instance - - - - Instance - Type - - - - - Description or comments on the element. The description can be provided in several languages. This - attribute has the name of the label and has a value with the label written in the default language. The - individual languages are modelled as child attributes. The names of the child attributes are the prefix - “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child - attributes are the labels within the respective language. - - - - - - A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. - [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. - - - - The type describes the type of the qualifier that is applied to the element. - - - - - The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and - the valueId are present then the value needs to be identical to the value of the referenced coded value - in valueId. - - - - - - Reference to the global unqiue id of a coded value. - - - - - - - Reference to any other referable element of any other AAS or a reference to an external object - or entity. Note: For references to any other referable elment of the same AAS InternalLinks are used and - this attribute value shall be empty. - - - - - - - A relationship element is used to define a relationship between two referable elements. - - Identifying string of the element within its name space. Constraint AASd-001: In case of a - referable element not being an identifiable element this id is mandatory and used for referring to the - element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore - ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. - Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used - for unique reference in its name space and thus allows better usability and a more performant - implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - - 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. - - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - Global reference to the data specification template used by the element. - - - - - Kind of the element: either template or instance. - Instance - Instance - - - - Instance - Type - - - - - Description or comments on the element. The description can be provided in several languages. This - attribute has the name of the label and has a value with the label written in the default language. The - individual languages are modelled as child attributes. The names of the child attributes are the prefix - “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child - attributes are the labels within the respective language. - - - - - - A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. - [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. - - - - The type describes the type of the qualifier that is applied to the element. - - - - - The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and - the valueId are present then the value needs to be identical to the value of the referenced coded value - in valueId. - - - - - - Reference to the global unqiue id of a coded value. - - - - - - - Reference to any other referable element of any other AAS or a reference to an external object - or entity. Note: For references to any other referable elment of the same AAS InternalLinks are used and - this attribute value shall be empty. - - - - - - Reference to any other referable element of any other AAS or a reference to an external object - or entity. Note: For references to any other referable elment of the same AAS InternalLinks are used and - this attribute value shall be empty. - - - - - - An annotated relationship element is an relationship element that can be annotated with additional data - elements. - - - Annotations that hold for the relationships between the two elements. - - - - - An operation is a submodel element with input and output variables. - - Identifying string of the element within its name space. Constraint AASd-001: In case of a - referable element not being an identifiable element this id is mandatory and used for referring to the - element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore - ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. - Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used - for unique reference in its name space and thus allows better usability and a more performant - implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - - 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. - - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - Global reference to the data specification template used by the element. - - - - - Kind of the element: either template or instance. - Instance - Instance - - - - Instance - Type - - - - - Description or comments on the element. The description can be provided in several languages. This - attribute has the name of the label and has a value with the label written in the default language. The - individual languages are modelled as child attributes. The names of the child attributes are the prefix - “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child - attributes are the labels within the respective language. - - - - - - A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. - [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. - - - - The type describes the type of the qualifier that is applied to the element. - - - - - The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and - the valueId are present then the value needs to be identical to the value of the referenced coded value - in valueId. - - - - - - Reference to the global unqiue id of a coded value. - - - - - - - The list of AAS OperationVariableIn entities. In AML, the corresponding InternalElement with this role - is a child of the InternalElement with the Operation role. - - - - The list of AAS OperationVariableOut entities. In AML, the corresponding InternalElement with this role - is a child of the InternalElement with the Operation role. - - - - The list of AAS OperationVariableOut entities. In AML, the corresponding InternalElement with this role - is a child of the InternalElement with the Operation role. - - - - A view is a collection of referable elements w.r.t. to a specific viewpoint of one or more - stakeholders. - - - Identifying string of the element within its name space. Constraint AASd-001: In case of a - referable element not being an identifiable element this id is mandatory and used for referring to the - element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore - ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. - Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used - for unique reference in its name space and thus allows better usability and a more performant - implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - - 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. - - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - Global reference to the data specification template used by the element. - - - - - Description or comments on the element. The description can be provided in several languages. This - attribute has the name of the label and has a value with the label written in the default language. The - individual languages are modelled as child attributes. The names of the child attributes are the prefix - “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child - attributes are the labels within the respective language. - - - - - - - A dictionary contains elements that can be reused. - - Identifying string of the element within its name space. Constraint AASd-001: In case of a - referable element not being an identifiable element this id is mandatory and used for referring to the - element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore - ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. - Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used - for unique reference in its name space and thus allows better usability and a more performant - implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - - 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. - - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - - - - - - - Explanation: The semantics of a property or other elements that may have a semantic description is - defined by a concept description. The description of the concept should follow a standardized schema (realized - as data specification template). - - - Identifying string of the element within its name space. Constraint AASd-001: In case of a - referable element not being an identifiable element this id is mandatory and used for referring to the - element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore - ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. - Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used - for unique reference in its name space and thus allows better usability and a more performant - implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - - 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. - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - Abstract attribute class for identification. Has the subattributes id and idType. - - - Identifier of the element. Its type is defined in idType. Id is a subproperty of - identification. - - - - - - Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the - enumeration “IdentifierType”. IdType is a subproperty of identification. - - - - - - - Abstract attribute for administration. Has the subattributes revision and version. - - - Revision of the element. Constraint AASd-005: A revision requires a version. This means, if - there is no version there is no revision neither. Revision is a subproperty of administration. - - - - - - Version of the element. Version is a subproperty of administration. - - - - - - Global reference to the data specification template used by the element. - - - - Global reference to an external definition the concept is compatible to or was derived from. - - - - - - - Description Role class of an element that has a data specification template. A template defines the - additional attributes an element may or shall have. - - - Identifying string of the element within its name space. Constraint AASd-001: In case of a - referable element not being an identifiable element this id is mandatory and used for referring to the - element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore - ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. - Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used - for unique reference in its name space and thus allows better usability and a more performant - implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - - 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. - - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - - - - - - Abstract attribute class for identification. Has the subattributes id and idType. - - - Identifier of the element. Its type is defined in idType. Id is a subproperty of - identification. - - - - - - Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the - enumeration “IdentifierType”. IdType is a subproperty of identification. - - - - - - - Abstract attribute for administration. Has the subattributes revision and version. - - - Revision of the element. Constraint AASd-005: A revision requires a version. This means, if - there is no version there is no revision neither. Revision is a subproperty of administration. - - - - - - Version of the element. Version is a subproperty of administration. - - - - - - - Content of the data specification template. - - - -1.0.0 - - - -Automation Markup Language Base Role Class Library - Part 1 Content extended with Part 3 and Part 4 - Content - -2.2.2 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -0 - - An AAS Data Specification template for IEC61369. A template consists of the DataSpecificationContent - containing the additional attributes to be added to the element instance that references the data specification - template and meta information about the template itself (this is why DataSpecification inherits from - Identifiable). In UML these are two separated classes. - - - Identifying string of the element within its name space. Constraint AASd-001: In case of a - referable element not being an identifiable element this id is mandatory and used for referring to the - element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore - ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. - Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used - for unique reference in its name space and thus allows better usability and a more performant - implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - - 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. - - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - - - - - - Abstract attribute class for identification. Has the subattributes id and idType. - - - Identifier of the element. Its type is defined in idType. Id is a subproperty of - identification. - - http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360 - - - - Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the - enumeration “IdentifierType”. IdType is a subproperty of identification. - - IRI - - - - - Abstract attribute for administration. Has the subattributes revision and version. - - - Revision of the element. Constraint AASd-005: A revision requires a version. This means, if - there is no version there is no revision neither. Revision is a subproperty of administration. - - - - - - Version of the element. Version is a subproperty of administration. - - - - - - - The content of an AAS Data Specification template for IEC61360. - - Identifies the attribute hierarchy for preferredName in above attribute hierachy. Subordinate - attributes are designated by the country code information (see aml-lang literal). - - - - - Identifies the attribute for shortName in above attribute hierarchy. - - - - Identifies the attribute for unit in above attribute hierarchy. - - - - Identifies the attribute for unitId in above attribute hierarchy in its string serialization. - - - - - Identifies the attribute for sourceOfDefinition in above attribute hierachy. Subordinate - attributes are designated by the country code information (see aml-lang literal). - - - - - Identifies the attribute for symbol in above attribute hierarchy. - - - - Identifies the attribute for dataType in above attribute hierarchy. - - - - Identifies the attribute for definition in above attribute hierachy. Subordinate attributes are - designated by the country code information (see aml-lang literal). - - - - - Identifies the attribute for valueFormat in above attribute hierarchy. - - - - Identifies the attribute for valueList in above attribute hierarchy. - - - - The attribute value. - - - - The id for the value. - - - - - - - -0 - diff --git a/dataformat-aml/src/main/resources/interface-class-lib_aas.automl b/dataformat-aml/src/main/resources/interface-class-lib_aas.automl new file mode 100644 index 00000000..533c7d15 --- /dev/null +++ b/dataformat-aml/src/main/resources/interface-class-lib_aas.automl @@ -0,0 +1,34 @@ + + Interface Class Library according to Details of the Asset Administration Shell V2.0. + 1.0.0 + + A FileDataReference represents the address to a File. FileDataReference is derived from the + AutomationML Interface Class ExternalDataReference that is defined in AutomationML + BPR_005E_ExternalDataReference_v1.0.0_2:The interface class “ExternalDataReference” shall be used in order + to reference external documents out of the scope of AutomationML. + + + + Reference to any other referable element of the same of any other AAS or a reference to an external + object or entity. For local references inside the same Asset Administration Shell an InternalLink between + two objects with this interface "ReferableReference" shall be set. In this case the attribute value has to + be empty. For references between different Asset Administration Shells or external objects or entities the + attribute value shall be used and no InternalLink shall be set. + + + Reference to any other referable element of any other AAS or a reference to an external object + or entity. Note: For references to any other referable element of the same AAS InternalLinks are used + and this attribute value shall be empty. + + + + + diff --git a/dataformat-aml/src/main/resources/interface-class-lib_automl_bpr.automl b/dataformat-aml/src/main/resources/interface-class-lib_automl_bpr.automl new file mode 100644 index 00000000..c8915fd0 --- /dev/null +++ b/dataformat-aml/src/main/resources/interface-class-lib_automl_bpr.automl @@ -0,0 +1,14 @@ + + 1.0.0 + + + Mime type of the content of the File. + + + \ No newline at end of file diff --git a/dataformat-aml/src/main/resources/interface-class-lib_automl_interface.automl b/dataformat-aml/src/main/resources/interface-class-lib_automl_interface.automl new file mode 100644 index 00000000..a833a072 --- /dev/null +++ b/dataformat-aml/src/main/resources/interface-class-lib_automl_interface.automl @@ -0,0 +1,93 @@ + + Standard Automation Markup Language Interface Class Library - Part 1 Content extended with Part 3 and Part + 4 Content + + 2.2.2 + + + + + + + + + + The attribute refURI is an IRI that can represent an absolute or relative path to an L + document. An added fragment (with #) references inside the document + + + + + + + + + + + + + + + + + + true + + + + + + + + + + + diff --git a/dataformat-aml/src/main/resources/role-class-lib_aas.automl b/dataformat-aml/src/main/resources/role-class-lib_aas.automl new file mode 100644 index 00000000..0db7b808 --- /dev/null +++ b/dataformat-aml/src/main/resources/role-class-lib_aas.automl @@ -0,0 +1,1811 @@ + + Role Class Library according to Details of the Asset Administration Shell V2.0. + 1.0.0 + + An Asset Administration Shell. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a + referable element not being an identifiable element this id is mandatory and used for referring to the + element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore + ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. + Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used + for unique reference in its name space and thus allows better usability and a more performant + implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + + 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. + + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + + + + + + + Abstract attribute class for identification. Has the subattributes id and idType. + + + Identifier of the element. Its type is defined in idType. Id is a subproperty of + identification. + + + + + + Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the + enumeration “IdentifierType”. IdType is a subproperty of identification. + + + + + + + Abstract attribute for administration. Has the subattributes revision and version. + + + Revision of the element. Constraint AASd-005: A revision requires a version. This means, if + there is no version there is no revision neither. Revision is a subproperty of administration. + + + + + + Version of the element. Version is a subproperty of administration. + + + + + + Global reference to the data specification template used by the element. + + + + + The derivedFrom attribute is used to establish a relationship between two Asset Administration + Shells that are derived from each other. + + + + + + + An Asset describes meta data of an asset that is represented by an AAS. The asset may either represent + an asset type or an asset instance. The asset has a globally unique identifier plus – if needed – additional + domain specific (proprietary) identifiers. + + + Identifying string of the element within its name space. Constraint AASd-001: In case of a + referable element not being an identifiable element this id is mandatory and used for referring to the + element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore + ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. + Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used + for unique reference in its name space and thus allows better usability and a more performant + implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + + 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. + + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + + Abstract attribute class for identification. Has the subattributes id and idType. + + + Identifier of the element. Its type is defined in idType. + + + + + Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the + enumeration “IdentifierType”. IdType is a subproperty of identification. + + + + + + + Abstract attribute for administration. Has the subattributes revision and version. + + + Revision of the element. Constraint AASd-005: A revision requires a version. This means, if + there is no version there is no revision neither. Revision is a subproperty of administration. + + + + + + Version of the element. Version is a subproperty of administration. + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either type or instance. + Instance + Instance + + + + Instance + Type + + + + + + A Submodel defines a specific aspect of the asset represented by the AAS. A submodel is used to + structure the virtual representation and technical functionality of an Administration Shell into distinguishable + parts. Each submodel refers to a well-defined domain or subject matter. Submodels can become standardized and + thus become submodels types. Submodels can have different life-cycles. + + + Identifying string of the element within its name space. Constraint AASd-001: In case of a + referable element not being an identifiable element this id is mandatory and used for referring to the + element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore + ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. + Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used + for unique reference in its name space and thus allows better usability and a more performant + implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + + 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. + + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + + Abstract attribute class for identification. Has the subattributes id and idType. + + + Identifier of the element. Its type is defined in idType. Id is a subproperty of + identification. + + + + + + Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the + enumeration “IdentifierType”. IdType is a subproperty of identification. + + + + + + + Abstract attribute for administration. Has the subattributes revision and version. + + + Revision of the element. Constraint AASd-005: A revision requires a version. This means, if + there is no version there is no revision neither. Revision is a subproperty of administration. + + + + + + Version of the element. Version of the element. Version is a subproperty of administration. + + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This + attribute has the name of the label and has a value with the label written in the default language. The + individual languages are modelled as child attributes. The names of the child attributes are the prefix + “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child + attributes are the labels within the respective language. + + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. + [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and + the valueId are present then the value needs to be identical to the value of the referenced coded value + in valueId. + + + + + + Reference to the global unqiue id of a coded value. + + + + + + + A submodel element collection is a set or list of submodel elements. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a + referable element not being an identifiable element this id is mandatory and used for referring to the + element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore + ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. + Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used + for unique reference in its name space and thus allows better usability and a more performant + implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + + 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. + + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This + attribute has the name of the label and has a value with the label written in the default language. The + individual languages are modelled as child attributes. The names of the child attributes are the prefix + “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child + attributes are the labels within the respective language. + + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. + [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and + the valueId are present then the value needs to be identical to the value of the referenced coded value + in valueId. + + + + + + Reference to the global unqiue id of a coded value. + + + + + + If allowDuplicates=true, then it is allowed that the collection contains the same element several + times. + + false + + + + If ordered=false, then the elements in the property collection are not ordered. If ordered=true + then the elements in the collection are ordered. Default = false. Note: An ordered submodel element + collection is typically implemented as an indexed array. + + false + + + + Submodel element contained in the collection. + + + + + A BLOB is a data element that represents a file that is contained with its source code in the value + attribute. + + + Identifying string of the element within its name space. Constraint AASd-001: In case of a + referable element not being an identifiable element this id is mandatory and used for referring to the + element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore + ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. + Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used + for unique reference in its name space and thus allows better usability and a more performant + implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + + 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. + + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This + attribute has the name of the label and has a value with the label written in the default language. The + individual languages are modelled as child attributes. The names of the child attributes are the prefix + “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child + attributes are the labels within the respective language. + + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. + [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and + the valueId are present then the value needs to be identical to the value of the referenced coded value + in valueId. + + + + + + Reference to the global unqiue id of a coded value. + + + + + + Mime type of the content of the BLOB. The mime type states which file extension the file has. Valid + values are e.g. “application/json”, “application/xls”, ”image/jpg”. The allowed values are defined as in + RFC2046. + + + + + + The value of the BLOB instance of a blob data element. Note: In contrast to the file property the + file content is stored directly as value in the Blob data element. + + + + + + + A capability is the implementation-independent description of the potential of an asset to achieve a + certain effect in the physical or virtual world. + + + Identifying string of the element within its name space. Constraint AASd-001: In case of a + referable element not being an identifiable element this id is mandatory and used for referring to the + element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore + ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. + Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used + for unique reference in its name space and thus allows better usability and a more performant + implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + + 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. + + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This + attribute has the name of the label and has a value with the label written in the default language. The + individual languages are modelled as child attributes. The names of the child attributes are the prefix + “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child + attributes are the labels within the respective language. + + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. + [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and + the valueId are present then the value needs to be identical to the value of the referenced coded value + in valueId. + + + + + + Reference to the global unqiue id of a coded value. + + + + + + + A role class for a File that a data element that represents an address to a file. It is derived from + the AutomationML role class ExternalData that is an role type for a document type and the base class for all + document type roles. It describes different document types. ExternalData is defined in AutomationML + BPR_005E_ExternalDataReference_v1.0.0_2. + + + Identifying string of the element within its name space. Constraint AASd-001: In case of a + referable element not being an identifiable element this id is mandatory and used for referring to the + element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore + ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. + Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used + for unique reference in its name space and thus allows better usability and a more performant + implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + + 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. + + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This + attribute has the name of the label and has a value with the label written in the default language. The + individual languages are modelled as child attributes. The names of the child attributes are the prefix + “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child + attributes are the labels within the respective language. + + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. + [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and + the valueId are present then the value needs to be identical to the value of the referenced coded value + in valueId. + + + + + + Reference to the global unqiue id of a coded value. + + + + + + + The attribute refURI is an IRI that can represent an absolute or relative path to an L + document. An added fragment (with #) references inside the document + + + + Mime type of the content of the File. + + + + + A property is a data element that has a single value. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a + referable element not being an identifiable element this id is mandatory and used for referring to the + element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore + ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. + Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used + for unique reference in its name space and thus allows better usability and a more performant + implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + + 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. + + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This + attribute has the name of the label and has a value with the label written in the default language. The + individual languages are modelled as child attributes. The names of the child attributes are the prefix + “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child + attributes are the labels within the respective language. + + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. + [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and + the valueId are present then the value needs to be identical to the value of the referenced coded value + in valueId. + + + + + + Reference to the global unqiue id of a coded value. + + + + + + The value of the property instance. + + + + Reference to the global unique id if a coded value. + + + + + A reference element is a data element that defines a logical reference to another element within the + same or another AAS or a reference to an external object or entity. + + + Identifying string of the element within its name space. Constraint AASd-001: In case of a + referable element not being an identifiable element this id is mandatory and used for referring to the + element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore + ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. + Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used + for unique reference in its name space and thus allows better usability and a more performant + implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + + 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. + + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This + attribute has the name of the label and has a value with the label written in the default language. The + individual languages are modelled as child attributes. The names of the child attributes are the prefix + “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child + attributes are the labels within the respective language. + + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. + [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and + the valueId are present then the value needs to be identical to the value of the referenced coded value + in valueId. + + + + + + Reference to the global unqiue id of a coded value. + + + + + + + Reference to any other referable element of any other AAS or a reference to an external object + or entity. Note: For references to any other referable elment of the same AAS InternalLinks are used and + this attribute value shall be empty. + + + + + + + A relationship element is used to define a relationship between two referable elements. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a + referable element not being an identifiable element this id is mandatory and used for referring to the + element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore + ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. + Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used + for unique reference in its name space and thus allows better usability and a more performant + implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + + 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. + + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This + attribute has the name of the label and has a value with the label written in the default language. The + individual languages are modelled as child attributes. The names of the child attributes are the prefix + “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child + attributes are the labels within the respective language. + + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. + [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and + the valueId are present then the value needs to be identical to the value of the referenced coded value + in valueId. + + + + + + Reference to the global unqiue id of a coded value. + + + + + + + Reference to any other referable element of any other AAS or a reference to an external object + or entity. Note: For references to any other referable elment of the same AAS InternalLinks are used and + this attribute value shall be empty. + + + + + + Reference to any other referable element of any other AAS or a reference to an external object + or entity. Note: For references to any other referable elment of the same AAS InternalLinks are used and + this attribute value shall be empty. + + + + + + An annotated relationship element is an relationship element that can be annotated with additional data + elements. + + + Annotations that hold for the relationships between the two elements. + + + + + An operation is a submodel element with input and output variables. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a + referable element not being an identifiable element this id is mandatory and used for referring to the + element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore + ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. + Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used + for unique reference in its name space and thus allows better usability and a more performant + implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + + 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. + + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This + attribute has the name of the label and has a value with the label written in the default language. The + individual languages are modelled as child attributes. The names of the child attributes are the prefix + “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child + attributes are the labels within the respective language. + + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. + [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and + the valueId are present then the value needs to be identical to the value of the referenced coded value + in valueId. + + + + + + Reference to the global unqiue id of a coded value. + + + + + + + The list of AAS OperationVariableIn entities. In AML, the corresponding InternalElement with this role + is a child of the InternalElement with the Operation role. + + + + The list of AAS OperationVariableOut entities. In AML, the corresponding InternalElement with this role + is a child of the InternalElement with the Operation role. + + + + The list of AAS OperationVariableOut entities. In AML, the corresponding InternalElement with this role + is a child of the InternalElement with the Operation role. + + + + A view is a collection of referable elements w.r.t. to a specific viewpoint of one or more + stakeholders. + + + Identifying string of the element within its name space. Constraint AASd-001: In case of a + referable element not being an identifiable element this id is mandatory and used for referring to the + element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore + ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. + Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used + for unique reference in its name space and thus allows better usability and a more performant + implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + + 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. + + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + + Global reference to the data specification template used by the element. + + + + + Description or comments on the element. The description can be provided in several languages. This + attribute has the name of the label and has a value with the label written in the default language. The + individual languages are modelled as child attributes. The names of the child attributes are the prefix + “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child + attributes are the labels within the respective language. + + + + + + + A dictionary contains elements that can be reused. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a + referable element not being an identifiable element this id is mandatory and used for referring to the + element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore + ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. + Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used + for unique reference in its name space and thus allows better usability and a more performant + implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + + 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. + + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + + + + + + + + Explanation: The semantics of a property or other elements that may have a semantic description is + defined by a concept description. The description of the concept should follow a standardized schema (realized + as data specification template). + + + Identifying string of the element within its name space. Constraint AASd-001: In case of a + referable element not being an identifiable element this id is mandatory and used for referring to the + element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore + ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. + Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used + for unique reference in its name space and thus allows better usability and a more performant + implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + + Abstract attribute class for identification. Has the subattributes id and idType. + + + Identifier of the element. Its type is defined in idType. Id is a subproperty of + identification. + + + + + + Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the + enumeration “IdentifierType”. IdType is a subproperty of identification. + + + + + + + Abstract attribute for administration. Has the subattributes revision and version. + + + Revision of the element. Constraint AASd-005: A revision requires a version. This means, if + there is no version there is no revision neither. Revision is a subproperty of administration. + + + + + + Version of the element. Version is a subproperty of administration. + + + + + + Global reference to the data specification template used by the element. + + + + Global reference to an external definition the concept is compatible to or was derived from. + + + + + + + Description Role class of an element that has a data specification template. A template defines the + additional attributes an element may or shall have. + + + Identifying string of the element within its name space. Constraint AASd-001: In case of a + referable element not being an identifiable element this id is mandatory and used for referring to the + element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore + ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. + Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used + for unique reference in its name space and thus allows better usability and a more performant + implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + + 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. + + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + + + + + + + Abstract attribute class for identification. Has the subattributes id and idType. + + + Identifier of the element. Its type is defined in idType. Id is a subproperty of + identification. + + + + + + Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the + enumeration “IdentifierType”. IdType is a subproperty of identification. + + + + + + + Abstract attribute for administration. Has the subattributes revision and version. + + + Revision of the element. Constraint AASd-005: A revision requires a version. This means, if + there is no version there is no revision neither. Revision is a subproperty of administration. + + + + + + Version of the element. Version is a subproperty of administration. + + + + + + + Content of the data specification template. + + diff --git a/dataformat-aml/src/main/resources/role-class-lib_automl_base.automl b/dataformat-aml/src/main/resources/role-class-lib_automl_base.automl new file mode 100644 index 00000000..9ab7721b --- /dev/null +++ b/dataformat-aml/src/main/resources/role-class-lib_automl_base.automl @@ -0,0 +1,80 @@ + + Automation Markup Language Base Role Class Library - Part 1 Content extended with Part 3 and Part 4 + Content + + 2.2.2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dataformat-aml/src/main/resources/role-class-lib_automl_bpr.automl b/dataformat-aml/src/main/resources/role-class-lib_automl_bpr.automl new file mode 100644 index 00000000..e948c07e --- /dev/null +++ b/dataformat-aml/src/main/resources/role-class-lib_automl_bpr.automl @@ -0,0 +1,7 @@ + + 1.0.0 + + diff --git a/dataformat-aml/src/main/resources/system-unit-class-lib_aas.automl b/dataformat-aml/src/main/resources/system-unit-class-lib_aas.automl new file mode 100644 index 00000000..742a3637 --- /dev/null +++ b/dataformat-aml/src/main/resources/system-unit-class-lib_aas.automl @@ -0,0 +1,4 @@ + + 0 + diff --git a/dataformat-aml/src/main/resources/system-unit-class-lib_aas_data_specification_templates.automl b/dataformat-aml/src/main/resources/system-unit-class-lib_aas_data_specification_templates.automl new file mode 100644 index 00000000..b7780f38 --- /dev/null +++ b/dataformat-aml/src/main/resources/system-unit-class-lib_aas_data_specification_templates.automl @@ -0,0 +1,206 @@ + + 0 + + An AAS Data Specification template for IEC61369. A template consists of the DataSpecificationContent + containing the additional attributes to be added to the element instance that references the data specification + template and meta information about the template itself (this is why DataSpecification inherits from + Identifiable). In UML these are two separated classes. + + + Identifying string of the element within its name space. Constraint AASd-001: In case of a + referable element not being an identifiable element this id is mandatory and used for referring to the + element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore + ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. + Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used + for unique reference in its name space and thus allows better usability and a more performant + implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + + 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. + + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + + + + + + + Abstract attribute class for identification. Has the subattributes id and idType. + + + Identifier of the element. Its type is defined in idType. Id is a subproperty of + identification. + + http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360 + + + + Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the + enumeration “IdentifierType”. IdType is a subproperty of identification. + + IRI + + + + + Abstract attribute for administration. Has the subattributes revision and version. + + + Revision of the element. Constraint AASd-005: A revision requires a version. This means, if + there is no version there is no revision neither. Revision is a subproperty of administration. + + + + + + Version of the element. Version is a subproperty of administration. + + + + + + + The content of an AAS Data Specification template for IEC61360. + + Identifies the attribute hierarchy for preferredName in above attribute hierachy. Subordinate + attributes are designated by the country code information (see aml-lang literal). + + + + + Identifies the attribute for shortName in above attribute hierarchy. + + + + Identifies the attribute for unit in above attribute hierarchy. + + + + Identifies the attribute for unitId in above attribute hierarchy in its string serialization. + + + + + Identifies the attribute for sourceOfDefinition in above attribute hierachy. Subordinate + attributes are designated by the country code information (see aml-lang literal). + + + + + Identifies the attribute for symbol in above attribute hierarchy. + + + + Identifies the attribute for dataType in above attribute hierarchy. + + + + Identifies the attribute for definition in above attribute hierachy. Subordinate attributes are + designated by the country code information (see aml-lang literal). + + + + + Identifies the attribute for valueFormat in above attribute hierarchy. + + + + Identifies the attribute for valueList in above attribute hierarchy. + + + + The attribute value. + + + + The id for the value. + + + + + + diff --git a/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/fixtures/FullExample.java b/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/fixtures/FullExample.java index 398cb10f..82f528fe 100644 --- a/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/fixtures/FullExample.java +++ b/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/fixtures/FullExample.java @@ -23,11 +23,11 @@ public class FullExample { - public static final java.io.File FILE = new java.io.File("src/test/resources/test_demo_full_example.json"); + public static final java.io.File FILE = new java.io.File("src/interface-class-lib_automl_interface/resources/test_demo_full_example.json"); public static final AssetAdministrationShell AAS_1 = new DefaultAssetAdministrationShell.Builder() .idShort("TestAssetAdministrationShell") - .description(new LangString("An Example Asset Administration Shell for the test application", "en-us")) + .description(new LangString("An Example Asset Administration Shell for the interface-class-lib_automl_interface application", "en-us")) .description(new LangString("Ein Beispiel-Verwaltungsschale für eine Test-Anwendung", "de")) .identification(new DefaultIdentifier.Builder() .idType(IdentifierType.IRI) @@ -136,7 +136,7 @@ public class FullExample { public static final AssetAdministrationShell AAS_4 = new DefaultAssetAdministrationShell.Builder() .idShort("TestAssetAdministrationShell") - .description(new LangString("An Example Asset Administration Shell for the test application", "en-us")) + .description(new LangString("An Example Asset Administration Shell for the interface-class-lib_automl_interface application", "en-us")) .description(new LangString("Ein Beispiel-Verwaltungsschale für eine Test-Anwendung", "de")) .identification(new DefaultIdentifier.Builder() .idType(IdentifierType.IRI) @@ -180,7 +180,7 @@ public class FullExample { public static final Submodel SUBMODEL_1 = new DefaultSubmodel.Builder() .idShort("Identification") - .description(new LangString("An example asset identification submodel for the test application", "en-us")) + .description(new LangString("An example asset identification submodel for the interface-class-lib_automl_interface application", "en-us")) .description(new LangString("Ein Beispiel-Identifikations-Submodel für eine Test-Anwendung", "de")) .identification(new DefaultIdentifier.Builder() .idType(IdentifierType.IRI) @@ -267,7 +267,7 @@ public class FullExample { public static final Submodel SUBMODEL_2 = new DefaultSubmodel.Builder() .idShort("BillOfMaterial") - .description(new LangString("An example bill of material submodel for the test application", "en-us")) + .description(new LangString("An example bill of material submodel for the interface-class-lib_automl_interface application", "en-us")) .description(new LangString("Ein Beispiel-BillofMaterial-Submodel für eine Test-Anwendung", "de")) .identification(new DefaultIdentifier.Builder() .idType(IdentifierType.IRI) @@ -364,7 +364,7 @@ public class FullExample { public static final Submodel SUBMODEL_3 = new DefaultSubmodel.Builder() .idShort("TestSubmodel") - .description(new LangString("An example submodel for the test application", "en-us")) + .description(new LangString("An example submodel for the interface-class-lib_automl_interface application", "en-us")) .description(new LangString("Ein Beispiel-Teilmodell für eine Test-Anwendung", "de")) .identification(new DefaultIdentifier.Builder() .idType(IdentifierType.IRI) @@ -805,7 +805,7 @@ public class FullExample { public static final Submodel SUBMODEL_6 = new DefaultSubmodel.Builder() .idShort("TestSubmodel") - .description(new LangString("An example submodel for the test application", "en-us")) + .description(new LangString("An example submodel for the interface-class-lib_automl_interface application", "en-us")) .description(new LangString("Ein Beispiel-Teilmodell für eine Test-Anwendung", "de")) .identification(new DefaultIdentifier.Builder() .idType(IdentifierType.IRI) @@ -1123,7 +1123,7 @@ public class FullExample { public static final Submodel SUBMODEL_7 = new DefaultSubmodel.Builder() .idShort("TestSubmodel") - .description(new LangString("An example submodel for the test application", "en-us")) + .description(new LangString("An example submodel for the interface-class-lib_automl_interface application", "en-us")) .description(new LangString("Ein Beispiel-Teilmodell für eine Test-Anwendung", "de")) .identification(new DefaultIdentifier.Builder() .idType(IdentifierType.IRI) @@ -1457,7 +1457,7 @@ public class FullExample { public final static ConceptDescription CONCEPT_DESCRIPTION_1 = new DefaultConceptDescription.Builder() .idShort("TestConceptDescription") - .description(new LangString("An example concept description for the test application", "en-us")) + .description(new LangString("An example concept description for the interface-class-lib_automl_interface application", "en-us")) .description(new LangString("Ein Beispiel-ConceptDescription für eine Test-Anwendung", "de")) .identification(new DefaultIdentifier.Builder() .idType(IdentifierType.IRI) @@ -1486,7 +1486,7 @@ public class FullExample { public final static ConceptDescription CONCEPT_DESCRIPTION_3 = new DefaultConceptDescription.Builder() .idShort("TestConceptDescription") - .description(new LangString("An example concept description for the test application", "en-us")) + .description(new LangString("An example concept description for the interface-class-lib_automl_interface application", "en-us")) .description(new LangString("Ein Beispiel-ConceptDescription für eine Test-Anwendung", "de")) .identification(new DefaultIdentifier.Builder() .idType(IdentifierType.IRI) @@ -1571,11 +1571,11 @@ public class FullExample { .assetAdministrationShells(Arrays.asList( // AAS_1, // AAS_2, - AAS_3 -// AAS_4 +// AAS_3, + AAS_4 )) .submodels(Arrays.asList( -// SUBMODEL_1, + SUBMODEL_1 // SUBMODEL_2, // SUBMODEL_3, // SUBMODEL_4, From 05e771af1e0b133655a8a43ca280c982bd97f8ec Mon Sep 17 00:00:00 2001 From: Jacoby Date: Fri, 30 Jul 2021 10:44:12 +0200 Subject: [PATCH 07/18] first partially working AML serializer version using custom serialization engine --- dataformat-aml/pom.xml | 83 +- .../aas/v3/dataformat/aml/AasToAmlMapper.java | 109 + .../aml/AbstractClassNamingStrategy.java | 96 + .../v3/dataformat/aml/AmlDeserializer.java | 71 +- .../aas/v3/dataformat/aml/AmlSerializer.java | 154 +- .../aas/v3/dataformat/aml/AmlToAasMapper.java | 26 + .../dataformat/aml/IdClassNamingStrategy.java | 35 + .../v3/dataformat/aml/IdentityProvider.java | 51 + .../aas/v3/dataformat/aml/MappingContext.java | 216 + .../v3/dataformat/aml/MappingProvider.java | 127 + .../aas/v3/dataformat/aml/NamingStrategy.java | 23 + .../aml/NumberingClassNamingStrategy.java | 42 + .../aml/PropertyNamingStrategy.java | 73 + .../aas/v3/dataformat/aml/ValueMapping.java | 53 + .../aml/header/AutomationMLVersion.java | 45 + .../dataformat/aml/header/WriterHeader.java | 144 + .../aml/mapper/AbstractCollectionMapper.java | 61 + ...tAdministrationShellEnvironmentMapper.java | 115 + .../v3/dataformat/aml/mapper/BaseMapper.java | 136 + .../aml/mapper/CollectionMapper.java | 22 + .../mapper/ConstraintCollectionMapper.java | 30 + .../DataSpecificationContentMapper.java | 46 + .../DataSpecificationIEC61360Mapper.java | 52 + .../aml/mapper/DataSpecificationMapper.java | 49 + .../aml/mapper/DefaultCollectionMapper.java | 20 + .../dataformat/aml/mapper/DefaultMapper.java | 20 + ...ddedDataSpecificationCollectionMapper.java | 89 + .../v3/dataformat/aml/mapper/FileMapper.java | 61 + .../mapper/LangStringCollectionMapper.java | 54 + .../aas/v3/dataformat/aml/mapper/Mapper.java | 23 + .../aml/mapper/MappingException.java | 28 + .../aml/mapper/OperationMapper.java | 34 + .../OperationVariableCollectionMapper.java | 48 + .../aml/mapper/OperationVariableMapper.java | 33 + .../aml/mapper/QualifierMapper.java | 35 + .../aml/mapper/ReferenceCollectionMapper.java | 33 + .../aml/mapper/ReferenceElementMapper.java | 81 + .../aml/mapper/ReferenceMapper.java | 42 + .../aml/mapper/RelationshipElementMapper.java | 82 + .../aml/mapper/SubmodelCollectionMapper.java | 37 + .../dataformat/aml/mapper/SubmodelMapper.java | 49 + .../aml/mapper/ToAttributeMapper.java | 34 + .../v3/dataformat/aml/mapper/ViewMapper.java | 44 + .../mapper/util/ReferenceConverterUtil.java | 3 +- .../aas/v3/dataformat/aml/util/AASUtils.java | 171 + .../aml/util/AbstractReferableVisitor.java | 70 + .../dataformat/aml/util/AbstractVisitor.java | 58 + ...ssetAdministrationShellElementVisitor.java | 424 + ...ministrationShellElementWalkerVisitor.java | 464 + .../util/ReferencedReferableCollector.java | 64 + .../aas/v3/dataformat/aml/util/TypeUtils.java | 39 + .../resources/AssetAdministrationShellLib.aml | 1230 +++ .../main/resources/CAEX_ClassModel_V2.15.xsd | 592 ++ .../aml/deserialize/AmlDeserializerTest.java | 25 +- .../dataformat/aml/fixtures/FullExample.java | 53 +- .../dataformat/aml/fixtures/TestExample.java | 570 ++ .../aml/serialize/AmlSerializerTest.java | 32 +- .../test/resources/amlfile/example-motor.xml | 5629 +++++------ .../test/resources/amlfile/full-example.xml | 8921 +++++++++++++++++ dataformat-core/pom.xml | 2 +- .../v3/dataformat/core/ReflectionHelper.java | 50 + dataformat-json/pom.xml | 2 +- dataformat-xml/pom.xml | 2 +- pom.xml | 6 +- 64 files changed, 18050 insertions(+), 3063 deletions(-) create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AasToAmlMapper.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AbstractClassNamingStrategy.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlToAasMapper.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/IdClassNamingStrategy.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/IdentityProvider.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/MappingContext.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/MappingProvider.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/NamingStrategy.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/NumberingClassNamingStrategy.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/PropertyNamingStrategy.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/ValueMapping.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/header/AutomationMLVersion.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/header/WriterHeader.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/AbstractCollectionMapper.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/AssetAdministrationShellEnvironmentMapper.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/BaseMapper.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/CollectionMapper.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/ConstraintCollectionMapper.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/DataSpecificationContentMapper.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/DataSpecificationIEC61360Mapper.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/DataSpecificationMapper.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/DefaultCollectionMapper.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/DefaultMapper.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/EmbeddedDataSpecificationCollectionMapper.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/FileMapper.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/LangStringCollectionMapper.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/Mapper.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/MappingException.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/OperationMapper.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/OperationVariableCollectionMapper.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/OperationVariableMapper.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/QualifierMapper.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/ReferenceCollectionMapper.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/ReferenceElementMapper.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/ReferenceMapper.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/RelationshipElementMapper.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/SubmodelCollectionMapper.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/SubmodelMapper.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/ToAttributeMapper.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/ViewMapper.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util/AASUtils.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util/AbstractReferableVisitor.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util/AbstractVisitor.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util/AssetAdministrationShellElementVisitor.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util/AssetAdministrationShellElementWalkerVisitor.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util/ReferencedReferableCollector.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util/TypeUtils.java create mode 100644 dataformat-aml/src/main/resources/AssetAdministrationShellLib.aml create mode 100644 dataformat-aml/src/main/resources/CAEX_ClassModel_V2.15.xsd create mode 100644 dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/fixtures/TestExample.java create mode 100644 dataformat-aml/src/test/resources/amlfile/full-example.xml diff --git a/dataformat-aml/pom.xml b/dataformat-aml/pom.xml index 02da8211..c65826b1 100644 --- a/dataformat-aml/pom.xml +++ b/dataformat-aml/pom.xml @@ -13,64 +13,55 @@ io.admin-shell.aas model - ${model.version} + ${revision} compile io.admin-shell.aas dataformat-core - ${model.version} + ${revision} compile - com.fasterxml.jackson.core - jackson-annotations - ${jackson.version} - compile + com.google.guava + guava + 30.1.1-jre - com.fasterxml.jackson.core - jackson-databind - ${jackson.version} + org.slf4j + slf4j-api + ${slf4j.version} - com.fasterxml.jackson.dataformat - jackson-dataformat-xml - ${jackson.version} + javax.xml.bind + jaxb-api + ${jaxb.version} - ma.glasnost.orika - orika-core - ${orika.version} + org.eclipse.persistence + org.eclipse.persistence.moxy + ${moxy.version} - - org.slf4j - slf4j-api - ${slf4j.version} - junit junit ${junit.version} test - + org.skyscreamer jsonassert ${jsonassert.version} test - + + + net.codesup.util + jaxb2-rich-contract-plugin + ${jaxb-rich-contract.version} + - - org.apache.maven.plugins - maven-compiler-plugin - - 11 - 11 - - org.codehaus.mojo flatten-maven-plugin @@ -95,6 +86,38 @@ + + org.apache.cxf + cxf-xjc-plugin + ${plugin.cxf.version} + + + net.codesup.util:jaxb2-rich-contract-plugin:${jaxb-rich-contract.version} + + + + + generate-caex-classes + generate-sources + + xsdtojava + + + ${basedir}/target/generated-sources/src + + + ${basedir}/src/main/resources/CAEX_ClassModel_V2.15.xsd + io.adminshell.aas.v3.dataformat.aml.model.caex + + -Xfluent-builder + -Ximmutable + + + + + + + diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AasToAmlMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AasToAmlMapper.java new file mode 100644 index 00000000..009f5eae --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AasToAmlMapper.java @@ -0,0 +1,109 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml; + +import io.adminshell.aas.v3.dataformat.aml.header.AutomationMLVersion; +import io.adminshell.aas.v3.dataformat.aml.header.WriterHeader; +import io.adminshell.aas.v3.dataformat.aml.mapper.AssetAdministrationShellEnvironmentMapper; +import io.adminshell.aas.v3.dataformat.aml.mapper.ConstraintCollectionMapper; +import io.adminshell.aas.v3.dataformat.aml.mapper.DataSpecificationContentMapper; +import io.adminshell.aas.v3.dataformat.aml.mapper.DataSpecificationIEC61360Mapper; +import io.adminshell.aas.v3.dataformat.aml.mapper.DefaultCollectionMapper; +import io.adminshell.aas.v3.dataformat.aml.mapper.DefaultMapper; +import io.adminshell.aas.v3.dataformat.aml.mapper.EmbeddedDataSpecificationCollectionMapper; +import io.adminshell.aas.v3.dataformat.aml.mapper.FileMapper; +import io.adminshell.aas.v3.dataformat.aml.mapper.LangStringCollectionMapper; +import io.adminshell.aas.v3.dataformat.aml.mapper.MappingException; +import io.adminshell.aas.v3.dataformat.aml.mapper.OperationVariableCollectionMapper; +import io.adminshell.aas.v3.dataformat.aml.mapper.OperationVariableMapper; +import io.adminshell.aas.v3.dataformat.aml.mapper.QualifierMapper; +import io.adminshell.aas.v3.dataformat.aml.mapper.ReferenceCollectionMapper; +import io.adminshell.aas.v3.dataformat.aml.mapper.ReferenceElementMapper; +import io.adminshell.aas.v3.dataformat.aml.mapper.ReferenceMapper; +import io.adminshell.aas.v3.dataformat.aml.mapper.RelationshipElementMapper; +import io.adminshell.aas.v3.dataformat.aml.mapper.SubmodelCollectionMapper; +import io.adminshell.aas.v3.dataformat.aml.mapper.SubmodelMapper; +import io.adminshell.aas.v3.dataformat.aml.model.caex.CAEXFile; +import io.adminshell.aas.v3.model.AssetAdministrationShellEnvironment; +import io.adminshell.aas.v3.model.LangString; +import io.adminshell.aas.v3.model.Referable; +import java.util.List; +import org.slf4j.LoggerFactory; + +public class AasToAmlMapper { + + public static final String DEFAULT_SCHEMA_VERSION = "2.15"; + public static final String DEFAULT_AML_VERSION = "2.0"; + public static final String DEFAULT_FILENAME = "AssetAdministrationShellEnvironment.aml"; + private static final org.slf4j.Logger log = LoggerFactory.getLogger(AasToAmlMapper.class); + private static final String DEFAULT_LANGUAGE = "EN"; + private CAEXFile result; + + public CAEXFile map(AssetAdministrationShellEnvironment env) throws MappingException { + return map(env, DEFAULT_SCHEMA_VERSION, DEFAULT_FILENAME); + } + + public CAEXFile map(AssetAdministrationShellEnvironment env, String schemaVersion, String filename) throws MappingException { + AbstractClassNamingStrategy classNamingStrategy = new NumberingClassNamingStrategy(); + classNamingStrategy.registerCustomNaming(LangString.class, x -> "aml-lang=" + x.getLanguage()); + PropertyNamingStrategy propertyNamingStrategy = new PropertyNamingStrategy(); + propertyNamingStrategy.registerCustomNaming(Referable.class, "descriptions", "description"); + MappingProvider mappingProvider = new MappingProvider( + new DefaultMapper(), + new DefaultCollectionMapper(), + List.of( + new AssetAdministrationShellEnvironmentMapper(), + new SubmodelCollectionMapper(), + new LangStringCollectionMapper(), + new ReferenceMapper(), + new OperationVariableMapper(), + new OperationVariableCollectionMapper(), + new ReferenceCollectionMapper(), + new ConstraintCollectionMapper(), + new QualifierMapper(), + new FileMapper(), + new SubmodelMapper(), + new EmbeddedDataSpecificationCollectionMapper(), + new DataSpecificationContentMapper(), + new ReferenceElementMapper(), + new RelationshipElementMapper(), + new DataSpecificationIEC61360Mapper()), + classNamingStrategy, + propertyNamingStrategy + ); + // FIX + // ReferenceElement and RelationshipElement reference other Referables. + // Each such reference is represented as an InternalLink in AML. + // InternalLinks require target to be an interface but AAS AML serialization + // does not define creation of such interfaces. Therefore, we do a preprocessing + // step to identify all Referable which are targeted by such a reference + // to later add a generic interface to them upon serialization + + // NOTE + // This has implications on ID generator and requires additional lookup table + // for Referable --> AML ID of ExternalInterface + MappingContext context = new MappingContext(mappingProvider, env); + context.getFileBuilder().withSchemaVersion(schemaVersion); + context.getFileBuilder().withFileName(filename); + context.getFileBuilder().withAdditionalInformation(new AutomationMLVersion("2.0")); + WriterHeader writerHeader = new WriterHeader(); + writerHeader.setName("foo"); + writerHeader.setId("bar"); + context.getFileBuilder().withAdditionalInformation(writerHeader.wrap()); + context.map(env); + return context.getFileBuilder().build(); + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AbstractClassNamingStrategy.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AbstractClassNamingStrategy.java new file mode 100644 index 00000000..60cd8ff3 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AbstractClassNamingStrategy.java @@ -0,0 +1,96 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml; + +import com.google.common.reflect.TypeToken; +import io.adminshell.aas.v3.dataformat.aml.util.TypeUtils; +import io.adminshell.aas.v3.model.LangString; +import io.adminshell.aas.v3.model.Referable; +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import java.util.function.BiFunction; +import java.util.function.Function; + +public abstract class AbstractClassNamingStrategy implements NamingStrategy { + + protected final boolean preferIdShort; + protected Map cache = new HashMap<>(); + protected List customNamings = new ArrayList<>(); + + private class TypeSafeFunction { + + public TypeSafeFunction(Class inputType, BiFunction provider) { + this.inputType = TypeToken.of(inputType); + this.provider = provider; + } + TypeToken inputType; + BiFunction provider; + } + + public void registerCustomNaming(Class type, Function provider) { + customNamings.add(new TypeSafeFunction(type, (x, y) -> provider.apply((T) x))); + } + + public void registerCustomNaming(Class type, BiFunction provider) { + customNamings.add(new TypeSafeFunction(type, provider)); + } + + private Optional getCustomNaming(Type type) { + return customNamings.stream() + .filter(x -> x.inputType.isSupertypeOf(type)) + .sorted((x, y) -> Objects.compare(x.inputType, y.inputType, new TypeUtils.TypeTokenComparator())) + .findFirst(); + } + + protected AbstractClassNamingStrategy() { + this(true); + } + + protected AbstractClassNamingStrategy(boolean preferIdShort) { + this.preferIdShort = preferIdShort; + } + + public String getName(Type type, Object obj, String property) { + if (cache.containsKey(obj)) { + return cache.get(obj); + } + String result = null; + if (preferIdShort && Referable.class.isAssignableFrom(obj.getClass())) { + Referable referable = (Referable) obj; + if (referable.getIdShort() != null && !referable.getIdShort().isEmpty()) { + result = referable.getIdShort(); + } + } + if (result == null) { + Optional customNaming = getCustomNaming(type); + if (customNaming.isPresent()) { + result = customNaming.get().provider.apply(obj, property).toString(); + } + } + if (result == null) { + result = generateName(obj); + } + cache.put(obj, result); + return result; + } + + protected abstract String generateName(Object obj); +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlDeserializer.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlDeserializer.java index f1e2a18c..87038fe8 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlDeserializer.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlDeserializer.java @@ -15,79 +15,36 @@ */ package io.adminshell.aas.v3.dataformat.aml; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.dataformat.xml.XmlMapper; import io.adminshell.aas.v3.dataformat.DeserializationException; import io.adminshell.aas.v3.dataformat.Deserializer; -import io.adminshell.aas.v3.dataformat.aml.model.caex.AdditionalInformation; -import io.adminshell.aas.v3.dataformat.aml.model.caex.Attribute; import io.adminshell.aas.v3.dataformat.aml.model.caex.CAEXFile; -import io.adminshell.aas.v3.dataformat.aml.model.caex.ExternalInterface; -import io.adminshell.aas.v3.dataformat.aml.model.caex.InstanceHierarchy; -import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElement; -import io.adminshell.aas.v3.dataformat.aml.model.caex.RefSemantic; -import io.adminshell.aas.v3.dataformat.aml.model.caex.RoleRequirements; -import io.adminshell.aas.v3.dataformat.aml.model.mixin.AdditionalInformationMixin; -import io.adminshell.aas.v3.dataformat.aml.model.mixin.AttributeMixin; -import io.adminshell.aas.v3.dataformat.aml.model.mixin.CAEXMixin; -import io.adminshell.aas.v3.dataformat.aml.model.mixin.ExternalInterfaceMixin; -import io.adminshell.aas.v3.dataformat.aml.model.mixin.InstanceHierarchyMixin; -import io.adminshell.aas.v3.dataformat.aml.model.mixin.InternalElementMixin; -import io.adminshell.aas.v3.dataformat.aml.model.mixin.RefSemanticMixin; -import io.adminshell.aas.v3.dataformat.aml.model.mixin.RoleRequirementsMixin; -import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.AASEnvironmentMapper; import io.adminshell.aas.v3.model.AssetAdministrationShellEnvironment; -import ma.glasnost.orika.MapperFacade; +import java.io.StringReader; +import javax.xml.bind.JAXBException; +import javax.xml.bind.Unmarshaller; +import org.eclipse.persistence.jaxb.JAXBContextFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class AmlDeserializer implements Deserializer { private static final Logger log = LoggerFactory.getLogger(AmlDeserializer.class); - private final MapperFacade mapper = new AASEnvironmentMapper(); - - public CAEXMixin convertXMLToCAEX(String xml) { - XmlMapper xmlMapper = XmlMapper.builder() - // .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false) - .addMixIn(CAEXFile.class, CAEXMixin.class) - .addMixIn(ExternalInterface.class, ExternalInterfaceMixin.class) - .addMixIn(AdditionalInformation.class, AdditionalInformationMixin.class) - .addMixIn(InstanceHierarchy.class, InstanceHierarchyMixin.class) - .addMixIn(InternalElement.class, InternalElementMixin.class) - .addMixIn(Attribute.class, AttributeMixin.class) - .addMixIn(RefSemantic.class, RefSemanticMixin.class) - .addMixIn(RoleRequirements.class, RoleRequirementsMixin.class) - .build(); - - CAEXMixin caex = null; - try { - caex = xmlMapper.readValue(xml, CAEXMixin.class); - } catch (JsonProcessingException e) { - e.printStackTrace(); - } - - //log.debug(caex.toString()); - //System.out.println(JSON.); - return caex; - } - - public AssetAdministrationShellEnvironment modelTransformation(CAEXFile caex) { - AssetAdministrationShellEnvironment environment = null; - - return environment; - } + private AmlToAasMapper mapper = new AmlToAasMapper(); @Override public AssetAdministrationShellEnvironment read(String value) throws DeserializationException { - // XML --> CAEX - CAEXMixin caex = this.convertXMLToCAEX(value); - // CAEX --> AAS -// return this.modelTransformation(caex); - return null; + try { + Unmarshaller unmarshaller = JAXBContextFactory.createContext(new Class[]{CAEXFile.class}, null).createUnmarshaller(); + StringReader reader = new StringReader(value); + CAEXFile aml = (CAEXFile) unmarshaller.unmarshal(reader); + return mapper.map(aml); + } catch (JAXBException ex) { + throw new DeserializationException("error deserializing AssetAdministrationShellEnvironment", ex); + } } @Override public void useImplementation(Class aasInterface, Class implementation) { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + throw new UnsupportedOperationException("Not supported yet."); } } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlSerializer.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlSerializer.java index 650c5bf1..218b1d07 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlSerializer.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlSerializer.java @@ -15,125 +15,81 @@ */ package io.adminshell.aas.v3.dataformat.aml; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.SerializationFeature; -import com.fasterxml.jackson.dataformat.xml.XmlMapper; import io.adminshell.aas.v3.dataformat.SerializationException; import io.adminshell.aas.v3.dataformat.Serializer; -import io.adminshell.aas.v3.dataformat.aml.model.caex.*; -import io.adminshell.aas.v3.dataformat.aml.model.mixin.*; -import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.AASEnvironmentMapper; -import io.adminshell.aas.v3.model.AssetAdministrationShell; +import io.adminshell.aas.v3.dataformat.aml.header.AutomationMLVersion; +import io.adminshell.aas.v3.dataformat.aml.header.WriterHeader; +import io.adminshell.aas.v3.dataformat.aml.mapper.MappingException; +import io.adminshell.aas.v3.dataformat.aml.model.caex.CAEXFile; import io.adminshell.aas.v3.model.AssetAdministrationShellEnvironment; -import io.adminshell.aas.v3.model.Submodel; -import ma.glasnost.orika.MapperFacade; +import java.io.IOException; +import java.io.StringWriter; +import javax.xml.bind.JAXBException; +import javax.xml.bind.Marshaller; +import javax.xml.bind.Unmarshaller; +import org.eclipse.persistence.jaxb.JAXBContextFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.io.File; -import java.io.IOException; -import java.nio.file.Files; -import java.util.ArrayList; -import java.util.List; - public class AmlSerializer implements Serializer { + private static final String AAS_LIB_SOURCE = "/AssetAdministrationShellLib.aml"; private static final Logger log = LoggerFactory.getLogger(AmlSerializer.class); + private AasToAmlMapper mapper = new AasToAmlMapper(); - private final MapperFacade mapper = new AASEnvironmentMapper(); + private boolean enableClassLibs = false; - @Override - public String write(AssetAdministrationShellEnvironment aasEnvironment) throws SerializationException { - try { - CAEXFile caexFile = modelTransformation(aasEnvironment); - String xml = convertXml(caexFile); - String result = cleanUpXml(xml); - return result; - } catch (JsonProcessingException ex) { - throw new SerializationException("error serializing AssetAdministrationShellEnvironment", ex); - } + public AmlSerializer() { } - private CAEXFile modelTransformation(AssetAdministrationShellEnvironment environment) { - // Map environment to CAEX file - CAEXFile caexFile = mapper.map(environment, CAEXFile.class); - caexFile.setSchemaVersion(CAEXConstants.SCHEMA_VERSION); - caexFile.setXmlns(CAEXConstants.XMLNS); - caexFile.setXsi(CAEXConstants.XSI); - - // Add additional information to CAEX - AdditionalInformation additionalInformation = new AdditionalInformation(); - additionalInformation.setAutomationMLVersion(CAEXConstants.AUTOMATION_ML_VERSION); - caexFile.setAdditionalInformation(additionalInformation); - - // Add AssetAdministrationShell instance hierarchy to CAEX - InstanceHierarchy instanceHierarchy = new InstanceHierarchy(); - instanceHierarchy.setName(CAEXConstants.AAS_INSTANCE_HIERARCHY); - instanceHierarchy.setVersion(CAEXConstants.AAS_INSTANCE_HIERARCHY_VERSION); - caexFile.setInstanceHierarchy(instanceHierarchy); - - // Map all asset administration shells to internal elements - List administrationShells = new ArrayList<>(environment.getAssetAdministrationShells()); - List shellInternalElements = mapper.mapAsList(administrationShells, InternalElement.class); - instanceHierarchy.setInternalElements(shellInternalElements); - - // Map all submodels to internal elements - List submodels = new ArrayList<>(environment.getSubmodels()); - List submodelInternalElements = mapper.mapAsList(submodels, InternalElement.class); - instanceHierarchy.getInternalElements().addAll(submodelInternalElements); - - return caexFile; + public AmlSerializer(boolean enableClassLibs) { + this.enableClassLibs = enableClassLibs; } - private String convertXml(CAEXFile caexFile) throws JsonProcessingException { - caexFile.setInterfaceClassLibs(new ArrayList<>(){{ - add(readClassLib("interface-class-lib_aas.automl")); - add(readClassLib("interface-class-lib_automl_interface.automl")); - add(readClassLib("interface-class-lib_automl_bpr.automl")); - }}); - - caexFile.setRoleClassLibs(new ArrayList<>(){{ - add(readClassLib("role-class-lib_aas.automl")); - add(readClassLib("role-class-lib_automl_base.automl")); - add(readClassLib("role-class-lib_automl_bpr.automl")); - }}); - - caexFile.setSystemUnitClassLibs(new ArrayList<>(){{ - add(readClassLib("system-unit-class-lib_aas.automl")); - add(readClassLib("system-unit-class-lib_aas_data_specification_templates.automl")); - }}); - - XmlMapper xmlMapper = XmlMapper.builder() - .disable(SerializationFeature.FAIL_ON_EMPTY_BEANS) - .enable(SerializationFeature.INDENT_OUTPUT) - .addMixIn(CAEXFile.class, CAEXMixin.class) - .addMixIn(ExternalInterface.class, ExternalInterfaceMixin.class) - .addMixIn(AdditionalInformation.class, AdditionalInformationMixin.class) - .addMixIn(InstanceHierarchy.class, InstanceHierarchyMixin.class) - .addMixIn(InternalElement.class, InternalElementMixin.class) - .addMixIn(Attribute.class, AttributeMixin.class) - .addMixIn(RefSemantic.class, RefSemanticMixin.class) - .addMixIn(RoleRequirements.class, RoleRequirementsMixin.class) - .build(); - - return xmlMapper.writeValueAsString(caexFile); + @Override + public String write(AssetAdministrationShellEnvironment aasEnvironment) throws SerializationException { + return write(aasEnvironment, true); } - private String readClassLib(String fileName) { - ClassLoader classLoader = getClass().getClassLoader(); - File file = new File(classLoader.getResource(fileName).getFile()); - String content = null; + public String write(AssetAdministrationShellEnvironment aasEnvironment, boolean withLibraries) throws SerializationException { try { - content = new String(Files.readAllBytes(file.toPath())); - } catch (IOException e) { - e.printStackTrace(); + CAEXFile aml = mapper.map(aasEnvironment); + if (withLibraries) { + aml = addAASLibrary(aml); + } + Marshaller marshaller = JAXBContextFactory.createContext( + new Class[]{ + CAEXFile.class, + AutomationMLVersion.class, + WriterHeader.class, + WriterHeader.Wrapper.class + }, + null).createMarshaller(); + marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); + StringWriter writer = new StringWriter(); + marshaller.marshal(aml, writer); + return writer.toString(); + } catch (JAXBException ex) { + throw new SerializationException("error serializing AssetAdministrationShellEnvironment", ex); + } catch (MappingException ex) { + throw new SerializationException("error serializing AssetAdministrationShellEnvironment, mapping to AML failed", ex); + } catch (IOException ex) { + throw new SerializationException("error serializing AssetAdministrationShellEnvironment, AAS library could not be loaded", ex); } - return content; } - private String cleanUpXml(String xml) { - String withoutEmptyAttributes = xml.replaceAll("", ""); - String withoutEmptyLines = withoutEmptyAttributes.replaceAll("(?m)^[ \t]*\r?\n", ""); - return withoutEmptyLines; + private CAEXFile addAASLibrary(CAEXFile file) throws JAXBException, IOException { + // potential issue: when dynamically adding custom DataSpecificationTemplates this won't work + CAEXFile aasLib = loadAASLibrary(); + return CAEXFile.copyOf(file) + .addInterfaceClassLib(aasLib.getInterfaceClassLib()) + .addRoleClassLib(aasLib.getRoleClassLib()) + .addSystemUnitClassLib(aasLib.getSystemUnitClassLib()) + .build(); + } + + private CAEXFile loadAASLibrary() throws JAXBException, IOException { + Unmarshaller unmarshaller = JAXBContextFactory.createContext(new Class[]{CAEXFile.class}, null).createUnmarshaller(); + return (CAEXFile) unmarshaller.unmarshal(getClass().getResource(AAS_LIB_SOURCE).openStream()); } } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlToAasMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlToAasMapper.java new file mode 100644 index 00000000..50acb2a5 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlToAasMapper.java @@ -0,0 +1,26 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml; + +import io.adminshell.aas.v3.dataformat.aml.model.caex.CAEXFile; +import io.adminshell.aas.v3.model.AssetAdministrationShellEnvironment; + +public class AmlToAasMapper { + + public AssetAdministrationShellEnvironment map(CAEXFile aml) { + throw new UnsupportedOperationException(); + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/IdClassNamingStrategy.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/IdClassNamingStrategy.java new file mode 100644 index 00000000..33f4427e --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/IdClassNamingStrategy.java @@ -0,0 +1,35 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml; + +import java.util.UUID; + +public class IdClassNamingStrategy extends AbstractClassNamingStrategy { + + public IdClassNamingStrategy() { + super(); + } + + public IdClassNamingStrategy(boolean preferIdShort) { + super(preferIdShort); + } + + @Override + protected String generateName(Object obj) { + return UUID.randomUUID().toString(); + } + +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/IdentityProvider.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/IdentityProvider.java new file mode 100644 index 00000000..ee7b0e3e --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/IdentityProvider.java @@ -0,0 +1,51 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml; + +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; + +public class IdentityProvider { + + private Map ids = new HashMap<>(); + + public String getId(Object obj) { +// if (ids.containsKey(obj)) { +// return ids.get(obj); +// } + String result = generateId(); +// ids.put(obj, result); + return result; + } + + public String getCachedId(Object obj) { + if (ids.containsKey(obj)) { + return ids.get(obj); + } + String result = generateId(); + ids.put(obj, result); + return result; + } + + public String generateId() { + String result = null; + do { + result = UUID.randomUUID().toString(); + } while (ids.entrySet().contains(result)); + return result; + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/MappingContext.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/MappingContext.java new file mode 100644 index 00000000..f9da33a1 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/MappingContext.java @@ -0,0 +1,216 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml; + +import io.adminshell.aas.v3.dataformat.aml.mapper.MappingException; +import io.adminshell.aas.v3.dataformat.aml.model.caex.AttributeType; +import io.adminshell.aas.v3.dataformat.aml.model.caex.CAEXFile; +import io.adminshell.aas.v3.dataformat.aml.model.caex.CAEXFile.InstanceHierarchy; +import io.adminshell.aas.v3.dataformat.aml.model.caex.CAEXFile.SystemUnitClassLib; +import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; +import io.adminshell.aas.v3.dataformat.aml.model.caex.RoleClassType; +import io.adminshell.aas.v3.dataformat.aml.util.ReferencedReferableCollector; +import io.adminshell.aas.v3.model.AssetAdministrationShellEnvironment; +import io.adminshell.aas.v3.model.Referable; +import java.beans.PropertyDescriptor; +import java.lang.reflect.Type; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class MappingContext { + + private static final String EMPTY_STRING = ""; + private static final Logger log = LoggerFactory.getLogger(MappingContext.class); + private IdentityProvider identityProvider; + private final MappingProvider mappingProvider; + private final AssetAdministrationShellEnvironment environment; + private CAEXFile.Builder fileBuilder; + private final InstanceHierarchy.Builder hierarchyBuilder; + private final InternalElementType.Builder internalElementBuilder; + private final AttributeType.Builder attributeBuilder; + private final PropertyDescriptor property; + private final Map referecedReferableIDs; + + public MappingContext(MappingProvider mappingProvider, AssetAdministrationShellEnvironment environment) { + this(mappingProvider, null, environment, null, null, null, null, null); + } + + public String getInternalLinkTargetId(Referable target) { + if (!isTargetOfInternalLink(target)) { + referecedReferableIDs.put(target, identityProvider.getCachedId(target)); + } + return referecedReferableIDs.get(target); + } + + public boolean isTargetOfInternalLink(Referable target) { + return referecedReferableIDs.containsKey(target) && !referecedReferableIDs.get(target).equals(EMPTY_STRING); + } + + public void appendReferenceTargetInterfaceIfRequired(Object obj) { + RoleClassType.ExternalInterface referenceTargetInterface = getReferenceTargetInterface(obj); + if (referenceTargetInterface != null) { + internalElementBuilder.addExternalInterface(referenceTargetInterface); + } + } + + public RoleClassType.ExternalInterface getReferenceTargetInterface(Object obj) { + RoleClassType.ExternalInterface result = null; + if (obj != null && Referable.class.isAssignableFrom(obj.getClass())) { + Referable referable = (Referable) obj; + if (isTargetOfInternalLink(referable)) { + result = RoleClassType.ExternalInterface.builder() + .withID(identityProvider.generateId()) + .withName("externalReferenceTarget") + .withRefBaseClassPath("AutomationMLInterfaceClassLib/AutomationMLBaseInterface") + .build(); + } + } + return result; + } + + public MappingContext(MappingProvider mappingProvider, + IdentityProvider identityProvider, + AssetAdministrationShellEnvironment environment, + Map referecedReferableIDs, + InstanceHierarchy.Builder hierarchyBuilder, + InternalElementType.Builder internalElementBuilder, AttributeType.Builder attributeBuilder, + PropertyDescriptor property) { + if (identityProvider == null) { + this.identityProvider = new IdentityProvider(); + } else { + this.identityProvider = identityProvider; + } + if (referecedReferableIDs == null) { + this.referecedReferableIDs = new ReferencedReferableCollector(environment).collect().stream() + .collect(Collectors.toMap(x -> x, x -> EMPTY_STRING)); + } else { + this.referecedReferableIDs = referecedReferableIDs; + } + this.fileBuilder = CAEXFile.builder(); + this.mappingProvider = mappingProvider; + this.environment = environment; + this.hierarchyBuilder = hierarchyBuilder; + this.internalElementBuilder = internalElementBuilder; + this.attributeBuilder = attributeBuilder; + this.property = property; + } + + public void addAttribute(AttributeType attribute) { + if (attributeBuilder != null) { + attributeBuilder.addAttribute(attribute); + } else if (internalElementBuilder != null) { + internalElementBuilder.addAttribute(attribute); + } else { + log.warn("adding attribute failed because no parent builder defined"); + } + } + + public void addSystemUnitClassLib(SystemUnitClassLib systemUnitClassLib) { + if (fileBuilder != null) { + fileBuilder = fileBuilder.withSystemUnitClassLib(systemUnitClassLib); + } + } + + public void addInternalElement(InternalElementType internalElement) { + if (internalElementBuilder != null) { + internalElementBuilder.addInternalElement(internalElement); + } else if (hierarchyBuilder != null) { + hierarchyBuilder.addInternalElement(internalElement); + } else { + log.warn("adding internalElement failed because no parent builder defined"); + } + } + + public void map(T value) throws MappingException { + mappingProvider.getMapper(value).map(value, this); + } + + public void map(Type type, T value) throws MappingException { + mappingProvider.getMapper(type).map(value, this); + } + + public MappingContext with(InstanceHierarchy.Builder hierarchyBuilder) { + return new MappingContext(mappingProvider, identityProvider, environment, referecedReferableIDs, hierarchyBuilder, internalElementBuilder, attributeBuilder, property); + } + + public MappingContext with(InternalElementType.Builder internalElementBuilder) { + return new MappingContext(mappingProvider, identityProvider, environment, referecedReferableIDs, hierarchyBuilder, internalElementBuilder, attributeBuilder, property); + } + + public MappingContext with(AttributeType.Builder attributeBuilder) { + return new MappingContext(mappingProvider, identityProvider, environment, referecedReferableIDs, hierarchyBuilder, internalElementBuilder, attributeBuilder, property); + } + + public MappingContext with(PropertyDescriptor property) { + return new MappingContext(mappingProvider, identityProvider, environment, referecedReferableIDs, hierarchyBuilder, internalElementBuilder, attributeBuilder, property); + } + + public MappingContext withoutProperty() { + return new MappingContext(mappingProvider, identityProvider, environment, referecedReferableIDs, hierarchyBuilder, internalElementBuilder, attributeBuilder, null); + } + + public MappingContext withoutIdentidyProvider() { + return new MappingContext(mappingProvider, new IdentityProvider(), environment, referecedReferableIDs, hierarchyBuilder, internalElementBuilder, attributeBuilder, null); + } + + public void resetIdentityProvider() { + this.identityProvider = new IdentityProvider(); + } + + public void etIdentityProvider(IdentityProvider identityProvider) { + this.identityProvider = identityProvider; + } + + public PropertyDescriptor getProperty() { + return property; + } + + public AssetAdministrationShellEnvironment getEnvironment() { + return environment; + } + + public MappingProvider getMappingProvider() { + return mappingProvider; + } + + public CAEXFile.Builder getFileBuilder() { + return fileBuilder; + } + + public IdentityProvider getIdentityProvider() { + return identityProvider; + } + + public InstanceHierarchy.Builder getHierarchyBuilder() { + return hierarchyBuilder; + } + + public InternalElementType.Builder getInternalElementBuilder() { + return internalElementBuilder; + } + + public AttributeType.Builder getAttributeBuilder() { + return attributeBuilder; + } + + public Map getReferecedReferableIDs() { + return referecedReferableIDs; + } + +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/MappingProvider.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/MappingProvider.java new file mode 100644 index 00000000..576cbe38 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/MappingProvider.java @@ -0,0 +1,127 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml; + +import com.google.common.reflect.TypeToken; +import io.adminshell.aas.v3.dataformat.aml.mapper.Mapper; +import io.adminshell.aas.v3.dataformat.aml.util.TypeUtils; +import java.lang.reflect.Type; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import java.util.stream.Collectors; +import static java.util.stream.Collectors.groupingBy; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class MappingProvider { + + private static final Logger log = LoggerFactory.getLogger(MappingProvider.class); + private final NamingStrategy internalElementNamingStrategy; + private final NamingStrategy attributeNamingStrategy; + private Mapper defaultMapper; + private Mapper> defaultCollectionMapper; + private Map, List> mappings; + + public MappingProvider(Mapper defaultMapper, + Mapper> defaultCollectionMapper, + List> mappers, + NamingStrategy internalElementNamingStrategy, + NamingStrategy attributeNamingStrategy) { + this.defaultMapper = defaultMapper; + this.defaultCollectionMapper = defaultCollectionMapper; + this.internalElementNamingStrategy = internalElementNamingStrategy; + this.attributeNamingStrategy = attributeNamingStrategy; + initializeMappings(mappers); + } + + public MappingProvider copy() { + return new MappingProvider(defaultMapper, defaultCollectionMapper, mappings, internalElementNamingStrategy, attributeNamingStrategy); + } + + public void forceMapper(TypeToken typeToken, Mapper mapper) { + mappings.put(typeToken, Arrays.asList(mapper)); + } + + public void forceMapper(Class type, Mapper mapper) { + mappings.put(TypeToken.of(type), Arrays.asList(mapper)); + } + + protected MappingProvider(Mapper defaultMapper, + Mapper> defaultCollectionMapper, + Map, List> mappings, + NamingStrategy internalElementNamingStrategy, + NamingStrategy attributeNamingStrategy) { + this.defaultMapper = defaultMapper; + this.defaultCollectionMapper = defaultCollectionMapper; + this.internalElementNamingStrategy = internalElementNamingStrategy; + this.attributeNamingStrategy = attributeNamingStrategy; + this.mappings = mappings; + } + + private void initializeMappings(List> mappers) { + // can be extremely simplified as same interface cannot be implemented twice in one class! + mappings = mappers.stream().flatMap(x -> TypeToken.of(x.getClass()) + .getTypes().stream() + .filter(y -> Mapper.class.equals(y.getRawType())) + .map(y -> new Object() { + TypeToken type = y.resolveType(Mapper.class.getTypeParameters()[0]); + Mapper mapper = x; + })).collect(groupingBy( + x -> x.type, + Collectors.mapping(x -> x.mapper, Collectors.toList()))); + } + + public Mapper getMapper(Object obj) { + if (obj == null) { + return getMapper(Object.class); + } + if (Type.class.isAssignableFrom(obj.getClass())) { + return getMapper((Type) obj); + } + return getMapper(obj.getClass()); + } + + public Mapper getMapper(Type type) { + Optional> customMapper = mappings.entrySet().stream() + .filter(x -> x.getKey().isSupertypeOf(type)) + .sorted((x, y) -> Objects.compare(x.getKey(), y.getKey(), new TypeUtils.TypeTokenComparator())) + .map(x -> x.getValue()) + .findFirst(); + if (!customMapper.isPresent() || customMapper.get().isEmpty()) { + if (TypeToken.of(Collection.class).isSupertypeOf(type) && defaultCollectionMapper != null) { + return (Mapper) 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); + } + + public NamingStrategy getInternalElementNamingStrategy() { + return internalElementNamingStrategy; + } + + public NamingStrategy getAttributeNamingStrategy() { + return attributeNamingStrategy; + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/NamingStrategy.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/NamingStrategy.java new file mode 100644 index 00000000..233e23f0 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/NamingStrategy.java @@ -0,0 +1,23 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml; + +import java.lang.reflect.Type; + +public interface NamingStrategy { + + public String getName(Type type, Object obj, String property); +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/NumberingClassNamingStrategy.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/NumberingClassNamingStrategy.java new file mode 100644 index 00000000..03b6a13c --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/NumberingClassNamingStrategy.java @@ -0,0 +1,42 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml; + +import java.util.HashMap; +import java.util.Map; + +public class NumberingClassNamingStrategy extends AbstractClassNamingStrategy { + + private final Map, Integer> counter = new HashMap<>(); + + public NumberingClassNamingStrategy() { + super(); + } + + public NumberingClassNamingStrategy(boolean preferIdShort) { + super(preferIdShort); + } + + @Override + protected String generateName(Object obj) { + if (!counter.containsKey(obj.getClass())) { + counter.put(obj.getClass(), 0); + } + counter.put(obj.getClass(), counter.get(obj.getClass()) + 1); + return obj.getClass().getSimpleName() + "_" + counter.get(obj.getClass()); + } + +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/PropertyNamingStrategy.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/PropertyNamingStrategy.java new file mode 100644 index 00000000..c55d23e5 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/PropertyNamingStrategy.java @@ -0,0 +1,73 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml; + +import com.google.common.reflect.TypeToken; +import io.adminshell.aas.v3.dataformat.aml.util.TypeUtils; +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.Optional; +import java.util.function.BiFunction; +import java.util.function.Function; +import java.util.stream.Collectors; + +public class PropertyNamingStrategy implements NamingStrategy { + + protected List customNamings = new ArrayList<>(); + + protected class TypeSafeFunction { + + public TypeSafeFunction(Class inputType, BiFunction provider) { + this.inputType = TypeToken.of(inputType); + this.provider = provider; + } + TypeToken inputType; + BiFunction provider; + } + + public void registerCustomNaming(Class type, BiFunction provider) { + customNamings.add(new TypeSafeFunction(type, provider)); + } + + public void registerCustomNaming(Class type, String oldName, String newName) { + customNamings.add(new TypeSafeFunction(type, (obj, property) -> Objects.equals(oldName, property) ? newName : null)); + } + + public void registerCustomNaming(Class type, Function provider) { + customNamings.add(new TypeSafeFunction(type, (x, y) -> provider.apply((T) x))); + } + + private List getCustomNaming(Type type, String property) { + return customNamings.stream() + .filter(x -> x.inputType.isSupertypeOf(type)) + .sorted((x, y) -> Objects.compare(x.inputType, y.inputType, new TypeUtils.TypeTokenComparator())) + .collect(Collectors.toList()); + } + + @Override + public String getName(Type type, Object obj, String property) { + for (TypeSafeFunction customNaming : getCustomNaming(type, property)) { + String result = (String) customNaming.provider.apply(obj, property); + if (result != null) { + return result; + } + } + return property; + } + +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/ValueMapping.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/ValueMapping.java new file mode 100644 index 00000000..9c2fc560 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/ValueMapping.java @@ -0,0 +1,53 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml; + +public class ValueMapping { + + private Object value; + private MappingMode mappingMode; + + public ValueMapping(Object result) { + this.value = result; + this.mappingMode = MappingMode.VALUE; + } + + public ValueMapping(Object result, MappingMode mappingMode) { + this.value = result; + this.mappingMode = mappingMode; + } + + public Object getValue() { + return value; + } + + public void setValue(Object value) { + this.value = value; + } + + public MappingMode getMappingMode() { + return mappingMode; + } + + public void setMappingMode(MappingMode mappingMode) { + this.mappingMode = mappingMode; + } + + public static enum MappingMode { + VALUE, + RECURSIVE + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/header/AutomationMLVersion.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/header/AutomationMLVersion.java new file mode 100644 index 00000000..0fc06f46 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/header/AutomationMLVersion.java @@ -0,0 +1,45 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.header; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElementRef; +import javax.xml.bind.annotation.XmlType; + +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(namespace = "http://www.w3.org/2001/XMLSchema", name = "string") +public class AutomationMLVersion { + + public static final String DEFAULT_VERSION = "2.0"; + + @XmlAttribute(name = "AutomationMLVersion") + private final String value; + + public AutomationMLVersion() { + value = DEFAULT_VERSION; + } + + public AutomationMLVersion(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/header/WriterHeader.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/header/WriterHeader.java new file mode 100644 index 00000000..e6aca9d6 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/header/WriterHeader.java @@ -0,0 +1,144 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.header; + +import java.text.SimpleDateFormat; +import java.util.Date; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + +public class WriterHeader { + + @XmlElement(name = "WriterName") + private String name; + @XmlElement(name = "WriterID") + private String id; + @XmlElement(name = "WriterVendor") + private String vendor; + @XmlElement(name = "WriterVendorURL") + private String vendorUrl; + @XmlElement(name = "WriterVersion") + private String version; + @XmlElement(name = "WriterRelease") + private String release; + @XmlElement(name = "LastWritingDateTime") + private String writingDate; + @XmlElement(name = "WriterProjectTitle") + private String projectTitle; + @XmlElement(name = "WriterProjectID") + private String projectID; + + public WriterHeader() { + SimpleDateFormat formatter = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss"); + writingDate = formatter.format(new Date()); + } + + public String getName() { + return name; + } + +// @XmlType(name = "xs:string") + public static class Wrapper { + + @XmlElement(name = "WriterHeader") + private WriterHeader writerHeader; + + public Wrapper() { + } + + public WriterHeader getWriterHeader() { + return writerHeader; + } + + public void setWriterHeader(WriterHeader writerHeader) { + this.writerHeader = writerHeader; + } + } + + public Object wrap() { + Wrapper result = new Wrapper(); + result.setWriterHeader(this); + return result; + } + + public void setName(String name) { + this.name = name; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getVendor() { + return vendor; + } + + public void setVendor(String vendor) { + this.vendor = vendor; + } + + public String getVendorUrl() { + return vendorUrl; + } + + public void setVendorUrl(String vendorUrl) { + this.vendorUrl = vendorUrl; + } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + public String getRelease() { + return release; + } + + public void setRelease(String release) { + this.release = release; + } + + public String getWritingDate() { + return writingDate; + } + + public void setWritingDate(String writingDate) { + this.writingDate = writingDate; + } + + public String getProjectTitle() { + return projectTitle; + } + + public void setProjectTitle(String projectTitle) { + this.projectTitle = projectTitle; + } + + public String getProjectID() { + return projectID; + } + + public void setProjectID(String projectID) { + this.projectID = projectID; + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/AbstractCollectionMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/AbstractCollectionMapper.java new file mode 100644 index 00000000..ae1a3f25 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/AbstractCollectionMapper.java @@ -0,0 +1,61 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.mapper; + +import io.adminshell.aas.v3.dataformat.aml.MappingContext; +import io.adminshell.aas.v3.dataformat.aml.model.caex.AttributeType; +import io.adminshell.aas.v3.dataformat.core.ReflectionHelper; +import java.lang.reflect.ParameterizedType; +import java.util.Collection; + +public class AbstractCollectionMapper extends BaseMapper> { + + @Override + protected Class getValueType(Collection collection, MappingContext context) { + if (context.getProperty() != null) { + return (Class) ((ParameterizedType) context.getProperty().getReadMethod().getGenericReturnType()).getActualTypeArguments()[0]; + } + if (collection != null && !collection.isEmpty()) { + return (Class) ReflectionHelper.getAasInterface(collection.iterator().next().getClass()); + } + return (Class) ((ParameterizedType) getClass().getGenericSuperclass()).getActualTypeArguments()[0]; + } + + @Override + protected void toInternalElement(Collection collection, MappingContext context) throws MappingException { + for (T element : collection) { + context.withoutProperty().map(element); + } + } + + @Override + protected void toAttribute(Collection collection, MappingContext context) throws MappingException { + Class aasType = context.getProperty().getReadMethod().getDeclaringClass(); + AttributeType.Builder builder = AttributeType.builder() + .withName(context.getMappingProvider().getAttributeNamingStrategy().getName( + context.getProperty().getReadMethod().getReturnType(), + collection, + context.getProperty().getName())) + .withRefSemantic(refSemantic( + aasType.getSimpleName(), + context.getProperty().getName())); + MappingContext subContext = context.with(builder).withoutProperty(); + for (T element : collection) { + subContext.map(element); + } + context.addAttribute(builder.build()); + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/AssetAdministrationShellEnvironmentMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/AssetAdministrationShellEnvironmentMapper.java new file mode 100644 index 00000000..3f54fbf0 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/AssetAdministrationShellEnvironmentMapper.java @@ -0,0 +1,115 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.mapper; + +import com.google.inject.util.Types; +import io.adminshell.aas.v3.dataformat.aml.IdentityProvider; +import io.adminshell.aas.v3.dataformat.aml.MappingContext; +import io.adminshell.aas.v3.dataformat.aml.MappingProvider; +import io.adminshell.aas.v3.dataformat.aml.model.caex.CAEXFile; +import io.adminshell.aas.v3.dataformat.aml.model.caex.CAEXFile.SystemUnitClassLib; +import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; +import io.adminshell.aas.v3.dataformat.aml.model.caex.SystemUnitClassType; +import io.adminshell.aas.v3.dataformat.aml.model.caex.SystemUnitClassType.SupportedRoleClass; +import io.adminshell.aas.v3.dataformat.aml.model.caex.SystemUnitFamilyType; +import io.adminshell.aas.v3.dataformat.aml.util.AASUtils; +import io.adminshell.aas.v3.dataformat.core.ReflectionHelper; +import io.adminshell.aas.v3.model.AssetAdministrationShell; +import io.adminshell.aas.v3.model.AssetAdministrationShellEnvironment; +import io.adminshell.aas.v3.model.ConceptDescription; +import io.adminshell.aas.v3.model.ModelingKind; +import io.adminshell.aas.v3.model.Submodel; +import java.util.Collection; +import java.util.List; +import java.util.stream.Collectors; + +public class AssetAdministrationShellEnvironmentMapper extends BaseMapper { + + @Override + public void map(AssetAdministrationShellEnvironment value, MappingContext context) throws MappingException { + List assetAdministrationShells = value.getAssetAdministrationShells().stream() + .filter(x -> x.getSubmodels().stream() + .anyMatch(sm -> AASUtils.resolveSubmodelReference(sm, value).get().getKind() == ModelingKind.INSTANCE)) + .collect(Collectors.toList()); + toHierarchy(AssetAdministrationShell.class, assetAdministrationShells, context); + toHierarchy(ConceptDescription.class, value.getConceptDescriptions(), context); + mapTemplates(value, context); + } + + protected void toHierarchy(Class type, Collection value, MappingContext context) throws MappingException { + CAEXFile.InstanceHierarchy.Builder builder = CAEXFile.InstanceHierarchy.builder() + .withName(type.getSimpleName() + "InstanceHierarchy"); + context.with(builder).map(Types.newParameterizedType(Collection.class, type), value); + context.getFileBuilder().addInstanceHierarchy(builder.build()); + } + + protected void mapTemplates(AssetAdministrationShellEnvironment env, MappingContext context) throws MappingException { + context.resetIdentityProvider(); + boolean empty = true; + SystemUnitClassLib.Builder builder = SystemUnitClassLib.builder() + .withName("AssetAdministrationShellSystemUnitClasses"); + // generate SystemUnitClass for each AAS with at least 1 Submodel with kind == TEMPLATE + // generate SystemUnitClass for each Submodel with king == TEMPLATE + for (AssetAdministrationShell aas : env.getAssetAdministrationShells()) { + List submodelTemplates = AASUtils.getSubmodelTemplates(aas, env); + if (!submodelTemplates.isEmpty()) { + empty = false; + InternalElementType.Builder temp = InternalElementType.builder(); + MappingContext subContext = new MappingContext( + context.getMappingProvider(), + new IdentityProvider(), + env, + context.getReferecedReferableIDs(), + null, + temp, + null, + null); + subContext.map(aas); + builder.addSystemUnitClass(internalElementToSystemUnitClass(temp.build().getInternalElement().get(0))); + } + for (Submodel submodel : submodelTemplates) { + InternalElementType.Builder temp = InternalElementType.builder(); + MappingContext subContext = new MappingContext( + context.getMappingProvider(), + new IdentityProvider(), + env, + context.getReferecedReferableIDs(), + null, + temp, + null, + null); + subContext.map(submodel); + builder.addSystemUnitClass(internalElementToSystemUnitClass(temp.build().getInternalElement().get(0))); + } + } + if (!empty) { + context.addSystemUnitClassLib(builder.build()); +// context.getFileBuilder().addSystemUnitClassLib(builder.build()); + } + } + + protected SystemUnitFamilyType internalElementToSystemUnitClass(InternalElementType internalElement) { + return SystemUnitFamilyType.builder() + .withName(internalElement.getName()) + .withID(internalElement.getID()) + .addAttribute(internalElement.getAttribute()) + .addInternalElement(internalElement.getInternalElement()) + .withSupportedRoleClass(SupportedRoleClass.builder() + .withRefRoleClassPath(internalElement.getRoleRequirements().getRefBaseRoleClassPath()) + .build()) + .build(); + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/BaseMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/BaseMapper.java new file mode 100644 index 00000000..a97a64b8 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/BaseMapper.java @@ -0,0 +1,136 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.mapper; + +import io.adminshell.aas.v3.dataformat.aml.MappingContext; +import io.adminshell.aas.v3.dataformat.aml.model.caex.AttributeType; +import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; +import io.adminshell.aas.v3.dataformat.aml.model.caex.RoleClassType; +import io.adminshell.aas.v3.dataformat.core.ReflectionHelper; +import io.adminshell.aas.v3.model.Referable; +import java.beans.IntrospectionException; +import java.beans.Introspector; +import java.beans.PropertyDescriptor; +import java.lang.reflect.InvocationTargetException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.List; +import java.util.Optional; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +public abstract class BaseMapper implements Mapper { + + protected Optional findMapper(Class type) { + return Optional.empty(); + } + + protected Class getValueType(T value, MappingContext context) { + return value.getClass(); + } + + @Override + public void map(T value, MappingContext context) throws MappingException { + if (value == null || context == null) { + return; + } + Class aasType = getValueType(value, context); + Class aasTypeInfo = ReflectionHelper.getMostSpecificTypeWithModelType(aasType); + if (aasTypeInfo != null) { + toInternalElement(value, context); + } else { + toAttribute(value, context); + } + } + + protected void toInternalElement(T value, MappingContext context) throws MappingException { + InternalElementType.Builder builder = InternalElementType.builder(); + builder = builder.withID(context.getIdentityProvider().getCachedId(value)) + .withName(context.getMappingProvider().getInternalElementNamingStrategy().getName( + value.getClass(), + value, + null)) + .withRoleRequirements(roleRequirement(ReflectionHelper.getModelType(value.getClass()))); + mapProperties(value, context.with(builder)); + context.with(builder).appendReferenceTargetInterfaceIfRequired(value); + context.addInternalElement(builder.build()); + } + + protected void toAttribute(T value, MappingContext context) throws MappingException { + Class aasType = ReflectionHelper.getAasInterface(value.getClass()); + AttributeType.Builder builder = AttributeType.builder(); + if (context.getProperty() != null) { + builder = builder + .withName(context.getMappingProvider().getAttributeNamingStrategy().getName( + context.getProperty().getReadMethod().getGenericReturnType(), + value, + context.getProperty().getName())) + .withRefSemantic(refSemantic( + context.getProperty().getReadMethod().getDeclaringClass().getSimpleName(), + context.getProperty().getName())); + } + if (aasType != null) { + mapProperties(value, context.with(builder)); + } else { + builder = builder.withValue(value); + } + context.addAttribute(builder.build()); + } + + protected void mapProperties(T value, MappingContext context, String... ignoreProperties) throws MappingException { + List ignored = Arrays.asList(ignoreProperties); + Class aasType = ReflectionHelper.getAasInterface(value.getClass()); + Set> types = new HashSet<>(); + if (aasType != null) { + types.add(aasType); + types.addAll(ReflectionHelper.getSuperTypes(aasType, true)); + } + for (Class type : types) { + try { + for (PropertyDescriptor property : Introspector.getBeanInfo(type).getPropertyDescriptors()) { + if (!ignored.contains(property.getName())) { + context.with(property).map(property.getReadMethod().getGenericReturnType(), + getPropertyValue(value, property, context)); + } + } + } catch (IntrospectionException ex) { + throw new MappingException("error listing properties of class " + type, ex); + } + } + } + + protected Object getPropertyValue(T value, PropertyDescriptor property, MappingContext context) throws MappingException { + try { + return property.getReadMethod().invoke(value); + } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException ex) { + throw new MappingException("failed to get property value for property " + property.getName(), ex); + } + } + + protected InternalElementType.RoleRequirements roleRequirement(String value) { + return InternalElementType.RoleRequirements.builder() + .withRefBaseRoleClassPath("AssetAdministrationShellRoleClassLib/" + value) + .build(); + } + + protected AttributeType.RefSemantic refSemantic(String className, String propertyName) { + return AttributeType.RefSemantic.builder() + .withCorrespondingAttributePath("AAS:" + className + "/" + propertyName) + .build(); + } + +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/CollectionMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/CollectionMapper.java new file mode 100644 index 00000000..10fe1719 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/CollectionMapper.java @@ -0,0 +1,22 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.mapper; + +import java.util.Collection; + +public interface CollectionMapper extends Mapper> { + +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/ConstraintCollectionMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/ConstraintCollectionMapper.java new file mode 100644 index 00000000..cd205c4e --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/ConstraintCollectionMapper.java @@ -0,0 +1,30 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.mapper; + +import io.adminshell.aas.v3.dataformat.aml.MappingContext; +import io.adminshell.aas.v3.model.Constraint; +import java.util.Collection; + +public class ConstraintCollectionMapper implements CollectionMapper { + + @Override + public void map(Collection value, MappingContext context) throws MappingException { + for (Constraint element : value) { + context.map(element); + } + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/DataSpecificationContentMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/DataSpecificationContentMapper.java new file mode 100644 index 00000000..960f8bd3 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/DataSpecificationContentMapper.java @@ -0,0 +1,46 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.mapper; + +import io.adminshell.aas.v3.dataformat.aml.MappingContext; +import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; +import io.adminshell.aas.v3.dataformat.core.ReflectionHelper; +import io.adminshell.aas.v3.model.DataSpecificationContent; + +public class DataSpecificationContentMapper extends BaseMapper { + + public DataSpecificationContentMapper() { + } + + @Override + public void map(DataSpecificationContent content, MappingContext context) throws MappingException { + toInternalElement(content, context); + } + + @Override + protected void toInternalElement(DataSpecificationContent value, MappingContext context) throws MappingException { + InternalElementType.Builder builder = InternalElementType.builder(); + builder = builder.withID(context.getIdentityProvider().getId(value)) + .withName(context.getMappingProvider().getInternalElementNamingStrategy().getName( + value.getClass(), + value, + null)) + .withRoleRequirements(roleRequirement(DataSpecificationContent.class.getSimpleName())); + mapProperties(value, context.with(builder)); + context.with(builder).appendReferenceTargetInterfaceIfRequired(value); + context.addInternalElement(builder.build()); + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/DataSpecificationIEC61360Mapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/DataSpecificationIEC61360Mapper.java new file mode 100644 index 00000000..2d674def --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/DataSpecificationIEC61360Mapper.java @@ -0,0 +1,52 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.mapper; + +import io.adminshell.aas.v3.dataformat.aml.MappingContext; +import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; +import io.adminshell.aas.v3.dataformat.core.ReflectionHelper; +import io.adminshell.aas.v3.model.DataSpecificationContent; +import io.adminshell.aas.v3.model.DataSpecificationIEC61360; +import java.beans.PropertyDescriptor; + +public class DataSpecificationIEC61360Mapper extends BaseMapper { + + @Override + public void map(DataSpecificationIEC61360 content, MappingContext context) throws MappingException { + toInternalElement(content, context); + } + + @Override + protected void toInternalElement(DataSpecificationIEC61360 value, MappingContext context) throws MappingException { + InternalElementType.Builder builder = InternalElementType.builder(); + builder = builder.withID(context.getIdentityProvider().getId(value)) + .withName(context.getMappingProvider().getInternalElementNamingStrategy().getName( + value.getClass(), + value, + null)) + .withRoleRequirements(roleRequirement(DataSpecificationContent.class.getSimpleName())); + mapProperties(value, context.with(builder)); + context.with(builder).appendReferenceTargetInterfaceIfRequired(value); + context.addInternalElement(builder.build()); + } + + protected Object getPropertyValue(DataSpecificationIEC61360 value, PropertyDescriptor property, MappingContext context) throws MappingException { + if (property.getName().equals("levelTypes") || property.getName().equals("valueList")) { + return null; + } + return super.getPropertyValue(value, property, context); + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/DataSpecificationMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/DataSpecificationMapper.java new file mode 100644 index 00000000..815f671f --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/DataSpecificationMapper.java @@ -0,0 +1,49 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.mapper; + +import io.adminshell.aas.v3.dataformat.aml.MappingContext; +import io.adminshell.aas.v3.dataformat.aml.model.caex.AttributeType; +import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; +import io.adminshell.aas.v3.dataformat.aml.model.caex.RoleClassType; +import io.adminshell.aas.v3.dataformat.aml.model.caex.SystemUnitClassType.InternalLink; +import io.adminshell.aas.v3.dataformat.aml.util.AASUtils; +import io.adminshell.aas.v3.dataformat.core.ReflectionHelper; +import io.adminshell.aas.v3.model.DataSpecificationContent; +import io.adminshell.aas.v3.model.EmbeddedDataSpecification; + +public class DataSpecificationMapper extends BaseMapper { + + public DataSpecificationMapper() { + } + + @Override + public void map(EmbeddedDataSpecification value, MappingContext context) throws MappingException { + if (value.getDataSpecificationContent() != null) { + //embedded + DataSpecificationContent content = value.getDataSpecificationContent(); + String refSystemUnitPath = "AssetAdministrationShellDataSpecificationTemplates/" + content.getClass().getSimpleName() + "Template/" + content.getClass().getSimpleName(); + InternalElementType.Builder builder = InternalElementType.builder() + .withID(context.getIdentityProvider().getId(value)) + .withRefBaseSystemUnitPath(refSystemUnitPath) + .withName("EmbeddedDataSpecification"); + // serialize properties, but with different attribute path ("IEC:DataSpecificationIEC63360/[propertyName]) + } else { + // linked + // should this even be serialized for AML? + } + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/DefaultCollectionMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/DefaultCollectionMapper.java new file mode 100644 index 00000000..b342911a --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/DefaultCollectionMapper.java @@ -0,0 +1,20 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.mapper; + +public class DefaultCollectionMapper extends AbstractCollectionMapper { + +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/DefaultMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/DefaultMapper.java new file mode 100644 index 00000000..bab23d08 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/DefaultMapper.java @@ -0,0 +1,20 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.mapper; + +public class DefaultMapper extends BaseMapper { + +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/EmbeddedDataSpecificationCollectionMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/EmbeddedDataSpecificationCollectionMapper.java new file mode 100644 index 00000000..fbda1b31 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/EmbeddedDataSpecificationCollectionMapper.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 io.adminshell.aas.v3.dataformat.aml.mapper; + +import io.adminshell.aas.v3.dataformat.aml.MappingContext; +import io.adminshell.aas.v3.dataformat.aml.model.caex.AttributeType; +import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; +import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.util.ReferenceConverterUtil; +import io.adminshell.aas.v3.model.DataSpecificationContent; +import io.adminshell.aas.v3.model.EmbeddedDataSpecification; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +public class EmbeddedDataSpecificationCollectionMapper extends BaseMapper> { + + @Override + public void map(Collection value, MappingContext context) throws MappingException { + if (value == null || context == null || value.isEmpty()) { + return; + } + long countAttributes = value.stream().filter(x -> x.getDataSpecificationContent() == null).count(); + long countInternalElement = value.size() - countAttributes; + List attributes = new ArrayList<>(); + List internalElements = new ArrayList<>(); + for (EmbeddedDataSpecification element : value) { + if (element.getDataSpecificationContent() == null) { + AttributeType.Builder builder = AttributeType.builder() + .withName("hasDataSpecification" + (countAttributes > 1 ? "_" + (attributes.size() + 1) : "")) + .withValue(ReferenceConverterUtil.convert(element.getDataSpecification())) + .withRefSemantic(refSemantic("ConceptDescription", "dataSpecification")); + attributes.add(builder.build()); + } else { + // need to map all properties but with specific attribute path + // idea: get current attribute path via context? + // for now do not care about correct attribute path + InternalElementType.Builder temp = InternalElementType.builder(); + MappingContext subContext = new MappingContext( + context.getMappingProvider(), + context.getIdentityProvider(), + context.getEnvironment(), + context.getReferecedReferableIDs(), + null, + temp, + null, + null); + subContext.map(element.getDataSpecificationContent()); + InternalElementType.Builder builder = InternalElementType.copyOf(temp.build().getInternalElement().get(0)) + .withName("EmbeddedDataSpecification" + (countInternalElement > 1 ? "_" + (internalElements.size() + 1) : "")) + .withID(context.getIdentityProvider().getId(element)) + .withRefBaseSystemUnitPath("AssetAdministrationShellDataSpecificationTemplates/" + + getDataSpecificationContentType(element.getDataSpecificationContent().getClass()) + "Template/" + + getDataSpecificationContentType(element.getDataSpecificationContent().getClass())); + internalElements.add(builder.build()); + } + } + attributes.forEach(x -> context.addAttribute(x)); + internalElements.forEach(x -> context.addInternalElement(x)); + } + + private String getDataSpecificationContentType(Class type) { + // TODO should be resolved using DataSpecificationManager but this requires fundamental changes to + // DataSpecificationManager as it currently is based on Reference instead of name + // workaround: go up superclasses/interfaces and find most-specific interface that extends DataSpecificationContent + if (type == null) { + return null; + } + Class[] interfaces = type.getInterfaces(); + for (Class temp : interfaces) { + if (DataSpecificationContent.class.isAssignableFrom(temp)) { + return temp.getSimpleName(); + } + } + return getDataSpecificationContentType(type.getSuperclass()); + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/FileMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/FileMapper.java new file mode 100644 index 00000000..925fa0ed --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/FileMapper.java @@ -0,0 +1,61 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.mapper; + +import io.adminshell.aas.v3.dataformat.aml.MappingContext; +import io.adminshell.aas.v3.dataformat.aml.model.caex.AttributeType; +import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; +import io.adminshell.aas.v3.dataformat.aml.model.caex.RoleClassType; +import io.adminshell.aas.v3.dataformat.core.ReflectionHelper; +import io.adminshell.aas.v3.model.File; + +public class FileMapper extends BaseMapper { + + public FileMapper() { + } + + @Override + public void map(File file, MappingContext context) throws MappingException { + if (file == null) { + return; + } + InternalElementType.Builder builder = InternalElementType.builder(); + builder = builder.withID(context.getIdentityProvider().getCachedId(file)) + .withName(context.getMappingProvider().getInternalElementNamingStrategy().getName( + file.getClass(), + file, + null)) + .withRoleRequirements(roleRequirement(ReflectionHelper.getModelType(file.getClass()))) + .withExternalInterface(RoleClassType.ExternalInterface.builder() + .withName("FileDataReference") + .withID(context.getIdentityProvider().generateId()) + .withRefBaseClassPath("AssetAdministrationShellInterfaceClassLib/FileDataReference") + .addAttribute(AttributeType.builder() + .withName("MIMEType") + .withAttributeDataType("xs:string") + .withValue(file.getMimeType()) + .build()) + .addAttribute(AttributeType.builder() + .withName("refURI") + .withValue(file.getValue()) + .withAttributeDataType("xs:anyURI") + .build()) + .build()); + mapProperties(file, context.with(builder)); + context.with(builder).appendReferenceTargetInterfaceIfRequired(file); + context.addInternalElement(builder.build()); + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/LangStringCollectionMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/LangStringCollectionMapper.java new file mode 100644 index 00000000..bfb51cd3 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/LangStringCollectionMapper.java @@ -0,0 +1,54 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.mapper; + +import io.adminshell.aas.v3.dataformat.aml.MappingContext; +import io.adminshell.aas.v3.dataformat.aml.model.caex.AttributeType; +import io.adminshell.aas.v3.model.LangString; +import java.lang.reflect.ParameterizedType; +import java.util.Collection; +import java.util.stream.Collectors; + +public class LangStringCollectionMapper extends BaseMapper> { + + @Override + public void map(Collection value, MappingContext context) { + if (context == null || context.getProperty() == null) { + throw new IllegalArgumentException("context.property must be non-null"); + } + if (value == null || value.isEmpty()) { + return; + } + Object t = (Class) ((ParameterizedType) context.getProperty().getReadMethod().getGenericReturnType()).getActualTypeArguments()[0]; + context.addAttribute(AttributeType.builder() + // für collections funktioniert getName so nicht weil value.class == Collection + type erasure + .withName(context.getMappingProvider().getAttributeNamingStrategy().getName( + context.getProperty().getReadMethod().getDeclaringClass(), + value, + context.getProperty().getName())) + .withRefSemantic(AttributeType.RefSemantic.builder() + .withCorrespondingAttributePath("AAS:" + context.getProperty().getReadMethod().getDeclaringClass().getSimpleName() + "/" + context.getProperty().getName()) + .build()) + .addAttribute(value.stream() + .map(x -> AttributeType.builder() + .withName("aml-lang=" + x.getLanguage()) + .withValue(x.getValue()) + .build()) + .collect(Collectors.toList())) + .build()); + } + +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/Mapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/Mapper.java new file mode 100644 index 00000000..6fc26f1e --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/Mapper.java @@ -0,0 +1,23 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.mapper; + +import io.adminshell.aas.v3.dataformat.aml.MappingContext; + +public interface Mapper { + + public void map(T value, MappingContext context) throws MappingException; +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/MappingException.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/MappingException.java new file mode 100644 index 00000000..226195c4 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/MappingException.java @@ -0,0 +1,28 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.mapper; + +public class MappingException extends Exception { + + public MappingException(String msg) { + super(msg); + } + + public MappingException(String msg, Throwable err) { + super(msg, err); + } + +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/OperationMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/OperationMapper.java new file mode 100644 index 00000000..92767282 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/OperationMapper.java @@ -0,0 +1,34 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.mapper; + +import io.adminshell.aas.v3.dataformat.aml.MappingContext; +import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; +import io.adminshell.aas.v3.model.Operation; + +public class OperationMapper implements Mapper { + + public OperationMapper() { + } + + @Override + public void map(Operation operation, MappingContext context) { + InternalElementType.Builder builder = InternalElementType.builder() + .withName(context.getMappingProvider().getInternalElementNamingStrategy().getName(Operation.class, operation, null)); + context.with(builder).appendReferenceTargetInterfaceIfRequired(operation); + context.addInternalElement(builder.build()); + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/OperationVariableCollectionMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/OperationVariableCollectionMapper.java new file mode 100644 index 00000000..3c600346 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/OperationVariableCollectionMapper.java @@ -0,0 +1,48 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.mapper; + +import io.adminshell.aas.v3.dataformat.aml.MappingContext; +import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; +import io.adminshell.aas.v3.model.OperationVariable; +import java.util.Collection; + +public class OperationVariableCollectionMapper extends AbstractCollectionMapper { + + @Override + public void map(Collection value, MappingContext context) throws MappingException { + if (value == null || value.isEmpty()) { + return; + } + String name = context.getMappingProvider().getAttributeNamingStrategy().getName( + value.getClass(), + value, + context.getProperty().getName()); + name = name.substring(0, 1).toUpperCase() + name.substring(1); + InternalElementType.Builder builder = InternalElementType.builder() + .withName(name) + .withID(context.getIdentityProvider().getId(value)) + .withRoleRequirements(roleRequirement("Operation" + name)); + for (OperationVariable element : value) { + context + .with(builder) + .withoutProperty() + .withoutIdentidyProvider() + .map(element); + } + context.addInternalElement(builder.build()); + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/OperationVariableMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/OperationVariableMapper.java new file mode 100644 index 00000000..6a6464d8 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/OperationVariableMapper.java @@ -0,0 +1,33 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.mapper; + +import io.adminshell.aas.v3.dataformat.aml.MappingContext; +import io.adminshell.aas.v3.model.OperationVariable; + +public class OperationVariableMapper extends BaseMapper { + + public OperationVariableMapper() { + } + + @Override + public void map(OperationVariable operationVariable, MappingContext context) throws MappingException { +// toInternalElement(operationVariable, context); + if (operationVariable != null && operationVariable.getValue() != null) { + context.withoutProperty().map(operationVariable.getValue()); + } + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/QualifierMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/QualifierMapper.java new file mode 100644 index 00000000..34db6fde --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/QualifierMapper.java @@ -0,0 +1,35 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.mapper; + +import io.adminshell.aas.v3.dataformat.aml.MappingContext; +import io.adminshell.aas.v3.dataformat.aml.model.caex.AttributeType; +import io.adminshell.aas.v3.dataformat.aml.model.caex.AttributeType.RefSemantic; +import io.adminshell.aas.v3.model.Qualifier; + +public class QualifierMapper extends BaseMapper { + + @Override + public void map(Qualifier qualifier, MappingContext context) throws MappingException { + AttributeType.Builder builder = AttributeType.builder() + .withName("qualifier:" + qualifier.getType() + "=" + qualifier.getValue()) + .addRefSemantic(RefSemantic.builder() + .withCorrespondingAttributePath("AAS:" + context.getProperty().getReadMethod().getDeclaringClass().getSimpleName() + "/" + context.getProperty().getName()) + .build()); + mapProperties(qualifier, context.with(builder)); + context.addAttribute(builder.build()); + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/ReferenceCollectionMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/ReferenceCollectionMapper.java new file mode 100644 index 00000000..2f1cde78 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/ReferenceCollectionMapper.java @@ -0,0 +1,33 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.mapper; + +import io.adminshell.aas.v3.dataformat.aml.MappingContext; +import io.adminshell.aas.v3.model.Reference; +import java.util.Collection; + +public class ReferenceCollectionMapper implements CollectionMapper { + + @Override + public void map(Collection value, MappingContext context) throws MappingException { + if (value == null || value.isEmpty()) { + return; + } + for (Reference element : value) { + context.withoutProperty().map(element); + } + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/ReferenceElementMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/ReferenceElementMapper.java new file mode 100644 index 00000000..f9a5da45 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/ReferenceElementMapper.java @@ -0,0 +1,81 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.mapper; + +import io.adminshell.aas.v3.dataformat.aml.MappingContext; +import io.adminshell.aas.v3.dataformat.aml.model.caex.AttributeType; +import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; +import io.adminshell.aas.v3.dataformat.aml.model.caex.RoleClassType; +import io.adminshell.aas.v3.dataformat.aml.model.caex.SystemUnitClassType; +import io.adminshell.aas.v3.dataformat.aml.model.caex.SystemUnitClassType.InternalLink; +import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.util.ReferenceConverterUtil; +import io.adminshell.aas.v3.dataformat.aml.util.AASUtils; +import io.adminshell.aas.v3.dataformat.core.ReflectionHelper; +import io.adminshell.aas.v3.model.Referable; +import io.adminshell.aas.v3.model.Reference; +import io.adminshell.aas.v3.model.ReferenceElement; + +public class ReferenceElementMapper extends BaseMapper { + + public ReferenceElementMapper() { + } + + @Override + public void map(ReferenceElement element, MappingContext context) throws MappingException { + if (element == null) { + return; + } + // regular mapping + InternalElementType.Builder builder = InternalElementType.builder() + .withID(context.getIdentityProvider().getCachedId(element)) + .withName(context.getMappingProvider().getInternalElementNamingStrategy().getName( + element.getClass(), + element, + null)) + .withRoleRequirements(roleRequirement(ReflectionHelper.getModelType(element.getClass()))); + mapProperties(element, context.with(builder), "value"); + // add interface + RoleClassType.ExternalInterface.Builder interfaceBuilder = RoleClassType.ExternalInterface.builder() + .withID(context.getIdentityProvider().generateId()) + .withName("ReferableReference") + .withRefBaseClassPath("AssetAdministrationShellInterfaceClassLib/ReferableReference"); + Referable resolvedReference = AASUtils.resolve(element.getValue(), context.getEnvironment()); + if (resolvedReference != null) { + // TODO internalLink must be added on appropriate level which contains both elements + // check if it can also be added on higher levels as this would make things easier + // !!! neither CAEXFile nor InstanceHierarchy allow definition of internalLinks which + // !!! contradicts CAEX meta model as depicted on slide 13 https://www.plt.rwth-aachen.de/global/show_document.asp?id=aaaaaaaaaatmalk + builder = builder.withInternalLink(InternalLink.builder() + .withName("value") + .withID(context.getIdentityProvider().generateId()) + .withRefPartnerSideA(context.getIdentityProvider().getCachedId(element) + ":ReferableReference") + .withRefPartnerSideB(context.getInternalLinkTargetId(resolvedReference) + ":externalReferenceTarget") + .build()); + } else { + interfaceBuilder = interfaceBuilder + .addAttribute(AttributeType.builder() + .withName("value") + .withID(context.getIdentityProvider().generateId()) + .withAttributeDataType("xs:string") + .withValue(ReferenceConverterUtil.convert(element.getValue())) + .build()); + } + builder.withExternalInterface(interfaceBuilder.build()); + context.with(builder).appendReferenceTargetInterfaceIfRequired(element); + context.addInternalElement(builder.build()); + } + +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/ReferenceMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/ReferenceMapper.java new file mode 100644 index 00000000..a28dd1de --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/ReferenceMapper.java @@ -0,0 +1,42 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.mapper; + +import io.adminshell.aas.v3.dataformat.aml.MappingContext; +import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.util.ReferenceConverterUtil; +import io.adminshell.aas.v3.dataformat.aml.util.AASUtils; +import io.adminshell.aas.v3.model.KeyElements; +import io.adminshell.aas.v3.model.Reference; +import io.adminshell.aas.v3.model.Submodel; +import java.util.Optional; + +public class ReferenceMapper extends ToAttributeMapper { + + @Override + public void map(Reference reference, MappingContext context) throws MappingException { + if (reference != null && !reference.getKeys().isEmpty()) { + KeyElements referencedType = reference.getKeys().get(reference.getKeys().size() - 1).getType(); + if (referencedType == KeyElements.SUBMODEL) { + Optional resolvedSubmodel = AASUtils.resolveSubmodelReference(reference, context.getEnvironment()); + if (resolvedSubmodel.isPresent()) { + context.withoutIdentidyProvider().map(resolvedSubmodel.get()); + return; + } + } + } + mapAsAttribute(ReferenceConverterUtil.convert(reference), context); + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/RelationshipElementMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/RelationshipElementMapper.java new file mode 100644 index 00000000..4e5836e7 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/RelationshipElementMapper.java @@ -0,0 +1,82 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.mapper; + +import io.adminshell.aas.v3.dataformat.aml.MappingContext; +import io.adminshell.aas.v3.dataformat.aml.model.caex.AttributeType; +import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; +import io.adminshell.aas.v3.dataformat.aml.model.caex.RoleClassType; +import io.adminshell.aas.v3.dataformat.aml.model.caex.SystemUnitClassType.InternalLink; +import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.util.ReferenceConverterUtil; +import io.adminshell.aas.v3.dataformat.aml.util.AASUtils; +import io.adminshell.aas.v3.dataformat.core.ReflectionHelper; +import io.adminshell.aas.v3.model.Referable; +import io.adminshell.aas.v3.model.Reference; +import io.adminshell.aas.v3.model.RelationshipElement; + +public class RelationshipElementMapper extends BaseMapper { + + public RelationshipElementMapper() { + } + + @Override + public void map(RelationshipElement element, MappingContext context) throws MappingException { + if (element == null) { + return; + } + // regular mapping + InternalElementType.Builder builder = InternalElementType.builder() + .withID(context.getIdentityProvider().getCachedId(element)) + .withName(context.getMappingProvider().getInternalElementNamingStrategy().getName( + element.getClass(), + element, + null)) + .withRoleRequirements(roleRequirement(ReflectionHelper.getModelType(element.getClass()))); + mapProperties(element, context.with(builder), "first", "second"); + // add special mapping for first, second + mapProperty(element, element.getFirst(), "first", context.with(builder)); + mapProperty(element, element.getSecond(), "second", context.with(builder)); + context.with(builder).appendReferenceTargetInterfaceIfRequired(element); + context.addInternalElement(builder.build()); + } + + private void mapProperty(RelationshipElement element, Reference reference, String name, MappingContext context) { + RoleClassType.ExternalInterface.Builder builder = RoleClassType.ExternalInterface.builder() + .withName(name) + .withRefBaseClassPath("AssetAdministrationShellInterfaceClassLib/ReferableReference"); + Referable resolvedReference = AASUtils.resolve(reference, context.getEnvironment()); + if (resolvedReference != null) { + // TODO internalLink must be added on appropriate level which contains both elements + // check if it can also be added on higher levels as this would make things easier + // !!! neither CAEXFile nor InstanceHierarchy allow definition of internalLinks which + // !!! contradicts CAEX meta model as depicted on slide 13 https://www.plt.rwth-aachen.de/global/show_document.asp?id=aaaaaaaaaatmalk + context.getInternalElementBuilder() + .addInternalLink(InternalLink.builder() + .withName(name) + .withID(context.getIdentityProvider().generateId()) + .withRefPartnerSideA(context.getIdentityProvider().getCachedId(element) + ":name") + .withRefPartnerSideB(context.getInternalLinkTargetId(resolvedReference) + ":externalReferenceTarget") + .build()); + } else { + builder = builder.addAttribute(AttributeType.builder() + .withName("value") + .withAttributeDataType("xs:string") + .withValue(ReferenceConverterUtil.convert(reference)) + .build()); + } + context.getInternalElementBuilder().addExternalInterface(builder.build()); + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/SubmodelCollectionMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/SubmodelCollectionMapper.java new file mode 100644 index 00000000..e8701aa7 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/SubmodelCollectionMapper.java @@ -0,0 +1,37 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.mapper; + +import io.adminshell.aas.v3.dataformat.aml.MappingContext; +import io.adminshell.aas.v3.model.ModelingKind; +import io.adminshell.aas.v3.model.Submodel; +import java.util.Collection; +import java.util.stream.Collectors; + +public class SubmodelCollectionMapper extends BaseMapper> { + + @Override + public void map(Collection value, MappingContext context) throws MappingException { + if (value == null || context == null) { + return; + } + super.map(value, context); +// super.map(value.stream() +// .filter(x -> x.getKind() == ModelingKind.INSTANCE) +// .collect(Collectors.toList()), +// context); + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/SubmodelMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/SubmodelMapper.java new file mode 100644 index 00000000..84c61b58 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/SubmodelMapper.java @@ -0,0 +1,49 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.mapper; + +import io.adminshell.aas.v3.dataformat.aml.MappingContext; +import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; +import io.adminshell.aas.v3.dataformat.core.ReflectionHelper; +import io.adminshell.aas.v3.model.ModelingKind; +import io.adminshell.aas.v3.model.Operation; +import io.adminshell.aas.v3.model.Submodel; + +public class SubmodelMapper extends BaseMapper { + + public SubmodelMapper() { + } + + @Override + protected void toInternalElement(Submodel value, MappingContext context) throws MappingException { + InternalElementType.Builder builder = InternalElementType.builder(); + builder = builder.withID(context.getIdentityProvider().getCachedId(value)) + .withName(context.getMappingProvider().getInternalElementNamingStrategy().getName( + value.getClass(), + value, + null)) + .withRoleRequirements(roleRequirement(ReflectionHelper.getModelType(value.getClass()))); + if (value.getKind() == ModelingKind.TEMPLATE) { + builder = builder.withRefBaseSystemUnitPath("AssetAdministrationShellSystemUnitClasses/" + context.getMappingProvider().getInternalElementNamingStrategy().getName( + value.getClass(), + value, + null)); + } + mapProperties(value, context.with(builder)); + context.with(builder).appendReferenceTargetInterfaceIfRequired(value); + context.addInternalElement(builder.build()); + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/ToAttributeMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/ToAttributeMapper.java new file mode 100644 index 00000000..7272fe13 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/ToAttributeMapper.java @@ -0,0 +1,34 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.mapper; + +import io.adminshell.aas.v3.dataformat.aml.MappingContext; +import io.adminshell.aas.v3.dataformat.aml.model.caex.AttributeType; + +public abstract class ToAttributeMapper implements Mapper { + + protected void mapAsAttribute(Object value, MappingContext context) { + if (value != null && context.getProperty() != null) { + context.addAttribute(AttributeType.builder() + .withName(context.getProperty().getName()) + .withValue(value) + .withRefSemantic(AttributeType.RefSemantic.builder() + .withCorrespondingAttributePath("AAS:" + context.getProperty().getReadMethod().getDeclaringClass().getSimpleName() + "/" + context.getProperty().getName()) + .build()) + .build()); + } + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/ViewMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/ViewMapper.java new file mode 100644 index 00000000..94388af9 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/ViewMapper.java @@ -0,0 +1,44 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.mapper; + +import io.adminshell.aas.v3.dataformat.aml.MappingContext; +import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; +import io.adminshell.aas.v3.dataformat.core.ReflectionHelper; +import io.adminshell.aas.v3.model.View; + +public class ViewMapper extends BaseMapper { + + @Override + public void map(View view, MappingContext context) throws MappingException { + if (view == null || view.getContainedElements() == null || view.getContainedElements().isEmpty()) { + return; + } + InternalElementType.Builder builder = InternalElementType.builder(); + builder = builder.withID(context.getIdentityProvider().getCachedId(view)) + .withName(context.getMappingProvider().getInternalElementNamingStrategy().getName( + view.getClass(), + view, + null)) + // .withRefBaseSystemUnitPath(context.getIdentityProvider().getId( + // AASUtils.resolve( + // view.getContainedElements().get(0), + // context.getEnvironment()))) + .withRoleRequirements(roleRequirement(ReflectionHelper.getModelType(view.getClass()))); + context.with(builder).appendReferenceTargetInterfaceIfRequired(view); + context.addInternalElement(builder.build()); + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/util/ReferenceConverterUtil.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/util/ReferenceConverterUtil.java index 7220c899..c60630ea 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/util/ReferenceConverterUtil.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/util/ReferenceConverterUtil.java @@ -24,7 +24,7 @@ public class ReferenceConverterUtil { public static String convert(Reference reference) { - if(reference == null) { + if (reference == null) { return null; } @@ -41,7 +41,6 @@ public static String convert(Reference reference) { // builder.append("("); // builder.append(key.isLocal() ? "local" : "no-local"); // builder.append(")"); - builder.append("["); builder.append(key.getIdType()); builder.append("]"); diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util/AASUtils.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util/AASUtils.java new file mode 100644 index 00000000..33a737ad --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util/AASUtils.java @@ -0,0 +1,171 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.util; + +import com.google.common.base.Objects; +import io.adminshell.aas.v3.dataformat.core.ReflectionHelper; +import io.adminshell.aas.v3.dataformat.core.serialization.EnumSerializer; +import io.adminshell.aas.v3.model.AssetAdministrationShell; +import io.adminshell.aas.v3.model.AssetAdministrationShellEnvironment; +import io.adminshell.aas.v3.model.Identifiable; +import io.adminshell.aas.v3.model.Key; +import io.adminshell.aas.v3.model.KeyElements; +import io.adminshell.aas.v3.model.KeyType; +import io.adminshell.aas.v3.model.ModelingKind; +import io.adminshell.aas.v3.model.Referable; +import io.adminshell.aas.v3.model.Reference; +import io.adminshell.aas.v3.model.Submodel; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; +import java.util.stream.Collectors; + +public class AASUtils { + + private AASUtils() { + } + + public static Optional resolveSubmodelReference(Reference reference, AssetAdministrationShellEnvironment environment) { + return environment.getSubmodels().stream() + .filter(sm -> Objects.equal(sm.getIdentification().getIdentifier(), reference.getKeys().get(0).getValue())) + .findAny(); + } + + public static boolean isLocal(Reference reference, AssetAdministrationShellEnvironment environment) { + // could/should additionally try resolving it + return !reference.getKeys().stream().anyMatch(x -> x.getType() == KeyElements.GLOBAL_REFERENCE); + } + + public static List getSubmodelTemplates(AssetAdministrationShell aas, AssetAdministrationShellEnvironment environment) { + return aas.getSubmodels().stream() + .map(ref -> resolveSubmodelReference(ref, environment)) + .filter(sm -> sm.isPresent()) + .map(sm -> sm.get()) + .filter(sm -> sm.getKind() == ModelingKind.TEMPLATE) + .collect(Collectors.toList()); + } + + public static boolean hasTemplate(AssetAdministrationShell aas, AssetAdministrationShellEnvironment environment) { + return !getSubmodelTemplates(aas, environment).isEmpty(); + } + + public static Referable resolve(Reference reference, AssetAdministrationShellEnvironment env) { + + List keys = reference.getKeys(); + + //get reduced Key list from last identifiable key to end + List reducedKeyList = new ArrayList<>(); + reduceKeyList(keys, reducedKeyList); + + //resolve the reference + Referable searchedReferable = null; + for (int i = 0; i < reducedKeyList.size(); i++) { + + Key actualKey = reducedKeyList.get(i); + String className = EnumSerializer.translate(actualKey.getType().name()); + try { + + //get class from the key type and calculate the method name for getting a list of the elements + //e.g. "getSubmodelElements" + Class c = Class.forName(ReflectionHelper.MODEL_PACKAGE_NAME + "." + className); + + //TODO: visitor pattern? e.g. for Operation Variables + String methodName = "get" + className + "s"; + + Method method = null; + + if (i == 0) { + //first Key is identifiable + + //get list of elements due to the key type + method = env.getClass().getMethod(methodName); + List list = (List) method.invoke(env); + searchedReferable = getIdentifiable(actualKey, c, list); + + } else { + + //if searchedReferable is null then the first identifiable could not be found + if (searchedReferable == null) { + return null; + } + + //get list of elements due to the key type + method = searchedReferable.getClass().getMethod(methodName); + List list = (List) method.invoke(searchedReferable); + searchedReferable = getReferable(actualKey, list); + } + + } catch (ClassNotFoundException | NoSuchMethodException e) { + e.printStackTrace(); + return null; + } catch (InvocationTargetException | IllegalAccessException e) { + e.printStackTrace(); + } + } + + return searchedReferable; + } + + private static void reduceKeyList(List keys, List reducedKeyList) { + for (int i = keys.size() - 1; i >= 0; i--) { + Key k = keys.get(i); + reducedKeyList.add(0, k); + String className = EnumSerializer.translate(k.getType().name()); + Class c = null; + try { + c = Class.forName(ReflectionHelper.MODEL_PACKAGE_NAME + "." + className); + } catch (ClassNotFoundException e) { + e.printStackTrace(); + } + if (Identifiable.class.isAssignableFrom(c)) { + break; + } + } + } + + private static Referable getReferable(Key actualKey, List list) { + Referable searchedReferable = null; + for (Object e : list) { + Referable element = (Referable) e; + if (actualKey.getIdType() == KeyType.ID_SHORT) { + if (element.getIdShort().equals(actualKey.getValue())) { + searchedReferable = element; + } + } + } + return searchedReferable; + } + + private static Identifiable getIdentifiable(Key lastKey, Class c, List list) { + if (Identifiable.class.isAssignableFrom(c)) { + for (Object e : list) { + Identifiable element = (Identifiable) e; + if (lastKey.getIdType() == KeyType.ID_SHORT) { + if (element.getIdShort().equals(lastKey.getValue())) { + return element; + } + } else if (lastKey.getIdType() == KeyType.IRI || lastKey.getIdType() == KeyType.IRDI || lastKey.getIdType() == KeyType.CUSTOM) { + if (element.getIdentification().getIdentifier().equals(lastKey.getValue())) { + return element; + } + } + } + } + return null; + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util/AbstractReferableVisitor.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util/AbstractReferableVisitor.java new file mode 100644 index 00000000..44d1038f --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util/AbstractReferableVisitor.java @@ -0,0 +1,70 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.util; + +import io.adminshell.aas.v3.model.Property; +import io.adminshell.aas.v3.model.Submodel; +import io.adminshell.aas.v3.model.SubmodelElement; +import io.adminshell.aas.v3.model.SubmodelElementCollection; +import java.lang.reflect.Method; + +public abstract class AbstractReferableVisitor { + + private static final String METHOD_NAME = "visit"; + + public void visit(Object o) { + Method visitMethod = getMethod(o.getClass()); + if (visitMethod == null) { + defaultVisit(o); + } else { + try { + visitMethod.invoke(this, new Object[]{o}); + } catch (Exception ex) { + throw new RuntimeException(ex); + } + } + } + + public abstract void visit(Submodel submodel); + + public abstract void visit(SubmodelElement submodelElement); + + public abstract void visit(SubmodelElementCollection submodelElementCollection); + + public abstract void visit(Property property); + + public void defaultVisit(Object o) { + + } + + protected Method getMethod(Class source) { + Class clazz = source; + while (!clazz.equals(Object.class)) { + try { + return getClass().getMethod(METHOD_NAME, clazz); + } catch (NoSuchMethodException ex) { + clazz = clazz.getSuperclass(); + } + } + for (Class clsInterface : source.getInterfaces()) { + try { + return getClass().getMethod(METHOD_NAME, clsInterface); + } catch (NoSuchMethodException ex) { + } + } + return null; + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util/AbstractVisitor.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util/AbstractVisitor.java new file mode 100644 index 00000000..5aae42d2 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util/AbstractVisitor.java @@ -0,0 +1,58 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.util; + +import java.lang.reflect.Method; + +public abstract class AbstractVisitor { + + private static final String METHOD_NAME = "visit"; + + public void visit(Object o) { + Method visitMethod = getMethod(o.getClass()); + if (visitMethod == null) { + defaultVisit(o); + } else { + try { + visitMethod.invoke(this, new Object[]{o}); + } catch (Exception ex) { + throw new RuntimeException(ex); + } + } + } + + public void defaultVisit(Object o) { + + } + + protected Method getMethod(Class source) { + Class clazz = source; + while (!clazz.equals(Object.class)) { + try { + return getClass().getMethod(METHOD_NAME, clazz); + } catch (NoSuchMethodException ex) { + clazz = clazz.getSuperclass(); + } + } + for (Class clsInterface : source.getInterfaces()) { + try { + return getClass().getMethod(METHOD_NAME, clsInterface); + } catch (NoSuchMethodException ex) { + } + } + return null; + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util/AssetAdministrationShellElementVisitor.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util/AssetAdministrationShellElementVisitor.java new file mode 100644 index 00000000..4c921e97 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util/AssetAdministrationShellElementVisitor.java @@ -0,0 +1,424 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.util; + +import io.adminshell.aas.v3.model.AccessControl; +import io.adminshell.aas.v3.model.AccessControlPolicyPoints; +import io.adminshell.aas.v3.model.AccessPermissionRule; +import io.adminshell.aas.v3.model.AdministrativeInformation; +import io.adminshell.aas.v3.model.AnnotatedRelationshipElement; +import io.adminshell.aas.v3.model.Asset; +import io.adminshell.aas.v3.model.AssetAdministrationShell; +import io.adminshell.aas.v3.model.AssetAdministrationShellEnvironment; +import io.adminshell.aas.v3.model.AssetInformation; +import io.adminshell.aas.v3.model.BasicEvent; +import io.adminshell.aas.v3.model.Blob; +import io.adminshell.aas.v3.model.BlobCertificate; +import io.adminshell.aas.v3.model.Capability; +import io.adminshell.aas.v3.model.Certificate; +import io.adminshell.aas.v3.model.ConceptDescription; +import io.adminshell.aas.v3.model.Constraint; +import io.adminshell.aas.v3.model.DataElement; +import io.adminshell.aas.v3.model.DataSpecificationContent; +import io.adminshell.aas.v3.model.DataSpecificationIEC61360; +import io.adminshell.aas.v3.model.DataSpecificationPhysicalUnit; +import io.adminshell.aas.v3.model.EmbeddedDataSpecification; +import io.adminshell.aas.v3.model.Entity; +import io.adminshell.aas.v3.model.Event; +import io.adminshell.aas.v3.model.EventElement; +import io.adminshell.aas.v3.model.EventMessage; +import io.adminshell.aas.v3.model.Extension; +import io.adminshell.aas.v3.model.File; +import io.adminshell.aas.v3.model.Formula; +import io.adminshell.aas.v3.model.HasDataSpecification; +import io.adminshell.aas.v3.model.HasExtensions; +import io.adminshell.aas.v3.model.HasKind; +import io.adminshell.aas.v3.model.HasSemantics; +import io.adminshell.aas.v3.model.Identifiable; +import io.adminshell.aas.v3.model.Identifier; +import io.adminshell.aas.v3.model.IdentifierKeyValuePair; +import io.adminshell.aas.v3.model.Key; +import io.adminshell.aas.v3.model.LangString; +import io.adminshell.aas.v3.model.MultiLanguageProperty; +import io.adminshell.aas.v3.model.ObjectAttributes; +import io.adminshell.aas.v3.model.Operation; +import io.adminshell.aas.v3.model.OperationVariable; +import io.adminshell.aas.v3.model.Permission; +import io.adminshell.aas.v3.model.PermissionsPerObject; +import io.adminshell.aas.v3.model.PolicyAdministrationPoint; +import io.adminshell.aas.v3.model.PolicyDecisionPoint; +import io.adminshell.aas.v3.model.PolicyEnforcementPoints; +import io.adminshell.aas.v3.model.PolicyInformationPoints; +import io.adminshell.aas.v3.model.Property; +import io.adminshell.aas.v3.model.Qualifiable; +import io.adminshell.aas.v3.model.Qualifier; +import io.adminshell.aas.v3.model.Range; +import io.adminshell.aas.v3.model.Referable; +import io.adminshell.aas.v3.model.Reference; +import io.adminshell.aas.v3.model.ReferenceElement; +import io.adminshell.aas.v3.model.RelationshipElement; +import io.adminshell.aas.v3.model.Security; +import io.adminshell.aas.v3.model.SubjectAttributes; +import io.adminshell.aas.v3.model.Submodel; +import io.adminshell.aas.v3.model.SubmodelElement; +import io.adminshell.aas.v3.model.SubmodelElementCollection; +import io.adminshell.aas.v3.model.ValueList; +import io.adminshell.aas.v3.model.ValueReferencePair; +import io.adminshell.aas.v3.model.View; + +public interface AssetAdministrationShellElementVisitor { + + public default void visit(Certificate certificate) { + if (certificate == null) { + return; + } + Class type = certificate.getClass(); + if (BlobCertificate.class.isAssignableFrom(type)) { + visit((BlobCertificate) certificate); + } + } + + public default void visit(Constraint constraint) { + if (constraint == null) { + return; + } + Class type = constraint.getClass(); + if (Qualifier.class.isAssignableFrom(type)) { + visit((Qualifier) constraint); + } else if (Formula.class.isAssignableFrom(type)) { + visit((Formula) constraint); + } + } + + 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(Event event) { + if (event == null) { + return; + } + Class type = event.getClass(); + if (BasicEvent.class.isAssignableFrom(type)) { + visit((BasicEvent) 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 (View.class.isAssignableFrom(type)) { + visit((View) hasDataSpecification); + } else if (Asset.class.isAssignableFrom(type)) { + visit((Asset) 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 (IdentifierKeyValuePair.class.isAssignableFrom(type)) { + visit((IdentifierKeyValuePair) hasSemantics); + } else if (Submodel.class.isAssignableFrom(type)) { + visit((Submodel) hasSemantics); + } else if (SubmodelElement.class.isAssignableFrom(type)) { + visit((SubmodelElement) hasSemantics); + } else if (View.class.isAssignableFrom(type)) { + visit((View) 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 (Asset.class.isAssignableFrom(type)) { + visit((Asset) 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 (Event.class.isAssignableFrom(type)) { + visit((Event) 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); + } else if (AccessPermissionRule.class.isAssignableFrom(type)) { + visit((AccessPermissionRule) 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); + } else if (View.class.isAssignableFrom(type)) { + visit((View) referable); + } else if (AccessPermissionRule.class.isAssignableFrom(type)) { + visit((AccessPermissionRule) referable); + } + } + + public default void visit(AssetAdministrationShellEnvironment assetAdministrationShellEnvironment) { + } + + public default void visit(AccessControl accessControl) { + } + + public default void visit(AccessControlPolicyPoints accessControlPolicyPoints) { + } + + public default void visit(AccessPermissionRule accessPermissionRule) { + } + + public default void visit(AdministrativeInformation administrativeInformation) { + } + + public default void visit(AnnotatedRelationshipElement annotatedRelationshipElement) { + } + + public default void visit(Asset asset) { + } + + public default void visit(AssetAdministrationShell assetAdministrationShell) { + } + + public default void visit(AssetInformation assetInformation) { + } + + public default void visit(BasicEvent basicEvent) { + } + + public default void visit(Blob blob) { + } + + public default void visit(BlobCertificate blobCertificate) { + } + + public default void visit(Capability capability) { + } + + public default void visit(ConceptDescription conceptDescription) { + } + + public default void visit(DataSpecificationIEC61360 dataSpecificationIEC61360) { + } + + public default void visit(DataSpecificationPhysicalUnit dataSpecificationPhysicalUnit) { + } + + public default void visit(EmbeddedDataSpecification embeddedDataSpecification) { + } + + public default void visit(Entity entity) { + } + + public default void visit(EventElement eventElement) { + } + + public default void visit(EventMessage eventMessage) { + } + + public default void visit(Extension extension) { + } + + public default void visit(File file) { + } + + public default void visit(Formula formula) { + } + + public default void visit(Identifier identifier) { + } + + public default void visit(IdentifierKeyValuePair identifierKeyValuePair) { + } + + public default void visit(Key key) { + } + + public default void visit(LangString langString) { + } + + public default void visit(MultiLanguageProperty multiLanguageProperty) { + } + + public default void visit(ObjectAttributes objectAttributes) { + } + + public default void visit(Operation operation) { + } + + public default void visit(OperationVariable operationVariable) { + } + + public default void visit(Permission permission) { + } + + public default void visit(PermissionsPerObject permissionsPerObject) { + } + + public default void visit(PolicyAdministrationPoint policyAdministrationPoint) { + } + + public default void visit(PolicyDecisionPoint policyDecisionPoint) { + } + + public default void visit(PolicyEnforcementPoints policyEnforcementPoints) { + } + + public default void visit(PolicyInformationPoints policyInformationPoints) { + } + + 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(Security security) { + } + + public default void visit(SubjectAttributes subjectAttributes) { + } + + public default void visit(Submodel submodel) { + } + + public default void visit(SubmodelElementCollection submodelElementCollection) { + } + + public default void visit(ValueList valueList) { + } + + public default void visit(ValueReferencePair valueReferencePair) { + } + + public default void visit(View view) { + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util/AssetAdministrationShellElementWalkerVisitor.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util/AssetAdministrationShellElementWalkerVisitor.java new file mode 100644 index 00000000..8a367ea9 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util/AssetAdministrationShellElementWalkerVisitor.java @@ -0,0 +1,464 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.util; + +import io.adminshell.aas.v3.model.AccessControl; +import io.adminshell.aas.v3.model.AccessControlPolicyPoints; +import io.adminshell.aas.v3.model.AccessPermissionRule; +import io.adminshell.aas.v3.model.AnnotatedRelationshipElement; +import io.adminshell.aas.v3.model.AssetAdministrationShell; +import io.adminshell.aas.v3.model.AssetAdministrationShellEnvironment; +import io.adminshell.aas.v3.model.AssetInformation; +import io.adminshell.aas.v3.model.BasicEvent; +import io.adminshell.aas.v3.model.BlobCertificate; +import io.adminshell.aas.v3.model.Certificate; +import io.adminshell.aas.v3.model.ConceptDescription; +import io.adminshell.aas.v3.model.Entity; +import io.adminshell.aas.v3.model.Extension; +import io.adminshell.aas.v3.model.Formula; +import io.adminshell.aas.v3.model.HasDataSpecification; +import io.adminshell.aas.v3.model.HasExtensions; +import io.adminshell.aas.v3.model.HasSemantics; +import io.adminshell.aas.v3.model.Identifiable; +import io.adminshell.aas.v3.model.IdentifierKeyValuePair; +import io.adminshell.aas.v3.model.MultiLanguageProperty; +import io.adminshell.aas.v3.model.ObjectAttributes; +import io.adminshell.aas.v3.model.Operation; +import io.adminshell.aas.v3.model.OperationVariable; +import io.adminshell.aas.v3.model.Permission; +import io.adminshell.aas.v3.model.PermissionsPerObject; +import io.adminshell.aas.v3.model.PolicyAdministrationPoint; +import io.adminshell.aas.v3.model.PolicyInformationPoints; +import io.adminshell.aas.v3.model.Property; +import io.adminshell.aas.v3.model.Qualifiable; +import io.adminshell.aas.v3.model.Qualifier; +import io.adminshell.aas.v3.model.Referable; +import io.adminshell.aas.v3.model.Reference; +import io.adminshell.aas.v3.model.ReferenceElement; +import io.adminshell.aas.v3.model.RelationshipElement; +import io.adminshell.aas.v3.model.Security; +import io.adminshell.aas.v3.model.SubjectAttributes; +import io.adminshell.aas.v3.model.Submodel; +import io.adminshell.aas.v3.model.SubmodelElementCollection; +import io.adminshell.aas.v3.model.ValueList; +import io.adminshell.aas.v3.model.ValueReferencePair; +import io.adminshell.aas.v3.model.View; + +public interface AssetAdministrationShellElementWalkerVisitor extends AssetAdministrationShellElementVisitor { + + @Override + public default void visit(AccessControl accessControl) { + if (accessControl == null) { + return; + } + visit(accessControl.getDefaultEnvironmentAttributes()); + visit(accessControl.getDefaultPermissions()); + visit(accessControl.getDefaultSubjectAttributes()); + visit(accessControl.getSelectableEnvironmentAttributes()); + visit(accessControl.getSelectablePermissions()); + visit(accessControl.getSelectableSubjectAttributes()); + accessControl.getAccessPermissionRules().forEach(x -> visit(x)); + AssetAdministrationShellElementVisitor.super.visit(accessControl); + } + + @Override + public default void visit(AccessControlPolicyPoints accessControlPolicyPoints) { + if (accessControlPolicyPoints == null) { + return; + } + visit(accessControlPolicyPoints.getPolicyAdministrationPoint()); + visit(accessControlPolicyPoints.getPolicyDecisionPoint()); + visit(accessControlPolicyPoints.getPolicyEnforcementPoint()); + visit(accessControlPolicyPoints.getPolicyInformationPoints()); + AssetAdministrationShellElementVisitor.super.visit(accessControlPolicyPoints); + } + + @Override + public default void visit(AccessPermissionRule accessPermissionRule) { + if (accessPermissionRule == null) { + return; + } + visit(accessPermissionRule.getTargetSubjectAttributes()); + accessPermissionRule.getPermissionsPerObjects().forEach(x -> visit(x)); + AssetAdministrationShellElementVisitor.super.visit(accessPermissionRule); + } + + @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.getSecurity()); + visit(assetAdministrationShell.getAssetInformation()); + assetAdministrationShell.getSubmodels().forEach(x -> visit(x)); + assetAdministrationShell.getViews().forEach(x -> visit(x)); + AssetAdministrationShellElementVisitor.super.visit(assetAdministrationShell); + } + + @Override + public default void visit(AssetInformation assetInformation) { + if (assetInformation == null) { + return; + } + visit(assetInformation.getGlobalAssetId()); + visit(assetInformation.getDefaultThumbnail()); + assetInformation.getSpecificAssetIds().forEach(x -> visit(x)); + assetInformation.getBillOfMaterials().forEach(x -> visit(x)); + AssetAdministrationShellElementVisitor.super.visit(assetInformation); + } + + @Override + public default void visit(BasicEvent basicEvent) { + if (basicEvent == null) { + return; + } + visit(basicEvent.getObserved()); + AssetAdministrationShellElementVisitor.super.visit(basicEvent); + } + + @Override + public default void visit(Certificate certificate) { + if (certificate == null) { + return; + } + visit(certificate.getPolicyAdministrationPoint()); + AssetAdministrationShellElementVisitor.super.visit(certificate); + } + + @Override + public default void visit(ConceptDescription conceptDescription) { + if (conceptDescription == null) { + return; + } + conceptDescription.getIsCaseOfs().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()); + visit(identifiable.getIdentification()); + AssetAdministrationShellElementVisitor.super.visit(identifiable); + } + + @Override + public default void visit(IdentifierKeyValuePair identifierKeyValuePair) { + if (identifierKeyValuePair == null) { + return; + } + visit(identifierKeyValuePair.getExternalSubjectId()); + AssetAdministrationShellElementVisitor.super.visit(identifierKeyValuePair); + } + + @Override + public default void visit(MultiLanguageProperty multiLanguageProperty) { + if (multiLanguageProperty == null) { + return; + } + multiLanguageProperty.getValues().forEach(x -> visit(x)); + visit(multiLanguageProperty.getValueId()); + AssetAdministrationShellElementVisitor.super.visit(multiLanguageProperty); + } + + @Override + public default void visit(ObjectAttributes objectAttributes) { + if (objectAttributes == null) { + return; + } + objectAttributes.getObjectAttributes().forEach(x -> visit(x)); + AssetAdministrationShellElementVisitor.super.visit(objectAttributes); + } + + @Override + public default void visit(OperationVariable operationVariable) { + if (operationVariable == null) { + return; + } + visit(operationVariable.getValue()); + AssetAdministrationShellElementVisitor.super.visit(operationVariable); + } + + @Override + public default void visit(PolicyInformationPoints policyInformationPoints) { + if (policyInformationPoints == null) { + return; + } + policyInformationPoints.getInternalInformationPoints().forEach(x -> visit(x)); + AssetAdministrationShellElementVisitor.super.visit(policyInformationPoints); + } + + @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.getDescriptions().forEach(x -> visit(x)); + referable.getDisplayNames().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(Security security) { + if (security == null) { + return; + } + visit(security.getAccessControlPolicyPoints()); + security.getCertificates().forEach(x -> visit(x)); + security.getRequiredCertificateExtensions().forEach(x -> visit(x)); + AssetAdministrationShellElementVisitor.super.visit(security); + } + + @Override + public default void visit(SubjectAttributes subjectAttributes) { + if (subjectAttributes == null) { + return; + } + subjectAttributes.getSubjectAttributes().forEach(x -> visit(x)); + AssetAdministrationShellElementVisitor.super.visit(subjectAttributes); + } + + @Override + public default void visit(Permission permission) { + if (permission == null) { + return; + } + visit(permission.getPermission()); + AssetAdministrationShellElementVisitor.super.visit(permission); + } + + @Override + public default void visit(PermissionsPerObject permissionsPerObject) { + if (permissionsPerObject == null) { + return; + } + visit(permissionsPerObject.getObject()); + visit(permissionsPerObject.getTargetObjectAttributes()); + permissionsPerObject.getPermissions().forEach(x -> visit(x)); + AssetAdministrationShellElementVisitor.super.visit(permissionsPerObject); + } + + @Override + public default void visit(PolicyAdministrationPoint policyAdministrationPoint) { + if (policyAdministrationPoint == null) { + return; + } + visit(policyAdministrationPoint.getLocalAccessControl()); + AssetAdministrationShellElementVisitor.super.visit(policyAdministrationPoint); + } + + @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(Formula formula) { + if (formula == null) { + return; + } + formula.getDependsOns().forEach(x -> visit(x)); + AssetAdministrationShellElementVisitor.super.visit(formula); + } + + @Override + public default void visit(Extension extension) { + if (extension == null) { + return; + } + visit(extension.getRefersTo()); + AssetAdministrationShellElementVisitor.super.visit(extension); + } + + @Override + public default void visit(AssetAdministrationShellEnvironment 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.getValues().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); + } + + @Override + public default void visit(BlobCertificate blobCertificate) { + if (blobCertificate == null) { + return; + } + visit(blobCertificate.getBlobCertificate()); + visit(blobCertificate.getPolicyAdministrationPoint()); + blobCertificate.getContainedExtensions().forEach(x -> visit(x)); + AssetAdministrationShellElementVisitor.super.visit(blobCertificate); + } + + @Override + public default void visit(ValueList valueList) { + if (valueList == null) { + return; + } + valueList.getValueReferencePairTypes().forEach(x -> visit(x)); + AssetAdministrationShellElementVisitor.super.visit(valueList); + } + + @Override + public default void visit(ValueReferencePair valueReferencePair) { + if (valueReferencePair == null) { + return; + } + visit(valueReferencePair.getValueId()); + AssetAdministrationShellElementVisitor.super.visit(valueReferencePair); + } + + @Override + public default void visit(View view) { + if (view == null) { + return; + } + view.getContainedElements().forEach(x -> visit(x)); + AssetAdministrationShellElementVisitor.super.visit(view); + } + +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util/ReferencedReferableCollector.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util/ReferencedReferableCollector.java new file mode 100644 index 00000000..2f2cf646 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util/ReferencedReferableCollector.java @@ -0,0 +1,64 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.util; + +import io.adminshell.aas.v3.model.AssetAdministrationShellEnvironment; +import io.adminshell.aas.v3.model.Referable; +import io.adminshell.aas.v3.model.Reference; +import io.adminshell.aas.v3.model.ReferenceElement; +import io.adminshell.aas.v3.model.RelationshipElement; +import java.util.HashSet; +import java.util.Set; + +public class ReferencedReferableCollector { + + private AssetAdministrationShellEnvironment env; + + public ReferencedReferableCollector(AssetAdministrationShellEnvironment env) { + this.env = env; + } + + public Set collect() { + Visitor visitor = new Visitor(); + visitor.visit(env); + return visitor.referencedElements; + } + + private class Visitor implements AssetAdministrationShellElementWalkerVisitor { + + Set referencedElements = new HashSet<>(); + + @Override + public void visit(ReferenceElement referenceElement) { + handleReference(referenceElement.getValue()); + AssetAdministrationShellElementWalkerVisitor.super.visit(referenceElement); + } + + private void handleReference(Reference reference) { + Referable target = AASUtils.resolve(reference, env); + if (target != null) { + referencedElements.add(target); + } + } + + @Override + public void visit(RelationshipElement relationshipElement) { + handleReference(relationshipElement.getFirst()); + handleReference(relationshipElement.getSecond()); + AssetAdministrationShellElementWalkerVisitor.super.visit(relationshipElement); + } + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util/TypeUtils.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util/TypeUtils.java new file mode 100644 index 00000000..bf085b0c --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util/TypeUtils.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 io.adminshell.aas.v3.dataformat.aml.util; + +import com.google.common.reflect.TypeToken; +import java.util.Comparator; + +public class TypeUtils { + + private TypeUtils() { + } + + public static class TypeTokenComparator 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-aml/src/main/resources/AssetAdministrationShellLib.aml b/dataformat-aml/src/main/resources/AssetAdministrationShellLib.aml new file mode 100644 index 00000000..6d37a571 --- /dev/null +++ b/dataformat-aml/src/main/resources/AssetAdministrationShellLib.aml @@ -0,0 +1,1230 @@ + + + + + + + + + + + + AutomationML Editor + 916578CA-FE0D-474E-A4FC-9E1719892369 + AutomationML e.V. + www.AutomationML.org + 5.2.7.0 + 5.2.7.0 + 2019-11-20T12:12:12.6586496 + Application Recommendation Asset Administration Shell + AR AAS + + + + Interface Class Library according to Details of the Asset Administration Shell V2.0. + 1.0.0 + + A FileDataReference represents the address to a File. FileDataReference is derived from the AutomationML Interface Class ExternalDataReference that is defined in AutomationML BPR_005E_ExternalDataReference_v1.0.0_2:The interface class “ExternalDataReference” shall be used in order to reference external documents out of the scope of AutomationML. + + + Reference to any other referable element of the same of any other AAS or a reference to an external object or entity. For local references inside the same Asset Administration Shell an InternalLink between two objects with this interface "ReferableReference" shall be set. In this case the attribute value has to be empty. For references between different Asset Administration Shells or external objects or entities the attribute value shall be used and no InternalLink shall be set. + + Reference to any other referable element of any other AAS or a reference to an external object or entity. Note: For references to any other referable element of the same AAS InternalLinks are used and this attribute value shall be empty. + + + + + + Standard Automation Markup Language Interface Class Library - Part 1 Content extended with Part 3 and Part 4 Content + 2.2.2 + + + + + + + + + + The attribute refURI is an IRI that can represent an absolute or relative path to an L document. An added fragment (with #) references inside the document + + + + + + + + + + + + + + + + + true + + + + + + + + + + + + + 1.0.0 + + + Mime type of the content of the File. + + + + + Role Class Library according to Details of the Asset Administration Shell V2.0. + 1.0.0 + + An Asset Administration Shell. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + + + + + + Abstract attribute class for identification. Has the subattributes id and idType. + + + Identifier of the element. Its type is defined in idType. Id is a subproperty of identification. + + + + + Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the enumeration “IdentifierType”. IdType is a subproperty of identification. + + + + + + Abstract attribute for administration. Has the subattributes revision and version. + + + Revision of the element. Constraint AASd-005: A revision requires a version. This means, if there is no version there is no revision neither. Revision is a subproperty of administration. + + + + + Version of the element. Version is a subproperty of administration. + + + + + + Global reference to the data specification template used by the element. + + + + + The derivedFrom attribute is used to establish a relationship between two Asset Administration Shells that are derived from each other. + + + + + + An Asset describes meta data of an asset that is represented by an AAS. The asset may either represent an asset type or an asset instance. The asset has a globally unique identifier plus – if needed – additional domain specific (proprietary) identifiers. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + Abstract attribute class for identification. Has the subattributes id and idType. + + + Identifier of the element. Its type is defined in idType. + + + + + Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the enumeration “IdentifierType”. IdType is a subproperty of identification. + + + + + + Abstract attribute for administration. Has the subattributes revision and version. + + + Revision of the element. Constraint AASd-005: A revision requires a version. This means, if there is no version there is no revision neither. Revision is a subproperty of administration. + + + + + Version of the element. Version is a subproperty of administration. + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the asset: either type or instance. + Instance + Instance + + + + Instance + Type + + + + + + A Submodel defines a specific aspect of the asset represented by the AAS. A submodel is used to structure the virtual representation and technical functionality of an Administration Shell into distinguishable parts. Each submodel refers to a well-defined domain or subject matter. Submodels can become standardized and thus become submodels types. Submodels can have different life-cycles. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + Abstract attribute class for identification. Has the subattributes id and idType. + + + Identifier of the element. Its type is defined in idType. Id is a subproperty of identification. + + + + + Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the enumeration “IdentifierType”. IdType is a subproperty of identification. + + + + + + Abstract attribute for administration. Has the subattributes revision and version. + + + Revision of the element. Constraint AASd-005: A revision requires a version. This means, if there is no version there is no revision neither. Revision is a subproperty of administration. + + + + + Version of the element. Version of the element. Version is a subproperty of administration. + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. + + + + + Reference to the global unqiue id of a coded value. + + + + + + + A submodel element collection is a set or list of submodel elements. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. + + + + + Reference to the global unqiue id of a coded value. + + + + + + If allowDuplicates=true, then it is allowed that the collection contains the same element several times. + false + + + + If ordered=false, then the elements in the property collection are not ordered. If ordered=true then the elements in the collection are ordered. Default = false. Note: An ordered submodel element collection is typically implemented as an indexed array. + false + + + + Submodel element contained in the collection. + + + + + A BLOB is a data element that represents a file that is contained with its source code in the value attribute. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. + + + + + Reference to the global unqiue id of a coded value. + + + + + + Mime type of the content of the BLOB. The mime type states which file extension the file has. Valid values are e.g. “application/json”, “application/xls”, ”image/jpg”. The allowed values are defined as in RFC2046. + + + + + The value of the BLOB instance of a blob data element. Note: In contrast to the file property the file content is stored directly as value in the Blob data element. + + + + + + A capability is the implementation-independent description of the potential of an asset to achieve a certain effect in the physical or virtual world. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. + + + + + Reference to the global unqiue id of a coded value. + + + + + + + A role class for a File that a data element that represents an address to a file. It is derived from the AutomationML role class ExternalData that is an role type for a document type and the base class for all document type roles. It describes different document types. ExternalData is defined in AutomationML BPR_005E_ExternalDataReference_v1.0.0_2. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. + + + + + Reference to the global unqiue id of a coded value. + + + + + + + The attribute refURI is an IRI that can represent an absolute or relative path to an L document. An added fragment (with #) references inside the document + + + Mime type of the content of the File. + + + + + A property is a data element that has a single value. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. + + + + + Reference to the global unqiue id of a coded value. + + + + + + The value of the property instance. + + + + Reference to the global unique id if a coded value. + + + + + A reference element is a data element that defines a logical reference to another element within the same or another AAS or a reference to an external object or entity. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. + + + + + Reference to the global unqiue id of a coded value. + + + + + + + Reference to any other referable element of any other AAS or a reference to an external object or entity. Note: For references to any other referable elment of the same AAS InternalLinks are used and this attribute value shall be empty. + + + + + + A relationship element is used to define a relationship between two referable elements. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. + + + + + Reference to the global unqiue id of a coded value. + + + + + + + Reference to any other referable element of any other AAS or a reference to an external object or entity. Note: For references to any other referable elment of the same AAS InternalLinks are used and this attribute value shall be empty. + + + + + Reference to any other referable element of any other AAS or a reference to an external object or entity. Note: For references to any other referable elment of the same AAS InternalLinks are used and this attribute value shall be empty. + + + + + An annotated relationship element is an relationship element that can be annotated with additional data elements. + + Annotations that hold for the relationships between the two elements. + + + + + An operation is a submodel element with input and output variables. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. + + + + + Reference to the global unqiue id of a coded value. + + + + + + + The list of AAS OperationVariableIn entities. In AML, the corresponding InternalElement with this role is a child of the InternalElement with the Operation role. + + + The list of AAS OperationVariableOut entities. In AML, the corresponding InternalElement with this role is a child of the InternalElement with the Operation role. + + + The list of AAS OperationVariableOut entities. In AML, the corresponding InternalElement with this role is a child of the InternalElement with the Operation role. + + + A view is a collection of referable elements w.r.t. to a specific viewpoint of one or more stakeholders. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + Global reference to the data specification template used by the element. + + + + + Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. + + + + + + A dictionary contains elements that can be reused. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + + + + + + + Explanation: The semantics of a property or other elements that may have a semantic description is defined by a concept description. The description of the concept should follow a standardized schema (realized as data specification template). + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + Abstract attribute class for identification. Has the subattributes id and idType. + + + Identifier of the element. Its type is defined in idType. Id is a subproperty of identification. + + + + + Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the enumeration “IdentifierType”. IdType is a subproperty of identification. + + + + + + Abstract attribute for administration. Has the subattributes revision and version. + + + Revision of the element. Constraint AASd-005: A revision requires a version. This means, if there is no version there is no revision neither. Revision is a subproperty of administration. + + + + + Version of the element. Version is a subproperty of administration. + + + + + + Global reference to the data specification template used by the element. + + + + Global reference to an external definition the concept is compatible to or was derived from. + + + + + + Description Role class of an element that has a data specification template. A template defines the additional attributes an element may or shall have. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + + + + + + Abstract attribute class for identification. Has the subattributes id and idType. + + + Identifier of the element. Its type is defined in idType. Id is a subproperty of identification. + + + + + Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the enumeration “IdentifierType”. IdType is a subproperty of identification. + + + + + + Abstract attribute for administration. Has the subattributes revision and version. + + + Revision of the element. Constraint AASd-005: A revision requires a version. This means, if there is no version there is no revision neither. Revision is a subproperty of administration. + + + + + Version of the element. Version is a subproperty of administration. + + + + + + + Content of the data specification template. + + + An entity is a submodel element that is used to model entities. Constraint AASd-056: If the semanticId of a Entity submodel element references a ConceptDescription then the ConceptDescription/category shall be one of following values: ENTITY. The ConceptDescription describes the elements assigned to the entity via Entity/statement. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. + + + + + Reference to the global unqiue id of a coded value. + + + + + + Describes statements applicable to the entity by a set of submodel elements, typically with a qualified value. + + + + Describes whether the entity is a co-managed entity or a self-managed entity. + SelfManagedEntity + SelfManagedEntity + + + + CoManagedEntity + SelfManagedEntity + + + + + Reference to an identifier key value pair representing a specific identifier of the asset represented by the asset administration shell. See Constraint AASd-014 + + + + Reference to the asset the entity is representing. Constraint AASd-014: Either the attribute globalAssetId or specificAssetId of an Entity must be set if Entity/entityType is set to "SelfManagedEntity". They are not existing otherwise. + + + + + + Automation Markup Language Base Role Class Library - Part 1 Content extended with Part 3 and Part 4 Content + 2.2.2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1.0.0 + + + + 0 + + An AAS Data Specification template for IEC61369. A template consists of the DataSpecificationContent containing the additional attributes to be added to the element instance that references the data specification template and meta information about the template itself (this is why DataSpecification inherits from Identifiable). In UML these are two separated classes. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + + + + + + Abstract attribute class for identification. Has the subattributes id and idType. + + + Identifier of the element. Its type is defined in idType. Id is a subproperty of identification. + http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360 + + + + Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the enumeration “IdentifierType”. IdType is a subproperty of identification. + IRI + + + + + Abstract attribute for administration. Has the subattributes revision and version. + + + Revision of the element. Constraint AASd-005: A revision requires a version. This means, if there is no version there is no revision neither. Revision is a subproperty of administration. + + + + + Version of the element. Version is a subproperty of administration. + + + + + + + The content of an AAS Data Specification template for IEC61360. + + Identifies the attribute hierarchy for preferredName in above attribute hierachy. Subordinate attributes are designated by the country code information (see aml-lang literal). + + + + Identifies the attribute for shortName in above attribute hierarchy. + + + + Identifies the attribute for unit in above attribute hierarchy. + + + + Identifies the attribute for unitId in above attribute hierarchy in its string serialization. + + + + Identifies the attribute for sourceOfDefinition in above attribute hierachy. Subordinate attributes are designated by the country code information (see aml-lang literal). + + + + Identifies the attribute for symbol in above attribute hierarchy. + + + + Identifies the attribute for dataType in above attribute hierarchy. + + + + Identifies the attribute for definition in above attribute hierachy. Subordinate attributes are designated by the country code information (see aml-lang literal). + + + + Identifies the attribute for valueFormat in above attribute hierarchy. + + + + Identifies the attribute for valueList in above attribute hierarchy. + + + + The attribute value. + + + + The id for the value. + + + + + + + diff --git a/dataformat-aml/src/main/resources/CAEX_ClassModel_V2.15.xsd b/dataformat-aml/src/main/resources/CAEX_ClassModel_V2.15.xsd new file mode 100644 index 00000000..31acecb4 --- /dev/null +++ b/dataformat-aml/src/main/resources/CAEX_ClassModel_V2.15.xsd @@ -0,0 +1,592 @@ + + + + + + + Optionally describes the change state of a CAEX object. If used, the ChangeMode shall have the following value range: state, create, delete and change. This information should be used for further change management applications. + + + + + + + + + + + Defines a group of organizational information, like description, version, revision, copyright, etc. + + + + + Textual description for CAEX objects. + + + + + + + + + + + + Organizational information about the state of the version. + + + + + + + + + + + + Organizational information about the state of the revision. + + + + + + + + + + + + + + + + + + Organizational information about copyright. + + + + + + + + + + + + Optional auxiliary field that may contain any additional information about a CAEX object. + + + + + + + CAEX basis object that comprises a basic set of attributes and header information which exist for all CAEX elements. + + + + + Optionally describes the change state of a CAEX object. If used, the ChangeMode shall have the following value range: state, create, delete and change. This information should be used for further change management applications. + + + + + + + CAEX basis object derived from CAEXBasicObject, augmented by + Name (required) and ID (optional). + + + + + + + Optional attribute that describes a unique identifier of the CAEX object. + + + + + Describes the name of the CAEX object. + + + + + + + + Shall be used for InterfaceClass definition, provides base structures for an interface class definition. + + + + + + + Characterizes properties of the InterfaceClass. + + + + + + Stores the reference of a class to its base class. References contain the full path to the referred class object. + + + + + + + + Defines base structures for a hierarchical InterfaceClass tree. The hierarchical structure of an interface library has organizational character only. + + + + + + + Element that allows definition of child InterfaceClasses within the class hierarchy. The parent child relation between two InterfaceClasses has no semantic. + + + + + + + + + Shall be used for RoleClass definition, provides base structures for a role class definition. + + + + + + + Characterizes properties of the RoleClass. + + + + + Description of an external interface. + + + + + + + + + + + Stores the reference of a class to its base class. References contain the full path to the referred class object. + + + + + + + + Defines base structures for a hierarchical RoleClass tree. The hierarchical structure of a role library has organizational character only. + + + + + + + Element that allows definition of child RoleClasses within the class hierarchy. The parent child relation between two RoleClasses has no semantic. + + + + + + + + + Defines base structures for a SystemUnit class definition. + + + + + + + Characterizes properties of the SystemUnitClass. + + + + + Description of an external interface. + + + + + Shall be used in order to define nested objects inside of a SystemUnitClass or another InternalElement. Allows description of the internal structure of a CAEX object. + + + + + Allows the association to a RoleClass which this SystemUnitClass can play. A SystemUnitClass may reference multiple roles. + + + + + + + + + + + + + + + Shall be used in order to define the relationships between internal interfaces of InternalElements. + + + + + + + + + + + + + + + + + Defines base structures for a hierarchical SystemUnitClass tree. The hierarchical structure of a SystemUnit library has organizational character only. + + + + + + + Element that allows definition of child SystemUnitClasses within the class hierarchy. The parent child relation between two SystemUnitClasses has no semantic. + + + + + + Stores the reference of a class to its base class. References contain the full path to the referred class object. + + + + + + + + Type for definition of nested objects inside of a SystemUnitClass. + + + + + + + Describes role requirements of an InternalElement. It allows the definition of a reference to a RoleClass and the specification of role requirements like required attributes and required interfaces. + + + + + + + + Characterizes properties of the RoleRequirements. + + + + + + + + + + + + Host element for AttributeNameMapping and InterfaceNameMapping. + + + + + + Stores the reference of an InternalElement to a class or instance definition. References contain the full path information. + + + + + + + + Defines base structures for attribute definitions. + + + + + + + A predefined default value for an attribute. + + + + + Element describing the value of an attribute. + + + + + A reference to a definition of a defined attribute, e. g. to an attribute in a standardized library, this allows the semantic definition of the attribute. + + + + + + + + + + + + Element to restrict the range of validity of a defined attribute. + + + + + Element that allows the description of nested attributes. + + + + + + Describes the unit of the attribute. + + + + + Describes the data type of the attribute using XML notation. + + + + + + + + + + + Defines base structures for definition of value requirements of an attribute. + + + + + + + Element of to define constraints of ordinal scaled attribute values. + + + + + + Element to define a maximum value of an attribute. + + + + + Element to define a required value of an attribute. + + + + + Element to define a minimum value of an attribute. + + + + + + + + Element of to define constraints of nominal scaled attribute values. + + + + + + Element to define a required value of an attribute. It may be defined multiple times in order to define a discrete value range of the attribute. + + + + + + + + Element to define constraints for attribute values of an unknown scale type. + + + + + + Defines informative requirements as a constraint for an attribute value. + + + + + + + + + Describes the name of the constraint. + + + + + + + + Base element for AttributeNameMapping and InterfaceNameMapping. + + + + + + + Allows the definition of the mapping between attribute names of corresponding RoleClasses and SystemUnitClasses. + + + + + + + + + + + + + Mapping of interface names of corresponding RoleClasses and SystemUnitClasses. + + + + + + + + + + + + + + + + + Root-element of the CAEX schema. + + + + + + + + Container element for the alias definition of external CAEX files. + + + + + + + Describes the path of the external CAEX file. Absolute and relative paths are allowed. + + + + + Describes the alias name of an external CAEX file to enable referencing elements of the external CAEX file. + + + + + + + + + Root element for a system hierarchy of object instances. + + + + + + + + Shall be used in order to define nested objects inside of a SystemUnitClass or another InternalElement. Allows description of the internal structure of a CAEX object. + + + + + + + + + + Container element for a hierarchy of InterfaceClass definitions. It shall contain any interface class definitions. CAEX supports multiple interface libraries.. + + + + + + + + Class definition for interfaces. + + + + + + + + + + Container element for a hierarchy of RoleClass definitions. It shall contain any RoleClass definitions. CAEX supports multiple role libraries. + + + + + + + + Definition of a class of a role type. + + + + + + + + + + Container element for a hierarchy of SystemUnitClass definitions. It shall contain any SystemunitClass definitions. CAEX supports multiple SystemUnitClass libraries. + + + + + + + + Shall be used for SystemUnitClass definition, provides definition of a class of a SystemUnitClass type. + + + + + + + + + + + Describes the name of the CAEX file. + + + + + Describes the version of the schema. Each CAEX document must specify which CAEX version it requires. The version number of a CAEX document must fit to the version number specified in the CAEX schema file. + + + + + + + \ No newline at end of file diff --git a/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/deserialize/AmlDeserializerTest.java b/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/deserialize/AmlDeserializerTest.java index 2399b2b5..f0a4cb64 100644 --- a/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/deserialize/AmlDeserializerTest.java +++ b/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/deserialize/AmlDeserializerTest.java @@ -15,25 +15,24 @@ */ package io.adminshell.aas.v3.dataformat.aml.deserialize; -import com.fasterxml.jackson.dataformat.xml.XmlMapper; +import io.adminshell.aas.v3.dataformat.DeserializationException; import io.adminshell.aas.v3.dataformat.aml.AmlDeserializer; +import io.adminshell.aas.v3.dataformat.aml.fixtures.FullExample; +import io.adminshell.aas.v3.model.AssetAdministrationShellEnvironment; +import java.io.FileNotFoundException; +import static org.junit.Assert.assertEquals; -import java.io.*; +import org.junit.Ignore; +import org.junit.Test; public class AmlDeserializerTest { private final AmlDeserializer deserializer = new AmlDeserializer(); - private final XmlMapper xmlMapper = new XmlMapper(); - - private String inputStreamToString(InputStream inputStream) throws IOException { - StringBuilder stringBuilder = new StringBuilder(); - String line; - BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream)); - while ((line = reader.readLine()) != null) { - stringBuilder.append(line); - } - reader.close(); - return stringBuilder.toString(); + @Test + @Ignore + public void testSAPFullExample() throws DeserializationException, FileNotFoundException { + AssetAdministrationShellEnvironment actual = deserializer.read(FullExample.FILE); + assertEquals(FullExample.ENVIRONMENT, actual); } } diff --git a/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/fixtures/FullExample.java b/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/fixtures/FullExample.java index 82f528fe..d7144fb4 100644 --- a/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/fixtures/FullExample.java +++ b/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/fixtures/FullExample.java @@ -23,11 +23,11 @@ public class FullExample { - public static final java.io.File FILE = new java.io.File("src/interface-class-lib_automl_interface/resources/test_demo_full_example.json"); + public static final java.io.File FILE = new java.io.File("src/test/resources/test_demo_full_example.json"); public static final AssetAdministrationShell AAS_1 = new DefaultAssetAdministrationShell.Builder() .idShort("TestAssetAdministrationShell") - .description(new LangString("An Example Asset Administration Shell for the interface-class-lib_automl_interface application", "en-us")) + .description(new LangString("An Example Asset Administration Shell for the test application", "en-us")) .description(new LangString("Ein Beispiel-Verwaltungsschale für eine Test-Anwendung", "de")) .identification(new DefaultIdentifier.Builder() .idType(IdentifierType.IRI) @@ -136,7 +136,7 @@ public class FullExample { public static final AssetAdministrationShell AAS_4 = new DefaultAssetAdministrationShell.Builder() .idShort("TestAssetAdministrationShell") - .description(new LangString("An Example Asset Administration Shell for the interface-class-lib_automl_interface application", "en-us")) + .description(new LangString("An Example Asset Administration Shell for the test application", "en-us")) .description(new LangString("Ein Beispiel-Verwaltungsschale für eine Test-Anwendung", "de")) .identification(new DefaultIdentifier.Builder() .idType(IdentifierType.IRI) @@ -180,7 +180,7 @@ public class FullExample { public static final Submodel SUBMODEL_1 = new DefaultSubmodel.Builder() .idShort("Identification") - .description(new LangString("An example asset identification submodel for the interface-class-lib_automl_interface application", "en-us")) + .description(new LangString("An example asset identification submodel for the test application", "en-us")) .description(new LangString("Ein Beispiel-Identifikations-Submodel für eine Test-Anwendung", "de")) .identification(new DefaultIdentifier.Builder() .idType(IdentifierType.IRI) @@ -267,7 +267,7 @@ public class FullExample { public static final Submodel SUBMODEL_2 = new DefaultSubmodel.Builder() .idShort("BillOfMaterial") - .description(new LangString("An example bill of material submodel for the interface-class-lib_automl_interface application", "en-us")) + .description(new LangString("An example bill of material submodel for the test application", "en-us")) .description(new LangString("Ein Beispiel-BillofMaterial-Submodel für eine Test-Anwendung", "de")) .identification(new DefaultIdentifier.Builder() .idType(IdentifierType.IRI) @@ -364,7 +364,7 @@ public class FullExample { public static final Submodel SUBMODEL_3 = new DefaultSubmodel.Builder() .idShort("TestSubmodel") - .description(new LangString("An example submodel for the interface-class-lib_automl_interface application", "en-us")) + .description(new LangString("An example submodel for the test application", "en-us")) .description(new LangString("Ein Beispiel-Teilmodell für eine Test-Anwendung", "de")) .identification(new DefaultIdentifier.Builder() .idType(IdentifierType.IRI) @@ -805,7 +805,7 @@ public class FullExample { public static final Submodel SUBMODEL_6 = new DefaultSubmodel.Builder() .idShort("TestSubmodel") - .description(new LangString("An example submodel for the interface-class-lib_automl_interface application", "en-us")) + .description(new LangString("An example submodel for the test application", "en-us")) .description(new LangString("Ein Beispiel-Teilmodell für eine Test-Anwendung", "de")) .identification(new DefaultIdentifier.Builder() .idType(IdentifierType.IRI) @@ -1123,7 +1123,7 @@ public class FullExample { public static final Submodel SUBMODEL_7 = new DefaultSubmodel.Builder() .idShort("TestSubmodel") - .description(new LangString("An example submodel for the interface-class-lib_automl_interface application", "en-us")) + .description(new LangString("An example submodel for the test application", "en-us")) .description(new LangString("Ein Beispiel-Teilmodell für eine Test-Anwendung", "de")) .identification(new DefaultIdentifier.Builder() .idType(IdentifierType.IRI) @@ -1457,7 +1457,7 @@ public class FullExample { public final static ConceptDescription CONCEPT_DESCRIPTION_1 = new DefaultConceptDescription.Builder() .idShort("TestConceptDescription") - .description(new LangString("An example concept description for the interface-class-lib_automl_interface application", "en-us")) + .description(new LangString("An example concept description for the test application", "en-us")) .description(new LangString("Ein Beispiel-ConceptDescription für eine Test-Anwendung", "de")) .identification(new DefaultIdentifier.Builder() .idType(IdentifierType.IRI) @@ -1486,7 +1486,7 @@ public class FullExample { public final static ConceptDescription CONCEPT_DESCRIPTION_3 = new DefaultConceptDescription.Builder() .idShort("TestConceptDescription") - .description(new LangString("An example concept description for the interface-class-lib_automl_interface application", "en-us")) + .description(new LangString("An example concept description for the test application", "en-us")) .description(new LangString("Ein Beispiel-ConceptDescription für eine Test-Anwendung", "de")) .identification(new DefaultIdentifier.Builder() .idType(IdentifierType.IRI) @@ -1569,25 +1569,22 @@ public class FullExample { public static final AssetAdministrationShellEnvironment ENVIRONMENT = new DefaultAssetAdministrationShellEnvironment.Builder() .assetAdministrationShells(Arrays.asList( -// AAS_1, -// AAS_2, -// AAS_3, - AAS_4 - )) + AAS_1, + AAS_2, + AAS_3, + AAS_4)) .submodels(Arrays.asList( - SUBMODEL_1 -// SUBMODEL_2, -// SUBMODEL_3, -// SUBMODEL_4, -// SUBMODEL_5, -// SUBMODEL_6, -// SUBMODEL_7 - )) + SUBMODEL_1, + SUBMODEL_2, + SUBMODEL_3, + SUBMODEL_4, + SUBMODEL_5, + SUBMODEL_6, + SUBMODEL_7)) .conceptDescriptions(Arrays.asList( -// CONCEPT_DESCRIPTION_1, -// CONCEPT_DESCRIPTION_2, -// CONCEPT_DESCRIPTION_3, -// CONCEPT_DESCRIPTION_4 - )) + CONCEPT_DESCRIPTION_1, + CONCEPT_DESCRIPTION_2, + CONCEPT_DESCRIPTION_3, + CONCEPT_DESCRIPTION_4)) .build(); } diff --git a/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/fixtures/TestExample.java b/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/fixtures/TestExample.java new file mode 100644 index 00000000..e49c10e5 --- /dev/null +++ b/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/fixtures/TestExample.java @@ -0,0 +1,570 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.fixtures; + +import io.adminshell.aas.v3.dataformat.core.ReflectionHelper; +import io.adminshell.aas.v3.dataformat.core.deserialization.EnumDeserializer; +import io.adminshell.aas.v3.model.*; +import io.adminshell.aas.v3.model.impl.*; + +import java.util.Arrays; +import java.util.Base64; + +public class TestExample { + + public static final java.io.File FILE = new java.io.File("src/test/resources/test_demo_full_example.json"); + + private static KeyElements resolveKeyElement(Class type) { + String potentialEnumName = EnumDeserializer.translate(ReflectionHelper.getAasInterface(type).getSimpleName()); + return KeyElements.valueOf(potentialEnumName); + } + + private static final Reference asReference(Identifiable identifiable) { + return new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .idType(KeyType.IRI) + .type(resolveKeyElement(identifiable.getClass())) + .value(identifiable.getIdentification().getIdentifier()) + .build()) + .build(); + } + + public static final Submodel SUBMODEL_1 = new DefaultSubmodel.Builder() + .idShort("Identification") + .description(new LangString("An example asset identification submodel for the test application", "en-us")) + .description(new LangString("Ein Beispiel-Identifikations-Submodel für eine Test-Anwendung", "de")) + .identification(new DefaultIdentifier.Builder() + .idType(IdentifierType.IRI) + .identifier("http://acplt.org/Submodels/Assets/TestAsset/Identification") + .build()) + .administration(new DefaultAdministrativeInformation.Builder() + .version("0.9") + .revision("0") + .build()) + .kind(ModelingKind.INSTANCE) + .semanticId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.SUBMODEL) + .idType(KeyType.IRI) + .value("http://acplt.org/SubmodelTemplates/AssetIdentification") + .build()) + .build()) + .submodelElement(new DefaultReferenceElement.Builder() + .idShort("ExampleReferenceElement") + .category("Parameter") + .description(new LangString("Example Reference Element object", "en-us")) + .description(new LangString("Beispiel Reference Element Element", "de")) + .semanticId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE).value( + "http://acplt.org/ReferenceElements/ExampleReferenceElement") + .idType(KeyType.IRI) + .build()) + .build()) + .value(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .idType(KeyType.IRI) + .type(KeyElements.SUBMODEL) + .value("http://acplt.org/Submodels/Assets/TestAsset/Identification") + .build()) + .key(new DefaultKey.Builder() + .type(KeyElements.SUBMODEL_ELEMENT) + .idType(KeyType.ID_SHORT) + .value("ExampleOperation") + .build()) + .build()) + .build()) +// .submodelElement(new DefaultRelationshipElement.Builder() +// .idShort("ExampleRelationshipElement") +// .first(new DefaultReference.Builder() +// .key(new DefaultKey.Builder() +// .idType(KeyType.IRI) +// .type(KeyElements.SUBMODEL) +// .value("http://acplt.org/Submodels/Assets/TestAsset/Identification") +// .build()) +// .key(new DefaultKey.Builder() +// .type(KeyElements.SUBMODEL_ELEMENT) +// .idType(KeyType.ID_SHORT) +// .value("ExampleOperation") +// .build()) +// .build()) +// .second(new DefaultReference.Builder() +// .key(new DefaultKey.Builder() +// .idType(KeyType.IRI) +// .type(KeyElements.SUBMODEL) +// .value("http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial") +// .build()) +// .build()) +// .build()) + .submodelElement(new DefaultFile.Builder() + .idShort("ExampleFile") + .category("Parameter") + .description(new LangString("Example File object", "en-us")) + .description(new LangString("Beispiel File Element", "de")) + .semanticId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .value("http://acplt.org/Files/ExampleFile") + .idType(KeyType.IRI) + .build()) + .build()) + .value("/TestFile.pdf") + .mimeType("application/pdf") + .build()) + .submodelElement(new DefaultOperation.Builder() + .idShort("ExampleOperation") + .category("Parameter") + .description(new LangString("Example Operation object", "en-us")) + .description(new LangString("Beispiel Operation Element", "de")) + .semanticId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .value("http://acplt.org/Operations/ExampleOperation") + .idType(KeyType.IRI) + .build()) + .build()) + .inputVariable(new DefaultOperationVariable.Builder() + .value(new DefaultProperty.Builder() + .idShort("ExampleProperty") + .category("Constant") + .description(new LangString("Example Property object", "en-us")) + .description(new LangString("Beispiel Property Element", "de")) + .semanticId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .value("http://acplt.org/Properties/ExampleProperty") + .idType(KeyType.IRI) + .build()) + .build()) + .value("exampleValue") + .valueId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .idType(KeyType.IRI) + .value("http://acplt.org/ValueId/ExampleValueId") + .build()) + .build()) + .valueType("string") + .build()) + .build()) + .outputVariable(new DefaultOperationVariable.Builder() + .value(new DefaultProperty.Builder() + .idShort("ExampleProperty") + .category("Constant") + .description(new LangString("Example Property object", "en-us")) + .description(new LangString("Beispiel Property Element", "de")) + .semanticId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .value("http://acplt.org/Properties/ExampleProperty") + .idType(KeyType.IRI) + .build()) + .build()) + .value("exampleValue") + .valueId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .idType(KeyType.IRI) + .value("http://acplt.org/ValueId/ExampleValueId") + .build()) + .build()) + .valueType("string") + .build()) + .build()) + .inoutputVariable(new DefaultOperationVariable.Builder() + .value(new DefaultProperty.Builder() + .idShort("ExampleProperty") + .category("Constant") + .description(new LangString("Example Property object", "en-us")) + .description(new LangString("Beispiel Property Element", "de")) + .semanticId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .value("http://acplt.org/Properties/ExampleProperty") + .idType(KeyType.IRI) + .build()) + .build()) + .value("exampleValue") + .valueId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .idType(KeyType.IRI) + .value("http://acplt.org/ValueId/ExampleValueId") + .build()) + .build()) + .valueType("string") + .build()) + .build()) + .build()) + // .submodelElement( + // new DefaultProperty.Builder() + // .idShort("ManufacturerName") + // .description(new LangString("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.", "en-us")) + // .description(new LangString("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", "de")) + // .semanticId(new DefaultReference.Builder() + // .key(new DefaultKey.Builder() + // .type(KeyElements.GLOBAL_REFERENCE) + // .value("0173-1#02-AAO677#002") + // .idType(KeyType.IRI) + // .build()) + // .build()) + // .qualifier(new DefaultQualifier.Builder() + // .value("100") + // .valueId(new DefaultReference.Builder() + // .key(new DefaultKey.Builder() + // .type(KeyElements.GLOBAL_REFERENCE) + // .idType(KeyType.IRI) + // .value("http://acplt.org/ValueId/ExampleValueId") + // .build()) + // .build()) + // .valueType("int") + // .type("http://acplt.org/Qualifier/ExampleQualifier") + // .build()) + // .qualifier(new DefaultQualifier.Builder() + // .value("50") + // .valueId(new DefaultReference.Builder() + // .key(new DefaultKey.Builder() + // .type(KeyElements.GLOBAL_REFERENCE) + // .idType(KeyType.IRI) + // .value("http://acplt.org/ValueId/ExampleValueId") + // .build()) + // .build()) + // .valueType("int") + // .type("http://acplt.org/Qualifier/ExampleQualifier2") + // .build()) + // .value("ACPLT") + // .valueId(new DefaultReference.Builder() + // .key(new DefaultKey.Builder() + // .type(KeyElements.GLOBAL_REFERENCE) + // .idType(KeyType.IRI) + // .value("http://acplt.org/ValueId/ExampleValueId") + // .build()) + // .build()) + // .valueType("string") + // .build()) + + // .submodelElement(new DefaultProperty.Builder() + // .idShort("InstanceId") + // .description(new LangString("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.", "en-us")) + // .description(new LangString("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", "de")) + // .semanticId(new DefaultReference.Builder() + // .key(new DefaultKey.Builder() + // .type(KeyElements.GLOBAL_REFERENCE) + // .value("http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber") + // .idType(KeyType.IRI) + // .build()) + // .build()) + // .value("978-8234-234-342") + // .valueId(new DefaultReference.Builder() + // .key(new DefaultKey.Builder() + // .type(KeyElements.GLOBAL_REFERENCE) + // .idType(KeyType.IRI) + // .value("http://acplt.org/ValueId/ExampleValueId") + // .build()) + // .build()) + // .valueType("string") + // .build()) + .build(); + + public static final Submodel SUBMODEL_2 = new DefaultSubmodel.Builder() + .idShort("BillOfMaterial") + .description(new LangString("An example bill of material submodel for the test application", "en-us")) + .description(new LangString("Ein Beispiel-BillofMaterial-Submodel für eine Test-Anwendung", "de")) + .identification(new DefaultIdentifier.Builder() + .idType(IdentifierType.IRI) + .identifier("http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial") + .build()) + .administration(new DefaultAdministrativeInformation.Builder() + .version("0.9") + .build()) + .kind(ModelingKind.TEMPLATE) + .semanticId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.SUBMODEL) + .idType(KeyType.IRI) + .value("http://acplt.org/SubmodelTemplates/BillOfMaterial") + .build()) + .build()) + .submodelElement(new DefaultEntity.Builder() + .idShort("ExampleEntity") + .description(new LangString("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.", "en-us")) + .description(new LangString("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", "de")) + .semanticId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .value("http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber") + .idType(KeyType.IRI) + .build()) + .build()) + .statement(new DefaultProperty.Builder() + .idShort("ExampleProperty2") + .category("Constant") + .description(new LangString("Example Property object", "en-us")) + .description(new LangString("Beispiel Property Element", "de")) + .semanticId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .value("http://acplt.org/Properties/ExampleProperty") + .idType(KeyType.IRI) + .build()) + .build()) + .value("exampleValue2") + .valueId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .idType(KeyType.IRI) + .value("http://acplt.org/ValueId/ExampleValueId") + .build()) + .build()) + .valueType("string") + .build()) + .statement(new DefaultProperty.Builder() + .idShort("ExampleProperty") + .category("Constant") + .description(new LangString("Example Property object", "en-us")) + .description(new LangString("Beispiel Property Element", "de")) + .semanticId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .value("http://acplt.org/Properties/ExampleProperty") + .idType(KeyType.IRI) + .build()) + .build()) + .value("exampleValue") + .valueId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .idType(KeyType.IRI) + .value("http://acplt.org/ValueId/ExampleValueId") + .build()) + .build()) + .valueType("string") + .build()) + .entityType(EntityType.CO_MANAGED_ENTITY) + .build()) + .submodelElement(new DefaultEntity.Builder() + .idShort("ExampleEntity2") + .description(new LangString("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.", "en-us")) + .description(new LangString("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", "de")) + .semanticId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .value("http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber") + .idType(KeyType.IRI) + .build()) + .build()) + .entityType(EntityType.SELF_MANAGED_ENTITY) + .globalAssetId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.ASSET) + .idType(KeyType.IRI) + .value("https://acplt.org/Test_Asset2") + .build()) + .build()) + .build()) + .qualifier(new DefaultQualifier.Builder() + .value("100") + .valueId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .idType(KeyType.IRI) + .value("http://acplt.org/ValueId/ExampleValueId") + .build()) + .build()) + .valueType("int") + .type("http://acplt.org/Qualifier/ExampleQualifier") + .build()) + .qualifier(new DefaultQualifier.Builder() + .value("50") + .valueId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .idType(KeyType.IRI) + .value("http://acplt.org/ValueId/ExampleValueId") + .build()) + .build()) + .valueType("int") + .type("http://acplt.org/Qualifier/ExampleQualifier2") + .build()) + .build(); + + public final static ConceptDescription CONCEPT_DESCRIPTION_1 = new DefaultConceptDescription.Builder() + .idShort("TestConceptDescription") + .description(new LangString("An example concept description for the test application", "en-us")) + .description(new LangString("Ein Beispiel-ConceptDescription für eine Test-Anwendung", "de")) + .identification(new DefaultIdentifier.Builder() + .idType(IdentifierType.IRI) + .identifier("https://acplt.org/Test_ConceptDescription") + .build()) + .administration(new DefaultAdministrativeInformation.Builder() + .version("0.9") + .revision("0") + .build()) + .isCaseOf(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .idType(KeyType.IRI) + .value("http://acplt.org/DataSpecifications/ConceptDescriptions/TestConceptDescription") + .build()) + .build()) + .embeddedDataSpecification(new DefaultEmbeddedDataSpecification.Builder() + .dataSpecificationContent(new DefaultDataSpecificationIEC61360.Builder() + .preferredName(new LangString("Test Specification", "de")) + .preferredName(new LangString("TestSpecification", "en-us")) + .dataType(DataTypeIEC61360.REAL_MEASURE) + .definition(new LangString("Dies ist eine Data Specification für Testzwecke", "de")) + .definition(new LangString("This is a DataSpecification for testing purposes", "en-us")) + .shortName(new LangString("Test Spec", "de")) + .shortName(new LangString("TestSpec", "en-us")) + .unit("SpaceUnit") + .unitId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .idType(KeyType.IRI) + .value("http://acplt.org/Units/SpaceUnit") + .build()) + .build()) + .sourceOfDefinition("http://acplt.org/DataSpec/ExampleDef") + .symbol("SU") + .valueFormat("string") + .value("TEST") + .levelType(LevelType.MIN) + .levelType(LevelType.MAX) + .valueList(new DefaultValueList.Builder() + .valueReferencePairTypes(new DefaultValueReferencePair.Builder() + .value("exampleValue") + .valueId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .idType(KeyType.IRI) + .value("http://acplt.org/ValueId/ExampleValueId") + .build()) + .build()) + // TODO valueType + .build()) + .valueReferencePairTypes(new DefaultValueReferencePair.Builder() + .value("exampleValue2") + .valueId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .idType(KeyType.IRI) + .value("http://acplt.org/ValueId/ExampleValueId2") + .build()) + .build()) + // TODO valueType + .build()) + .build()) + .build()) + .build()) + .embeddedDataSpecification(new DefaultEmbeddedDataSpecification.Builder() + .dataSpecificationContent(new DefaultDataSpecificationIEC61360.Builder() + .preferredName(new LangString("Test Specification2", "de")) + .preferredName(new LangString("TestSpecification2", "en-us")) + .dataType(DataTypeIEC61360.REAL_MEASURE) + .definition(new LangString("Dies ist eine Data Specification für Testzwecke2", "de")) + .definition(new LangString("This is a DataSpecification for testing purposes2", "en-us")) + .shortName(new LangString("Test Spec2", "de")) + .shortName(new LangString("TestSpec2", "en-us")) + .unit("SpaceUnit") + .unitId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .idType(KeyType.IRI) + .value("http://acplt.org/Units/SpaceUnit") + .build()) + .build()) + .sourceOfDefinition("http://acplt.org/DataSpec/ExampleDef") + .symbol("SU") + .valueFormat("string") + .value("TEST2") + .levelType(LevelType.MIN) + .levelType(LevelType.MAX) + .valueList(new DefaultValueList.Builder() + .valueReferencePairTypes(new DefaultValueReferencePair.Builder() + .value("exampleValue21") + .valueId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .idType(KeyType.IRI) + .value("http://acplt.org/ValueId/ExampleValueId") + .build()) + .build()) + // TODO valueType + .build()) + .valueReferencePairTypes(new DefaultValueReferencePair.Builder() + .value("exampleValue22") + .valueId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.GLOBAL_REFERENCE) + .idType(KeyType.IRI) + .value("http://acplt.org/ValueId/ExampleValueId2") + .build()) + .build()) + // TODO valueType + .build()) + .build()) + .build()) + .build()) + .build(); + + public static final AssetAdministrationShell AAS_1 = new DefaultAssetAdministrationShell.Builder() + .idShort("TestAssetAdministrationShell") + .description(new LangString("An Example Asset Administration Shell for the test application", "en-us")) + .description(new LangString("Ein Beispiel-Verwaltungsschale für eine Test-Anwendung", "de")) + .identification(new DefaultIdentifier.Builder() + .idType(IdentifierType.IRI) + .identifier("https://acplt.org/Test_AssetAdministrationShell") + .build()) + .administration(new DefaultAdministrativeInformation.Builder() + .version("0.9") + .revision("0") + .build()) + .derivedFrom(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.ASSET_ADMINISTRATION_SHELL) + .idType(KeyType.IRI) + .value("https://acplt.org/TestAssetAdministrationShell2") + .build()) + .build()) + .assetInformation(new DefaultAssetInformation.Builder() + .assetKind(AssetKind.INSTANCE) + .globalAssetId(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.ASSET) + .idType(KeyType.IRI) + .value("https://acplt.org/Test_Asset") + .build()) + .build()) + // .billOfMaterial(asReference(SUBMODEL_2)) + .build()) + .submodel(asReference(SUBMODEL_1)) + .submodel(asReference(SUBMODEL_2)) +// .view(new DefaultView.Builder() +// .idShort("ExampleView") +// .containedElement(asReference(SUBMODEL_1)) +// .build()) + .build(); + + public static final AssetAdministrationShellEnvironment ENVIRONMENT = new DefaultAssetAdministrationShellEnvironment.Builder() + .assetAdministrationShells(Arrays.asList( + AAS_1)) + .submodels(Arrays.asList( + SUBMODEL_1, + SUBMODEL_2)) + .conceptDescriptions(Arrays.asList( + CONCEPT_DESCRIPTION_1)) + .build(); +} diff --git a/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/serialize/AmlSerializerTest.java b/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/serialize/AmlSerializerTest.java index aa1fd6f6..cc94f823 100644 --- a/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/serialize/AmlSerializerTest.java +++ b/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/serialize/AmlSerializerTest.java @@ -18,29 +18,29 @@ import io.adminshell.aas.v3.dataformat.aml.fixtures.FullExample; import io.adminshell.aas.v3.dataformat.SerializationException; import io.adminshell.aas.v3.dataformat.aml.AmlSerializer; +import io.adminshell.aas.v3.dataformat.aml.fixtures.TestExample; +import io.adminshell.aas.v3.dataformat.aml.util.ReferencedReferableCollector; +import io.adminshell.aas.v3.model.Referable; +import java.util.Set; +import org.junit.Ignore; import org.junit.Test; -import java.io.File; -import java.io.FileWriter; -import java.io.IOException; - public class AmlSerializerTest { private final AmlSerializer serializer = new AmlSerializer(); + + @Test +// @Ignore + public void testExample() throws SerializationException { + String actual = serializer.write(TestExample.ENVIRONMENT, true); + System.out.println(actual); + } @Test + @Ignore public void testSAPFullExample() throws SerializationException { - String aml = serializer.write(FullExample.ENVIRONMENT); - - try { - File xmlOutput = new File("src/test/resources/amlfile/full-example.xml"); - FileWriter fileWriter = new FileWriter(xmlOutput); - fileWriter.write(aml); - fileWriter.close(); - } catch (IOException e) { - e.printStackTrace(); - } - - // System.err.println(actual); + String actual = serializer.write(FullExample.ENVIRONMENT); + System.out.println(actual); } + } diff --git a/dataformat-aml/src/test/resources/amlfile/example-motor.xml b/dataformat-aml/src/test/resources/amlfile/example-motor.xml index edac76c6..0b56535d 100644 --- a/dataformat-aml/src/test/resources/amlfile/example-motor.xml +++ b/dataformat-aml/src/test/resources/amlfile/example-motor.xml @@ -1,2889 +1,2890 @@ - - - 0 - - - - - - - - Instance - - - - (Submodel)(local)[IRI]i40.customer.com/type/1/1/F13E8576F6488342 - - - - - - IRI - - - - http://customer.com/assets/KHBVZJSQKIY - - - - - ServoDCMotor - - - - - - - - - - - Instance - - - - (GlobalReference)(no-local)[IRDI]0173-1#02-AAO677#002 - - - - Manufacturer - - - - CONSTANT - - - - CUSTOMER GmbH - - - - - - - - Instance - - - - (GlobalReference)(no-local)[IRDI]0173-1#02-AAY812#001 - - - - GLN - - - - CONSTANT - - - - 10101010 - - - - - - - - Instance - - - - (GlobalReference)(no-local)[IRDI]0173-1#02-AAW338#001 - - - - ProductDesignation - - - - CONSTANT - - - - I40 Capable Servo Motor (EN) - - - - - - - - Instance - - - - (GlobalReference)(no-local)[IRDI]0173-1#02-AAM556#002 - - - - SerialNumber - - - - CONSTANT - - - - P12345678I40 - - - - - Instance - - - - (GlobalReference)(no-local)[IRDI]0173-1#01-ADN198#009 - - - - - - IRI - - - - http://i40.customer.com/type/1/1/F13E8576F6488342 - - - - - Identification - - - - CONSTANT - - - - - - Identification from Manufacturer - - - Hersteller-Identifikation - - - - - - - - - - - Instance - - - - (ConceptDescription)(local)[IRI]http://customer.com/cd/1/1/18EBD56F6B43D89 - - - - RotationSpeed - - - - VARIABLE - - - - - - open circuit, external cooling - - - - 4370 - - - - - - - - Instance - - - - (ConceptDescription)(local)[IRI]http://customer.com/cd/1/1/18EBD56F6B43D896 - - - - Torque - - - - VARIABLE - - - - - - open circuit, external cooling - - - - 117.4 - - - - - Instance - - - - (GlobalReference)(no-local)[IRDI]0173-1#01-AFZ615#016 - - - - - - IRI - - - - http://i40.customer.com/instance/1/1/AC69B1CB44F07935 - - - - - OperationalData - - - - VARIABLE - - - - - - - - - - - + + + 0 + + - - Instance - - - - (ConceptDescription)(local)[IRI]www.vdi2770.com/blatt1/Entwurf/Okt18/cd/DocumentId/Val - + + + + + Instance + + + + (Submodel)(local)[IRI]i40.customer.com/type/1/1/F13E8576F6488342 + + + + + + IRI + + + + http://customer.com/assets/KHBVZJSQKIY + + + + + ServoDCMotor + + + + + + + + + + + Instance + + + + (GlobalReference)(no-local)[IRDI]0173-1#02-AAO677#002 + + + + Manufacturer + + + + CONSTANT + + + + CUSTOMER GmbH + + + + + + + + Instance + + + + (GlobalReference)(no-local)[IRDI]0173-1#02-AAY812#001 + + + + GLN + + + + CONSTANT + + + + 10101010 + + + + + + + + Instance + + + + (GlobalReference)(no-local)[IRDI]0173-1#02-AAW338#001 + + + + ProductDesignation + + + + CONSTANT + + + + I40 Capable Servo Motor (EN) + + + + + + + + Instance + + + + (GlobalReference)(no-local)[IRDI]0173-1#02-AAM556#002 + + + + SerialNumber + + + + CONSTANT + + + + P12345678I40 + + + + + Instance + + + + (GlobalReference)(no-local)[IRDI]0173-1#01-ADN198#009 + + + + + + IRI + + + + http://i40.customer.com/type/1/1/F13E8576F6488342 + + + + + Identification + + + + CONSTANT + + + + + + Identification from Manufacturer + + + Hersteller-Identifikation + + + + + + + + + + + Instance + + + + (ConceptDescription)(local)[IRI]http://customer.com/cd/1/1/18EBD56F6B43D89 + + + + RotationSpeed + + + + VARIABLE + + + + + + open circuit, external cooling + + + + 4370 + + + + + + + + Instance + + + + (ConceptDescription)(local)[IRI]http://customer.com/cd/1/1/18EBD56F6B43D896 + + + + Torque + + + + VARIABLE + + + + + + open circuit, external cooling + + + + 117.4 + + + + + Instance + + + + (GlobalReference)(no-local)[IRDI]0173-1#01-AFZ615#016 + + + + + + IRI + + + + http://i40.customer.com/instance/1/1/AC69B1CB44F07935 + + + + + OperationalData + + + + VARIABLE + + + + + + + + + + + + + + Instance + + + + (ConceptDescription)(local)[IRI]www.vdi2770.com/blatt1/Entwurf/Okt18/cd/DocumentId/Val + + + + DocumentId + + + + CONSTANT + + + + 3 608 870 A47 + + + + + + + + Instance + + + + (ConceptDescription)(local)[IRI]www.vdi2770.com/blatt1/Entwurf/Okt18/cd/DocumentClassification/ClassId + + + + DocumentClassId + + + + 03-02 + + + + + + + + Instance + + + + (ConceptDescription)(local)[IRI]www.vdi2770.com/blatt1/Entwurf/Okt18/cd/DocumentClassification/ClassName + + + + DocumentClassName + + + + Operation (EN) Bedienung (DE) + + + + + + + + Instance + + + + (ConceptDescription)(local)[IRI]www.vdi2770.com/blatt1/Entwurf/Okt18/cd/DocumentClassification/ClassificationSystem + + + + DocumentClassificationSystem + + + + VDI2770:2018 + + + + + + + + Instance + + + + (ConceptDescription)(local)[IRI]www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Organization/OrganizationName + + + + OrganizationName + + + + CUSTOMER + + + + + + + + Instance + + + + (ConceptDescription)(local)[IRI]www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Organization/OrganizationOfficialName + + + + OrganizationOfficialName + + + + CUSTOMER GmbH + + + + + + + + Instance + + + + (ConceptDescription)(local)[IRI]www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Description/Title + + + + Title + + + + Operating Manual + + + + + + + + Instance + + + + (ConceptDescription)(local)[IRI]www.vdi2770.com/blatt1/Entwurf/Okt18/cd/DocumentVersion/Language + + + + Language + + + + en-US + + + + + + + + Instance + + + + (ConceptDescription)(local)[IRI]www.vdi2770.com/blatt1/Entwurf/Okt18/cd/StoredDocumentRepresentation/DigitalFile + + + + DigitalFile_PDF + + + + PARAMETER + + + + + application/pdf + + + + /aasx/OperatingManual.pdf + + + + + + false + + + + false + + + + Instance + + + + (ConceptDescription)(local)[IRI]www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Document + + + + OperatingManual + + + + + Instance + + + + + + IRI + + + + http://i40.customer.com/type/1/1/1A7B62B529F1915 + + + + + Documentation + + + + CONSTANT + + + + + + + + + + + Instance + + + + (ConceptDescription)(local)[IRDI]0173-1#02-BAA120#008 + + + + MaxRotationSpeed + + + + PARAMETER + + + + 5000 + + + + + + + + Instance + + + + (ConceptDescription)(local)[IRDI]0173-1#02-BAE098#004 + + + + MaxTorque + + + + PARAMETER + + + + 200 + + + + + + + + (ConceptDescription)(local)[IRDI]0173-1#07-BAB657#003 + + + + Instance + + + + (ConceptDescription)(local)[IRDI]0173-1#02-BAE122#006 + + + + CoolingType + + + + PARAMETER + + + + + + open circuit, external cooling + + + + BAB657 + + + + + Instance + + + + (GlobalReference)(no-local)[IRDI]0173-1#01-AFZ615#016 + + + + + + IRI + + + + http.//i40.customer.com/type/1/1/7A7104BDAB57E184 + + + + + TechnicalData + + + + CONSTANT + + + + + + + IRI + + + + http://customer.com/aas/9175_7013_7091_9168 + + - DocumentId - + ExampleMotor + - CONSTANT - + CONSTANT + + + + + + Interface Class Library according to Details of the Asset Administration Shell V2.0. + 1.0.0 + + A FileDataReference represents the address to a File. FileDataReference is derived from the + AutomationML Interface Class ExternalDataReference that is defined in AutomationML + BPR_005E_ExternalDataReference_v1.0.0_2:The interface class “ExternalDataReference�? shall be used in order + to reference external documents out of the scope of AutomationML. + + + + Reference to any other referable element of the same of any other AAS or a reference to an external + object or entity. For local references inside the same Asset Administration Shell an InternalLink between + two objects with this interface "ReferableReference" shall be set. In this case the attribute value has to + be empty. For references between different Asset Administration Shells or external objects or entities the + attribute value shall be used and no InternalLink shall be set. + + + Reference to any other referable element of any other AAS or a reference to an external object + or entity. Note: For references to any other referable element of the same AAS InternalLinks are used + and this attribute value shall be empty. + + - - 3 608 870 A47 - + + + + 1.0.0 + + + Mime type of the content of the File. - - - - - - Instance - + + + + Standard Automation Markup Language Interface Class Library - Part 1 Content extended with Part 3 and Part + 4 Content + + 2.2.2 + + + + + + + + + + The attribute refURI is an IRI that can represent an absolute or relative path to an L + document. An added fragment (with #) references inside the document + + + + + + + + + + + + + + + + + + true + + + + + + + + + + + + + Role Class Library according to Details of the Asset Administration Shell V2.0. + 1.0.0 + + An Asset Administration Shell. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a + referable element not being an identifiable element this id is mandatory and used for referring to the + element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore + ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. + Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used + for unique reference in its name space and thus allows better usability and a more performant + implementation. In this case it is similar to the “BrowserPath�? in OPC UA. + + - - (ConceptDescription)(local)[IRI]www.vdi2770.com/blatt1/Entwurf/Okt18/cd/DocumentClassification/ClassId - + + 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. + + + - - DocumentClassId - + + Description or comments on the element. The description can be provided in several languages. + + + + + + + + + - - 03-02 - + + Abstract attribute class for identification. Has the subattributes id and idType. + + + Identifier of the element. Its type is defined in idType. Id is a subproperty of + identification. + + + + + + Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the + enumeration “IdentifierType�?. IdType is a subproperty of identification. + + + + - - - - - - Instance - + + Abstract attribute for administration. Has the subattributes revision and version. + + + Revision of the element. Constraint AASd-005: A revision requires a version. This means, if + there is no version there is no revision neither. Revision is a subproperty of administration. + + + + + + Version of the element. Version is a subproperty of administration. + + + - - (ConceptDescription)(local)[IRI]www.vdi2770.com/blatt1/Entwurf/Okt18/cd/DocumentClassification/ClassName - + + Global reference to the data specification template used by the element. + + - - DocumentClassName - + + The derivedFrom attribute is used to establish a relationship between two Asset Administration + Shells that are derived from each other. + + + - - Operation (EN) Bedienung (DE) - + + + An Asset describes meta data of an asset that is represented by an AAS. The asset may either represent + an asset type or an asset instance. The asset has a globally unique identifier plus – if needed – additional + domain specific (proprietary) identifiers. + + + Identifying string of the element within its name space. Constraint AASd-001: In case of a + referable element not being an identifiable element this id is mandatory and used for referring to the + element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore + ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. + Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used + for unique reference in its name space and thus allows better usability and a more performant + implementation. In this case it is similar to the “BrowserPath�? in OPC UA. + + - - - - - - Instance - + + 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. + + + - - (ConceptDescription)(local)[IRI]www.vdi2770.com/blatt1/Entwurf/Okt18/cd/DocumentClassification/ClassificationSystem - + + Description or comments on the element. The description can be provided in several languages. + + + + - - DocumentClassificationSystem - + + Abstract attribute class for identification. Has the subattributes id and idType. + + + Identifier of the element. Its type is defined in idType. + + + + + Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the + enumeration “IdentifierType�?. IdType is a subproperty of identification. + + + + - - VDI2770:2018 - + + Abstract attribute for administration. Has the subattributes revision and version. + + + Revision of the element. Constraint AASd-005: A revision requires a version. This means, if + there is no version there is no revision neither. Revision is a subproperty of administration. + + + + + + Version of the element. Version is a subproperty of administration. + + + - - - - - - Instance - + + Global reference to the data specification template used by the element. + + - - (ConceptDescription)(local)[IRI]www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Organization/OrganizationName - + + Kind of the element: either type or instance. + Instance + Instance + + + + Instance + Type + + - - OrganizationName - + + + A Submodel defines a specific aspect of the asset represented by the AAS. A submodel is used to + structure the virtual representation and technical functionality of an Administration Shell into distinguishable + parts. Each submodel refers to a well-defined domain or subject matter. Submodels can become standardized and + thus become submodels types. Submodels can have different life-cycles. + + + Identifying string of the element within its name space. Constraint AASd-001: In case of a + referable element not being an identifiable element this id is mandatory and used for referring to the + element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore + ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. + Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used + for unique reference in its name space and thus allows better usability and a more performant + implementation. In this case it is similar to the “BrowserPath�? in OPC UA. + + - - CUSTOMER - + + 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. + + + - - - - - - Instance - + + Description or comments on the element. The description can be provided in several languages. + + + + - - (ConceptDescription)(local)[IRI]www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Organization/OrganizationOfficialName - + + Abstract attribute class for identification. Has the subattributes id and idType. + + + Identifier of the element. Its type is defined in idType. Id is a subproperty of + identification. + + + + + + Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the + enumeration “IdentifierType�?. IdType is a subproperty of identification. + + + + - - OrganizationOfficialName - + + Abstract attribute for administration. Has the subattributes revision and version. + + + Revision of the element. Constraint AASd-005: A revision requires a version. This means, if + there is no version there is no revision neither. Revision is a subproperty of administration. + + + + + + Version of the element. Version of the element. Version is a subproperty of administration. + + + + - - CUSTOMER GmbH - + + Global reference to the data specification template used by the element. + + - - - - - - Instance - + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + - - (ConceptDescription)(local)[IRI]www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Description/Title - + + Description or comments on the element. The description can be provided in several languages. This + attribute has the name of the label and has a value with the label written in the default language. The + individual languages are modelled as child attributes. The names of the child attributes are the prefix + “aml-lang=�? with the expression of the language in compliance with RFC5646. At it, the values of the child + attributes are the labels within the respective language. + + + - - Title - + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. + [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and + the valueId are present then the value needs to be identical to the value of the referenced coded value + in valueId. + + + + + + Reference to the global unqiue id of a coded value. + + + + + + + A submodel element collection is a set or list of submodel elements. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a + referable element not being an identifiable element this id is mandatory and used for referring to the + element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore + ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. + Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used + for unique reference in its name space and thus allows better usability and a more performant + implementation. In this case it is similar to the “BrowserPath�? in OPC UA. + + - - Operating Manual - + + 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. + + + - - - - - - Instance - + + Description or comments on the element. The description can be provided in several languages. + + + + - - (ConceptDescription)(local)[IRI]www.vdi2770.com/blatt1/Entwurf/Okt18/cd/DocumentVersion/Language - + + Global reference to the data specification template used by the element. + + - - Language - + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + - - en-US - + + Description or comments on the element. The description can be provided in several languages. This + attribute has the name of the label and has a value with the label written in the default language. The + individual languages are modelled as child attributes. The names of the child attributes are the prefix + “aml-lang=�? with the expression of the language in compliance with RFC5646. At it, the values of the child + attributes are the labels within the respective language. + + + - - - - - - Instance - + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. + [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and + the valueId are present then the value needs to be identical to the value of the referenced coded value + in valueId. + + + + + + Reference to the global unqiue id of a coded value. + + + - - (ConceptDescription)(local)[IRI]www.vdi2770.com/blatt1/Entwurf/Okt18/cd/StoredDocumentRepresentation/DigitalFile - + + If allowDuplicates=true, then it is allowed that the collection contains the same element several + times. + + false + - - DigitalFile_PDF - + + If ordered=false, then the elements in the property collection are not ordered. If ordered=true + then the elements in the collection are ordered. Default = false. Note: An ordered submodel element + collection is typically implemented as an indexed array. + + false + - - PARAMETER - - - - - application/pdf - - - - /aasx/OperatingManual.pdf - - - - - - false - - - - false - - - - Instance - - - - (ConceptDescription)(local)[IRI]www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Document - - - - OperatingManual - - - - - Instance - - - - - - IRI - - - - http://i40.customer.com/type/1/1/1A7B62B529F1915 - - - - - Documentation - - - - CONSTANT - - - - - - - - - - - Instance - - - - (ConceptDescription)(local)[IRDI]0173-1#02-BAA120#008 - - - - MaxRotationSpeed - - - - PARAMETER - - - - 5000 - - - - - - - - Instance - - - - (ConceptDescription)(local)[IRDI]0173-1#02-BAE098#004 - - - - MaxTorque - - - - PARAMETER - - - - 200 - - - - - - - - (ConceptDescription)(local)[IRDI]0173-1#07-BAB657#003 - - - - Instance - - - - (ConceptDescription)(local)[IRDI]0173-1#02-BAE122#006 - - - - CoolingType - - - - PARAMETER - - - - - - open circuit, external cooling - - - - BAB657 - - - - - Instance - - - - (GlobalReference)(no-local)[IRDI]0173-1#01-AFZ615#016 - - - - - - IRI - - - - http.//i40.customer.com/type/1/1/7A7104BDAB57E184 - - - - - TechnicalData - - - - CONSTANT - - - - - - - IRI - - - - http://customer.com/aas/9175_7013_7091_9168 - - - - - ExampleMotor - - - - CONSTANT - - - - - Interface Class Library according to Details of the Asset Administration Shell V2.0. - 1.0.0 - - A FileDataReference represents the address to a File. FileDataReference is derived from the - AutomationML Interface Class ExternalDataReference that is defined in AutomationML - BPR_005E_ExternalDataReference_v1.0.0_2:The interface class “ExternalDataReference? shall be used in order - to reference external documents out of the scope of AutomationML. - - - - Reference to any other referable element of the same of any other AAS or a reference to an external - object or entity. For local references inside the same Asset Administration Shell an InternalLink between - two objects with this interface "ReferableReference" shall be set. In this case the attribute value has to - be empty. For references between different Asset Administration Shells or external objects or entities the - attribute value shall be used and no InternalLink shall be set. - - - Reference to any other referable element of any other AAS or a reference to an external object - or entity. Note: For references to any other referable element of the same AAS InternalLinks are used - and this attribute value shall be empty. - - - - - - -1.0.0 - - - Mime type of the content of the File. - - - - -Standard Automation Markup Language Interface Class Library - Part 1 Content extended with Part 3 and Part - 4 Content - -2.2.2 - - - - - - - - - - The attribute refURI is an IRI that can represent an absolute or relative path to an L - document. An added fragment (with #) references inside the document + Submodel element contained in the collection. + + + + + A BLOB is a data element that represents a file that is contained with its source code in the value + attribute. - - + Name="idShort" + AttributeDataType="xs:string"> + Identifying string of the element within its name space. Constraint AASd-001: In case of a + referable element not being an identifiable element this id is mandatory and used for referring to the + element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore + ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. + Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used + for unique reference in its name space and thus allows better usability and a more performant + implementation. In this case it is similar to the “BrowserPath�? in OPC UA. + + + + + 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. + + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This + attribute has the name of the label and has a value with the label written in the default language. The + individual languages are modelled as child attributes. The names of the child attributes are the prefix + “aml-lang=�? with the expression of the language in compliance with RFC5646. At it, the values of the child + attributes are the labels within the respective language. + + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. + [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and + the valueId are present then the value needs to be identical to the value of the referenced coded value + in valueId. + + + + + + Reference to the global unqiue id of a coded value. + + + + + + Mime type of the content of the BLOB. The mime type states which file extension the file has. Valid + values are e.g. “application/json�?, “application/xls�?, �?image/jpg�?. The allowed values are defined as in + RFC2046. + + + + - - - - - - - - - - - - - true - - - - - - - - - - - - -Role Class Library according to Details of the Asset Administration Shell V2.0. -1.0.0 - - An Asset Administration Shell. - - Identifying string of the element within its name space. Constraint AASd-001: In case of a - referable element not being an identifiable element this id is mandatory and used for referring to the - element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore - ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. - Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used - for unique reference in its name space and thus allows better usability and a more performant - implementation. In this case it is similar to the “BrowserPath? in OPC UA. - - - - - 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. - - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - - - - - - Abstract attribute class for identification. Has the subattributes id and idType. - - - Identifier of the element. Its type is defined in idType. Id is a subproperty of - identification. - - - - - - Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the - enumeration “IdentifierType?. IdType is a subproperty of identification. - - - - - - - Abstract attribute for administration. Has the subattributes revision and version. - - - Revision of the element. Constraint AASd-005: A revision requires a version. This means, if - there is no version there is no revision neither. Revision is a subproperty of administration. - - - - - - Version of the element. Version is a subproperty of administration. - - - - - - Global reference to the data specification template used by the element. - - - - - The derivedFrom attribute is used to establish a relationship between two Asset Administration - Shells that are derived from each other. - - - - - - - An Asset describes meta data of an asset that is represented by an AAS. The asset may either represent - an asset type or an asset instance. The asset has a globally unique identifier plus – if needed – additional - domain specific (proprietary) identifiers. - - - Identifying string of the element within its name space. Constraint AASd-001: In case of a - referable element not being an identifiable element this id is mandatory and used for referring to the - element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore - ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. - Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used - for unique reference in its name space and thus allows better usability and a more performant - implementation. In this case it is similar to the “BrowserPath? in OPC UA. - - - - - 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. - - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - Abstract attribute class for identification. Has the subattributes id and idType. - - - Identifier of the element. Its type is defined in idType. - - - - - Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the - enumeration “IdentifierType?. IdType is a subproperty of identification. - - - - - - - Abstract attribute for administration. Has the subattributes revision and version. - - - Revision of the element. Constraint AASd-005: A revision requires a version. This means, if - there is no version there is no revision neither. Revision is a subproperty of administration. - - - - - - Version of the element. Version is a subproperty of administration. - - - - - - Global reference to the data specification template used by the element. - - - - - Kind of the element: either type or instance. - Instance - Instance - - - - Instance - Type - - - - - - A Submodel defines a specific aspect of the asset represented by the AAS. A submodel is used to - structure the virtual representation and technical functionality of an Administration Shell into distinguishable - parts. Each submodel refers to a well-defined domain or subject matter. Submodels can become standardized and - thus become submodels types. Submodels can have different life-cycles. - - - Identifying string of the element within its name space. Constraint AASd-001: In case of a - referable element not being an identifiable element this id is mandatory and used for referring to the - element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore - ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. - Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used - for unique reference in its name space and thus allows better usability and a more performant - implementation. In this case it is similar to the “BrowserPath? in OPC UA. - - - - - 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. - - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - Abstract attribute class for identification. Has the subattributes id and idType. - - - Identifier of the element. Its type is defined in idType. Id is a subproperty of - identification. - - - - - - Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the - enumeration “IdentifierType?. IdType is a subproperty of identification. - - - - - - - Abstract attribute for administration. Has the subattributes revision and version. - - - Revision of the element. Constraint AASd-005: A revision requires a version. This means, if - there is no version there is no revision neither. Revision is a subproperty of administration. - - - - - - Version of the element. Version of the element. Version is a subproperty of administration. - - - - - - - Global reference to the data specification template used by the element. - - - - - Kind of the element: either template or instance. - Instance - Instance - - - - Instance - Type - - - - - Description or comments on the element. The description can be provided in several languages. This - attribute has the name of the label and has a value with the label written in the default language. The - individual languages are modelled as child attributes. The names of the child attributes are the prefix - “aml-lang=? with the expression of the language in compliance with RFC5646. At it, the values of the child - attributes are the labels within the respective language. - - - - - - A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. - [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. - - - - The type describes the type of the qualifier that is applied to the element. - - - - - The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and - the valueId are present then the value needs to be identical to the value of the referenced coded value - in valueId. + The value of the BLOB instance of a blob data element. Note: In contrast to the file property the + file content is stored directly as value in the Blob data element. + + + + + + + A capability is the implementation-independent description of the potential of an asset to achieve a + certain effect in the physical or virtual world. - - - - - Reference to the global unqiue id of a coded value. - - - - - - - A submodel element collection is a set or list of submodel elements. - - Identifying string of the element within its name space. Constraint AASd-001: In case of a - referable element not being an identifiable element this id is mandatory and used for referring to the - element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore - ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. - Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used - for unique reference in its name space and thus allows better usability and a more performant - implementation. In this case it is similar to the “BrowserPath? in OPC UA. - - - - - 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. - - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - Global reference to the data specification template used by the element. - - - - - Kind of the element: either template or instance. - Instance - Instance - - - - Instance - Type - - - - - Description or comments on the element. The description can be provided in several languages. This - attribute has the name of the label and has a value with the label written in the default language. The - individual languages are modelled as child attributes. The names of the child attributes are the prefix - “aml-lang=? with the expression of the language in compliance with RFC5646. At it, the values of the child - attributes are the labels within the respective language. - - - - - - A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. - [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. - - - - The type describes the type of the qualifier that is applied to the element. - - - - - The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and - the valueId are present then the value needs to be identical to the value of the referenced coded value - in valueId. - - - - - - Reference to the global unqiue id of a coded value. - - - - - - If allowDuplicates=true, then it is allowed that the collection contains the same element several - times. - - false - - - - If ordered=false, then the elements in the property collection are not ordered. If ordered=true - then the elements in the collection are ordered. Default = false. Note: An ordered submodel element - collection is typically implemented as an indexed array. - - false - - - - Submodel element contained in the collection. - - - - - A BLOB is a data element that represents a file that is contained with its source code in the value - attribute. - - - Identifying string of the element within its name space. Constraint AASd-001: In case of a - referable element not being an identifiable element this id is mandatory and used for referring to the - element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore - ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. - Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used - for unique reference in its name space and thus allows better usability and a more performant - implementation. In this case it is similar to the “BrowserPath? in OPC UA. - - - - - 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. - - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - Global reference to the data specification template used by the element. - - - - - Kind of the element: either template or instance. - Instance - Instance - - - - Instance - Type - - - - - Description or comments on the element. The description can be provided in several languages. This - attribute has the name of the label and has a value with the label written in the default language. The - individual languages are modelled as child attributes. The names of the child attributes are the prefix - “aml-lang=? with the expression of the language in compliance with RFC5646. At it, the values of the child - attributes are the labels within the respective language. - - - - - - A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. - [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. - - - - The type describes the type of the qualifier that is applied to the element. - - - - + Identifying string of the element within its name space. Constraint AASd-001: In case of a + referable element not being an identifiable element this id is mandatory and used for referring to the + element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore + ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. + Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used + for unique reference in its name space and thus allows better usability and a more performant + implementation. In this case it is similar to the “BrowserPath�? in OPC UA. + + + + + 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. + + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + - The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and - the valueId are present then the value needs to be identical to the value of the referenced coded value - in valueId. + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This + attribute has the name of the label and has a value with the label written in the default language. The + individual languages are modelled as child attributes. The names of the child attributes are the prefix + “aml-lang=�? with the expression of the language in compliance with RFC5646. At it, the values of the child + attributes are the labels within the respective language. + + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. + [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and + the valueId are present then the value needs to be identical to the value of the referenced coded value + in valueId. + + + + + + Reference to the global unqiue id of a coded value. + + + + + + + A role class for a File that a data element that represents an address to a file. It is derived from + the AutomationML role class ExternalData that is an role type for a document type and the base class for all + document type roles. It describes different document types. ExternalData is defined in AutomationML + BPR_005E_ExternalDataReference_v1.0.0_2. - - - - - Reference to the global unqiue id of a coded value. - - - - - - Mime type of the content of the BLOB. The mime type states which file extension the file has. Valid - values are e.g. “application/json?, “application/xls?, ?image/jpg?. The allowed values are defined as in - RFC2046. - - - - - - The value of the BLOB instance of a blob data element. Note: In contrast to the file property the - file content is stored directly as value in the Blob data element. - - - - - - - A capability is the implementation-independent description of the potential of an asset to achieve a - certain effect in the physical or virtual world. - - - Identifying string of the element within its name space. Constraint AASd-001: In case of a - referable element not being an identifiable element this id is mandatory and used for referring to the - element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore - ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. - Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used - for unique reference in its name space and thus allows better usability and a more performant - implementation. In this case it is similar to the “BrowserPath? in OPC UA. - - - - - 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. - - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - Global reference to the data specification template used by the element. - - - - - Kind of the element: either template or instance. - Instance - Instance - - - - Instance - Type - - - - - Description or comments on the element. The description can be provided in several languages. This - attribute has the name of the label and has a value with the label written in the default language. The - individual languages are modelled as child attributes. The names of the child attributes are the prefix - “aml-lang=? with the expression of the language in compliance with RFC5646. At it, the values of the child - attributes are the labels within the respective language. - - - - - - A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. - [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. - - - - The type describes the type of the qualifier that is applied to the element. - - - - + Identifying string of the element within its name space. Constraint AASd-001: In case of a + referable element not being an identifiable element this id is mandatory and used for referring to the + element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore + ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. + Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used + for unique reference in its name space and thus allows better usability and a more performant + implementation. In this case it is similar to the “BrowserPath�? in OPC UA. + + + + + 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. + + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + - The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and - the valueId are present then the value needs to be identical to the value of the referenced coded value - in valueId. - - - - - Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This + attribute has the name of the label and has a value with the label written in the default language. The + individual languages are modelled as child attributes. The names of the child attributes are the prefix + “aml-lang=�? with the expression of the language in compliance with RFC5646. At it, the values of the child + attributes are the labels within the respective language. + + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. + [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and + the valueId are present then the value needs to be identical to the value of the referenced coded value + in valueId. + + + + + + Reference to the global unqiue id of a coded value. + + + + + + + The attribute refURI is an IRI that can represent an absolute or relative path to an L + document. An added fragment (with #) references inside the document + + + + Mime type of the content of the File. + + + + + A property is a data element that has a single value. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a + referable element not being an identifiable element this id is mandatory and used for referring to the + element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore + ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. + Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used + for unique reference in its name space and thus allows better usability and a more performant + implementation. In this case it is similar to the “BrowserPath�? in OPC UA. + + + + + 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. + + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + - Reference to the global unqiue id of a coded value. - - - - - - - A role class for a File that a data element that represents an address to a file. It is derived from - the AutomationML role class ExternalData that is an role type for a document type and the base class for all - document type roles. It describes different document types. ExternalData is defined in AutomationML - BPR_005E_ExternalDataReference_v1.0.0_2. - - - Identifying string of the element within its name space. Constraint AASd-001: In case of a - referable element not being an identifiable element this id is mandatory and used for referring to the - element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore - ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. - Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used - for unique reference in its name space and thus allows better usability and a more performant - implementation. In this case it is similar to the “BrowserPath? in OPC UA. - - - - - 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. - - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - Global reference to the data specification template used by the element. - - - - - Kind of the element: either template or instance. - Instance - Instance - - - - Instance - Type - - - - - Description or comments on the element. The description can be provided in several languages. This - attribute has the name of the label and has a value with the label written in the default language. The - individual languages are modelled as child attributes. The names of the child attributes are the prefix - “aml-lang=? with the expression of the language in compliance with RFC5646. At it, the values of the child - attributes are the labels within the respective language. - - - - - - A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. - [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. - - - - The type describes the type of the qualifier that is applied to the element. - - - - Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This + attribute has the name of the label and has a value with the label written in the default language. The + individual languages are modelled as child attributes. The names of the child attributes are the prefix + “aml-lang=�? with the expression of the language in compliance with RFC5646. At it, the values of the child + attributes are the labels within the respective language. + + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. + [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and + the valueId are present then the value needs to be identical to the value of the referenced coded value + in valueId. + + + + + + Reference to the global unqiue id of a coded value. + + + + + - The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and - the valueId are present then the value needs to be identical to the value of the referenced coded value - in valueId. - - - - - The value of the property instance. + + + - Reference to the global unqiue id of a coded value. - - - - - - - The attribute refURI is an IRI that can represent an absolute or relative path to an L - document. An added fragment (with #) references inside the document + Reference to the global unique id if a coded value. + + + + + A reference element is a data element that defines a logical reference to another element within the + same or another AAS or a reference to an external object or entity. - - + Identifying string of the element within its name space. Constraint AASd-001: In case of a + referable element not being an identifiable element this id is mandatory and used for referring to the + element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore + ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. + Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used + for unique reference in its name space and thus allows better usability and a more performant + implementation. In this case it is similar to the “BrowserPath�? in OPC UA. + + + + + 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. + + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + - Mime type of the content of the File. - - - - - A property is a data element that has a single value. - - Identifying string of the element within its name space. Constraint AASd-001: In case of a - referable element not being an identifiable element this id is mandatory and used for referring to the - element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore - ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. - Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used - for unique reference in its name space and thus allows better usability and a more performant - implementation. In this case it is similar to the “BrowserPath? in OPC UA. - - - - - 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. - - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - Global reference to the data specification template used by the element. - - - - - Kind of the element: either template or instance. - Instance - Instance - - - - Instance - Type - - - - - Description or comments on the element. The description can be provided in several languages. This - attribute has the name of the label and has a value with the label written in the default language. The - individual languages are modelled as child attributes. The names of the child attributes are the prefix - “aml-lang=? with the expression of the language in compliance with RFC5646. At it, the values of the child - attributes are the labels within the respective language. - - - - - - A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. - [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. - - - - The type describes the type of the qualifier that is applied to the element. - - - - Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This + attribute has the name of the label and has a value with the label written in the default language. The + individual languages are modelled as child attributes. The names of the child attributes are the prefix + “aml-lang=�? with the expression of the language in compliance with RFC5646. At it, the values of the child + attributes are the labels within the respective language. + + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. + [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and + the valueId are present then the value needs to be identical to the value of the referenced coded value + in valueId. + + + + + + Reference to the global unqiue id of a coded value. + + + + + + + Reference to any other referable element of any other AAS or a reference to an external object + or entity. Note: For references to any other referable elment of the same AAS InternalLinks are used and + this attribute value shall be empty. + + + + + + + A relationship element is used to define a relationship between two referable elements. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a + referable element not being an identifiable element this id is mandatory and used for referring to the + element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore + ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. + Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used + for unique reference in its name space and thus allows better usability and a more performant + implementation. In this case it is similar to the “BrowserPath�? in OPC UA. + + + + + 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. + + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + - The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and - the valueId are present then the value needs to be identical to the value of the referenced coded value - in valueId. + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This + attribute has the name of the label and has a value with the label written in the default language. The + individual languages are modelled as child attributes. The names of the child attributes are the prefix + “aml-lang=�? with the expression of the language in compliance with RFC5646. At it, the values of the child + attributes are the labels within the respective language. + + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. + [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and + the valueId are present then the value needs to be identical to the value of the referenced coded value + in valueId. + + + + + + Reference to the global unqiue id of a coded value. + + + + + + + Reference to any other referable element of any other AAS or a reference to an external object + or entity. Note: For references to any other referable elment of the same AAS InternalLinks are used and + this attribute value shall be empty. + + + + + + Reference to any other referable element of any other AAS or a reference to an external object + or entity. Note: For references to any other referable elment of the same AAS InternalLinks are used and + this attribute value shall be empty. + + + + + + An annotated relationship element is an relationship element that can be annotated with additional data + elements. - - - - - Reference to the global unqiue id of a coded value. - - - - - - The value of the property instance. - - - - Reference to the global unique id if a coded value. - - - - - A reference element is a data element that defines a logical reference to another element within the - same or another AAS or a reference to an external object or entity. - - - Identifying string of the element within its name space. Constraint AASd-001: In case of a - referable element not being an identifiable element this id is mandatory and used for referring to the - element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore - ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. - Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used - for unique reference in its name space and thus allows better usability and a more performant - implementation. In this case it is similar to the “BrowserPath? in OPC UA. - - - - - 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. - - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - Global reference to the data specification template used by the element. - - - - - Kind of the element: either template or instance. - Instance - Instance - - - - Instance - Type - - - - - Description or comments on the element. The description can be provided in several languages. This - attribute has the name of the label and has a value with the label written in the default language. The - individual languages are modelled as child attributes. The names of the child attributes are the prefix - “aml-lang=? with the expression of the language in compliance with RFC5646. At it, the values of the child - attributes are the labels within the respective language. - - - - - - A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. - [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. - - - - The type describes the type of the qualifier that is applied to the element. - - - - Annotations that hold for the relationships between the two elements. + + + + + An operation is a submodel element with input and output variables. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a + referable element not being an identifiable element this id is mandatory and used for referring to the + element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore + ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. + Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used + for unique reference in its name space and thus allows better usability and a more performant + implementation. In this case it is similar to the “BrowserPath�? in OPC UA. + + + + + 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. + + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + - The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and - the valueId are present then the value needs to be identical to the value of the referenced coded value - in valueId. + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This + attribute has the name of the label and has a value with the label written in the default language. The + individual languages are modelled as child attributes. The names of the child attributes are the prefix + “aml-lang=�? with the expression of the language in compliance with RFC5646. At it, the values of the child + attributes are the labels within the respective language. + + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. + [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and + the valueId are present then the value needs to be identical to the value of the referenced coded value + in valueId. + + + + + + Reference to the global unqiue id of a coded value. + + + + + + + The list of AAS OperationVariableIn entities. In AML, the corresponding InternalElement with this role + is a child of the InternalElement with the Operation role. - - - - - Reference to the global unqiue id of a coded value. - - - - - - - Reference to any other referable element of any other AAS or a reference to an external object - or entity. Note: For references to any other referable elment of the same AAS InternalLinks are used and - this attribute value shall be empty. + + + The list of AAS OperationVariableOut entities. In AML, the corresponding InternalElement with this role + is a child of the InternalElement with the Operation role. - - - - - - A relationship element is used to define a relationship between two referable elements. - - Identifying string of the element within its name space. Constraint AASd-001: In case of a - referable element not being an identifiable element this id is mandatory and used for referring to the - element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore - ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. - Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used - for unique reference in its name space and thus allows better usability and a more performant - implementation. In this case it is similar to the “BrowserPath? in OPC UA. - - - - - 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. - - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - Global reference to the data specification template used by the element. - - - - - Kind of the element: either template or instance. - Instance - Instance - - - - Instance - Type - - - - - Description or comments on the element. The description can be provided in several languages. This - attribute has the name of the label and has a value with the label written in the default language. The - individual languages are modelled as child attributes. The names of the child attributes are the prefix - “aml-lang=? with the expression of the language in compliance with RFC5646. At it, the values of the child - attributes are the labels within the respective language. - - - - - - A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. - [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. - - - - The type describes the type of the qualifier that is applied to the element. - - - - - The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and - the valueId are present then the value needs to be identical to the value of the referenced coded value - in valueId. + + + The list of AAS OperationVariableOut entities. In AML, the corresponding InternalElement with this role + is a child of the InternalElement with the Operation role. - - - - - Reference to the global unqiue id of a coded value. - - - - - - - Reference to any other referable element of any other AAS or a reference to an external object - or entity. Note: For references to any other referable elment of the same AAS InternalLinks are used and - this attribute value shall be empty. + + + A view is a collection of referable elements w.r.t. to a specific viewpoint of one or more + stakeholders. - - - - + Identifying string of the element within its name space. Constraint AASd-001: In case of a + referable element not being an identifiable element this id is mandatory and used for referring to the + element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore + ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. + Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used + for unique reference in its name space and thus allows better usability and a more performant + implementation. In this case it is similar to the “BrowserPath�? in OPC UA. + + + + + 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. + + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + - Reference to any other referable element of any other AAS or a reference to an external object - or entity. Note: For references to any other referable elment of the same AAS InternalLinks are used and - this attribute value shall be empty. + Global reference to the data specification template used by the element. + + + + + Description or comments on the element. The description can be provided in several languages. This + attribute has the name of the label and has a value with the label written in the default language. The + individual languages are modelled as child attributes. The names of the child attributes are the prefix + “aml-lang=�? with the expression of the language in compliance with RFC5646. At it, the values of the child + attributes are the labels within the respective language. + + + + + + + A dictionary contains elements that can be reused. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a + referable element not being an identifiable element this id is mandatory and used for referring to the + element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore + ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. + Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used + for unique reference in its name space and thus allows better usability and a more performant + implementation. In this case it is similar to the “BrowserPath�? in OPC UA. + + + + + 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. + + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + + + + + + + + Explanation: The semantics of a property or other elements that may have a semantic description is + defined by a concept description. The description of the concept should follow a standardized schema (realized + as data specification template). - - - - - An annotated relationship element is an relationship element that can be annotated with additional data - elements. - - - Annotations that hold for the relationships between the two elements. - - - - - An operation is a submodel element with input and output variables. - - Identifying string of the element within its name space. Constraint AASd-001: In case of a - referable element not being an identifiable element this id is mandatory and used for referring to the - element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore - ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. - Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used - for unique reference in its name space and thus allows better usability and a more performant - implementation. In this case it is similar to the “BrowserPath? in OPC UA. - - - - - 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. - - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - Global reference to the data specification template used by the element. - - - - - Kind of the element: either template or instance. - Instance - Instance - - - - Instance - Type - - - - - Description or comments on the element. The description can be provided in several languages. This - attribute has the name of the label and has a value with the label written in the default language. The - individual languages are modelled as child attributes. The names of the child attributes are the prefix - “aml-lang=? with the expression of the language in compliance with RFC5646. At it, the values of the child - attributes are the labels within the respective language. - - - - - - A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. - [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. - - - - The type describes the type of the qualifier that is applied to the element. - - - - + Identifying string of the element within its name space. Constraint AASd-001: In case of a + referable element not being an identifiable element this id is mandatory and used for referring to the + element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore + ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. + Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used + for unique reference in its name space and thus allows better usability and a more performant + implementation. In this case it is similar to the “BrowserPath�? in OPC UA. + + + + - The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and - the valueId are present then the value needs to be identical to the value of the referenced coded value - in valueId. - - - - - 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + + Abstract attribute class for identification. Has the subattributes id and idType. + + + Identifier of the element. Its type is defined in idType. Id is a subproperty of + identification. + + + + + + Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the + enumeration “IdentifierType�?. IdType is a subproperty of identification. + + + + + + + Abstract attribute for administration. Has the subattributes revision and version. + + + Revision of the element. Constraint AASd-005: A revision requires a version. This means, if + there is no version there is no revision neither. Revision is a subproperty of administration. + + + + + + Version of the element. Version is a subproperty of administration. + + + + + - Reference to the global unqiue id of a coded value. - - - - - - - The list of AAS OperationVariableIn entities. In AML, the corresponding InternalElement with this role - is a child of the InternalElement with the Operation role. - - - - The list of AAS OperationVariableOut entities. In AML, the corresponding InternalElement with this role - is a child of the InternalElement with the Operation role. - - - - The list of AAS OperationVariableOut entities. In AML, the corresponding InternalElement with this role - is a child of the InternalElement with the Operation role. - - - - A view is a collection of referable elements w.r.t. to a specific viewpoint of one or more - stakeholders. - - - Identifying string of the element within its name space. Constraint AASd-001: In case of a - referable element not being an identifiable element this id is mandatory and used for referring to the - element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore - ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. - Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used - for unique reference in its name space and thus allows better usability and a more performant - implementation. In this case it is similar to the “BrowserPath? in OPC UA. - - - - - 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. - - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - Global reference to the data specification template used by the element. - - - - - Description or comments on the element. The description can be provided in several languages. This - attribute has the name of the label and has a value with the label written in the default language. The - individual languages are modelled as child attributes. The names of the child attributes are the prefix - “aml-lang=? with the expression of the language in compliance with RFC5646. At it, the values of the child - attributes are the labels within the respective language. - - - - - - - A dictionary contains elements that can be reused. - - Identifying string of the element within its name space. Constraint AASd-001: In case of a - referable element not being an identifiable element this id is mandatory and used for referring to the - element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore - ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. - Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used - for unique reference in its name space and thus allows better usability and a more performant - implementation. In this case it is similar to the “BrowserPath? in OPC UA. - - - - - 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. - - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - - - - - - - Explanation: The semantics of a property or other elements that may have a semantic description is - defined by a concept description. The description of the concept should follow a standardized schema (realized - as data specification template). - - - Identifying string of the element within its name space. Constraint AASd-001: In case of a - referable element not being an identifiable element this id is mandatory and used for referring to the - element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore - ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. - Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used - for unique reference in its name space and thus allows better usability and a more performant - implementation. In this case it is similar to the “BrowserPath? in OPC UA. - - - - - 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. - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - Abstract attribute class for identification. Has the subattributes id and idType. - - - Identifier of the element. Its type is defined in idType. Id is a subproperty of - identification. - - - - - - Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the - enumeration “IdentifierType?. IdType is a subproperty of identification. - - - - - - - Abstract attribute for administration. Has the subattributes revision and version. - - - Revision of the element. Constraint AASd-005: A revision requires a version. This means, if - there is no version there is no revision neither. Revision is a subproperty of administration. - - - - - - Version of the element. Version is a subproperty of administration. - - - - - - Global reference to the data specification template used by the element. - - - - Global reference to an external definition the concept is compatible to or was derived from. - - - - - - - Description Role class of an element that has a data specification template. A template defines the - additional attributes an element may or shall have. - - - Identifying string of the element within its name space. Constraint AASd-001: In case of a - referable element not being an identifiable element this id is mandatory and used for referring to the - element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore - ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. - Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used - for unique reference in its name space and thus allows better usability and a more performant - implementation. In this case it is similar to the “BrowserPath? in OPC UA. - - - - - 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. - - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - - - - - - Abstract attribute class for identification. Has the subattributes id and idType. - - - Identifier of the element. Its type is defined in idType. Id is a subproperty of - identification. - - - - - - Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the - enumeration “IdentifierType?. IdType is a subproperty of identification. - - - - - - - Abstract attribute for administration. Has the subattributes revision and version. - - - Revision of the element. Constraint AASd-005: A revision requires a version. This means, if - there is no version there is no revision neither. Revision is a subproperty of administration. - - - - - - Version of the element. Version is a subproperty of administration. - - - - - - - Content of the data specification template. - - - -1.0.0 - - - -Automation Markup Language Base Role Class Library - Part 1 Content extended with Part 3 and Part 4 - Content - -2.2.2 - - - - + Global reference to the data specification template used by the element. + + + + Global reference to an external definition the concept is compatible to or was derived from. + + + + + - - - - - - - - - - - - - - - + Name="DataSpecification" + RefBaseClassPath="AutomationMLBaseRoleClassLib/AutomationMLBaseRole"> + Description Role class of an element that has a data specification template. A template defines the + additional attributes an element may or shall have. + + + Identifying string of the element within its name space. Constraint AASd-001: In case of a + referable element not being an identifiable element this id is mandatory and used for referring to the + element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore + ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. + Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used + for unique reference in its name space and thus allows better usability and a more performant + implementation. In this case it is similar to the “BrowserPath�? in OPC UA. + + + + + 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. + + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + + + + + + + Abstract attribute class for identification. Has the subattributes id and idType. + + + Identifier of the element. Its type is defined in idType. Id is a subproperty of + identification. + + + + + + Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the + enumeration “IdentifierType�?. IdType is a subproperty of identification. + + + + + + + Abstract attribute for administration. Has the subattributes revision and version. + + + Revision of the element. Constraint AASd-005: A revision requires a version. This means, if + there is no version there is no revision neither. Revision is a subproperty of administration. + + + + + + Version of the element. Version is a subproperty of administration. + + + + + + Name="DataSpecificationContent" + RefBaseClassPath="AutomationMLBaseRoleClassLib/AutomationMLBaseRole"> + Content of the data specification template. + + + + 1.0.0 + Name="ExternalData" + RefBaseClassPath="AutomationMLBaseRoleClassLib/AutomationMLBaseRole"/> + + + Automation Markup Language Base Role Class Library - Part 1 Content extended with Part 3 and Part 4 + Content + + 2.2.2 - - - - - - - -0 - - An AAS Data Specification template for IEC61369. A template consists of the DataSpecificationContent - containing the additional attributes to be added to the element instance that references the data specification - template and meta information about the template itself (this is why DataSpecification inherits from - Identifiable). In UML these are two separated classes. - - - Identifying string of the element within its name space. Constraint AASd-001: In case of a - referable element not being an identifiable element this id is mandatory and used for referring to the - element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore - ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. - Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used - for unique reference in its name space and thus allows better usability and a more performant - implementation. In this case it is similar to the “BrowserPath? in OPC UA. - - - - - 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. - - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - - - - - - Abstract attribute class for identification. Has the subattributes id and idType. - - - Identifier of the element. Its type is defined in idType. Id is a subproperty of - identification. - - http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360 - - - - Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the - enumeration “IdentifierType?. IdType is a subproperty of identification. - - IRI - - - - - Abstract attribute for administration. Has the subattributes revision and version. - - - Revision of the element. Constraint AASd-005: A revision requires a version. This means, if - there is no version there is no revision neither. Revision is a subproperty of administration. - - - - - - Version of the element. Version is a subproperty of administration. - - - - - - - The content of an AAS Data Specification template for IEC61360. - - Identifies the attribute hierarchy for preferredName in above attribute hierachy. Subordinate - attributes are designated by the country code information (see aml-lang literal). - - - - - Identifies the attribute for shortName in above attribute hierarchy. - - - - Identifies the attribute for unit in above attribute hierarchy. - - - - Identifies the attribute for unitId in above attribute hierarchy in its string serialization. - - - - - Identifies the attribute for sourceOfDefinition in above attribute hierachy. Subordinate - attributes are designated by the country code information (see aml-lang literal). - - - - - Identifies the attribute for symbol in above attribute hierarchy. - - - - Identifies the attribute for dataType in above attribute hierarchy. - - - - Identifies the attribute for definition in above attribute hierachy. Subordinate attributes are - designated by the country code information (see aml-lang literal). + Name="AutomationMLBaseRole"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + An AAS Data Specification template for IEC61369. A template consists of the DataSpecificationContent + containing the additional attributes to be added to the element instance that references the data specification + template and meta information about the template itself (this is why DataSpecification inherits from + Identifiable). In UML these are two separated classes. - - - - Identifies the attribute for valueFormat in above attribute hierarchy. - - - - Identifies the attribute for valueList in above attribute hierarchy. - - - - The attribute value. - - - - The id for the value. - - - - - - - -0 - + + Identifying string of the element within its name space. Constraint AASd-001: In case of a + referable element not being an identifiable element this id is mandatory and used for referring to the + element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore + ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. + Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used + for unique reference in its name space and thus allows better usability and a more performant + implementation. In this case it is similar to the “BrowserPath�? in OPC UA. + + + + + 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. + + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + + + + + + + Abstract attribute class for identification. Has the subattributes id and idType. + + + Identifier of the element. Its type is defined in idType. Id is a subproperty of + identification. + + http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360 + + + + Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the + enumeration “IdentifierType�?. IdType is a subproperty of identification. + + IRI + + + + + Abstract attribute for administration. Has the subattributes revision and version. + + + Revision of the element. Constraint AASd-005: A revision requires a version. This means, if + there is no version there is no revision neither. Revision is a subproperty of administration. + + + + + + Version of the element. Version is a subproperty of administration. + + + + + + + The content of an AAS Data Specification template for IEC61360. + + Identifies the attribute hierarchy for preferredName in above attribute hierachy. Subordinate + attributes are designated by the country code information (see aml-lang literal). + + + + + Identifies the attribute for shortName in above attribute hierarchy. + + + + Identifies the attribute for unit in above attribute hierarchy. + + + + Identifies the attribute for unitId in above attribute hierarchy in its string serialization. + + + + + Identifies the attribute for sourceOfDefinition in above attribute hierachy. Subordinate + attributes are designated by the country code information (see aml-lang literal). + + + + + Identifies the attribute for symbol in above attribute hierarchy. + + + + Identifies the attribute for dataType in above attribute hierarchy. + + + + Identifies the attribute for definition in above attribute hierachy. Subordinate attributes are + designated by the country code information (see aml-lang literal). + + + + + Identifies the attribute for valueFormat in above attribute hierarchy. + + + + Identifies the attribute for valueList in above attribute hierarchy. + + + + The attribute value. + + + + The id for the value. + + + + + + + + 0 + \ No newline at end of file diff --git a/dataformat-aml/src/test/resources/amlfile/full-example.xml b/dataformat-aml/src/test/resources/amlfile/full-example.xml new file mode 100644 index 00000000..eea866a2 --- /dev/null +++ b/dataformat-aml/src/test/resources/amlfile/full-example.xml @@ -0,0 +1,8921 @@ + + + + 0 + + + + + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + + (GLOBAL_REFERENCE)[IRI]0173-1#02-AAO677#002 + + + + ManufacturerName + + + + + + + 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. + + + 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 + + + + + + xs:int + + + + 100 + + + + + + + + + + xs:int + + + + 50 + + + + + + + + ACPLT + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + + (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber + + + + InstanceId + + + + + + + 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. + + + 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 + + + + 978-8234-234-342 + + + + + + (SUBMODEL)[IRI]http://acplt.org/SubmodelTemplates/AssetIdentification + + + + + + IRI + + + + http://acplt.org/Submodels/Assets/TestAsset/Identification + + + + + + + 0.9 + + + + 0 + + + + + Identification + + + + + + + An example asset identification submodel for the test application + + + Ein Beispiel-Identifikations-Submodel für eine Test-Anwendung + + + + + + + + + + + + + + + CO_MANAGED_ENTITY + + + + + (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber + + + + ExampleEntity + + + + + + + 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. + + + 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 + + + + + + + + + SELF_MANAGED_ENTITY + + + + + (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber + + + + ExampleEntity2 + + + + + + + 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. + + + 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 + + + + + + (SUBMODEL)[IRI]http://acplt.org/SubmodelTemplates/BillOfMaterial + + + + + + IRI + + + + http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial + + + + + + + 0.9 + + + + + + + + BillOfMaterial + + + + + + + An example bill of material submodel for the test application + + + Ein Beispiel-BillofMaterial-Submodel für eine Test-Anwendung + + + + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleRelationshipElement + + + + ExampleRelationshipElement + + + + Parameter + + + + + + Example RelationshipElement object + + + Beispiel RelationshipElement Element + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + (PROPERTY)[ID_SHORT]ExampleProperty2 + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement + + + + ExampleAnnotatedRelationshipElement + + + + Parameter + + + + + + Example AnnotatedRelationshipElement object + + + Beispiel AnnotatedRelationshipElement Element + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + (PROPERTY)[ID_SHORT]ExampleProperty2 + + + + + + + + + + + + + + + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Operations/ExampleOperation + + + + ExampleOperation + + + + Parameter + + + + + + Example Operation object + + + Beispiel Operation Element + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Capabilities/ExampleCapability + + + + ExampleCapability + + + + Parameter + + + + + + Example Capability object + + + Beispiel Capability Element + + + + + + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Events/ExampleBasicEvent + + + + ExampleBasicEvent + + + + Parameter + + + + + + Example BasicEvent object + + + Beispiel BasicEvent Element + + + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty + + + + ExampleProperty + + + + Constant + + + + + + Example Property object + + + Beispiel Property Element + + + + exampleValue + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty + + + + ExampleMultiLanguageProperty + + + + Constant + + + + + + Example MultiLanguageProperty object + + + Beispiel MulitLanguageProperty Element + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleMultiLanguageValueId + + + + + + Example value of a MultiLanguageProperty element + + + Beispielswert für ein MulitLanguageProperty-Element + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Ranges/ExampleRange + + + + ExampleRange + + + + Parameter + + + + + + Example Range object + + + Beispiel Range Element + + + + 100 + + + + 0 + + + + + true + + + + false + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered + + + + ExampleSubmodelCollectionOrdered + + + + Parameter + + + + + + Example SubmodelElementCollectionOrdered object + + + Beispiel SubmodelElementCollectionOrdered Element + + + + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Blobs/ExampleBlob + + + + ExampleBlob + + + + Parameter + + + + + + Example Blob object + + + Beispiel Blob Element + + + + + application/pdf + + + + [1, 2, 3, 4, 5] + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Files/ExampleFile + + + + ExampleFile + + + + Parameter + + + + + + Example File object + + + Beispiel File Element + + + + + application/pdf + + + + /TestFile.pdf + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ReferenceElements/ExampleReferenceElement + + + + ExampleReferenceElement + + + + Parameter + + + + + + Example Reference Element object + + + Beispiel Reference Element Element + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + false + + + + false + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered + + + + ExampleSubmodelCollectionUnordered + + + + Parameter + + + + + + Example SubmodelElementCollectionUnordered object + + + Beispiel SubmodelElementCollectionUnordered Element + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelTemplates/ExampleSubmodel + + + + + + IRI + + + + https://acplt.org/Test_Submodel + + + + + + + 0.9 + + + + 0 + + + + + TestSubmodel + + + + + + + An example submodel for the test application + + + Ein Beispiel-Teilmodell für eine Test-Anwendung + + + + + + + + + + + + + + + ExampleRelationshipElement + + + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + + + + + + + ExampleAnnotatedRelationshipElement + + + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + + + + + + + + + + + + + + + + + + + + + + ExampleOperation + + + + + + + + + + + + + ExampleCapability + + + + + + + + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + + ExampleBasicEvent + + + + + + + + + + + + + + + + + + ExampleProperty + + + + + + + + + + + + + + + + ExampleMultiLanguageProperty + + + + + + + + + + + + + + + + + + + ExampleRange + + + + + + + + + + + + + true + + + + false + + + + + + ExampleSubmodelCollectionOrdered + + + + + + + + + + + + + + + + + ExampleBlob + + + + + + + application/pdf + + + + null + + + + + + + + + + + + ExampleFile + + + + + + + application/pdf + + + + + + + + + + + + + + + ExampleReferenceElement + + + + + + + + + + false + + + + false + + + + + + ExampleSubmodelCollectionUnordered + + + + + + + + + + + false + + + + false + + + + + + ExampleSubmodelCollectionUnordered2 + + + + + + + + + + + IRI + + + + https://acplt.org/Test_Submodel_Mandatory + + + + + + + + + + + + + + + + + + + + + IRI + + + + https://acplt.org/Test_Submodel2_Mandatory + + + + + + + + + + + + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleRelationshipElement + + + + ExampleRelationshipElement + + + + Parameter + + + + + + Example RelationshipElement object + + + Beispiel RelationshipElement Element + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement + + + + ExampleAnnotatedRelationshipElement + + + + Parameter + + + + + + Example AnnotatedRelationshipElement object + + + Beispiel AnnotatedRelationshipElement Element + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + + + + + + + + + + + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Operations/ExampleOperation + + + + ExampleOperation + + + + Parameter + + + + + + Example Operation object + + + Beispiel Operation Element + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Capabilities/ExampleCapability + + + + ExampleCapability + + + + Parameter + + + + + + Example Capability object + + + Beispiel Capability Element + + + + + + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Events/ExampleBasicEvent + + + + ExampleBasicEvent + + + + Parameter + + + + + + Example BasicEvent object + + + Beispiel BasicEvent Element + + + + + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty + + + + ExampleProperty + + + + Constant + + + + + + Example Property object + + + Beispiel Property Element + + + + + + xs:string + + + + + + + + + + + exampleValue + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty + + + + ExampleMultiLanguageProperty + + + + Constant + + + + + + Example MultiLanguageProperty object + + + Beispiel MulitLanguageProperty Element + + + + + + + + + Example value of a MultiLanguageProperty element + + + Beispielswert für ein MulitLanguageProperty-Element + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Ranges/ExampleRange + + + + ExampleRange + + + + Parameter + + + + + + Example Range object + + + Beispiel Range Element + + + + 100 + + + + 0 + + + + + true + + + + false + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered + + + + ExampleSubmodelCollectionOrdered + + + + Parameter + + + + + + Example SubmodelElementCollectionOrdered object + + + Beispiel SubmodelElementCollectionOrdered Element + + + + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Blobs/ExampleBlob + + + + ExampleBlob + + + + Parameter + + + + + + Example Blob object + + + Beispiel Blob Element + + + + + application/pdf + + + + [1, 2, 3, 4, 5] + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Files/ExampleFile + + + + ExampleFile + + + + Parameter + + + + + + Example File object + + + Beispiel File Element + + + + + application/pdf + + + + /TestFile.pdf + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ReferenceElements/ExampleReferenceElement + + + + ExampleReferenceElement + + + + Parameter + + + + + + Example Reference Element object + + + Beispiel Reference Element Element + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + false + + + + false + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered + + + + ExampleSubmodelCollectionUnordered + + + + Parameter + + + + + + Example SubmodelElementCollectionUnordered object + + + Beispiel SubmodelElementCollectionUnordered Element + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelTemplates/ExampleSubmodel + + + + + + IRI + + + + https://acplt.org/Test_Submodel_Missing + + + + + + + 0.9 + + + + 0 + + + + + TestSubmodel + + + + + + + An example submodel for the test application + + + Ein Beispiel-Teilmodell für eine Test-Anwendung + + + + + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleRelationshipElement + + + + ExampleRelationshipElement + + + + Parameter + + + + + + Example RelationshipElement object + + + Beispiel RelationshipElement Element + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement + + + + ExampleAnnotatedRelationshipElement + + + + Parameter + + + + + + Example AnnotatedRelationshipElement object + + + Beispiel AnnotatedRelationshipElement Element + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + + + + + + + + + + + + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Operations/ExampleOperation + + + + ExampleOperation + + + + Parameter + + + + + + Example Operation object + + + Beispiel Operation Element + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Capabilities/ExampleCapability + + + + ExampleCapability + + + + Parameter + + + + + + Example Capability object + + + Beispiel Capability Element + + + + + + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Events/ExampleBasicEvent + + + + ExampleBasicEvent + + + + Parameter + + + + + + Example BasicEvent object + + + Beispiel BasicEvent Element + + + + + + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty + + + + ExampleProperty + + + + Constant + + + + + + Example Property object + + + Beispiel Property Element + + + + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty + + + + ExampleMultiLanguageProperty + + + + Constant + + + + + + Example MultiLanguageProperty object + + + Beispiel MulitLanguageProperty Element + + + + + + + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Ranges/ExampleRange + + + + ExampleRange + + + + Parameter + + + + + + Example Range object + + + Beispiel Range Element + + + + 100 + + + + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Ranges/ExampleRange + + + + ExampleRange2 + + + + Parameter + + + + + + Example Range object + + + Beispiel Range Element + + + + + + + 0 + + + + + true + + + + false + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered + + + + ExampleSubmodelCollectionOrdered + + + + Parameter + + + + + + Example SubmodelElementCollectionOrdered object + + + Beispiel SubmodelElementCollectionOrdered Element + + + + + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Blobs/ExampleBlob + + + + ExampleBlob + + + + Parameter + + + + + + Example Blob object + + + Beispiel Blob Element + + + + + application/pdf + + + + null + + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Files/ExampleFile + + + + ExampleFile + + + + Parameter + + + + + + Example File object + + + Beispiel File Element + + + + + application/pdf + + + + + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ReferenceElements/ExampleReferenceElement + + + + ExampleReferenceElement + + + + Parameter + + + + + + Example Reference Element object + + + Beispiel Reference Element Element + + + + + + + + false + + + + false + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered + + + + ExampleSubmodelCollectionUnordered + + + + Parameter + + + + + + Example SubmodelElementCollectionUnordered object + + + Beispiel SubmodelElementCollectionUnordered Element + + + + + + + + + false + + + + false + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered + + + + ExampleSubmodelCollectionUnordered2 + + + + Parameter + + + + + + Example SubmodelElementCollectionUnordered object + + + Beispiel SubmodelElementCollectionUnordered Element + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelTemplates/ExampleSubmodel + + + + + + IRI + + + + https://acplt.org/Test_Submodel_Template + + + + + + + 0.9 + + + + 0 + + + + + TestSubmodel + + + + + + + An example submodel for the test application + + + Ein Beispiel-Teilmodell für eine Test-Anwendung + + + + + (ASSET_ADMINISTRATION_SHELL)[IRI]https://acplt.org/TestAssetAdministrationShell2 + + + + + + IRI + + + + https://acplt.org/Test_AssetAdministrationShell + + + + + + + 0.9 + + + + 0 + + + + + TestAssetAdministrationShell + + + + + + + An Example Asset Administration Shell for the test application + + + Ein Beispiel-Verwaltungsschale für eine Test-Anwendung + + + + + + (SUBMODEL)[IRI]https://acplt.org/Test_Submodel + + + + (SUBMODEL)[IRI]http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial + + + + (SUBMODEL)[IRI]http://acplt.org/Submodels/Assets/TestAsset/Identification + + + + + + + + + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + + (GLOBAL_REFERENCE)[IRI]0173-1#02-AAO677#002 + + + + ManufacturerName + + + + + + + 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. + + + 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 + + + + + + xs:int + + + + 100 + + + + + + + + + + xs:int + + + + 50 + + + + + + + + ACPLT + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + + (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber + + + + InstanceId + + + + + + + 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. + + + 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 + + + + 978-8234-234-342 + + + + + + (SUBMODEL)[IRI]http://acplt.org/SubmodelTemplates/AssetIdentification + + + + + + IRI + + + + http://acplt.org/Submodels/Assets/TestAsset/Identification + + + + + + + 0.9 + + + + 0 + + + + + Identification + + + + + + + An example asset identification submodel for the test application + + + Ein Beispiel-Identifikations-Submodel für eine Test-Anwendung + + + + + + + + + + + + + + + CO_MANAGED_ENTITY + + + + + (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber + + + + ExampleEntity + + + + + + + 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. + + + 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 + + + + + + + + + SELF_MANAGED_ENTITY + + + + + (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber + + + + ExampleEntity2 + + + + + + + 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. + + + 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 + + + + + + (SUBMODEL)[IRI]http://acplt.org/SubmodelTemplates/BillOfMaterial + + + + + + IRI + + + + http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial + + + + + + + 0.9 + + + + + + + + BillOfMaterial + + + + + + + An example bill of material submodel for the test application + + + Ein Beispiel-BillofMaterial-Submodel für eine Test-Anwendung + + + + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleRelationshipElement + + + + ExampleRelationshipElement + + + + Parameter + + + + + + Example RelationshipElement object + + + Beispiel RelationshipElement Element + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + (PROPERTY)[ID_SHORT]ExampleProperty2 + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement + + + + ExampleAnnotatedRelationshipElement + + + + Parameter + + + + + + Example AnnotatedRelationshipElement object + + + Beispiel AnnotatedRelationshipElement Element + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + (PROPERTY)[ID_SHORT]ExampleProperty2 + + + + + + + + + + + + + + + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Operations/ExampleOperation + + + + ExampleOperation + + + + Parameter + + + + + + Example Operation object + + + Beispiel Operation Element + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Capabilities/ExampleCapability + + + + ExampleCapability + + + + Parameter + + + + + + Example Capability object + + + Beispiel Capability Element + + + + + + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Events/ExampleBasicEvent + + + + ExampleBasicEvent + + + + Parameter + + + + + + Example BasicEvent object + + + Beispiel BasicEvent Element + + + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty + + + + ExampleProperty + + + + Constant + + + + + + Example Property object + + + Beispiel Property Element + + + + exampleValue + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty + + + + ExampleMultiLanguageProperty + + + + Constant + + + + + + Example MultiLanguageProperty object + + + Beispiel MulitLanguageProperty Element + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleMultiLanguageValueId + + + + + + Example value of a MultiLanguageProperty element + + + Beispielswert für ein MulitLanguageProperty-Element + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Ranges/ExampleRange + + + + ExampleRange + + + + Parameter + + + + + + Example Range object + + + Beispiel Range Element + + + + 100 + + + + 0 + + + + + true + + + + false + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered + + + + ExampleSubmodelCollectionOrdered + + + + Parameter + + + + + + Example SubmodelElementCollectionOrdered object + + + Beispiel SubmodelElementCollectionOrdered Element + + + + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Blobs/ExampleBlob + + + + ExampleBlob + + + + Parameter + + + + + + Example Blob object + + + Beispiel Blob Element + + + + + application/pdf + + + + [1, 2, 3, 4, 5] + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Files/ExampleFile + + + + ExampleFile + + + + Parameter + + + + + + Example File object + + + Beispiel File Element + + + + + application/pdf + + + + /TestFile.pdf + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ReferenceElements/ExampleReferenceElement + + + + ExampleReferenceElement + + + + Parameter + + + + + + Example Reference Element object + + + Beispiel Reference Element Element + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + false + + + + false + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered + + + + ExampleSubmodelCollectionUnordered + + + + Parameter + + + + + + Example SubmodelElementCollectionUnordered object + + + Beispiel SubmodelElementCollectionUnordered Element + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelTemplates/ExampleSubmodel + + + + + + IRI + + + + https://acplt.org/Test_Submodel + + + + + + + 0.9 + + + + 0 + + + + + TestSubmodel + + + + + + + An example submodel for the test application + + + Ein Beispiel-Teilmodell für eine Test-Anwendung + + + + + + + + + + + + + + + ExampleRelationshipElement + + + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + + + + + + + ExampleAnnotatedRelationshipElement + + + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + + + + + + + + + + + + + + + + + + + + + + ExampleOperation + + + + + + + + + + + + + ExampleCapability + + + + + + + + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + + ExampleBasicEvent + + + + + + + + + + + + + + + + + + ExampleProperty + + + + + + + + + + + + + + + + ExampleMultiLanguageProperty + + + + + + + + + + + + + + + + + + + ExampleRange + + + + + + + + + + + + + true + + + + false + + + + + + ExampleSubmodelCollectionOrdered + + + + + + + + + + + + + + + + + ExampleBlob + + + + + + + application/pdf + + + + null + + + + + + + + + + + + ExampleFile + + + + + + + application/pdf + + + + + + + + + + + + + + + ExampleReferenceElement + + + + + + + + + + false + + + + false + + + + + + ExampleSubmodelCollectionUnordered + + + + + + + + + + + false + + + + false + + + + + + ExampleSubmodelCollectionUnordered2 + + + + + + + + + + + IRI + + + + https://acplt.org/Test_Submodel_Mandatory + + + + + + + + + + + + + + + + + + + + + IRI + + + + https://acplt.org/Test_Submodel2_Mandatory + + + + + + + + + + + + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleRelationshipElement + + + + ExampleRelationshipElement + + + + Parameter + + + + + + Example RelationshipElement object + + + Beispiel RelationshipElement Element + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement + + + + ExampleAnnotatedRelationshipElement + + + + Parameter + + + + + + Example AnnotatedRelationshipElement object + + + Beispiel AnnotatedRelationshipElement Element + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + + + + + + + + + + + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Operations/ExampleOperation + + + + ExampleOperation + + + + Parameter + + + + + + Example Operation object + + + Beispiel Operation Element + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Capabilities/ExampleCapability + + + + ExampleCapability + + + + Parameter + + + + + + Example Capability object + + + Beispiel Capability Element + + + + + + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Events/ExampleBasicEvent + + + + ExampleBasicEvent + + + + Parameter + + + + + + Example BasicEvent object + + + Beispiel BasicEvent Element + + + + + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty + + + + ExampleProperty + + + + Constant + + + + + + Example Property object + + + Beispiel Property Element + + + + + + xs:string + + + + + + + + + + + exampleValue + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty + + + + ExampleMultiLanguageProperty + + + + Constant + + + + + + Example MultiLanguageProperty object + + + Beispiel MulitLanguageProperty Element + + + + + + + + + Example value of a MultiLanguageProperty element + + + Beispielswert für ein MulitLanguageProperty-Element + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Ranges/ExampleRange + + + + ExampleRange + + + + Parameter + + + + + + Example Range object + + + Beispiel Range Element + + + + 100 + + + + 0 + + + + + true + + + + false + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered + + + + ExampleSubmodelCollectionOrdered + + + + Parameter + + + + + + Example SubmodelElementCollectionOrdered object + + + Beispiel SubmodelElementCollectionOrdered Element + + + + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Blobs/ExampleBlob + + + + ExampleBlob + + + + Parameter + + + + + + Example Blob object + + + Beispiel Blob Element + + + + + application/pdf + + + + [1, 2, 3, 4, 5] + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Files/ExampleFile + + + + ExampleFile + + + + Parameter + + + + + + Example File object + + + Beispiel File Element + + + + + application/pdf + + + + /TestFile.pdf + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ReferenceElements/ExampleReferenceElement + + + + ExampleReferenceElement + + + + Parameter + + + + + + Example Reference Element object + + + Beispiel Reference Element Element + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + false + + + + false + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered + + + + ExampleSubmodelCollectionUnordered + + + + Parameter + + + + + + Example SubmodelElementCollectionUnordered object + + + Beispiel SubmodelElementCollectionUnordered Element + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelTemplates/ExampleSubmodel + + + + + + IRI + + + + https://acplt.org/Test_Submodel_Missing + + + + + + + 0.9 + + + + 0 + + + + + TestSubmodel + + + + + + + An example submodel for the test application + + + Ein Beispiel-Teilmodell für eine Test-Anwendung + + + + + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleRelationshipElement + + + + ExampleRelationshipElement + + + + Parameter + + + + + + Example RelationshipElement object + + + Beispiel RelationshipElement Element + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement + + + + ExampleAnnotatedRelationshipElement + + + + Parameter + + + + + + Example AnnotatedRelationshipElement object + + + Beispiel AnnotatedRelationshipElement Element + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + + + + + + + + + + + + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Operations/ExampleOperation + + + + ExampleOperation + + + + Parameter + + + + + + Example Operation object + + + Beispiel Operation Element + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Capabilities/ExampleCapability + + + + ExampleCapability + + + + Parameter + + + + + + Example Capability object + + + Beispiel Capability Element + + + + + + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Events/ExampleBasicEvent + + + + ExampleBasicEvent + + + + Parameter + + + + + + Example BasicEvent object + + + Beispiel BasicEvent Element + + + + + + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty + + + + ExampleProperty + + + + Constant + + + + + + Example Property object + + + Beispiel Property Element + + + + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty + + + + ExampleMultiLanguageProperty + + + + Constant + + + + + + Example MultiLanguageProperty object + + + Beispiel MulitLanguageProperty Element + + + + + + + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Ranges/ExampleRange + + + + ExampleRange + + + + Parameter + + + + + + Example Range object + + + Beispiel Range Element + + + + 100 + + + + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Ranges/ExampleRange + + + + ExampleRange2 + + + + Parameter + + + + + + Example Range object + + + Beispiel Range Element + + + + + + + 0 + + + + + true + + + + false + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered + + + + ExampleSubmodelCollectionOrdered + + + + Parameter + + + + + + Example SubmodelElementCollectionOrdered object + + + Beispiel SubmodelElementCollectionOrdered Element + + + + + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Blobs/ExampleBlob + + + + ExampleBlob + + + + Parameter + + + + + + Example Blob object + + + Beispiel Blob Element + + + + + application/pdf + + + + null + + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Files/ExampleFile + + + + ExampleFile + + + + Parameter + + + + + + Example File object + + + Beispiel File Element + + + + + application/pdf + + + + + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ReferenceElements/ExampleReferenceElement + + + + ExampleReferenceElement + + + + Parameter + + + + + + Example Reference Element object + + + Beispiel Reference Element Element + + + + + + + + false + + + + false + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered + + + + ExampleSubmodelCollectionUnordered + + + + Parameter + + + + + + Example SubmodelElementCollectionUnordered object + + + Beispiel SubmodelElementCollectionUnordered Element + + + + + + + + + false + + + + false + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered + + + + ExampleSubmodelCollectionUnordered2 + + + + Parameter + + + + + + Example SubmodelElementCollectionUnordered object + + + Beispiel SubmodelElementCollectionUnordered Element + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelTemplates/ExampleSubmodel + + + + + + IRI + + + + https://acplt.org/Test_Submodel_Template + + + + + + + 0.9 + + + + 0 + + + + + TestSubmodel + + + + + + + An example submodel for the test application + + + Ein Beispiel-Teilmodell für eine Test-Anwendung + + + + + + + + IRI + + + + https://acplt.org/Test_AssetAdministrationShell_Mandatory + + + + + + + + + + + + + + (SUBMODEL)[IRI]https://acplt.org/Test_Submodel_Mandatory + + + + (SUBMODEL)[IRI]https://acplt.org/Test_Submodel2_Mandatory + + + + + + + + + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + + (GLOBAL_REFERENCE)[IRI]0173-1#02-AAO677#002 + + + + ManufacturerName + + + + + + + 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. + + + 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 + + + + + + xs:int + + + + 100 + + + + + + + + + + xs:int + + + + 50 + + + + + + + + ACPLT + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + + (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber + + + + InstanceId + + + + + + + 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. + + + 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 + + + + 978-8234-234-342 + + + + + + (SUBMODEL)[IRI]http://acplt.org/SubmodelTemplates/AssetIdentification + + + + + + IRI + + + + http://acplt.org/Submodels/Assets/TestAsset/Identification + + + + + + + 0.9 + + + + 0 + + + + + Identification + + + + + + + An example asset identification submodel for the test application + + + Ein Beispiel-Identifikations-Submodel für eine Test-Anwendung + + + + + + + + + + + + + + + CO_MANAGED_ENTITY + + + + + (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber + + + + ExampleEntity + + + + + + + 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. + + + 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 + + + + + + + + + SELF_MANAGED_ENTITY + + + + + (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber + + + + ExampleEntity2 + + + + + + + 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. + + + 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 + + + + + + (SUBMODEL)[IRI]http://acplt.org/SubmodelTemplates/BillOfMaterial + + + + + + IRI + + + + http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial + + + + + + + 0.9 + + + + + + + + BillOfMaterial + + + + + + + An example bill of material submodel for the test application + + + Ein Beispiel-BillofMaterial-Submodel für eine Test-Anwendung + + + + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleRelationshipElement + + + + ExampleRelationshipElement + + + + Parameter + + + + + + Example RelationshipElement object + + + Beispiel RelationshipElement Element + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + (PROPERTY)[ID_SHORT]ExampleProperty2 + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement + + + + ExampleAnnotatedRelationshipElement + + + + Parameter + + + + + + Example AnnotatedRelationshipElement object + + + Beispiel AnnotatedRelationshipElement Element + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + (PROPERTY)[ID_SHORT]ExampleProperty2 + + + + + + + + + + + + + + + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Operations/ExampleOperation + + + + ExampleOperation + + + + Parameter + + + + + + Example Operation object + + + Beispiel Operation Element + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Capabilities/ExampleCapability + + + + ExampleCapability + + + + Parameter + + + + + + Example Capability object + + + Beispiel Capability Element + + + + + + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Events/ExampleBasicEvent + + + + ExampleBasicEvent + + + + Parameter + + + + + + Example BasicEvent object + + + Beispiel BasicEvent Element + + + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty + + + + ExampleProperty + + + + Constant + + + + + + Example Property object + + + Beispiel Property Element + + + + exampleValue + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty + + + + ExampleMultiLanguageProperty + + + + Constant + + + + + + Example MultiLanguageProperty object + + + Beispiel MulitLanguageProperty Element + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleMultiLanguageValueId + + + + + + Example value of a MultiLanguageProperty element + + + Beispielswert für ein MulitLanguageProperty-Element + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Ranges/ExampleRange + + + + ExampleRange + + + + Parameter + + + + + + Example Range object + + + Beispiel Range Element + + + + 100 + + + + 0 + + + + + true + + + + false + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered + + + + ExampleSubmodelCollectionOrdered + + + + Parameter + + + + + + Example SubmodelElementCollectionOrdered object + + + Beispiel SubmodelElementCollectionOrdered Element + + + + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Blobs/ExampleBlob + + + + ExampleBlob + + + + Parameter + + + + + + Example Blob object + + + Beispiel Blob Element + + + + + application/pdf + + + + [1, 2, 3, 4, 5] + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Files/ExampleFile + + + + ExampleFile + + + + Parameter + + + + + + Example File object + + + Beispiel File Element + + + + + application/pdf + + + + /TestFile.pdf + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ReferenceElements/ExampleReferenceElement + + + + ExampleReferenceElement + + + + Parameter + + + + + + Example Reference Element object + + + Beispiel Reference Element Element + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + false + + + + false + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered + + + + ExampleSubmodelCollectionUnordered + + + + Parameter + + + + + + Example SubmodelElementCollectionUnordered object + + + Beispiel SubmodelElementCollectionUnordered Element + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelTemplates/ExampleSubmodel + + + + + + IRI + + + + https://acplt.org/Test_Submodel + + + + + + + 0.9 + + + + 0 + + + + + TestSubmodel + + + + + + + An example submodel for the test application + + + Ein Beispiel-Teilmodell für eine Test-Anwendung + + + + + + + + + + + + + + + ExampleRelationshipElement + + + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + + + + + + + ExampleAnnotatedRelationshipElement + + + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + + + + + + + + + + + + + + + + + + + + + + ExampleOperation + + + + + + + + + + + + + ExampleCapability + + + + + + + + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + + ExampleBasicEvent + + + + + + + + + + + + + + + + + + ExampleProperty + + + + + + + + + + + + + + + + ExampleMultiLanguageProperty + + + + + + + + + + + + + + + + + + + ExampleRange + + + + + + + + + + + + + true + + + + false + + + + + + ExampleSubmodelCollectionOrdered + + + + + + + + + + + + + + + + + ExampleBlob + + + + + + + application/pdf + + + + null + + + + + + + + + + + + ExampleFile + + + + + + + application/pdf + + + + + + + + + + + + + + + ExampleReferenceElement + + + + + + + + + + false + + + + false + + + + + + ExampleSubmodelCollectionUnordered + + + + + + + + + + + false + + + + false + + + + + + ExampleSubmodelCollectionUnordered2 + + + + + + + + + + + IRI + + + + https://acplt.org/Test_Submodel_Mandatory + + + + + + + + + + + + + + + + + + + + + IRI + + + + https://acplt.org/Test_Submodel2_Mandatory + + + + + + + + + + + + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleRelationshipElement + + + + ExampleRelationshipElement + + + + Parameter + + + + + + Example RelationshipElement object + + + Beispiel RelationshipElement Element + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement + + + + ExampleAnnotatedRelationshipElement + + + + Parameter + + + + + + Example AnnotatedRelationshipElement object + + + Beispiel AnnotatedRelationshipElement Element + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + + + + + + + + + + + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Operations/ExampleOperation + + + + ExampleOperation + + + + Parameter + + + + + + Example Operation object + + + Beispiel Operation Element + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Capabilities/ExampleCapability + + + + ExampleCapability + + + + Parameter + + + + + + Example Capability object + + + Beispiel Capability Element + + + + + + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Events/ExampleBasicEvent + + + + ExampleBasicEvent + + + + Parameter + + + + + + Example BasicEvent object + + + Beispiel BasicEvent Element + + + + + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty + + + + ExampleProperty + + + + Constant + + + + + + Example Property object + + + Beispiel Property Element + + + + + + xs:string + + + + + + + + + + + exampleValue + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty + + + + ExampleMultiLanguageProperty + + + + Constant + + + + + + Example MultiLanguageProperty object + + + Beispiel MulitLanguageProperty Element + + + + + + + + + Example value of a MultiLanguageProperty element + + + Beispielswert für ein MulitLanguageProperty-Element + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Ranges/ExampleRange + + + + ExampleRange + + + + Parameter + + + + + + Example Range object + + + Beispiel Range Element + + + + 100 + + + + 0 + + + + + true + + + + false + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered + + + + ExampleSubmodelCollectionOrdered + + + + Parameter + + + + + + Example SubmodelElementCollectionOrdered object + + + Beispiel SubmodelElementCollectionOrdered Element + + + + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Blobs/ExampleBlob + + + + ExampleBlob + + + + Parameter + + + + + + Example Blob object + + + Beispiel Blob Element + + + + + application/pdf + + + + [1, 2, 3, 4, 5] + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Files/ExampleFile + + + + ExampleFile + + + + Parameter + + + + + + Example File object + + + Beispiel File Element + + + + + application/pdf + + + + /TestFile.pdf + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ReferenceElements/ExampleReferenceElement + + + + ExampleReferenceElement + + + + Parameter + + + + + + Example Reference Element object + + + Beispiel Reference Element Element + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + false + + + + false + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered + + + + ExampleSubmodelCollectionUnordered + + + + Parameter + + + + + + Example SubmodelElementCollectionUnordered object + + + Beispiel SubmodelElementCollectionUnordered Element + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelTemplates/ExampleSubmodel + + + + + + IRI + + + + https://acplt.org/Test_Submodel_Missing + + + + + + + 0.9 + + + + 0 + + + + + TestSubmodel + + + + + + + An example submodel for the test application + + + Ein Beispiel-Teilmodell für eine Test-Anwendung + + + + + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleRelationshipElement + + + + ExampleRelationshipElement + + + + Parameter + + + + + + Example RelationshipElement object + + + Beispiel RelationshipElement Element + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement + + + + ExampleAnnotatedRelationshipElement + + + + Parameter + + + + + + Example AnnotatedRelationshipElement object + + + Beispiel AnnotatedRelationshipElement Element + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + + + + + + + + + + + + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Operations/ExampleOperation + + + + ExampleOperation + + + + Parameter + + + + + + Example Operation object + + + Beispiel Operation Element + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Capabilities/ExampleCapability + + + + ExampleCapability + + + + Parameter + + + + + + Example Capability object + + + Beispiel Capability Element + + + + + + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Events/ExampleBasicEvent + + + + ExampleBasicEvent + + + + Parameter + + + + + + Example BasicEvent object + + + Beispiel BasicEvent Element + + + + + + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty + + + + ExampleProperty + + + + Constant + + + + + + Example Property object + + + Beispiel Property Element + + + + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty + + + + ExampleMultiLanguageProperty + + + + Constant + + + + + + Example MultiLanguageProperty object + + + Beispiel MulitLanguageProperty Element + + + + + + + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Ranges/ExampleRange + + + + ExampleRange + + + + Parameter + + + + + + Example Range object + + + Beispiel Range Element + + + + 100 + + + + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Ranges/ExampleRange + + + + ExampleRange2 + + + + Parameter + + + + + + Example Range object + + + Beispiel Range Element + + + + + + + 0 + + + + + true + + + + false + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered + + + + ExampleSubmodelCollectionOrdered + + + + Parameter + + + + + + Example SubmodelElementCollectionOrdered object + + + Beispiel SubmodelElementCollectionOrdered Element + + + + + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Blobs/ExampleBlob + + + + ExampleBlob + + + + Parameter + + + + + + Example Blob object + + + Beispiel Blob Element + + + + + application/pdf + + + + null + + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Files/ExampleFile + + + + ExampleFile + + + + Parameter + + + + + + Example File object + + + Beispiel File Element + + + + + application/pdf + + + + + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ReferenceElements/ExampleReferenceElement + + + + ExampleReferenceElement + + + + Parameter + + + + + + Example Reference Element object + + + Beispiel Reference Element Element + + + + + + + + false + + + + false + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered + + + + ExampleSubmodelCollectionUnordered + + + + Parameter + + + + + + Example SubmodelElementCollectionUnordered object + + + Beispiel SubmodelElementCollectionUnordered Element + + + + + + + + + false + + + + false + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered + + + + ExampleSubmodelCollectionUnordered2 + + + + Parameter + + + + + + Example SubmodelElementCollectionUnordered object + + + Beispiel SubmodelElementCollectionUnordered Element + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelTemplates/ExampleSubmodel + + + + + + IRI + + + + https://acplt.org/Test_Submodel_Template + + + + + + + 0.9 + + + + 0 + + + + + TestSubmodel + + + + + + + An example submodel for the test application + + + Ein Beispiel-Teilmodell für eine Test-Anwendung + + + + + + + + IRI + + + + https://acplt.org/Test_AssetAdministrationShell2_Mandatory + + + + + + + + + + + + + + + + + + + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + + (GLOBAL_REFERENCE)[IRI]0173-1#02-AAO677#002 + + + + ManufacturerName + + + + + + + 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. + + + 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 + + + + + + xs:int + + + + 100 + + + + + + + + + + xs:int + + + + 50 + + + + + + + + ACPLT + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + + (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber + + + + InstanceId + + + + + + + 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. + + + 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 + + + + 978-8234-234-342 + + + + + + (SUBMODEL)[IRI]http://acplt.org/SubmodelTemplates/AssetIdentification + + + + + + IRI + + + + http://acplt.org/Submodels/Assets/TestAsset/Identification + + + + + + + 0.9 + + + + 0 + + + + + Identification + + + + + + + An example asset identification submodel for the test application + + + Ein Beispiel-Identifikations-Submodel für eine Test-Anwendung + + + + + + + + + + + + + + + CO_MANAGED_ENTITY + + + + + (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber + + + + ExampleEntity + + + + + + + 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. + + + 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 + + + + + + + + + SELF_MANAGED_ENTITY + + + + + (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber + + + + ExampleEntity2 + + + + + + + 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. + + + 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 + + + + + + (SUBMODEL)[IRI]http://acplt.org/SubmodelTemplates/BillOfMaterial + + + + + + IRI + + + + http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial + + + + + + + 0.9 + + + + + + + + BillOfMaterial + + + + + + + An example bill of material submodel for the test application + + + Ein Beispiel-BillofMaterial-Submodel für eine Test-Anwendung + + + + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleRelationshipElement + + + + ExampleRelationshipElement + + + + Parameter + + + + + + Example RelationshipElement object + + + Beispiel RelationshipElement Element + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + (PROPERTY)[ID_SHORT]ExampleProperty2 + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement + + + + ExampleAnnotatedRelationshipElement + + + + Parameter + + + + + + Example AnnotatedRelationshipElement object + + + Beispiel AnnotatedRelationshipElement Element + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + (PROPERTY)[ID_SHORT]ExampleProperty2 + + + + + + + + + + + + + + + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Operations/ExampleOperation + + + + ExampleOperation + + + + Parameter + + + + + + Example Operation object + + + Beispiel Operation Element + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Capabilities/ExampleCapability + + + + ExampleCapability + + + + Parameter + + + + + + Example Capability object + + + Beispiel Capability Element + + + + + + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Events/ExampleBasicEvent + + + + ExampleBasicEvent + + + + Parameter + + + + + + Example BasicEvent object + + + Beispiel BasicEvent Element + + + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty + + + + ExampleProperty + + + + Constant + + + + + + Example Property object + + + Beispiel Property Element + + + + exampleValue + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty + + + + ExampleMultiLanguageProperty + + + + Constant + + + + + + Example MultiLanguageProperty object + + + Beispiel MulitLanguageProperty Element + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleMultiLanguageValueId + + + + + + Example value of a MultiLanguageProperty element + + + Beispielswert für ein MulitLanguageProperty-Element + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Ranges/ExampleRange + + + + ExampleRange + + + + Parameter + + + + + + Example Range object + + + Beispiel Range Element + + + + 100 + + + + 0 + + + + + true + + + + false + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered + + + + ExampleSubmodelCollectionOrdered + + + + Parameter + + + + + + Example SubmodelElementCollectionOrdered object + + + Beispiel SubmodelElementCollectionOrdered Element + + + + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Blobs/ExampleBlob + + + + ExampleBlob + + + + Parameter + + + + + + Example Blob object + + + Beispiel Blob Element + + + + + application/pdf + + + + [1, 2, 3, 4, 5] + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Files/ExampleFile + + + + ExampleFile + + + + Parameter + + + + + + Example File object + + + Beispiel File Element + + + + + application/pdf + + + + /TestFile.pdf + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ReferenceElements/ExampleReferenceElement + + + + ExampleReferenceElement + + + + Parameter + + + + + + Example Reference Element object + + + Beispiel Reference Element Element + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + false + + + + false + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered + + + + ExampleSubmodelCollectionUnordered + + + + Parameter + + + + + + Example SubmodelElementCollectionUnordered object + + + Beispiel SubmodelElementCollectionUnordered Element + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelTemplates/ExampleSubmodel + + + + + + IRI + + + + https://acplt.org/Test_Submodel + + + + + + + 0.9 + + + + 0 + + + + + TestSubmodel + + + + + + + An example submodel for the test application + + + Ein Beispiel-Teilmodell für eine Test-Anwendung + + + + + + + + + + + + + + + ExampleRelationshipElement + + + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + + + + + + + ExampleAnnotatedRelationshipElement + + + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + + + + + + + + + + + + + + + + + + + + + + ExampleOperation + + + + + + + + + + + + + ExampleCapability + + + + + + + + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + + ExampleBasicEvent + + + + + + + + + + + + + + + + + + ExampleProperty + + + + + + + + + + + + + + + + ExampleMultiLanguageProperty + + + + + + + + + + + + + + + + + + + ExampleRange + + + + + + + + + + + + + true + + + + false + + + + + + ExampleSubmodelCollectionOrdered + + + + + + + + + + + + + + + + + ExampleBlob + + + + + + + application/pdf + + + + null + + + + + + + + + + + + ExampleFile + + + + + + + application/pdf + + + + + + + + + + + + + + + ExampleReferenceElement + + + + + + + + + + false + + + + false + + + + + + ExampleSubmodelCollectionUnordered + + + + + + + + + + + false + + + + false + + + + + + ExampleSubmodelCollectionUnordered2 + + + + + + + + + + + IRI + + + + https://acplt.org/Test_Submodel_Mandatory + + + + + + + + + + + + + + + + + + + + + IRI + + + + https://acplt.org/Test_Submodel2_Mandatory + + + + + + + + + + + + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleRelationshipElement + + + + ExampleRelationshipElement + + + + Parameter + + + + + + Example RelationshipElement object + + + Beispiel RelationshipElement Element + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement + + + + ExampleAnnotatedRelationshipElement + + + + Parameter + + + + + + Example AnnotatedRelationshipElement object + + + Beispiel AnnotatedRelationshipElement Element + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + + + + + + + + + + + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Operations/ExampleOperation + + + + ExampleOperation + + + + Parameter + + + + + + Example Operation object + + + Beispiel Operation Element + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Capabilities/ExampleCapability + + + + ExampleCapability + + + + Parameter + + + + + + Example Capability object + + + Beispiel Capability Element + + + + + + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Events/ExampleBasicEvent + + + + ExampleBasicEvent + + + + Parameter + + + + + + Example BasicEvent object + + + Beispiel BasicEvent Element + + + + + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty + + + + ExampleProperty + + + + Constant + + + + + + Example Property object + + + Beispiel Property Element + + + + + + xs:string + + + + + + + + + + + exampleValue + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty + + + + ExampleMultiLanguageProperty + + + + Constant + + + + + + Example MultiLanguageProperty object + + + Beispiel MulitLanguageProperty Element + + + + + + + + + Example value of a MultiLanguageProperty element + + + Beispielswert für ein MulitLanguageProperty-Element + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Ranges/ExampleRange + + + + ExampleRange + + + + Parameter + + + + + + Example Range object + + + Beispiel Range Element + + + + 100 + + + + 0 + + + + + true + + + + false + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered + + + + ExampleSubmodelCollectionOrdered + + + + Parameter + + + + + + Example SubmodelElementCollectionOrdered object + + + Beispiel SubmodelElementCollectionOrdered Element + + + + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Blobs/ExampleBlob + + + + ExampleBlob + + + + Parameter + + + + + + Example Blob object + + + Beispiel Blob Element + + + + + application/pdf + + + + [1, 2, 3, 4, 5] + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Files/ExampleFile + + + + ExampleFile + + + + Parameter + + + + + + Example File object + + + Beispiel File Element + + + + + application/pdf + + + + /TestFile.pdf + + + + + + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ReferenceElements/ExampleReferenceElement + + + + ExampleReferenceElement + + + + Parameter + + + + + + Example Reference Element object + + + Beispiel Reference Element Element + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + false + + + + false + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered + + + + ExampleSubmodelCollectionUnordered + + + + Parameter + + + + + + Example SubmodelElementCollectionUnordered object + + + Beispiel SubmodelElementCollectionUnordered Element + + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelTemplates/ExampleSubmodel + + + + + + IRI + + + + https://acplt.org/Test_Submodel_Missing + + + + + + + 0.9 + + + + 0 + + + + + TestSubmodel + + + + + + + An example submodel for the test application + + + Ein Beispiel-Teilmodell für eine Test-Anwendung + + + + + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleRelationshipElement + + + + ExampleRelationshipElement + + + + Parameter + + + + + + Example RelationshipElement object + + + Beispiel RelationshipElement Element + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement + + + + ExampleAnnotatedRelationshipElement + + + + Parameter + + + + + + Example AnnotatedRelationshipElement object + + + Beispiel AnnotatedRelationshipElement Element + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + + + + + + + + + + + + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Operations/ExampleOperation + + + + ExampleOperation + + + + Parameter + + + + + + Example Operation object + + + Beispiel Operation Element + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Capabilities/ExampleCapability + + + + ExampleCapability + + + + Parameter + + + + + + Example Capability object + + + Beispiel Capability Element + + + + + + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Events/ExampleBasicEvent + + + + ExampleBasicEvent + + + + Parameter + + + + + + Example BasicEvent object + + + Beispiel BasicEvent Element + + + + + + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty + + + + ExampleProperty + + + + Constant + + + + + + Example Property object + + + Beispiel Property Element + + + + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty + + + + ExampleMultiLanguageProperty + + + + Constant + + + + + + Example MultiLanguageProperty object + + + Beispiel MulitLanguageProperty Element + + + + + + + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Ranges/ExampleRange + + + + ExampleRange + + + + Parameter + + + + + + Example Range object + + + Beispiel Range Element + + + + 100 + + + + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Ranges/ExampleRange + + + + ExampleRange2 + + + + Parameter + + + + + + Example Range object + + + Beispiel Range Element + + + + + + + 0 + + + + + true + + + + false + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered + + + + ExampleSubmodelCollectionOrdered + + + + Parameter + + + + + + Example SubmodelElementCollectionOrdered object + + + Beispiel SubmodelElementCollectionOrdered Element + + + + + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Blobs/ExampleBlob + + + + ExampleBlob + + + + Parameter + + + + + + Example Blob object + + + Beispiel Blob Element + + + + + application/pdf + + + + null + + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Files/ExampleFile + + + + ExampleFile + + + + Parameter + + + + + + Example File object + + + Beispiel File Element + + + + + application/pdf + + + + + + + + + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ReferenceElements/ExampleReferenceElement + + + + ExampleReferenceElement + + + + Parameter + + + + + + Example Reference Element object + + + Beispiel Reference Element Element + + + + + + + + false + + + + false + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered + + + + ExampleSubmodelCollectionUnordered + + + + Parameter + + + + + + Example SubmodelElementCollectionUnordered object + + + Beispiel SubmodelElementCollectionUnordered Element + + + + + + + + + false + + + + false + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered + + + + ExampleSubmodelCollectionUnordered2 + + + + Parameter + + + + + + Example SubmodelElementCollectionUnordered object + + + Beispiel SubmodelElementCollectionUnordered Element + + + + + TEMPLATE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelTemplates/ExampleSubmodel + + + + + + IRI + + + + https://acplt.org/Test_Submodel_Template + + + + + + + 0.9 + + + + 0 + + + + + TestSubmodel + + + + + + + An example submodel for the test application + + + Ein Beispiel-Teilmodell für eine Test-Anwendung + + + + + + + + IRI + + + + https://acplt.org/Test_AssetAdministrationShell_Missing + + + + + + + 0.9 + + + + 0 + + + + + TestAssetAdministrationShell + + + + + + + An Example Asset Administration Shell for the test application + + + Ein Beispiel-Verwaltungsschale für eine Test-Anwendung + + + + + + (SUBMODEL)[IRI]https://acplt.org/Test_Submodel_Missing + + + + + + diff --git a/dataformat-core/pom.xml b/dataformat-core/pom.xml index a7f1f180..8cb2caec 100644 --- a/dataformat-core/pom.xml +++ b/dataformat-core/pom.xml @@ -13,7 +13,7 @@ io.admin-shell.aas model - ${model.version} + ${revision} compile diff --git a/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/ReflectionHelper.java b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/ReflectionHelper.java index b05ae79a..7d5e173c 100644 --- a/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/ReflectionHelper.java +++ b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/ReflectionHelper.java @@ -23,11 +23,14 @@ import io.github.classgraph.ScanResult; 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 java.util.stream.Stream; +import org.apache.commons.lang3.ClassUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -76,6 +79,10 @@ public class ReflectionHelper { * 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 MIXINS_PACKAGE_NAME * package together with the corresponding class they should be applied to. @@ -161,6 +168,28 @@ 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) { + logger.warn("class '{}' implements more than one AAS interface, but only first one is used", type.getName()); + } + return implementedAasInterfaces.iterator().next(); + } + + 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 @@ -196,6 +225,9 @@ public static String getModelType(Class clazz) { * 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) -> { @@ -226,6 +258,7 @@ public static Class getMostSpecificTypeWithModelType(Class clazz) { SUBTYPES = scanSubtypes(modelScan); MIXINS = scanMixins(modelScan); DEFAULT_IMPLEMENTATIONS = scanDefaultImplementations(modelScan); + INTERFACES = scanAasInterfaces(); ENUMS = modelScan.getAllEnums().loadClasses(Enum.class); INTERFACES_WITHOUT_DEFAULT_IMPLEMENTATION = getInterfacesWithoutDefaultImplementation(modelScan); } @@ -236,6 +269,19 @@ private static Set> getInterfacesWithoutDefaultImplementation(ScanResul .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() @@ -263,6 +309,10 @@ private static List scanDefaultImplementations(ScanResult mo return defaultImplementations; } + private static Set scanAasInterfaces() { + return DEFAULT_IMPLEMENTATIONS.stream().map(x -> x.interfaceType).collect(Collectors.toSet()); + } + private static Map, Class> scanMixins(ScanResult modelScan) { ScanResult mixinScan = new ClassGraph() .enableClassInfo() diff --git a/dataformat-json/pom.xml b/dataformat-json/pom.xml index 2096844c..28201927 100644 --- a/dataformat-json/pom.xml +++ b/dataformat-json/pom.xml @@ -13,7 +13,7 @@ io.admin-shell.aas model - ${model.version} + ${revision} compile diff --git a/dataformat-xml/pom.xml b/dataformat-xml/pom.xml index 40b1f1fc..c07dc4be 100644 --- a/dataformat-xml/pom.xml +++ b/dataformat-xml/pom.xml @@ -13,7 +13,7 @@ io.admin-shell.aas model - ${model.version} + ${revision} compile diff --git a/pom.xml b/pom.xml index 27d88ebc..136b52a7 100644 --- a/pom.xml +++ b/pom.xml @@ -17,11 +17,11 @@ 1.0.0 - 1.1.2 1.8 1.8 UTF-8 UTF-8 + 3.3.1 1.2.2 3.2.0 4.1 @@ -30,11 +30,15 @@ 2.6 2.12.3 2.0.1.Final + 2.3.1 + 2.1.0 4.1.0 1.5.0 1.0.56 4.13 1.1.1 + 1.4.2.Final + 2.7.8 1.5.4 4.1.2 1.7.31 From d9347f10e83251fdc9f3d2ab9a60833e1111b10a Mon Sep 17 00:00:00 2001 From: Jacoby Date: Fri, 30 Jul 2021 10:50:10 +0200 Subject: [PATCH 08/18] Merge branch 'feature/aml-new' into 'feature/aml' --- .../aas/v3/dataformat/aml/AmlMapper.java | 34 - .../aml/model/caex/AASNamespace.java | 83 - .../aml/model/caex/AdditionalInformation.java | 36 - ...tAdministrationShellInterfaceClassLib.java | 31 - .../AssetAdministrationShellRoleClassLib.java | 50 - .../dataformat/aml/model/caex/Attribute.java | 90 - .../aml/model/caex/CAEXConstants.java | 25 - .../dataformat/aml/model/caex/CAEXFile.java | 117 -- .../aml/model/caex/ExternalInterface.java | 73 - .../aml/model/caex/InstanceHierarchy.java | 60 - .../aml/model/caex/InternalElement.java | 95 - .../aml/model/caex/RefSemantic.java | 33 - .../aml/model/caex/RoleRequirements.java | 53 - .../mixin/AdditionalInformationMixin.java | 40 - .../aml/model/mixin/AttributeMixin.java | 106 - .../dataformat/aml/model/mixin/CAEXMixin.java | 138 -- .../model/mixin/ExternalInterfaceMixin.java | 79 - .../model/mixin/InstanceHierarchyMixin.java | 67 - .../aml/model/mixin/InternalElementMixin.java | 107 - .../aml/model/mixin/RefSemanticMixin.java | 39 - .../model/mixin/RoleRequirementsMixin.java | 55 - .../mapper/AASEnvironmentMapper.java | 281 --- ...rativeInformationToAttributeConverter.java | 64 - .../AllowDuplicatesToAttributeConverter.java | 37 - .../AssetKindToAttributeConverter.java | 40 - .../BillOfMaterialToAttributeConverter.java | 40 - .../CategoryToAttributeConverter.java | 38 - .../DerivedFromToAttributeConverter.java | 40 - .../DescriptionToAttributeConverter.java | 64 - .../EntityTypeToAttributeConverter.java | 39 - .../IdShortToAttributeConverter.java | 43 - .../converter/IdShortToNameConverter.java | 34 - ...entificationModelToAttributeConverter.java | 40 - .../IdentificationToAttributeConverter.java | 65 - .../ModelingKindToAttributeConverter.java | 38 - .../ObservedToAttributeConverter.java | 40 - .../OrderedToAttributeConverter.java | 37 - .../PropertyValueToAttributeConverter.java | 39 - .../SemanticIdToAttributeConverter.java | 40 - .../ValueIdToAttributeConverter.java | 40 - .../AnnotatedRelationshipElementMapper.java | 31 - .../AssetAdministrationShellMapper.java | 127 -- .../mapper/mapper/AssetInformationMapper.java | 108 - .../serialize/mapper/mapper/AssetMapper.java | 31 - .../mapper/mapper/BasicEventMapper.java | 32 - .../serialize/mapper/mapper/BlobMapper.java | 65 - .../mapper/mapper/CapabilityMapper.java | 32 - .../serialize/mapper/mapper/EntityMapper.java | 43 - .../serialize/mapper/mapper/FileMapper.java | 64 - .../mapper/mapper/IdentifiableMapper.java | 29 - .../mapper/MultiLanguagePropertyMapper.java | 71 - .../mapper/mapper/OperationMapper.java | 46 - .../mapper/mapper/PropertyMapper.java | 42 - .../serialize/mapper/mapper/RangeMapper.java | 50 - .../mapper/mapper/ReferableMapper.java | 32 - .../mapper/mapper/ReferenceElementMapper.java | 43 - .../mapper/RelationshipElementMapper.java | 53 - .../SubmodelElementCollectionMapper.java | 31 - .../mapper/mapper/SubmodelElementMapper.java | 30 - .../mapper/mapper/SubmodelMapper.java | 53 - .../mapper/util/FileConverterUtil.java | 61 - .../mapper/util/QualifierConverterUtil.java | 95 - .../serialize/mapper/util/UrlEncoderUtil.java | 11 - .../resources/interface-class-lib_aas.automl | 34 - .../interface-class-lib_automl_bpr.automl | 14 - ...nterface-class-lib_automl_interface.automl | 93 - .../main/resources/role-class-lib_aas.automl | 1811 ----------------- .../role-class-lib_automl_base.automl | 80 - .../role-class-lib_automl_bpr.automl | 7 - .../system-unit-class-lib_aas.automl | 4 - ...ib_aas_data_specification_templates.automl | 206 -- 71 files changed, 5899 deletions(-) delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlMapper.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/AASNamespace.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/AdditionalInformation.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/AssetAdministrationShellInterfaceClassLib.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/AssetAdministrationShellRoleClassLib.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/Attribute.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/CAEXConstants.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/CAEXFile.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/ExternalInterface.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/InstanceHierarchy.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/InternalElement.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/RefSemantic.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/RoleRequirements.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/AdditionalInformationMixin.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/AttributeMixin.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/CAEXMixin.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/ExternalInterfaceMixin.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/InstanceHierarchyMixin.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/InternalElementMixin.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/RefSemanticMixin.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/RoleRequirementsMixin.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/AASEnvironmentMapper.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/AdministrativeInformationToAttributeConverter.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/AllowDuplicatesToAttributeConverter.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/AssetKindToAttributeConverter.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/BillOfMaterialToAttributeConverter.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/CategoryToAttributeConverter.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/DerivedFromToAttributeConverter.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/DescriptionToAttributeConverter.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/EntityTypeToAttributeConverter.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/IdShortToAttributeConverter.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/IdShortToNameConverter.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/IdentificationModelToAttributeConverter.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/IdentificationToAttributeConverter.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/ModelingKindToAttributeConverter.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/ObservedToAttributeConverter.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/OrderedToAttributeConverter.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/PropertyValueToAttributeConverter.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/SemanticIdToAttributeConverter.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/ValueIdToAttributeConverter.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/AnnotatedRelationshipElementMapper.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/AssetAdministrationShellMapper.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/AssetInformationMapper.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/AssetMapper.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/BasicEventMapper.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/BlobMapper.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/CapabilityMapper.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/EntityMapper.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/FileMapper.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/IdentifiableMapper.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/MultiLanguagePropertyMapper.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/OperationMapper.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/PropertyMapper.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/RangeMapper.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/ReferableMapper.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/ReferenceElementMapper.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/RelationshipElementMapper.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/SubmodelElementCollectionMapper.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/SubmodelElementMapper.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/SubmodelMapper.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/util/FileConverterUtil.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/util/QualifierConverterUtil.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/util/UrlEncoderUtil.java delete mode 100644 dataformat-aml/src/main/resources/interface-class-lib_aas.automl delete mode 100644 dataformat-aml/src/main/resources/interface-class-lib_automl_bpr.automl delete mode 100644 dataformat-aml/src/main/resources/interface-class-lib_automl_interface.automl delete mode 100644 dataformat-aml/src/main/resources/role-class-lib_aas.automl delete mode 100644 dataformat-aml/src/main/resources/role-class-lib_automl_base.automl delete mode 100644 dataformat-aml/src/main/resources/role-class-lib_automl_bpr.automl delete mode 100644 dataformat-aml/src/main/resources/system-unit-class-lib_aas.automl delete mode 100644 dataformat-aml/src/main/resources/system-unit-class-lib_aas_data_specification_templates.automl diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlMapper.java deleted file mode 100644 index 0735a763..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlMapper.java +++ /dev/null @@ -1,34 +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 io.adminshell.aas.v3.dataformat.aml; - -import io.adminshell.aas.v3.dataformat.aml.model.caex.AdditionalInformation; -import io.adminshell.aas.v3.dataformat.aml.model.caex.CAEXFile; -import io.adminshell.aas.v3.model.AssetAdministrationShellEnvironment; - -public class AmlMapper { - - public AssetAdministrationShellEnvironment map(CAEXFile aml) { - return null; - } - - public CAEXFile map(AssetAdministrationShellEnvironment aas) { -// return CAEXFile.builder() -// .additionalInformation(new AdditionalInformation() ) -// .build(); - return null; - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/AASNamespace.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/AASNamespace.java deleted file mode 100644 index 5a6b1cff..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/AASNamespace.java +++ /dev/null @@ -1,83 +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 io.adminshell.aas.v3.dataformat.aml.model.caex; - -public enum AASNamespace { - Referable_IdShort("Referable/idShort"), - Referable_Category("Referable/category"), - Referable_Description("Referable/description"), - Asset_Kind("AssetInformation/kind"), - Asset_GlobalAssetId("AssetInformation/globalAssetId"), - Asset_DefaultThumbnail("AssetInformation/defaultThumbnail"), - Asset_SpecificAssetId("AssetInformation/specificAssetId"), - Asset_BillOfMaterial("AssetInformation/billOfMaterial"), - HasKind_Kind("HasKind/kind"), - HasSemantics_SemanticId("HasSemantics/semanticId"), - Identifiable_Identification("Identifiable/identification"), - Identifier_IdType("Identifier/idType"), - Identifier_Id("Identifier/id"), - Identifiable_Administration("Identifiable/administration"), - AdministrationInformation_Version("AdministrationInformation/version"), - AdministrationInformation_Revision("AdministrationInformation/revision"), - HasDataSpecification_DataSpecification("HasDataSpecification/dataSpecification"), - Qualifiable_Qualifier("Qualifiable/qualifier"), - Qualifier_Qualifier("Qualifier/qualifier"), - Qualifier_Type("Qualifier/type"), - Qualifier_Value("Qualifier/value"), - Entity_Type("Entity/type"), - Entity_Asset("Entity/asset"), - BasicEvent_Observed("BasicEvent/observed"), - Qualifier_ValueId("Qualifier/valueId"), - AssetAdministrationShell_DerivedFrom("AssetAdministrationShell/derivedFrom"), - Asset_AssetIdentificationModel("Asset/assetIdentificationModel"), - AssetAdministrationShell_AssetInformation("AssetAdministrationShell/assetInformation"), - AssetInformation_AssetKind("AssetInformation/assetKind"), - AssetInformation_GlobalAssetId("AssetInformation/globalAssetId"), - AssetAdministrationShell_Submodels("AssetAdministrationShell/submodels"), - Property_Value("Property/value"), - MultiLanguageProperty_Value("MultiLanguageProperty/value"), - MultiLanguageProperty_ValueId("MultiLanguageProperty/valueId"), - Blob_Value("Blob/value"), - Blob_MimeType("Blob/mimeType"), - File_Value("File/value"), - File_MimeType("File/mimeType"), - Range_Max("Range/max"), - Range_Min("Range/min"), - ReferenceElement_Value("ReferenceElement/value"), - Property_ValueId("Property/valueId"), - AnnotationRelationshipElement_Annotations("AnnotationRelationshipElement/annotations"), - ConceptDescription_IsCaseOf("ConceptDescription/isCaseOf"), - ConceptDescription_DataSpecification("ConceptDescription/dataSpecification"), - RelationshipElement_First("RelationshipElement/first"), - RelationshipElement_Second("RelationshipElement/second"), - IdentifierKeyValuePair_Key("IdentifierKeyValuePair/key"), - IdentifierKeyValuePair_Value("IdentifierKeyValuePair/value"), - BillOfMaterial_Reference("BillOfMaterial/reference"), - // View - AssetAdministrationShell_View("AssetAdministrationShell/view"), - View_ContainedElement("View/containedElement"), - View_IdShort("View/idShort"); - - private String refSemantic; - - AASNamespace(String refSemantic) { - this.refSemantic = refSemantic; - } - - public String getRefSemantic() { - return "AAS:" + refSemantic; - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/AdditionalInformation.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/AdditionalInformation.java deleted file mode 100644 index 121638a5..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/AdditionalInformation.java +++ /dev/null @@ -1,36 +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 io.adminshell.aas.v3.dataformat.aml.model.caex; - -public class AdditionalInformation { - - private String automationMLVersion; - - public AdditionalInformation() { - } - - public AdditionalInformation(String automationMLVersion) { - this.automationMLVersion = automationMLVersion; - } - - public String getAutomationMLVersion() { - return automationMLVersion; - } - - public void setAutomationMLVersion(String automationMLVersion) { - this.automationMLVersion = automationMLVersion; - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/AssetAdministrationShellInterfaceClassLib.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/AssetAdministrationShellInterfaceClassLib.java deleted file mode 100644 index 949bdb44..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/AssetAdministrationShellInterfaceClassLib.java +++ /dev/null @@ -1,31 +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 io.adminshell.aas.v3.dataformat.aml.model.caex; - -public enum AssetAdministrationShellInterfaceClassLib { - FileDataReference("FileDataReference"); - - - private String refBaseRoleClassPath; - - AssetAdministrationShellInterfaceClassLib(String refBaseRoleClassPath) { - this.refBaseRoleClassPath = refBaseRoleClassPath; - } - - public String getRefBaseRoleClassPath() { - return "AssetAdministrationShellInterfaceClassLib/" + refBaseRoleClassPath; - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/AssetAdministrationShellRoleClassLib.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/AssetAdministrationShellRoleClassLib.java deleted file mode 100644 index d3cf3590..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/AssetAdministrationShellRoleClassLib.java +++ /dev/null @@ -1,50 +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 io.adminshell.aas.v3.dataformat.aml.model.caex; - -public enum AssetAdministrationShellRoleClassLib { - AssetAdministrationShell("AssetAdministrationShell"), - Asset("Asset"), - AssetInformation("AssetInformation"), - File("File"), - Range("Range"), - Entity("Entity"), - View("View"), - BasicEvent("BasicEvent"), - Capability("Capability"), - Operation("Operation"), - OperationInputVar("OperationInputVariables"), - OperationOutputVar("OperationOutputVariables"), - OperationInOutputVar("OperationInoutputVariables"), - Property("Property"), - SubmodelElementCollection("SubmodelElementCollection"), - Submodel("Submodel"), - ReferenceElement("ReferenceElement"), - MultiLanguageProperty("MultiLanguageProperty"), - RelationshipElementMapper("RelationshipElement"), - AnnotatedRelationshipElement("AnnotatedRelationshipElement"), - Blob("Blob"); - - private String refBaseRoleClassPath; - - AssetAdministrationShellRoleClassLib(String refBaseRoleClassPath) { - this.refBaseRoleClassPath = refBaseRoleClassPath; - } - - public String getRefBaseRoleClassPath() { - return "AssetAdministrationShellRoleClassLib/" + refBaseRoleClassPath; - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/Attribute.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/Attribute.java deleted file mode 100644 index de736bc7..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/Attribute.java +++ /dev/null @@ -1,90 +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 io.adminshell.aas.v3.dataformat.aml.model.caex; - -import java.util.List; - -public class Attribute { - - public Attribute(String name, String attributeDataType, String description, String value, RefSemantic refSemantic, List attributes) { - this.name = name; - this.attributeDataType = attributeDataType; - this.description = description; - this.value = value; - this.refSemantic = refSemantic; - this.attributes = attributes; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getAttributeDataType() { - return attributeDataType; - } - - public void setAttributeDataType(String attributeDataType) { - this.attributeDataType = attributeDataType; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } - - public RefSemantic getRefSemantic() { - return refSemantic; - } - - public void setRefSemantic(RefSemantic refSemantic) { - this.refSemantic = refSemantic; - } - - public List getAttributes() { - return attributes; - } - - public void setAttributes(List attributes) { - this.attributes = attributes; - } - - private String name; - - private String attributeDataType; - - private String description; - - private String value; - - private RefSemantic refSemantic; - - private List attributes; -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/CAEXConstants.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/CAEXConstants.java deleted file mode 100644 index ad8d421f..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/CAEXConstants.java +++ /dev/null @@ -1,25 +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 io.adminshell.aas.v3.dataformat.aml.model.caex; - -public class CAEXConstants { - public final static String SCHEMA_VERSION = "2.15"; - public final static String XMLNS = "http://www.w3.org/2001/XMLSchema-instance"; - public final static String XSI = "CAEX_ClassModel_V2.15.xsd"; - public final static String AUTOMATION_ML_VERSION = "2.0"; - public final static String AAS_INSTANCE_HIERARCHY = "AssetAdministrationShellInstanceHierarchy"; - public final static String AAS_INSTANCE_HIERARCHY_VERSION = "0"; -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/CAEXFile.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/CAEXFile.java deleted file mode 100644 index e07d08b4..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/CAEXFile.java +++ /dev/null @@ -1,117 +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 io.adminshell.aas.v3.dataformat.aml.model.caex; - -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; - -import java.util.List; - -public class CAEXFile { - - public CAEXFile() { - } - - public CAEXFile(String xmlns, String xsi, String schemaVersion, AdditionalInformation additionalInformation, InstanceHierarchy instanceHierarchy) { - this.xmlns = xmlns; - this.xsi = xsi; - this.schemaVersion = schemaVersion; - this.additionalInformation = additionalInformation; - this.instanceHierarchy = instanceHierarchy; - } - - private String xmlns; - - private String xsi; - - private String fileName; - - private String schemaVersion; - - private AdditionalInformation additionalInformation; - - private InstanceHierarchy instanceHierarchy; - - private List interfaceClassLibs; - - private List roleClassLibs; - - private List systemUnitClassLibs; - - public String getXmlns() { - return xmlns; - } - - public void setXmlns(String xmlns) { - this.xmlns = xmlns; - } - - public String getXsi() { - return xsi; - } - - public void setXsi(String xsi) { - this.xsi = xsi; - } - - public String getSchemaVersion() { - return schemaVersion; - } - - public void setSchemaVersion(String schemaVersion) { - this.schemaVersion = schemaVersion; - } - - public AdditionalInformation getAdditionalInformation() { - return additionalInformation; - } - - public void setAdditionalInformation(AdditionalInformation additionalInformation) { - this.additionalInformation = additionalInformation; - } - - public InstanceHierarchy getInstanceHierarchy() { - return instanceHierarchy; - } - - public void setInstanceHierarchy(InstanceHierarchy instanceHierarchy) { - this.instanceHierarchy = instanceHierarchy; - } - - public List getInterfaceClassLibs() { - return interfaceClassLibs; - } - - public void setInterfaceClassLibs(List interfaceClassLibs) { - this.interfaceClassLibs = interfaceClassLibs; - } - - public List getRoleClassLibs() { - return roleClassLibs; - } - - public void setRoleClassLibs(List roleClassLibs) { - this.roleClassLibs = roleClassLibs; - } - - public List getSystemUnitClassLibs() { - return systemUnitClassLibs; - } - - public void setSystemUnitClassLibs(List systemUnitClassLibs) { - this.systemUnitClassLibs = systemUnitClassLibs; - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/ExternalInterface.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/ExternalInterface.java deleted file mode 100644 index 8f66f890..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/ExternalInterface.java +++ /dev/null @@ -1,73 +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 io.adminshell.aas.v3.dataformat.aml.model.caex; - -import java.util.List; -import java.util.UUID; - -public class ExternalInterface { - - private String id; - - public ExternalInterface(String id, String name, String refBaseClassPath, List attributes) { - this.id = id; - this.name = name; - this.refBaseClassPath = refBaseClassPath; - this.attributes = attributes; - } - - private String name; - - private String refBaseClassPath; - - private List attributes; - - public ExternalInterface() { - id = UUID.randomUUID().toString(); - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getRefBaseClassPath() { - return refBaseClassPath; - } - - public void setRefBaseClassPath(String refBaseClassPath) { - this.refBaseClassPath = refBaseClassPath; - } - - public List getAttributes() { - return attributes; - } - - public void setAttributes(List attributes) { - this.attributes = attributes; - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/InstanceHierarchy.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/InstanceHierarchy.java deleted file mode 100644 index 0ed8b8dc..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/InstanceHierarchy.java +++ /dev/null @@ -1,60 +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 io.adminshell.aas.v3.dataformat.aml.model.caex; - -import java.util.List; - -public class InstanceHierarchy { - - public InstanceHierarchy() { - } - - public InstanceHierarchy(String name, String version, List internalElements) { - this.name = name; - this.version = version; - this.internalElements = internalElements; - } - - private String name; - - private String version; - - private List internalElements; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getVersion() { - return version; - } - - public void setVersion(String version) { - this.version = version; - } - - public List getInternalElements() { - return internalElements; - } - - public void setInternalElements(List internalElements) { - this.internalElements = internalElements; - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/InternalElement.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/InternalElement.java deleted file mode 100644 index a776d998..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/InternalElement.java +++ /dev/null @@ -1,95 +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 io.adminshell.aas.v3.dataformat.aml.model.caex; - -import java.util.List; -import java.util.UUID; - -public class InternalElement { - - public InternalElement(String id, String name, RoleRequirements roleRequirements, List internalElements, List attributes, List externalInterfaces) { - this.id = id; - this.name = name; - this.roleRequirements = roleRequirements; - this.internalElements = internalElements; - this.attributes = attributes; - this.externalInterfaces = externalInterfaces; - } - - private String id; - - private String name; - - private RoleRequirements roleRequirements; - - private List internalElements; - - private List attributes; - - private List externalInterfaces; - - public InternalElement() { - id = UUID.randomUUID().toString(); - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public RoleRequirements getRoleRequirements() { - return roleRequirements; - } - - public void setRoleRequirements(RoleRequirements roleRequirements) { - this.roleRequirements = roleRequirements; - } - - public List getInternalElements() { - return internalElements; - } - - public void setInternalElements(List internalElements) { - this.internalElements = internalElements; - } - - public List getAttributes() { - return attributes; - } - - public void setAttributes(List attributes) { - this.attributes = attributes; - } - - public List getExternalInterfaces() { - return externalInterfaces; - } - - public void setExternalInterfaces(List externalInterfaces) { - this.externalInterfaces = externalInterfaces; - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/RefSemantic.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/RefSemantic.java deleted file mode 100644 index e6df4e23..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/RefSemantic.java +++ /dev/null @@ -1,33 +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 io.adminshell.aas.v3.dataformat.aml.model.caex; - -public class RefSemantic { - - public RefSemantic(String correspondingAttributePath) { - this.correspondingAttributePath = correspondingAttributePath; - } - - private String correspondingAttributePath; - - public String getCorrespondingAttributePath() { - return correspondingAttributePath; - } - - public void setCorrespondingAttributePath(String correspondingAttributePath) { - this.correspondingAttributePath = correspondingAttributePath; - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/RoleRequirements.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/RoleRequirements.java deleted file mode 100644 index 31ddf13b..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/caex/RoleRequirements.java +++ /dev/null @@ -1,53 +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 io.adminshell.aas.v3.dataformat.aml.model.caex; - -import java.util.List; - -public class RoleRequirements { - - private String refBaseRoleClassPath; - - private List attributes; - - public RoleRequirements() { - } - - public RoleRequirements(String refBaseRoleClassPath) { - this.refBaseRoleClassPath = refBaseRoleClassPath; - } - - public RoleRequirements(String refBaseRoleClassPath, List attributes) { - this.refBaseRoleClassPath = refBaseRoleClassPath; - this.attributes = attributes; - } - - public String getRefBaseRoleClassPath() { - return refBaseRoleClassPath; - } - - public void setRefBaseRoleClassPath(String refBaseRoleClassPath) { - this.refBaseRoleClassPath = refBaseRoleClassPath; - } - - public List getAttributes() { - return attributes; - } - - public void setAttributes(List attributes) { - this.attributes = attributes; - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/AdditionalInformationMixin.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/AdditionalInformationMixin.java deleted file mode 100644 index 3c68b580..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/AdditionalInformationMixin.java +++ /dev/null @@ -1,40 +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 io.adminshell.aas.v3.dataformat.aml.model.mixin; - -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; - -public class AdditionalInformationMixin { - - public AdditionalInformationMixin() { - } - - public AdditionalInformationMixin(String automationMLVersion) { - this.automationMLVersion = automationMLVersion; - } - - @JacksonXmlProperty(localName = "AutomationMLVersion", isAttribute = true) - private String automationMLVersion; - - public String getAutomationMLVersion() { - return automationMLVersion; - } - - public void setAutomationMLVersion(String automationMLVersion) { - this.automationMLVersion = automationMLVersion; - } - -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/AttributeMixin.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/AttributeMixin.java deleted file mode 100644 index a0356c55..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/AttributeMixin.java +++ /dev/null @@ -1,106 +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 io.adminshell.aas.v3.dataformat.aml.model.mixin; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import io.adminshell.aas.v3.dataformat.aml.model.caex.RefSemantic; - -import java.util.List; - -@JsonInclude(JsonInclude.Include.NON_NULL) -public class AttributeMixin { - - public AttributeMixin(String name, String attributeDataType, String description, String value, RefSemantic refSemantic, List attributes) { - this.name = name; - this.attributeDataType = attributeDataType; - this.description = description; - this.value = value; - this.refSemantic = refSemantic; - this.attributes = attributes; - } - - public AttributeMixin() { - } - - @JacksonXmlProperty(localName = "Name", isAttribute = true) - private String name; - - @JacksonXmlProperty(localName = "AttributeDataType", isAttribute = true) - private String attributeDataType; - - @JacksonXmlProperty(localName = "Description") - private String description; - - @JacksonXmlProperty(localName = "Value") - private String value; - - @JacksonXmlProperty(localName = "RefSemantic") - private RefSemantic refSemantic; - - @JacksonXmlProperty(localName = "Attribute") - @JacksonXmlElementWrapper(useWrapping = false) - private List attributes; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getAttributeDataType() { - return attributeDataType; - } - - public void setAttributeDataType(String attributeDataType) { - this.attributeDataType = attributeDataType; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } - - public RefSemantic getRefSemantic() { - return refSemantic; - } - - public void setRefSemantic(RefSemantic refSemantic) { - this.refSemantic = refSemantic; - } - - public List getAttributes() { - return attributes; - } - - public void setAttributes(List attributes) { - this.attributes = attributes; - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/CAEXMixin.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/CAEXMixin.java deleted file mode 100644 index 395e620d..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/CAEXMixin.java +++ /dev/null @@ -1,138 +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 io.adminshell.aas.v3.dataformat.aml.model.mixin; - -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; - -import java.util.List; - -public class CAEXMixin { - - public CAEXMixin(String xmlns, String xsi, String fileName, String schemaVersion, AdditionalInformationMixin additionalInformation, InstanceHierarchyMixin instanceHierarchy) { - this.xmlns = xmlns; - this.xsi = xsi; - this.fileName = fileName; - this.schemaVersion = schemaVersion; - this.additionalInformation = additionalInformation; - this.instanceHierarchy = instanceHierarchy; - } - - public CAEXMixin() { - } - - @JacksonXmlProperty(localName = "xmlns:xsi", isAttribute = true) - private String xmlns; - - @JacksonXmlProperty(localName = "xsi:noNamespaceSchemaLocation", isAttribute = true) - private String xsi; - - @JacksonXmlProperty(localName = "FileName", isAttribute = true) - private String fileName; - - @JacksonXmlProperty(localName = "SchemaVersion", isAttribute = true) - private String schemaVersion; - - @JacksonXmlProperty(localName = "AdditionalInformation") - private AdditionalInformationMixin additionalInformation; - - @JacksonXmlProperty(localName = "InstanceHierarchy") - private InstanceHierarchyMixin instanceHierarchy; - - @JacksonXmlProperty(localName = "InterfaceClassLib") - @JacksonXmlElementWrapper(useWrapping = false) - private List interfaceClassLibs; - - @JacksonXmlProperty(localName = "RoleClassLib") - @JacksonXmlElementWrapper(useWrapping = false) - private List roleClassLibs; - - @JacksonXmlProperty(localName = "SystemUnitClassLib") - @JacksonXmlElementWrapper(useWrapping = false) - private List systemUnitClassLibs; - - public String getXmlns() { - return xmlns; - } - - public void setXmlns(String xmlns) { - this.xmlns = xmlns; - } - - public String getXsi() { - return xsi; - } - - public void setXsi(String xsi) { - this.xsi = xsi; - } - - public String getFileName() { - return fileName; - } - - public void setFileName(String fileName) { - this.fileName = fileName; - } - - public String getSchemaVersion() { - return schemaVersion; - } - - public void setSchemaVersion(String schemaVersion) { - this.schemaVersion = schemaVersion; - } - - public AdditionalInformationMixin getAdditionalInformation() { - return additionalInformation; - } - - public void setAdditionalInformation(AdditionalInformationMixin additionalInformation) { - this.additionalInformation = additionalInformation; - } - - public InstanceHierarchyMixin getInstanceHierarchy() { - return instanceHierarchy; - } - - public void setInstanceHierarchy(InstanceHierarchyMixin instanceHierarchy) { - this.instanceHierarchy = instanceHierarchy; - } - - public List getInterfaceClassLibs() { - return interfaceClassLibs; - } - - public void setInterfaceClassLibs(List interfaceClassLibs) { - this.interfaceClassLibs = interfaceClassLibs; - } - - public List getRoleClassLibs() { - return roleClassLibs; - } - - public void setRoleClassLibs(List roleClassLibs) { - this.roleClassLibs = roleClassLibs; - } - - public List getSystemUnitClassLibs() { - return systemUnitClassLibs; - } - - public void setSystemUnitClassLibs(List systemUnitClassLibs) { - this.systemUnitClassLibs = systemUnitClassLibs; - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/ExternalInterfaceMixin.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/ExternalInterfaceMixin.java deleted file mode 100644 index d3782b95..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/ExternalInterfaceMixin.java +++ /dev/null @@ -1,79 +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 io.adminshell.aas.v3.dataformat.aml.model.mixin; - -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; - -import java.util.List; - -public class ExternalInterfaceMixin { - - public ExternalInterfaceMixin(String name, String id, String refBaseClassPath, List attributes) { - this.name = name; - this.id = id; - this.refBaseClassPath = refBaseClassPath; - this.attributes = attributes; - } - - public ExternalInterfaceMixin() { - } - - @JacksonXmlProperty(localName = "Name", isAttribute = true) - private String name; - - @JacksonXmlProperty(localName = "Id", isAttribute = true) - private String id; - - @JacksonXmlProperty(localName = "RefBaseClassPath", isAttribute = true) - private String refBaseClassPath; - - @JacksonXmlProperty(localName = "Attribute") - @JacksonXmlElementWrapper(useWrapping = false) - private List attributes; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getRefBaseClassPath() { - return refBaseClassPath; - } - - public void setRefBaseClassPath(String refBaseClassPath) { - this.refBaseClassPath = refBaseClassPath; - } - - public List getAttributes() { - return attributes; - } - - public void setAttributes(List attributes) { - this.attributes = attributes; - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/InstanceHierarchyMixin.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/InstanceHierarchyMixin.java deleted file mode 100644 index da602b45..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/InstanceHierarchyMixin.java +++ /dev/null @@ -1,67 +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 io.adminshell.aas.v3.dataformat.aml.model.mixin; - -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; - -import java.util.List; - -public class InstanceHierarchyMixin { - - public InstanceHierarchyMixin(String name, String version, List internalElements) { - this.name = name; - this.version = version; - this.internalElements = internalElements; - } - - public InstanceHierarchyMixin() { - } - - @JacksonXmlProperty(localName = "Name", isAttribute = true) - private String name; - - @JacksonXmlProperty(localName = "Version") - private String version; - - @JacksonXmlProperty(localName = "InternalElement") - @JacksonXmlElementWrapper(useWrapping = false) - private List internalElements; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getVersion() { - return version; - } - - public void setVersion(String version) { - this.version = version; - } - - public List getInternalElements() { - return internalElements; - } - - public void setInternalElements(List internalElements) { - this.internalElements = internalElements; - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/InternalElementMixin.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/InternalElementMixin.java deleted file mode 100644 index 31d7d55c..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/InternalElementMixin.java +++ /dev/null @@ -1,107 +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 io.adminshell.aas.v3.dataformat.aml.model.mixin; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; - -import java.util.List; - -@JsonInclude(JsonInclude.Include.NON_NULL) -public class InternalElementMixin { - - public InternalElementMixin(String name, String id, RoleRequirementsMixin roleRequirements, List internalElements, List attributes, List externalInterfaces) { - this.name = name; - this.id = id; - this.roleRequirements = roleRequirements; - this.internalElements = internalElements; - this.attributes = attributes; - this.externalInterfaces = externalInterfaces; - } - - public InternalElementMixin() { - } - - @JacksonXmlProperty(localName = "Name", isAttribute = true) - private String name; - - @JacksonXmlProperty(localName = "Id", isAttribute = true) - private String id; - - @JacksonXmlProperty(localName = "RoleRequirements") - private RoleRequirementsMixin roleRequirements; - - @JacksonXmlProperty(localName = "InternalElement") - @JacksonXmlElementWrapper(useWrapping = false) - private List internalElements; - - @JacksonXmlProperty(localName = "Attribute") - @JacksonXmlElementWrapper(useWrapping = false) - private List attributes; - - @JacksonXmlProperty(localName = "ExternalInterface") - @JacksonXmlElementWrapper(useWrapping = false) - private List externalInterfaces; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public RoleRequirementsMixin getRoleRequirements() { - return roleRequirements; - } - - public void setRoleRequirements(RoleRequirementsMixin roleRequirements) { - this.roleRequirements = roleRequirements; - } - - public List getInternalElements() { - return internalElements; - } - - public void setInternalElements(List internalElements) { - this.internalElements = internalElements; - } - - public List getAttributes() { - return attributes; - } - - public void setAttributes(List attributes) { - this.attributes = attributes; - } - - public List getExternalInterfaces() { - return externalInterfaces; - } - - public void setExternalInterfaces(List externalInterfaces) { - this.externalInterfaces = externalInterfaces; - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/RefSemanticMixin.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/RefSemanticMixin.java deleted file mode 100644 index e25331ae..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/RefSemanticMixin.java +++ /dev/null @@ -1,39 +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 io.adminshell.aas.v3.dataformat.aml.model.mixin; - -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; - -public class RefSemanticMixin { - - public RefSemanticMixin(String correspondingAttributePath) { - this.correspondingAttributePath = correspondingAttributePath; - } - - public RefSemanticMixin() { - } - - @JacksonXmlProperty(localName = "CorrespondingAttributePath", isAttribute = true) - private String correspondingAttributePath; - - public String getCorrespondingAttributePath() { - return correspondingAttributePath; - } - - public void setCorrespondingAttributePath(String correspondingAttributePath) { - this.correspondingAttributePath = correspondingAttributePath; - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/RoleRequirementsMixin.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/RoleRequirementsMixin.java deleted file mode 100644 index d2a6adce..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/model/mixin/RoleRequirementsMixin.java +++ /dev/null @@ -1,55 +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 io.adminshell.aas.v3.dataformat.aml.model.mixin; - -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; - -import java.util.List; - -public class RoleRequirementsMixin { - - public RoleRequirementsMixin(String refBaseRoleClassPath, List attributes) { - this.refBaseRoleClassPath = refBaseRoleClassPath; - this.attributes = attributes; - } - - public RoleRequirementsMixin() { - } - - @JacksonXmlProperty(localName = "RefBaseRoleClassPath", isAttribute = true) - private String refBaseRoleClassPath; - - @JacksonXmlProperty(localName = "Attribute") - @JacksonXmlElementWrapper(useWrapping = false) - private List attributes; - - public String getRefBaseRoleClassPath() { - return refBaseRoleClassPath; - } - - public void setRefBaseRoleClassPath(String refBaseRoleClassPath) { - this.refBaseRoleClassPath = refBaseRoleClassPath; - } - - public List getAttributes() { - return attributes; - } - - public void setAttributes(List attributes) { - this.attributes = attributes; - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/AASEnvironmentMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/AASEnvironmentMapper.java deleted file mode 100644 index 52cce6f7..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/AASEnvironmentMapper.java +++ /dev/null @@ -1,281 +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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper; - -import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElement; -import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter.AdministrativeInformationToAttributeConverter; -import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter.AllowDuplicatesToAttributeConverter; -import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter.AssetKindToAttributeConverter; -import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter.BillOfMaterialToAttributeConverter; -import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter.CategoryToAttributeConverter; -import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter.DerivedFromToAttributeConverter; -import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter.DescriptionToAttributeConverter; -import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter.EntityTypeToAttributeConverter; -import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter.IdShortToAttributeConverter; -import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter.IdShortToNameConverter; -import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter.IdentificationModelToAttributeConverter; -import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter.IdentificationToAttributeConverter; -import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter.ModelingKindToAttributeConverter; -import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter.ObservedToAttributeConverter; -import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter.OrderedToAttributeConverter; -import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter.SemanticIdToAttributeConverter; -import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter.ValueIdToAttributeConverter; -import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper.AnnotatedRelationshipElementMapper; -import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper.AssetAdministrationShellMapper; -import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper.BasicEventMapper; -import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper.BlobMapper; -import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper.CapabilityMapper; -import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper.EntityMapper; -import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper.FileMapper; -import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper.IdentifiableMapper; -import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper.MultiLanguagePropertyMapper; -import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper.OperationMapper; -import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper.PropertyMapper; -import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper.RangeMapper; -import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper.ReferableMapper; -import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper.ReferenceElementMapper; -import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper.RelationshipElementMapper; -import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper.SubmodelElementCollectionMapper; -import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper.SubmodelElementMapper; -import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper.SubmodelMapper; -import io.adminshell.aas.v3.model.*; -import ma.glasnost.orika.MapperFactory; -import ma.glasnost.orika.impl.ConfigurableMapper; - - -public class AASEnvironmentMapper extends ConfigurableMapper { - - @Override - protected void configure(MapperFactory factory) { - // Register converter - factory.getConverterFactory() - .registerConverter(IdShortToNameConverter.class.getName(), new IdShortToNameConverter()); - factory.getConverterFactory() - .registerConverter(IdentificationToAttributeConverter.class.getName(), new IdentificationToAttributeConverter()); - factory.getConverterFactory() - .registerConverter(IdShortToAttributeConverter.class.getName(), new IdShortToAttributeConverter()); - factory.getConverterFactory() - .registerConverter(AssetKindToAttributeConverter.class.getName(), new AssetKindToAttributeConverter()); - factory.getConverterFactory() - .registerConverter(CategoryToAttributeConverter.class.getName(), new CategoryToAttributeConverter()); - factory.getConverterFactory() - .registerConverter(IdentificationModelToAttributeConverter.class.getName(), new IdentificationModelToAttributeConverter()); - factory.getConverterFactory() - .registerConverter(AdministrativeInformationToAttributeConverter.class.getName(), new AdministrativeInformationToAttributeConverter()); - factory.getConverterFactory() - .registerConverter(DescriptionToAttributeConverter.class.getName(), new DescriptionToAttributeConverter()); - factory.getConverterFactory() - .registerConverter(DerivedFromToAttributeConverter.class.getName(), new DerivedFromToAttributeConverter()); - factory.getConverterFactory() - .registerConverter(ModelingKindToAttributeConverter.class.getName(), new ModelingKindToAttributeConverter()); - factory.getConverterFactory() - .registerConverter(SemanticIdToAttributeConverter.class.getName(), new SemanticIdToAttributeConverter()); - factory.getConverterFactory() - .registerConverter(ValueIdToAttributeConverter.class.getName(), new ValueIdToAttributeConverter()); - factory.getConverterFactory() - .registerConverter(AllowDuplicatesToAttributeConverter.class.getName(), new AllowDuplicatesToAttributeConverter()); - factory.getConverterFactory() - .registerConverter(OrderedToAttributeConverter.class.getName(), new OrderedToAttributeConverter()); - factory.getConverterFactory() - .registerConverter(BillOfMaterialToAttributeConverter.class.getName(), new BillOfMaterialToAttributeConverter()); - factory.getConverterFactory() - .registerConverter(EntityTypeToAttributeConverter.class.getName(), new EntityTypeToAttributeConverter()); - factory.getConverterFactory() - .registerConverter(ObservedToAttributeConverter.class.getName(), new ObservedToAttributeConverter()); - - // Referable mapping - factory.classMap(Referable.class, InternalElement.class) - .mapNulls(true) - .fieldMap("idShort", "name") - .converter(IdShortToNameConverter.class.getName()).add() - .fieldMap("idShort", "attributes[0]") - .converter(IdShortToAttributeConverter.class.getName()).add() - .fieldMap("category", "attributes[1]") - .converter(CategoryToAttributeConverter.class.getName()).add() - .fieldMap("descriptions", "attributes[2]") - .converter(DescriptionToAttributeConverter.class.getName()).add() - .byDefault() - .customize(new ReferableMapper()) - .register(); - - // Identifiable mapping - factory.classMap(Identifiable.class, InternalElement.class) - .mapNulls(true) - .fieldMap("identification", "attributes[0]") - .converter(IdentificationToAttributeConverter.class.getName()).add() - .fieldMap("administration", "attributes[1]") - .converter(AdministrativeInformationToAttributeConverter.class.getName()).add() - .byDefault() - .customize(new IdentifiableMapper()) - .register(); - - // AssetAdministrationShell mapping - factory.classMap(AssetAdministrationShell.class, InternalElement.class) - .mapNulls(true) - .fieldMap("derivedFrom", "attributes[0]") - .converter(DerivedFromToAttributeConverter.class.getName()).add() - .byDefault() - .customize(new AssetAdministrationShellMapper()) - .register(); - -// // Asset information mapping -// factory.classMap(AssetInformation.class, InternalElement.class) -// .mapNulls(true) -// .fieldMap("assetKind", "attributes[0]") -// .converter(AssetKindToAttributeConverter.class.getName()).add() -// .byDefault() -// .customize(new AssetInformationMapper()) -// .register(); - - // Deprecated since v3 - // Asset mapping -// factory.classMap(Asset.class, InternalElement.class) -// .mapNulls(true) -// .fieldMap("kind", "attributes[0]") -// .converter(AssetKindToAttributeConverter.class.getName()).add() -// .fieldMap("assetIdentificationModel", "attributes[1]") -// .converter(IdentificationModelToAttributeConverter.class.getName()).add() -// .fieldMap("billOfMaterial", "attributes[2]") -// .converter(BillOfMaterialToAttributeConverter.class.getName()).add() -// .byDefault() -// .customize(new AssetMapper()) -// .register(); - - // Submodel mapping - factory.classMap(Submodel.class, InternalElement.class) - .mapNulls(true) - .fieldMap("kind", "attributes[0]") - .converter(ModelingKindToAttributeConverter.class.getName()).add() - .fieldMap("semanticId", "attributes[1]") - .converter(SemanticIdToAttributeConverter.class.getName()).add() - .byDefault() - .customize(new SubmodelMapper()) - .register(); - - // SubmodelElement mapping - factory.classMap(SubmodelElement.class, InternalElement.class) - .mapNulls(true) - .fieldMap("kind", "attributes[0]") - .converter(ModelingKindToAttributeConverter.class.getName()).add() - .fieldMap("semanticId", "attributes[1]") - .converter(SemanticIdToAttributeConverter.class.getName()).add() - .byDefault() - .customize(new SubmodelElementMapper()) - .register(); - - // SubmodelElementCollection mapping - factory.classMap(SubmodelElementCollection.class, InternalElement.class) - .mapNulls(true) - .fieldMap("ordered", "attributes[0]") - .converter(OrderedToAttributeConverter.class.getName()).add() - .fieldMap("allowDuplicates", "attributes[1]") - .converter(AllowDuplicatesToAttributeConverter.class.getName()).add() - .byDefault() - .customize(new SubmodelElementCollectionMapper()) - .register(); - - // Operation mapping - factory.classMap(Operation.class, InternalElement.class) - .mapNulls(true) - .byDefault() - .customize(new OperationMapper()) - .register(); - - // File mapping - factory.classMap(File.class, InternalElement.class) - .mapNulls(true) - .byDefault() - .customize(new FileMapper()) - .register(); - - // Capability mapping - factory.classMap(Capability.class, InternalElement.class) - .mapNulls(true) - .byDefault() - .customize(new CapabilityMapper()) - .register(); - - // Entity mapping - factory.classMap(Entity.class, InternalElement.class) - .mapNulls(true) - .fieldMap("entityType", "attributes[0]") - .converter(EntityTypeToAttributeConverter.class.getName()).add() - .byDefault() - .customize(new EntityMapper()) - .register(); - - // Property mapping - factory.classMap(Property.class, InternalElement.class) - .mapNulls(true) - .fieldMap("valueId", "attributes[0]") - .converter(ValueIdToAttributeConverter.class.getName()).add() - .byDefault() - .customize(new PropertyMapper()) - .register(); - - // Event mapping - factory.classMap(BasicEvent.class, InternalElement.class) - .mapNulls(true) - .fieldMap("observed", "attributes[0]") - .converter(ObservedToAttributeConverter.class.getName()).add() - .byDefault() - .customize(new BasicEventMapper()) - .register(); - - // Blob mapping - factory.classMap(Blob.class, InternalElement.class) - .mapNulls(true) - .byDefault() - .customize(new BlobMapper()) - .register(); - - // Range mapping - factory.classMap(Range.class, InternalElement.class) - .mapNulls(true) - .byDefault() - .customize(new RangeMapper()) - .register(); - - // ReferenceElement mapping - factory.classMap(ReferenceElement.class, InternalElement.class) - .mapNulls(true) - .byDefault() - .customize(new ReferenceElementMapper()) - .register(); - - // ReferenceElement mapping - factory.classMap(MultiLanguageProperty.class, InternalElement.class) - .mapNulls(true) - .byDefault() - .customize(new MultiLanguagePropertyMapper()) - .register(); - - // RelationshipElement mapping - factory.classMap(RelationshipElement.class, InternalElement.class) - .mapNulls(true) - .byDefault() - .customize(new RelationshipElementMapper()) - .register(); - - // AnnotatedRelationshipElement mapping - factory.classMap(AnnotatedRelationshipElement.class, InternalElement.class) - .mapNulls(true) - .byDefault() - .customize(new AnnotatedRelationshipElementMapper()) - .register(); - - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/AdministrativeInformationToAttributeConverter.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/AdministrativeInformationToAttributeConverter.java deleted file mode 100644 index 56ac90f3..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/AdministrativeInformationToAttributeConverter.java +++ /dev/null @@ -1,64 +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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter; - -import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; -import io.adminshell.aas.v3.dataformat.aml.model.caex.Attribute; -import io.adminshell.aas.v3.dataformat.aml.model.caex.RefSemantic; -import io.adminshell.aas.v3.model.AdministrativeInformation; -import java.util.ArrayList; -import java.util.List; -import ma.glasnost.orika.CustomConverter; -import ma.glasnost.orika.MappingContext; -import ma.glasnost.orika.metadata.Type; - -public class AdministrativeInformationToAttributeConverter extends CustomConverter { - - @Override - public Attribute convert(AdministrativeInformation source, Type destinationType, MappingContext mappingContext) { - // Root attribute - Attribute attribute = new Attribute( - "administration", - null, - null, - null, - new RefSemantic(AASNamespace.Identifiable_Administration.getRefSemantic()), - null - ); - - // Nested attributes - List nestedAttributes = new ArrayList<>(); - nestedAttributes.add(new Attribute( - "version", - null, - null, - source.getVersion(), - new RefSemantic(AASNamespace.AdministrationInformation_Version.getRefSemantic()), - null - )); - nestedAttributes.add(new Attribute( - "revision", - null, - null, - source.getRevision(), - new RefSemantic(AASNamespace.AdministrationInformation_Revision.getRefSemantic()), - null) - ); - attribute.setAttributes(nestedAttributes); - - return attribute; - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/AllowDuplicatesToAttributeConverter.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/AllowDuplicatesToAttributeConverter.java deleted file mode 100644 index a1a0e7f4..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/AllowDuplicatesToAttributeConverter.java +++ /dev/null @@ -1,37 +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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter; - -import io.adminshell.aas.v3.dataformat.aml.model.caex.Attribute; -import io.adminshell.aas.v3.dataformat.aml.model.caex.RefSemantic; -import ma.glasnost.orika.CustomConverter; -import ma.glasnost.orika.MappingContext; -import ma.glasnost.orika.metadata.Type; - -public class AllowDuplicatesToAttributeConverter extends CustomConverter { - - @Override - public Attribute convert(Boolean source, Type destinationType, MappingContext mappingContext) { - return new Attribute( - "allowDuplicates", - "xs:boolean", - null, - source.toString(), - new RefSemantic("AAS:SubmodelElementCollection/allowDuplicates"), - null - ); - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/AssetKindToAttributeConverter.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/AssetKindToAttributeConverter.java deleted file mode 100644 index 75c345e0..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/AssetKindToAttributeConverter.java +++ /dev/null @@ -1,40 +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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter; - -import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; -import io.adminshell.aas.v3.dataformat.aml.model.caex.Attribute; -import io.adminshell.aas.v3.dataformat.aml.model.caex.RefSemantic; -import io.adminshell.aas.v3.model.*; -import ma.glasnost.orika.CustomConverter; -import ma.glasnost.orika.MappingContext; -import ma.glasnost.orika.metadata.Type; - -public class AssetKindToAttributeConverter extends CustomConverter { - - @Override - public Attribute convert(AssetKind source, Type destinationType, MappingContext mappingContext) { - return new Attribute( - "assetKind", - null, - null, - source.toString(), - new RefSemantic(AASNamespace.Asset_Kind.getRefSemantic()), - null); - } - - -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/BillOfMaterialToAttributeConverter.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/BillOfMaterialToAttributeConverter.java deleted file mode 100644 index 9b61701f..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/BillOfMaterialToAttributeConverter.java +++ /dev/null @@ -1,40 +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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter; - -import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; -import io.adminshell.aas.v3.dataformat.aml.model.caex.Attribute; -import io.adminshell.aas.v3.dataformat.aml.model.caex.RefSemantic; -import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.util.ReferenceConverterUtil; -import io.adminshell.aas.v3.model.*; -import ma.glasnost.orika.CustomConverter; -import ma.glasnost.orika.MappingContext; -import ma.glasnost.orika.metadata.Type; - -public class BillOfMaterialToAttributeConverter extends CustomConverter { - - @Override - public Attribute convert(Reference source, Type destinationType, MappingContext mappingContext) { - return new Attribute( - "billOfMaterial", - null, - null, - ReferenceConverterUtil.convert(source), - new RefSemantic(AASNamespace.Asset_BillOfMaterial.getRefSemantic()), - null - ); - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/CategoryToAttributeConverter.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/CategoryToAttributeConverter.java deleted file mode 100644 index e7048c4b..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/CategoryToAttributeConverter.java +++ /dev/null @@ -1,38 +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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter; - -import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; -import io.adminshell.aas.v3.dataformat.aml.model.caex.Attribute; -import io.adminshell.aas.v3.dataformat.aml.model.caex.RefSemantic; -import ma.glasnost.orika.CustomConverter; -import ma.glasnost.orika.MappingContext; -import ma.glasnost.orika.metadata.Type; - -public class CategoryToAttributeConverter extends CustomConverter { - - @Override - public Attribute convert(String source, Type destinationType, MappingContext mappingContext) { - return new Attribute( - "category", - null, - null, - source, - new RefSemantic(AASNamespace.Referable_Category.getRefSemantic()), - null - ); - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/DerivedFromToAttributeConverter.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/DerivedFromToAttributeConverter.java deleted file mode 100644 index b318b88e..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/DerivedFromToAttributeConverter.java +++ /dev/null @@ -1,40 +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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter; - -import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; -import io.adminshell.aas.v3.dataformat.aml.model.caex.Attribute; -import io.adminshell.aas.v3.dataformat.aml.model.caex.RefSemantic; -import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.util.ReferenceConverterUtil; -import io.adminshell.aas.v3.model.*; -import ma.glasnost.orika.CustomConverter; -import ma.glasnost.orika.MappingContext; -import ma.glasnost.orika.metadata.Type; - -public class DerivedFromToAttributeConverter extends CustomConverter { - - @Override - public Attribute convert(Reference source, Type destinationType, MappingContext mappingContext) { - return new Attribute( - "derivedFrom", - null, - null, - ReferenceConverterUtil.convert(source), - new RefSemantic(AASNamespace.AssetAdministrationShell_DerivedFrom.getRefSemantic()), - null - ); - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/DescriptionToAttributeConverter.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/DescriptionToAttributeConverter.java deleted file mode 100644 index b8dcc05f..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/DescriptionToAttributeConverter.java +++ /dev/null @@ -1,64 +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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter; - -import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; -import io.adminshell.aas.v3.dataformat.aml.model.caex.Attribute; -import io.adminshell.aas.v3.dataformat.aml.model.caex.RefSemantic; -import io.adminshell.aas.v3.model.LangString; -import ma.glasnost.orika.CustomConverter; -import ma.glasnost.orika.MappingContext; -import ma.glasnost.orika.metadata.Type; - -import java.util.ArrayList; -import java.util.List; - -public class DescriptionToAttributeConverter extends CustomConverter, Attribute> { - - @Override - public Attribute convert(List source, Type destinationType, MappingContext mappingContext) { - if(source.isEmpty()) { - return null; - } - - // Root attribute - Attribute attribute = new Attribute( - "description", - null, - null, - null, - new RefSemantic(AASNamespace.Referable_Description.getRefSemantic()), - null - ); - - // Nested attributes - List nestedAttributes = new ArrayList<>(); - attribute.setAttributes(nestedAttributes); - - source.forEach(langString -> { - nestedAttributes.add(new Attribute( - "aml-lang=" + langString.getLanguage(), - null, - null, - langString.getValue(), - null, - null - ));; - }); - - return attribute; - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/EntityTypeToAttributeConverter.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/EntityTypeToAttributeConverter.java deleted file mode 100644 index 642e22e5..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/EntityTypeToAttributeConverter.java +++ /dev/null @@ -1,39 +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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter; - -import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; -import io.adminshell.aas.v3.dataformat.aml.model.caex.Attribute; -import io.adminshell.aas.v3.dataformat.aml.model.caex.RefSemantic; -import io.adminshell.aas.v3.model.*; -import ma.glasnost.orika.CustomConverter; -import ma.glasnost.orika.MappingContext; -import ma.glasnost.orika.metadata.Type; - -public class EntityTypeToAttributeConverter extends CustomConverter { - - @Override - public Attribute convert(EntityType source, Type destinationType, MappingContext mappingContext) { - return new Attribute( - "entityType", - null, - null, - source.name(), - new RefSemantic(AASNamespace.Entity_Type.getRefSemantic()), - null - ); - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/IdShortToAttributeConverter.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/IdShortToAttributeConverter.java deleted file mode 100644 index 5c6daded..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/IdShortToAttributeConverter.java +++ /dev/null @@ -1,43 +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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter; - -import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; -import io.adminshell.aas.v3.dataformat.aml.model.caex.Attribute; -import io.adminshell.aas.v3.dataformat.aml.model.caex.RefSemantic; -import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.util.UrlEncoderUtil; -import ma.glasnost.orika.CustomConverter; -import ma.glasnost.orika.MappingContext; -import ma.glasnost.orika.metadata.Type; - -public class IdShortToAttributeConverter extends CustomConverter { - - @Override - public Attribute convert(String source, Type destinationType, MappingContext mappingContext) { - if(source == null) { - return null; - } - - return new Attribute( - "idShort", - null, - null, - source, - new RefSemantic(AASNamespace.Referable_IdShort.getRefSemantic()), - null - ); - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/IdShortToNameConverter.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/IdShortToNameConverter.java deleted file mode 100644 index 5f4171c9..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/IdShortToNameConverter.java +++ /dev/null @@ -1,34 +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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter; - -import ma.glasnost.orika.CustomConverter; -import ma.glasnost.orika.MappingContext; -import ma.glasnost.orika.metadata.Type; - -import java.util.UUID; - -public class IdShortToNameConverter extends CustomConverter { - - @Override - public String convert(String source, Type destinationType, MappingContext mappingContext) { - if(source == null) { - return null; - } - - return source; - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/IdentificationModelToAttributeConverter.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/IdentificationModelToAttributeConverter.java deleted file mode 100644 index bdb8dc3c..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/IdentificationModelToAttributeConverter.java +++ /dev/null @@ -1,40 +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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter; - -import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; -import io.adminshell.aas.v3.dataformat.aml.model.caex.Attribute; -import io.adminshell.aas.v3.dataformat.aml.model.caex.RefSemantic; -import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.util.ReferenceConverterUtil; -import io.adminshell.aas.v3.model.*; -import ma.glasnost.orika.CustomConverter; -import ma.glasnost.orika.MappingContext; -import ma.glasnost.orika.metadata.Type; - -public class IdentificationModelToAttributeConverter extends CustomConverter { - - @Override - public Attribute convert(Reference source, Type destinationType, MappingContext mappingContext) { - return new Attribute( - "assetIdentificationModelRef", - null, - null, - ReferenceConverterUtil.convert(source), - new RefSemantic(AASNamespace.Asset_AssetIdentificationModel.getRefSemantic()), - null - ); - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/IdentificationToAttributeConverter.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/IdentificationToAttributeConverter.java deleted file mode 100644 index 447cc545..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/IdentificationToAttributeConverter.java +++ /dev/null @@ -1,65 +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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter; - -import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; -import io.adminshell.aas.v3.dataformat.aml.model.caex.Attribute; -import io.adminshell.aas.v3.dataformat.aml.model.caex.RefSemantic; -import io.adminshell.aas.v3.model.*; -import ma.glasnost.orika.CustomConverter; -import ma.glasnost.orika.MappingContext; -import ma.glasnost.orika.metadata.Type; - -import java.util.ArrayList; -import java.util.List; - -public class IdentificationToAttributeConverter extends CustomConverter { - - @Override - public Attribute convert(Identifier source, Type destinationType, MappingContext mappingContext) { - // Root attribute - Attribute attribute = new Attribute( - "identification", - null, - null, - null, - new RefSemantic(AASNamespace.Identifiable_Identification.getRefSemantic()), - null - ); - - // Nested attributes - List nestedAttributes = new ArrayList<>(); - nestedAttributes.add(new Attribute( - "idType", - null, - null, - source.getIdType().toString(), - new RefSemantic(AASNamespace.Identifier_IdType.getRefSemantic()), - null - )); - nestedAttributes.add(new Attribute( - "id", - null, - null, - source.getIdentifier(), - new RefSemantic(AASNamespace.Identifier_Id.getRefSemantic()), - null) - ); - attribute.setAttributes(nestedAttributes); - - return attribute; - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/ModelingKindToAttributeConverter.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/ModelingKindToAttributeConverter.java deleted file mode 100644 index 53ef6030..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/ModelingKindToAttributeConverter.java +++ /dev/null @@ -1,38 +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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter; - -import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; -import io.adminshell.aas.v3.dataformat.aml.model.caex.Attribute; -import io.adminshell.aas.v3.dataformat.aml.model.caex.RefSemantic; -import io.adminshell.aas.v3.model.*; -import ma.glasnost.orika.CustomConverter; -import ma.glasnost.orika.MappingContext; -import ma.glasnost.orika.metadata.Type; - -public class ModelingKindToAttributeConverter extends CustomConverter { - - @Override - public Attribute convert(ModelingKind source, Type destinationType, MappingContext mappingContext) { - return new Attribute( - "kind", - null, - null, - source.toString(), - new RefSemantic(AASNamespace.HasKind_Kind.getRefSemantic()), - null); - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/ObservedToAttributeConverter.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/ObservedToAttributeConverter.java deleted file mode 100644 index 7948b1ac..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/ObservedToAttributeConverter.java +++ /dev/null @@ -1,40 +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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter; - -import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; -import io.adminshell.aas.v3.dataformat.aml.model.caex.Attribute; -import io.adminshell.aas.v3.dataformat.aml.model.caex.RefSemantic; -import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.util.ReferenceConverterUtil; -import io.adminshell.aas.v3.model.*; -import ma.glasnost.orika.CustomConverter; -import ma.glasnost.orika.MappingContext; -import ma.glasnost.orika.metadata.Type; - -public class ObservedToAttributeConverter extends CustomConverter { - - @Override - public Attribute convert(Reference source, Type destinationType, MappingContext mappingContext) { - return new Attribute( - "observed", - null, - null, - ReferenceConverterUtil.convert(source), - new RefSemantic(AASNamespace.BasicEvent_Observed.getRefSemantic()), - null - ); - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/OrderedToAttributeConverter.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/OrderedToAttributeConverter.java deleted file mode 100644 index 462187b8..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/OrderedToAttributeConverter.java +++ /dev/null @@ -1,37 +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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter; - -import io.adminshell.aas.v3.dataformat.aml.model.caex.Attribute; -import io.adminshell.aas.v3.dataformat.aml.model.caex.RefSemantic; -import ma.glasnost.orika.CustomConverter; -import ma.glasnost.orika.MappingContext; -import ma.glasnost.orika.metadata.Type; - -public class OrderedToAttributeConverter extends CustomConverter { - - @Override - public Attribute convert(Boolean source, Type destinationType, MappingContext mappingContext) { - return new Attribute( - "ordered", - "xs:boolean", - null, - source.toString(), - new RefSemantic("AAS:SubmodelElementCollection/ordered"), - null - ); - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/PropertyValueToAttributeConverter.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/PropertyValueToAttributeConverter.java deleted file mode 100644 index cc68d3b8..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/PropertyValueToAttributeConverter.java +++ /dev/null @@ -1,39 +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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter; - -import io.adminshell.aas.v3.dataformat.aml.model.caex.Attribute; -import io.adminshell.aas.v3.dataformat.aml.model.caex.RefSemantic; -import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.util.ReferenceConverterUtil; -import io.adminshell.aas.v3.model.*; -import ma.glasnost.orika.CustomConverter; -import ma.glasnost.orika.MappingContext; -import ma.glasnost.orika.metadata.Type; - -public class PropertyValueToAttributeConverter extends CustomConverter { - - @Override - public Attribute convert(Reference source, Type destinationType, MappingContext mappingContext) { - return new Attribute( - "semanticId", - null, - null, - ReferenceConverterUtil.convert(source), - new RefSemantic("AAS:HasSemantics/semanticId"), - null - ); - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/SemanticIdToAttributeConverter.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/SemanticIdToAttributeConverter.java deleted file mode 100644 index cba70f83..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/SemanticIdToAttributeConverter.java +++ /dev/null @@ -1,40 +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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter; - -import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; -import io.adminshell.aas.v3.dataformat.aml.model.caex.Attribute; -import io.adminshell.aas.v3.dataformat.aml.model.caex.RefSemantic; -import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.util.ReferenceConverterUtil; -import io.adminshell.aas.v3.model.*; -import ma.glasnost.orika.CustomConverter; -import ma.glasnost.orika.MappingContext; -import ma.glasnost.orika.metadata.Type; - -public class SemanticIdToAttributeConverter extends CustomConverter { - - @Override - public Attribute convert(Reference source, Type destinationType, MappingContext mappingContext) { - return new Attribute( - "semanticId", - null, - null, - ReferenceConverterUtil.convert(source), - new RefSemantic(AASNamespace.HasSemantics_SemanticId.getRefSemantic()), - null - ); - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/ValueIdToAttributeConverter.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/ValueIdToAttributeConverter.java deleted file mode 100644 index af692051..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/converter/ValueIdToAttributeConverter.java +++ /dev/null @@ -1,40 +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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.converter; - -import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; -import io.adminshell.aas.v3.dataformat.aml.model.caex.Attribute; -import io.adminshell.aas.v3.dataformat.aml.model.caex.RefSemantic; -import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.util.ReferenceConverterUtil; -import io.adminshell.aas.v3.model.*; -import ma.glasnost.orika.CustomConverter; -import ma.glasnost.orika.MappingContext; -import ma.glasnost.orika.metadata.Type; - -public class ValueIdToAttributeConverter extends CustomConverter { - - @Override - public Attribute convert(Reference source, Type destinationType, MappingContext mappingContext) { - return new Attribute( - "valueId", - null, - null, - ReferenceConverterUtil.convert(source), - new RefSemantic(AASNamespace.Property_ValueId.getRefSemantic()), - null - ); - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/AnnotatedRelationshipElementMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/AnnotatedRelationshipElementMapper.java deleted file mode 100644 index 8d77546f..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/AnnotatedRelationshipElementMapper.java +++ /dev/null @@ -1,31 +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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper; - -import io.adminshell.aas.v3.dataformat.aml.model.caex.AssetAdministrationShellRoleClassLib; -import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElement; -import io.adminshell.aas.v3.dataformat.aml.model.caex.RoleRequirements; -import io.adminshell.aas.v3.model.*; -import ma.glasnost.orika.CustomMapper; -import ma.glasnost.orika.MappingContext; - -public class AnnotatedRelationshipElementMapper extends CustomMapper { - - @Override - public void mapAtoB(AnnotatedRelationshipElement annotatedRelationshipElement, InternalElement internalElement, MappingContext context) { - internalElement.setRoleRequirements(new RoleRequirements(AssetAdministrationShellRoleClassLib.AnnotatedRelationshipElement.getRefBaseRoleClassPath())); - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/AssetAdministrationShellMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/AssetAdministrationShellMapper.java deleted file mode 100644 index 52c72aa0..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/AssetAdministrationShellMapper.java +++ /dev/null @@ -1,127 +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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper; - -import io.adminshell.aas.v3.dataformat.aml.model.caex.*; -import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.util.ReferenceConverterUtil; -import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.util.UrlEncoderUtil; -import io.adminshell.aas.v3.model.AssetAdministrationShell; -import ma.glasnost.orika.CustomMapper; -import ma.glasnost.orika.MappingContext; - -import java.util.ArrayList; -import java.util.Objects; - -public class AssetAdministrationShellMapper extends CustomMapper { - - @Override - public void mapAtoB(AssetAdministrationShell assetAdministrationShell, InternalElement internalElement, MappingContext context) { - internalElement.setRoleRequirements(new RoleRequirements(AssetAdministrationShellRoleClassLib.AssetAdministrationShell.getRefBaseRoleClassPath())); - - // Set name and idShort by identification if idShort is not given - if (assetAdministrationShell.getIdShort().equals("") || assetAdministrationShell.getIdShort() == null) { - String idShort = UrlEncoderUtil.encode(assetAdministrationShell.getIdentification().getIdentifier()); - // Set AssetAdministrationShell name - internalElement.setName(idShort); - // Set idShort - internalElement.getAttributes().stream() - .filter(Objects::nonNull) - .filter(attribute -> attribute.getName().equals("idShort")).findAny().get().setValue(idShort); - } - - // AssetInformation - Attribute assetInformation = new Attribute( - "assetInformation", - null, - null, - null, - new RefSemantic(AASNamespace.AssetAdministrationShell_AssetInformation.getRefSemantic()), - null - ); - assetInformation.setAttributes(new ArrayList<>()); - assetInformation.getAttributes().add(new Attribute( - "assetKind", - null, - null, - assetAdministrationShell.getAssetInformation().getAssetKind().name(), - new RefSemantic(AASNamespace.AssetInformation_AssetKind.getRefSemantic()), - null - )); - assetInformation.getAttributes().add(new Attribute( - "globalAssetId", - null, - null, - ReferenceConverterUtil.convert(assetAdministrationShell.getAssetInformation().getGlobalAssetId()), - new RefSemantic(AASNamespace.AssetInformation_GlobalAssetId.getRefSemantic()), - null - )); - internalElement.getAttributes().add(assetInformation); - - // Submodels - assetAdministrationShell.getSubmodels().forEach(submodel -> { - Attribute submodels = new Attribute( - "submodel", - null, - null, - null, - new RefSemantic(AASNamespace.AssetAdministrationShell_Submodels.getRefSemantic()), - null - ); - submodels.setAttributes(new ArrayList<>()); - submodels.getAttributes().add(new Attribute( - "reference", - null, - null, - ReferenceConverterUtil.convert(submodel), - new RefSemantic(AASNamespace.ReferenceElement_Value.getRefSemantic()), - null - )); - internalElement.getAttributes().add(submodels); - }); - - // View - assetAdministrationShell.getViews().forEach(view -> { - Attribute views = new Attribute( - "view", - null, - null, - null, - new RefSemantic(AASNamespace.AssetAdministrationShell_View.getRefSemantic()), - null - ); - views.setAttributes(new ArrayList<>()); - views.getAttributes().add(new Attribute( - "idShort", - null, - null, - view.getIdShort(), - new RefSemantic(AASNamespace.View_IdShort.getRefSemantic()), - null - )); - if(!view.getContainedElements().isEmpty()) { - views.getAttributes().add(new Attribute( - "containedElement", - null, - null, - ReferenceConverterUtil.convert(view.getContainedElements().get(0)), - new RefSemantic(AASNamespace.View_ContainedElement.getRefSemantic()), - null - )); - } - internalElement.getAttributes().add(views); - }); - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/AssetInformationMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/AssetInformationMapper.java deleted file mode 100644 index cbbd8c10..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/AssetInformationMapper.java +++ /dev/null @@ -1,108 +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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper; - -import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; -import io.adminshell.aas.v3.dataformat.aml.model.caex.AssetAdministrationShellRoleClassLib; -import io.adminshell.aas.v3.dataformat.aml.model.caex.Attribute; -import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElement; -import io.adminshell.aas.v3.dataformat.aml.model.caex.RefSemantic; -import io.adminshell.aas.v3.dataformat.aml.model.caex.RoleRequirements; -import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.util.FileConverterUtil; -import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.util.ReferenceConverterUtil; -import io.adminshell.aas.v3.model.AssetInformation; -import ma.glasnost.orika.CustomMapper; -import ma.glasnost.orika.MappingContext; - -import java.util.ArrayList; - -public class AssetInformationMapper extends CustomMapper { - - @Override - public void mapAtoB(AssetInformation assetInformation, InternalElement internalElement, MappingContext context) { - internalElement.setRoleRequirements(new RoleRequirements(AssetAdministrationShellRoleClassLib.AssetInformation.getRefBaseRoleClassPath())); - - // globalAssetId - internalElement.getAttributes().add(new Attribute( - "globalAssetId", - null, - null, - ReferenceConverterUtil.convert(assetInformation.getGlobalAssetId()), - new RefSemantic(AASNamespace.Asset_GlobalAssetId.getRefSemantic()), - null - )); - - // specificAssetId - Attribute attributeSpecificAssetId = new Attribute( - "specificAssetId", - null, - null, - null, - new RefSemantic(AASNamespace.Asset_GlobalAssetId.getRefSemantic()), - null - ); - attributeSpecificAssetId.setAttributes(new ArrayList<>()); - assetInformation.getSpecificAssetIds().forEach(specificAssetId -> { - attributeSpecificAssetId.getAttributes().add(new Attribute( - "key", - null, - null, - specificAssetId.getKey(), - new RefSemantic(AASNamespace.IdentifierKeyValuePair_Key.getRefSemantic()), - null - )); - attributeSpecificAssetId.getAttributes().add(new Attribute( - "value", - null, - null, - specificAssetId.getValue(), - new RefSemantic(AASNamespace.IdentifierKeyValuePair_Value.getRefSemantic()), - null - )); - internalElement.getAttributes().add(attributeSpecificAssetId); - }); - - // bill of material - Attribute attributeBillOfMaterial = new Attribute( - "billOfMaterial", - null, - null, - null, - new RefSemantic(AASNamespace.Asset_BillOfMaterial.getRefSemantic()), - null - ); - attributeBillOfMaterial.setAttributes(new ArrayList<>()); - assetInformation.getBillOfMaterials().forEach(bill -> { - attributeBillOfMaterial.getAttributes().add(new Attribute( - "reference", - null, - null, - ReferenceConverterUtil.convert(bill), - new RefSemantic(AASNamespace.BillOfMaterial_Reference.getRefSemantic()), - null - )); - internalElement.getAttributes().add(attributeBillOfMaterial); - }); - - // file - internalElement.getAttributes().add(FileConverterUtil.convert( - assetInformation.getDefaultThumbnail(), - "defaultThumbnail", - new RefSemantic(AASNamespace.Asset_DefaultThumbnail.getRefSemantic()) - )); - - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/AssetMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/AssetMapper.java deleted file mode 100644 index 40a51025..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/AssetMapper.java +++ /dev/null @@ -1,31 +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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper; - -import io.adminshell.aas.v3.dataformat.aml.model.caex.AssetAdministrationShellRoleClassLib; -import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElement; -import io.adminshell.aas.v3.dataformat.aml.model.caex.RoleRequirements; -import io.adminshell.aas.v3.model.*; -import ma.glasnost.orika.CustomMapper; -import ma.glasnost.orika.MappingContext; - -public class AssetMapper extends CustomMapper { - - @Override - public void mapAtoB(Asset asset, InternalElement internalElement, MappingContext context) { - internalElement.setRoleRequirements(new RoleRequirements(AssetAdministrationShellRoleClassLib.Asset.getRefBaseRoleClassPath())); - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/BasicEventMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/BasicEventMapper.java deleted file mode 100644 index fe242dd3..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/BasicEventMapper.java +++ /dev/null @@ -1,32 +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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper; - -import io.adminshell.aas.v3.dataformat.aml.model.caex.AssetAdministrationShellRoleClassLib; -import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElement; -import io.adminshell.aas.v3.dataformat.aml.model.caex.RoleRequirements; -import io.adminshell.aas.v3.model.*; -import ma.glasnost.orika.CustomMapper; -import ma.glasnost.orika.MappingContext; - -public class BasicEventMapper extends CustomMapper { - - @Override - public void mapAtoB(BasicEvent basicEvent, InternalElement internalElement, MappingContext context) { - internalElement.setRoleRequirements(new RoleRequirements(AssetAdministrationShellRoleClassLib.BasicEvent.getRefBaseRoleClassPath())); - - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/BlobMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/BlobMapper.java deleted file mode 100644 index bf26c6b3..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/BlobMapper.java +++ /dev/null @@ -1,65 +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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper; - -import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; -import io.adminshell.aas.v3.dataformat.aml.model.caex.AssetAdministrationShellInterfaceClassLib; -import io.adminshell.aas.v3.dataformat.aml.model.caex.AssetAdministrationShellRoleClassLib; -import io.adminshell.aas.v3.dataformat.aml.model.caex.Attribute; -import io.adminshell.aas.v3.dataformat.aml.model.caex.ExternalInterface; -import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElement; -import io.adminshell.aas.v3.dataformat.aml.model.caex.RefSemantic; -import io.adminshell.aas.v3.dataformat.aml.model.caex.RoleRequirements; -import io.adminshell.aas.v3.model.*; -import ma.glasnost.orika.CustomMapper; -import ma.glasnost.orika.MappingContext; - -import java.util.ArrayList; -import java.util.Arrays; - -public class BlobMapper extends CustomMapper { - - @Override - public void mapAtoB(Blob blob, InternalElement internalElement, MappingContext context) { - internalElement.setRoleRequirements(new RoleRequirements(AssetAdministrationShellRoleClassLib.Blob.getRefBaseRoleClassPath())); - - ExternalInterface externalInterface = new ExternalInterface(); - externalInterface.setName("FileDataReference"); - externalInterface.setRefBaseClassPath(AssetAdministrationShellInterfaceClassLib.FileDataReference.getRefBaseRoleClassPath()); - externalInterface.setAttributes(new ArrayList<>()); - externalInterface.getAttributes().add(new Attribute( - "MIMEType", - "xs:anyURI", - null, - blob.getMimeType(), - new RefSemantic(AASNamespace.Blob_MimeType.getRefSemantic()), - null - )); - externalInterface.getAttributes().add(new Attribute( - "refURI", - "xs:string", - null, - Arrays.toString(blob.getValue()), - new RefSemantic(AASNamespace.Blob_Value.getRefSemantic()), - null - )); - - if (internalElement.getExternalInterfaces() == null) { - internalElement.setExternalInterfaces(new ArrayList<>()); - } - internalElement.getExternalInterfaces().add(externalInterface); - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/CapabilityMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/CapabilityMapper.java deleted file mode 100644 index 37691a29..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/CapabilityMapper.java +++ /dev/null @@ -1,32 +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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper; - -import io.adminshell.aas.v3.dataformat.aml.model.caex.AssetAdministrationShellRoleClassLib; -import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElement; -import io.adminshell.aas.v3.dataformat.aml.model.caex.RoleRequirements; -import io.adminshell.aas.v3.model.*; -import ma.glasnost.orika.CustomMapper; -import ma.glasnost.orika.MappingContext; - -public class CapabilityMapper extends CustomMapper { - - @Override - public void mapAtoB(Capability capability, InternalElement internalElement, MappingContext context) { - internalElement.setRoleRequirements(new RoleRequirements(AssetAdministrationShellRoleClassLib.Capability.getRefBaseRoleClassPath())); - } -} - diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/EntityMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/EntityMapper.java deleted file mode 100644 index 36ae8e31..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/EntityMapper.java +++ /dev/null @@ -1,43 +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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper; - -import io.adminshell.aas.v3.dataformat.aml.model.caex.AssetAdministrationShellRoleClassLib; -import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElement; -import io.adminshell.aas.v3.dataformat.aml.model.caex.RoleRequirements; -import io.adminshell.aas.v3.model.*; -import ma.glasnost.orika.CustomMapper; -import ma.glasnost.orika.MappingContext; - -import java.util.ArrayList; -import java.util.List; - -public class EntityMapper extends CustomMapper { - - @Override - public void mapAtoB(Entity entity, InternalElement internalElement, MappingContext context) { - internalElement.setRoleRequirements(new RoleRequirements(AssetAdministrationShellRoleClassLib.Entity.getRefBaseRoleClassPath())); - - List nested = new ArrayList<>(); - - entity.getStatements().forEach(submodelElement -> { - InternalElement statementInternalElement = new InternalElement(); - nested.add(statementInternalElement); - }); - - internalElement.setInternalElements(nested); - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/FileMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/FileMapper.java deleted file mode 100644 index 9aece7f7..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/FileMapper.java +++ /dev/null @@ -1,64 +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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper; - -import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; -import io.adminshell.aas.v3.dataformat.aml.model.caex.AssetAdministrationShellInterfaceClassLib; -import io.adminshell.aas.v3.dataformat.aml.model.caex.AssetAdministrationShellRoleClassLib; -import io.adminshell.aas.v3.dataformat.aml.model.caex.Attribute; -import io.adminshell.aas.v3.dataformat.aml.model.caex.ExternalInterface; -import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElement; -import io.adminshell.aas.v3.dataformat.aml.model.caex.RefSemantic; -import io.adminshell.aas.v3.dataformat.aml.model.caex.RoleRequirements; -import io.adminshell.aas.v3.model.*; -import ma.glasnost.orika.CustomMapper; -import ma.glasnost.orika.MappingContext; - -import java.util.ArrayList; - -public class FileMapper extends CustomMapper { - - @Override - public void mapAtoB(File file, InternalElement internalElement, MappingContext context) { - internalElement.setRoleRequirements(new RoleRequirements(AssetAdministrationShellRoleClassLib.File.getRefBaseRoleClassPath())); - - ExternalInterface externalInterface = new ExternalInterface(); - externalInterface.setName("FileDataReference"); - externalInterface.setRefBaseClassPath(AssetAdministrationShellInterfaceClassLib.FileDataReference.getRefBaseRoleClassPath()); - externalInterface.setAttributes(new ArrayList<>()); - externalInterface.getAttributes().add(new Attribute( - "MIMEType", - "xs:anyURI", - null, - file.getMimeType(), - new RefSemantic(AASNamespace.File_MimeType.getRefSemantic()), - null - )); - externalInterface.getAttributes().add(new Attribute( - "refURI", - "xs:string", - null, - file.getValue(), - new RefSemantic(AASNamespace.File_Value.getRefSemantic()), - null - )); - - if (internalElement.getExternalInterfaces() == null) { - internalElement.setExternalInterfaces(new ArrayList<>()); - } - internalElement.getExternalInterfaces().add(externalInterface); - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/IdentifiableMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/IdentifiableMapper.java deleted file mode 100644 index f6ae73ea..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/IdentifiableMapper.java +++ /dev/null @@ -1,29 +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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper; - -import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElement; -import io.adminshell.aas.v3.model.Identifiable; -import ma.glasnost.orika.CustomMapper; -import ma.glasnost.orika.MappingContext; - -public class IdentifiableMapper extends CustomMapper { - - @Override - public void mapAtoB(Identifiable identifiable, InternalElement internalElement, MappingContext context) { - - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/MultiLanguagePropertyMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/MultiLanguagePropertyMapper.java deleted file mode 100644 index 8e27c6d4..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/MultiLanguagePropertyMapper.java +++ /dev/null @@ -1,71 +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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper; - -import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; -import io.adminshell.aas.v3.dataformat.aml.model.caex.AssetAdministrationShellRoleClassLib; -import io.adminshell.aas.v3.dataformat.aml.model.caex.Attribute; -import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElement; -import io.adminshell.aas.v3.dataformat.aml.model.caex.RefSemantic; -import io.adminshell.aas.v3.dataformat.aml.model.caex.RoleRequirements; -import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.util.ReferenceConverterUtil; -import io.adminshell.aas.v3.model.MultiLanguageProperty; -import ma.glasnost.orika.CustomMapper; -import ma.glasnost.orika.MappingContext; -import java.util.ArrayList; -import java.util.List; - -public class MultiLanguagePropertyMapper extends CustomMapper { - - @Override - public void mapAtoB(MultiLanguageProperty multiLanguageProperty, InternalElement internalElement, MappingContext context) { - internalElement.setRoleRequirements(new RoleRequirements(AssetAdministrationShellRoleClassLib.MultiLanguageProperty.getRefBaseRoleClassPath())); - - internalElement.getAttributes().add(new Attribute( - "valueId", - null, - null, - ReferenceConverterUtil.convert(multiLanguageProperty.getValueId()), - new RefSemantic(AASNamespace.MultiLanguageProperty_ValueId.getRefSemantic()), - null - )); - - // Language root attribute - Attribute valueAttribute = new Attribute( - "value", - null, - null, - null, - new RefSemantic(AASNamespace.MultiLanguageProperty_Value.getRefSemantic()), - null - ); - internalElement.getAttributes().add(valueAttribute); - - // Language nested attributes - List nestedAttributes = new ArrayList<>(); - valueAttribute.setAttributes(nestedAttributes); - multiLanguageProperty.getValues().forEach(langString -> { - nestedAttributes.add(new Attribute( - "aml-lang=" + langString.getLanguage(), - null, - null, - langString.getValue(), - null, - null - )); - }); - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/OperationMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/OperationMapper.java deleted file mode 100644 index 616b40d6..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/OperationMapper.java +++ /dev/null @@ -1,46 +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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper; - -import io.adminshell.aas.v3.dataformat.aml.model.caex.AssetAdministrationShellRoleClassLib; -import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElement; -import io.adminshell.aas.v3.dataformat.aml.model.caex.RoleRequirements; -import io.adminshell.aas.v3.model.Operation; -import ma.glasnost.orika.CustomMapper; -import ma.glasnost.orika.MappingContext; -import java.util.ArrayList; - -public class OperationMapper extends CustomMapper { - - @Override - public void mapAtoB(Operation operation, InternalElement internalElement, MappingContext context) { - internalElement.setRoleRequirements(new RoleRequirements(AssetAdministrationShellRoleClassLib.Operation.getRefBaseRoleClassPath())); - - InternalElement inputVar = new InternalElement(); - inputVar.setRoleRequirements(new RoleRequirements(AssetAdministrationShellRoleClassLib.OperationInputVar.getRefBaseRoleClassPath())); - - InternalElement outputVar = new InternalElement(); - outputVar.setRoleRequirements(new RoleRequirements(AssetAdministrationShellRoleClassLib.OperationOutputVar.getRefBaseRoleClassPath())); - - InternalElement inoutVar = new InternalElement(); - inoutVar.setRoleRequirements(new RoleRequirements(AssetAdministrationShellRoleClassLib.OperationInOutputVar.getRefBaseRoleClassPath())); - - internalElement.setInternalElements(new ArrayList<>()); - internalElement.getInternalElements().add(inputVar); - internalElement.getInternalElements().add(outputVar); - internalElement.getInternalElements().add(inoutVar); - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/PropertyMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/PropertyMapper.java deleted file mode 100644 index 96a7f495..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/PropertyMapper.java +++ /dev/null @@ -1,42 +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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper; - -import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; -import io.adminshell.aas.v3.dataformat.aml.model.caex.AssetAdministrationShellRoleClassLib; -import io.adminshell.aas.v3.dataformat.aml.model.caex.Attribute; -import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElement; -import io.adminshell.aas.v3.dataformat.aml.model.caex.RefSemantic; -import io.adminshell.aas.v3.dataformat.aml.model.caex.RoleRequirements; -import io.adminshell.aas.v3.model.Property; -import ma.glasnost.orika.CustomMapper; -import ma.glasnost.orika.MappingContext; - -public class PropertyMapper extends CustomMapper { - - @Override - public void mapAtoB(Property property, InternalElement internalElement, MappingContext context) { - internalElement.setRoleRequirements(new RoleRequirements(AssetAdministrationShellRoleClassLib.Property.getRefBaseRoleClassPath())); - internalElement.getAttributes().add(new Attribute( - "value", - "xs:" + property.getValueType(), - null, - property.getValue(), - new RefSemantic(AASNamespace.Property_Value.getRefSemantic()), - null - )); - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/RangeMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/RangeMapper.java deleted file mode 100644 index d05139ac..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/RangeMapper.java +++ /dev/null @@ -1,50 +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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper; - -import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; -import io.adminshell.aas.v3.dataformat.aml.model.caex.AssetAdministrationShellRoleClassLib; -import io.adminshell.aas.v3.dataformat.aml.model.caex.Attribute; -import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElement; -import io.adminshell.aas.v3.dataformat.aml.model.caex.RefSemantic; -import io.adminshell.aas.v3.dataformat.aml.model.caex.RoleRequirements; -import io.adminshell.aas.v3.model.Range; -import ma.glasnost.orika.CustomMapper; -import ma.glasnost.orika.MappingContext; - -public class RangeMapper extends CustomMapper { - - @Override - public void mapAtoB(Range range, InternalElement internalElement, MappingContext context) { - internalElement.setRoleRequirements(new RoleRequirements(AssetAdministrationShellRoleClassLib.Range.getRefBaseRoleClassPath())); - internalElement.getAttributes().add(new Attribute( - "max", - "xs:" + range.getValueType(), - null, - range.getMax(), - new RefSemantic(AASNamespace.Range_Max.getRefSemantic()), - null - )); - internalElement.getAttributes().add(new Attribute( - "min", - "xs:" + range.getValueType(), - null, - range.getMin(), - new RefSemantic(AASNamespace.Range_Min.getRefSemantic()), - null - )); - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/ReferableMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/ReferableMapper.java deleted file mode 100644 index 7eb30082..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/ReferableMapper.java +++ /dev/null @@ -1,32 +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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper; - -import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; -import io.adminshell.aas.v3.dataformat.aml.model.caex.Attribute; -import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElement; -import io.adminshell.aas.v3.dataformat.aml.model.caex.RefSemantic; -import io.adminshell.aas.v3.model.Referable; -import ma.glasnost.orika.CustomMapper; -import ma.glasnost.orika.MappingContext; - -public class ReferableMapper extends CustomMapper { - - @Override - public void mapAtoB(Referable referable, InternalElement internalElement, MappingContext context) { - - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/ReferenceElementMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/ReferenceElementMapper.java deleted file mode 100644 index ac301da3..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/ReferenceElementMapper.java +++ /dev/null @@ -1,43 +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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper; - -import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; -import io.adminshell.aas.v3.dataformat.aml.model.caex.AssetAdministrationShellRoleClassLib; -import io.adminshell.aas.v3.dataformat.aml.model.caex.Attribute; -import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElement; -import io.adminshell.aas.v3.dataformat.aml.model.caex.RefSemantic; -import io.adminshell.aas.v3.dataformat.aml.model.caex.RoleRequirements; -import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.util.ReferenceConverterUtil; -import io.adminshell.aas.v3.model.ReferenceElement; -import ma.glasnost.orika.CustomMapper; -import ma.glasnost.orika.MappingContext; - -public class ReferenceElementMapper extends CustomMapper { - - @Override - public void mapAtoB(ReferenceElement referenceElement, InternalElement internalElement, MappingContext context) { - internalElement.setRoleRequirements(new RoleRequirements(AssetAdministrationShellRoleClassLib.ReferenceElement.getRefBaseRoleClassPath())); - internalElement.getAttributes().add(new Attribute( - "value", - null, - null, - ReferenceConverterUtil.convert(referenceElement.getValue()), - new RefSemantic(AASNamespace.ReferenceElement_Value.getRefSemantic()), - null - )); - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/RelationshipElementMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/RelationshipElementMapper.java deleted file mode 100644 index c1c9c8d6..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/RelationshipElementMapper.java +++ /dev/null @@ -1,53 +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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper; - -import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; -import io.adminshell.aas.v3.dataformat.aml.model.caex.AssetAdministrationShellRoleClassLib; -import io.adminshell.aas.v3.dataformat.aml.model.caex.Attribute; -import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElement; -import io.adminshell.aas.v3.dataformat.aml.model.caex.RefSemantic; -import io.adminshell.aas.v3.dataformat.aml.model.caex.RoleRequirements; -import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.util.ReferenceConverterUtil; -import io.adminshell.aas.v3.model.RelationshipElement; -import ma.glasnost.orika.CustomMapper; -import ma.glasnost.orika.MappingContext; - -public class RelationshipElementMapper extends CustomMapper { - - @Override - public void mapAtoB(RelationshipElement relationshipElement, InternalElement internalElement, MappingContext context) { - internalElement.setRoleRequirements(new RoleRequirements(AssetAdministrationShellRoleClassLib.RelationshipElementMapper.getRefBaseRoleClassPath())); - - internalElement.getAttributes().add(new Attribute( - "first", - null, - null, - ReferenceConverterUtil.convert(relationshipElement.getFirst()), - new RefSemantic(AASNamespace.RelationshipElement_First.getRefSemantic()), - null - )); - - internalElement.getAttributes().add(new Attribute( - "second", - null, - null, - ReferenceConverterUtil.convert(relationshipElement.getSecond()), - new RefSemantic(AASNamespace.RelationshipElement_Second.getRefSemantic()), - null - )); - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/SubmodelElementCollectionMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/SubmodelElementCollectionMapper.java deleted file mode 100644 index 4a5267bb..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/SubmodelElementCollectionMapper.java +++ /dev/null @@ -1,31 +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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper; - -import io.adminshell.aas.v3.dataformat.aml.model.caex.AssetAdministrationShellRoleClassLib; -import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElement; -import io.adminshell.aas.v3.dataformat.aml.model.caex.RoleRequirements; -import io.adminshell.aas.v3.model.SubmodelElementCollection; -import ma.glasnost.orika.CustomMapper; -import ma.glasnost.orika.MappingContext; - -public class SubmodelElementCollectionMapper extends CustomMapper { - - @Override - public void mapAtoB(SubmodelElementCollection submodelElementCollection, InternalElement internalElement, MappingContext context) { - internalElement.setRoleRequirements(new RoleRequirements(AssetAdministrationShellRoleClassLib.SubmodelElementCollection.getRefBaseRoleClassPath())); - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/SubmodelElementMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/SubmodelElementMapper.java deleted file mode 100644 index 99f5873c..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/SubmodelElementMapper.java +++ /dev/null @@ -1,30 +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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper; - -import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElement; -import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.util.QualifierConverterUtil; -import io.adminshell.aas.v3.model.SubmodelElement; -import ma.glasnost.orika.CustomMapper; -import ma.glasnost.orika.MappingContext; - -public class SubmodelElementMapper extends CustomMapper { - - @Override - public void mapAtoB(SubmodelElement submodelElement, InternalElement internalElement, MappingContext context) { - QualifierConverterUtil.createQualifierAttributesForSubmodelElement(submodelElement, internalElement); - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/SubmodelMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/SubmodelMapper.java deleted file mode 100644 index 77216465..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/mapper/SubmodelMapper.java +++ /dev/null @@ -1,53 +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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.mapper; - -import io.adminshell.aas.v3.dataformat.aml.model.caex.AssetAdministrationShellRoleClassLib; -import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElement; -import io.adminshell.aas.v3.dataformat.aml.model.caex.RoleRequirements; -import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.util.QualifierConverterUtil; -import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.util.UrlEncoderUtil; -import io.adminshell.aas.v3.model.ModelingKind; -import io.adminshell.aas.v3.model.Submodel; -import ma.glasnost.orika.CustomMapper; -import ma.glasnost.orika.MappingContext; - -import java.util.Objects; - -public class SubmodelMapper extends CustomMapper { - - @Override - public void mapAtoB(Submodel submodel, InternalElement internalElement, MappingContext context) { - if(submodel.getKind() == ModelingKind.TEMPLATE) { - return; - } - - internalElement.setRoleRequirements(new RoleRequirements(AssetAdministrationShellRoleClassLib.Submodel.getRefBaseRoleClassPath())); - - // Set name and idShort by identification if idShort is not given - if (submodel.getIdShort().equals("") || submodel.getIdShort() == null) { - String idShort = UrlEncoderUtil.encode(submodel.getIdentification().getIdentifier()); - // Set AssetAdministrationShell name - internalElement.setName(idShort); - // Set idShort - internalElement.getAttributes().stream() - .filter(Objects::nonNull) - .filter(attribute -> attribute.getName().equals("idShort")).findAny().get().setValue(idShort); - } - - QualifierConverterUtil.createQualifierAttributesForSubmodel(submodel, internalElement); - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/util/FileConverterUtil.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/util/FileConverterUtil.java deleted file mode 100644 index abf0fbc6..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/util/FileConverterUtil.java +++ /dev/null @@ -1,61 +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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.util; - -import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; -import io.adminshell.aas.v3.dataformat.aml.model.caex.Attribute; -import io.adminshell.aas.v3.dataformat.aml.model.caex.RefSemantic; -import io.adminshell.aas.v3.model.File; - -import java.util.ArrayList; - -public class FileConverterUtil { - - public static Attribute convert(File file, String rootName, RefSemantic rootRefSemantic) { - if (file == null) { - return null; - } - - Attribute attribute = new Attribute( - rootName, - null, - null, - null, - rootRefSemantic, - null - ); - attribute.setAttributes(new ArrayList<>()); - - attribute.getAttributes().add(new Attribute( - "MIMEType", - "xs:anyURI", - null, - file.getMimeType(), - new RefSemantic(AASNamespace.File_MimeType.getRefSemantic()), - null - )); - attribute.getAttributes().add(new Attribute( - "refURI", - "xs:string", - null, - file.getValue(), - new RefSemantic(AASNamespace.File_Value.getRefSemantic()), - null - )); - - return attribute; - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/util/QualifierConverterUtil.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/util/QualifierConverterUtil.java deleted file mode 100644 index d51cdbba..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/util/QualifierConverterUtil.java +++ /dev/null @@ -1,95 +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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.util; - -import io.adminshell.aas.v3.dataformat.aml.model.caex.AASNamespace; -import io.adminshell.aas.v3.dataformat.aml.model.caex.Attribute; -import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElement; -import io.adminshell.aas.v3.dataformat.aml.model.caex.RefSemantic; -import io.adminshell.aas.v3.model.Constraint; -import io.adminshell.aas.v3.model.Qualifier; -import io.adminshell.aas.v3.model.Submodel; -import io.adminshell.aas.v3.model.SubmodelElement; -import java.util.ArrayList; - -public class QualifierConverterUtil { - - public static void createQualifierAttributesForSubmodelElement(SubmodelElement submodelElement, InternalElement internalElement) { - if (submodelElement.getQualifiers() == null) { - return; - } - submodelElement.getQualifiers().forEach(qualifier -> { - createAttributes(qualifier, internalElement); - }); - } - - public static void createQualifierAttributesForSubmodel(Submodel submodel, InternalElement internalElement) { - if (submodel.getQualifiers() == null) { - return; - } - submodel.getQualifiers().forEach(qualifier -> { - createAttributes(qualifier, internalElement); - }); - } - - private static void createAttributes(Constraint constraint, InternalElement internalElement) { - if (constraint instanceof Qualifier) { - - // Root qualifier attribute - Attribute rootAttribute = new Attribute( - String.format("qualifier:%s=%s", - ((Qualifier) constraint).getType(), - ((Qualifier) constraint).getValue()), - null, - null, - null, - new RefSemantic(AASNamespace.Qualifier_Qualifier.getRefSemantic()), - null - ); - rootAttribute.setAttributes(new ArrayList<>()); - - // Nested attributes - rootAttribute.getAttributes().add(new Attribute( - "type", - null, - null, - "xs:" + ((Qualifier) constraint).getValueType(), - new RefSemantic(AASNamespace.Qualifier_Type.getRefSemantic()), - null - ) - ); - rootAttribute.getAttributes().add(new Attribute( - "value", - null, - null, - ((Qualifier) constraint).getValue(), - new RefSemantic(AASNamespace.Qualifier_Value.getRefSemantic()), - null - ) - ); - rootAttribute.getAttributes().add(new Attribute( - "semanticId", - null, - null, - ReferenceConverterUtil.convert(((Qualifier) constraint).getSemanticId()), - new RefSemantic(AASNamespace.HasSemantics_SemanticId.getRefSemantic()), - null - )); - - internalElement.getAttributes().add(rootAttribute); - } - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/util/UrlEncoderUtil.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/util/UrlEncoderUtil.java deleted file mode 100644 index 077b7790..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/util/UrlEncoderUtil.java +++ /dev/null @@ -1,11 +0,0 @@ -package io.adminshell.aas.v3.dataformat.aml.serialize.mapper.util; - -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; - -public class UrlEncoderUtil { - - public static String encode(String url) { - return URLEncoder.encode(url, StandardCharsets.UTF_8); - } -} diff --git a/dataformat-aml/src/main/resources/interface-class-lib_aas.automl b/dataformat-aml/src/main/resources/interface-class-lib_aas.automl deleted file mode 100644 index 533c7d15..00000000 --- a/dataformat-aml/src/main/resources/interface-class-lib_aas.automl +++ /dev/null @@ -1,34 +0,0 @@ - - Interface Class Library according to Details of the Asset Administration Shell V2.0. - 1.0.0 - - A FileDataReference represents the address to a File. FileDataReference is derived from the - AutomationML Interface Class ExternalDataReference that is defined in AutomationML - BPR_005E_ExternalDataReference_v1.0.0_2:The interface class “ExternalDataReference” shall be used in order - to reference external documents out of the scope of AutomationML. - - - - Reference to any other referable element of the same of any other AAS or a reference to an external - object or entity. For local references inside the same Asset Administration Shell an InternalLink between - two objects with this interface "ReferableReference" shall be set. In this case the attribute value has to - be empty. For references between different Asset Administration Shells or external objects or entities the - attribute value shall be used and no InternalLink shall be set. - - - Reference to any other referable element of any other AAS or a reference to an external object - or entity. Note: For references to any other referable element of the same AAS InternalLinks are used - and this attribute value shall be empty. - - - - - diff --git a/dataformat-aml/src/main/resources/interface-class-lib_automl_bpr.automl b/dataformat-aml/src/main/resources/interface-class-lib_automl_bpr.automl deleted file mode 100644 index c8915fd0..00000000 --- a/dataformat-aml/src/main/resources/interface-class-lib_automl_bpr.automl +++ /dev/null @@ -1,14 +0,0 @@ - - 1.0.0 - - - Mime type of the content of the File. - - - \ No newline at end of file diff --git a/dataformat-aml/src/main/resources/interface-class-lib_automl_interface.automl b/dataformat-aml/src/main/resources/interface-class-lib_automl_interface.automl deleted file mode 100644 index a833a072..00000000 --- a/dataformat-aml/src/main/resources/interface-class-lib_automl_interface.automl +++ /dev/null @@ -1,93 +0,0 @@ - - Standard Automation Markup Language Interface Class Library - Part 1 Content extended with Part 3 and Part - 4 Content - - 2.2.2 - - - - - - - - - - The attribute refURI is an IRI that can represent an absolute or relative path to an L - document. An added fragment (with #) references inside the document - - - - - - - - - - - - - - - - - - true - - - - - - - - - - - diff --git a/dataformat-aml/src/main/resources/role-class-lib_aas.automl b/dataformat-aml/src/main/resources/role-class-lib_aas.automl deleted file mode 100644 index 0db7b808..00000000 --- a/dataformat-aml/src/main/resources/role-class-lib_aas.automl +++ /dev/null @@ -1,1811 +0,0 @@ - - Role Class Library according to Details of the Asset Administration Shell V2.0. - 1.0.0 - - An Asset Administration Shell. - - Identifying string of the element within its name space. Constraint AASd-001: In case of a - referable element not being an identifiable element this id is mandatory and used for referring to the - element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore - ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. - Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used - for unique reference in its name space and thus allows better usability and a more performant - implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - - 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. - - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - - - - - - Abstract attribute class for identification. Has the subattributes id and idType. - - - Identifier of the element. Its type is defined in idType. Id is a subproperty of - identification. - - - - - - Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the - enumeration “IdentifierType”. IdType is a subproperty of identification. - - - - - - - Abstract attribute for administration. Has the subattributes revision and version. - - - Revision of the element. Constraint AASd-005: A revision requires a version. This means, if - there is no version there is no revision neither. Revision is a subproperty of administration. - - - - - - Version of the element. Version is a subproperty of administration. - - - - - - Global reference to the data specification template used by the element. - - - - - The derivedFrom attribute is used to establish a relationship between two Asset Administration - Shells that are derived from each other. - - - - - - - An Asset describes meta data of an asset that is represented by an AAS. The asset may either represent - an asset type or an asset instance. The asset has a globally unique identifier plus – if needed – additional - domain specific (proprietary) identifiers. - - - Identifying string of the element within its name space. Constraint AASd-001: In case of a - referable element not being an identifiable element this id is mandatory and used for referring to the - element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore - ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. - Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used - for unique reference in its name space and thus allows better usability and a more performant - implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - - 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. - - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - Abstract attribute class for identification. Has the subattributes id and idType. - - - Identifier of the element. Its type is defined in idType. - - - - - Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the - enumeration “IdentifierType”. IdType is a subproperty of identification. - - - - - - - Abstract attribute for administration. Has the subattributes revision and version. - - - Revision of the element. Constraint AASd-005: A revision requires a version. This means, if - there is no version there is no revision neither. Revision is a subproperty of administration. - - - - - - Version of the element. Version is a subproperty of administration. - - - - - - Global reference to the data specification template used by the element. - - - - - Kind of the element: either type or instance. - Instance - Instance - - - - Instance - Type - - - - - - A Submodel defines a specific aspect of the asset represented by the AAS. A submodel is used to - structure the virtual representation and technical functionality of an Administration Shell into distinguishable - parts. Each submodel refers to a well-defined domain or subject matter. Submodels can become standardized and - thus become submodels types. Submodels can have different life-cycles. - - - Identifying string of the element within its name space. Constraint AASd-001: In case of a - referable element not being an identifiable element this id is mandatory and used for referring to the - element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore - ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. - Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used - for unique reference in its name space and thus allows better usability and a more performant - implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - - 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. - - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - Abstract attribute class for identification. Has the subattributes id and idType. - - - Identifier of the element. Its type is defined in idType. Id is a subproperty of - identification. - - - - - - Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the - enumeration “IdentifierType”. IdType is a subproperty of identification. - - - - - - - Abstract attribute for administration. Has the subattributes revision and version. - - - Revision of the element. Constraint AASd-005: A revision requires a version. This means, if - there is no version there is no revision neither. Revision is a subproperty of administration. - - - - - - Version of the element. Version of the element. Version is a subproperty of administration. - - - - - - - Global reference to the data specification template used by the element. - - - - - Kind of the element: either template or instance. - Instance - Instance - - - - Instance - Type - - - - - Description or comments on the element. The description can be provided in several languages. This - attribute has the name of the label and has a value with the label written in the default language. The - individual languages are modelled as child attributes. The names of the child attributes are the prefix - “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child - attributes are the labels within the respective language. - - - - - - A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. - [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. - - - - The type describes the type of the qualifier that is applied to the element. - - - - - The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and - the valueId are present then the value needs to be identical to the value of the referenced coded value - in valueId. - - - - - - Reference to the global unqiue id of a coded value. - - - - - - - A submodel element collection is a set or list of submodel elements. - - Identifying string of the element within its name space. Constraint AASd-001: In case of a - referable element not being an identifiable element this id is mandatory and used for referring to the - element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore - ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. - Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used - for unique reference in its name space and thus allows better usability and a more performant - implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - - 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. - - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - Global reference to the data specification template used by the element. - - - - - Kind of the element: either template or instance. - Instance - Instance - - - - Instance - Type - - - - - Description or comments on the element. The description can be provided in several languages. This - attribute has the name of the label and has a value with the label written in the default language. The - individual languages are modelled as child attributes. The names of the child attributes are the prefix - “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child - attributes are the labels within the respective language. - - - - - - A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. - [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. - - - - The type describes the type of the qualifier that is applied to the element. - - - - - The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and - the valueId are present then the value needs to be identical to the value of the referenced coded value - in valueId. - - - - - - Reference to the global unqiue id of a coded value. - - - - - - If allowDuplicates=true, then it is allowed that the collection contains the same element several - times. - - false - - - - If ordered=false, then the elements in the property collection are not ordered. If ordered=true - then the elements in the collection are ordered. Default = false. Note: An ordered submodel element - collection is typically implemented as an indexed array. - - false - - - - Submodel element contained in the collection. - - - - - A BLOB is a data element that represents a file that is contained with its source code in the value - attribute. - - - Identifying string of the element within its name space. Constraint AASd-001: In case of a - referable element not being an identifiable element this id is mandatory and used for referring to the - element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore - ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. - Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used - for unique reference in its name space and thus allows better usability and a more performant - implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - - 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. - - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - Global reference to the data specification template used by the element. - - - - - Kind of the element: either template or instance. - Instance - Instance - - - - Instance - Type - - - - - Description or comments on the element. The description can be provided in several languages. This - attribute has the name of the label and has a value with the label written in the default language. The - individual languages are modelled as child attributes. The names of the child attributes are the prefix - “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child - attributes are the labels within the respective language. - - - - - - A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. - [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. - - - - The type describes the type of the qualifier that is applied to the element. - - - - - The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and - the valueId are present then the value needs to be identical to the value of the referenced coded value - in valueId. - - - - - - Reference to the global unqiue id of a coded value. - - - - - - Mime type of the content of the BLOB. The mime type states which file extension the file has. Valid - values are e.g. “application/json”, “application/xls”, ”image/jpg”. The allowed values are defined as in - RFC2046. - - - - - - The value of the BLOB instance of a blob data element. Note: In contrast to the file property the - file content is stored directly as value in the Blob data element. - - - - - - - A capability is the implementation-independent description of the potential of an asset to achieve a - certain effect in the physical or virtual world. - - - Identifying string of the element within its name space. Constraint AASd-001: In case of a - referable element not being an identifiable element this id is mandatory and used for referring to the - element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore - ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. - Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used - for unique reference in its name space and thus allows better usability and a more performant - implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - - 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. - - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - Global reference to the data specification template used by the element. - - - - - Kind of the element: either template or instance. - Instance - Instance - - - - Instance - Type - - - - - Description or comments on the element. The description can be provided in several languages. This - attribute has the name of the label and has a value with the label written in the default language. The - individual languages are modelled as child attributes. The names of the child attributes are the prefix - “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child - attributes are the labels within the respective language. - - - - - - A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. - [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. - - - - The type describes the type of the qualifier that is applied to the element. - - - - - The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and - the valueId are present then the value needs to be identical to the value of the referenced coded value - in valueId. - - - - - - Reference to the global unqiue id of a coded value. - - - - - - - A role class for a File that a data element that represents an address to a file. It is derived from - the AutomationML role class ExternalData that is an role type for a document type and the base class for all - document type roles. It describes different document types. ExternalData is defined in AutomationML - BPR_005E_ExternalDataReference_v1.0.0_2. - - - Identifying string of the element within its name space. Constraint AASd-001: In case of a - referable element not being an identifiable element this id is mandatory and used for referring to the - element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore - ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. - Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used - for unique reference in its name space and thus allows better usability and a more performant - implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - - 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. - - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - Global reference to the data specification template used by the element. - - - - - Kind of the element: either template or instance. - Instance - Instance - - - - Instance - Type - - - - - Description or comments on the element. The description can be provided in several languages. This - attribute has the name of the label and has a value with the label written in the default language. The - individual languages are modelled as child attributes. The names of the child attributes are the prefix - “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child - attributes are the labels within the respective language. - - - - - - A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. - [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. - - - - The type describes the type of the qualifier that is applied to the element. - - - - - The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and - the valueId are present then the value needs to be identical to the value of the referenced coded value - in valueId. - - - - - - Reference to the global unqiue id of a coded value. - - - - - - - The attribute refURI is an IRI that can represent an absolute or relative path to an L - document. An added fragment (with #) references inside the document - - - - Mime type of the content of the File. - - - - - A property is a data element that has a single value. - - Identifying string of the element within its name space. Constraint AASd-001: In case of a - referable element not being an identifiable element this id is mandatory and used for referring to the - element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore - ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. - Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used - for unique reference in its name space and thus allows better usability and a more performant - implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - - 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. - - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - Global reference to the data specification template used by the element. - - - - - Kind of the element: either template or instance. - Instance - Instance - - - - Instance - Type - - - - - Description or comments on the element. The description can be provided in several languages. This - attribute has the name of the label and has a value with the label written in the default language. The - individual languages are modelled as child attributes. The names of the child attributes are the prefix - “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child - attributes are the labels within the respective language. - - - - - - A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. - [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. - - - - The type describes the type of the qualifier that is applied to the element. - - - - - The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and - the valueId are present then the value needs to be identical to the value of the referenced coded value - in valueId. - - - - - - Reference to the global unqiue id of a coded value. - - - - - - The value of the property instance. - - - - Reference to the global unique id if a coded value. - - - - - A reference element is a data element that defines a logical reference to another element within the - same or another AAS or a reference to an external object or entity. - - - Identifying string of the element within its name space. Constraint AASd-001: In case of a - referable element not being an identifiable element this id is mandatory and used for referring to the - element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore - ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. - Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used - for unique reference in its name space and thus allows better usability and a more performant - implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - - 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. - - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - Global reference to the data specification template used by the element. - - - - - Kind of the element: either template or instance. - Instance - Instance - - - - Instance - Type - - - - - Description or comments on the element. The description can be provided in several languages. This - attribute has the name of the label and has a value with the label written in the default language. The - individual languages are modelled as child attributes. The names of the child attributes are the prefix - “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child - attributes are the labels within the respective language. - - - - - - A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. - [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. - - - - The type describes the type of the qualifier that is applied to the element. - - - - - The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and - the valueId are present then the value needs to be identical to the value of the referenced coded value - in valueId. - - - - - - Reference to the global unqiue id of a coded value. - - - - - - - Reference to any other referable element of any other AAS or a reference to an external object - or entity. Note: For references to any other referable elment of the same AAS InternalLinks are used and - this attribute value shall be empty. - - - - - - - A relationship element is used to define a relationship between two referable elements. - - Identifying string of the element within its name space. Constraint AASd-001: In case of a - referable element not being an identifiable element this id is mandatory and used for referring to the - element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore - ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. - Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used - for unique reference in its name space and thus allows better usability and a more performant - implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - - 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. - - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - Global reference to the data specification template used by the element. - - - - - Kind of the element: either template or instance. - Instance - Instance - - - - Instance - Type - - - - - Description or comments on the element. The description can be provided in several languages. This - attribute has the name of the label and has a value with the label written in the default language. The - individual languages are modelled as child attributes. The names of the child attributes are the prefix - “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child - attributes are the labels within the respective language. - - - - - - A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. - [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. - - - - The type describes the type of the qualifier that is applied to the element. - - - - - The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and - the valueId are present then the value needs to be identical to the value of the referenced coded value - in valueId. - - - - - - Reference to the global unqiue id of a coded value. - - - - - - - Reference to any other referable element of any other AAS or a reference to an external object - or entity. Note: For references to any other referable elment of the same AAS InternalLinks are used and - this attribute value shall be empty. - - - - - - Reference to any other referable element of any other AAS or a reference to an external object - or entity. Note: For references to any other referable elment of the same AAS InternalLinks are used and - this attribute value shall be empty. - - - - - - An annotated relationship element is an relationship element that can be annotated with additional data - elements. - - - Annotations that hold for the relationships between the two elements. - - - - - An operation is a submodel element with input and output variables. - - Identifying string of the element within its name space. Constraint AASd-001: In case of a - referable element not being an identifiable element this id is mandatory and used for referring to the - element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore - ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. - Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used - for unique reference in its name space and thus allows better usability and a more performant - implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - - 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. - - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - Global reference to the data specification template used by the element. - - - - - Kind of the element: either template or instance. - Instance - Instance - - - - Instance - Type - - - - - Description or comments on the element. The description can be provided in several languages. This - attribute has the name of the label and has a value with the label written in the default language. The - individual languages are modelled as child attributes. The names of the child attributes are the prefix - “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child - attributes are the labels within the respective language. - - - - - - A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. - [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. - - - - The type describes the type of the qualifier that is applied to the element. - - - - - The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and - the valueId are present then the value needs to be identical to the value of the referenced coded value - in valueId. - - - - - - Reference to the global unqiue id of a coded value. - - - - - - - The list of AAS OperationVariableIn entities. In AML, the corresponding InternalElement with this role - is a child of the InternalElement with the Operation role. - - - - The list of AAS OperationVariableOut entities. In AML, the corresponding InternalElement with this role - is a child of the InternalElement with the Operation role. - - - - The list of AAS OperationVariableOut entities. In AML, the corresponding InternalElement with this role - is a child of the InternalElement with the Operation role. - - - - A view is a collection of referable elements w.r.t. to a specific viewpoint of one or more - stakeholders. - - - Identifying string of the element within its name space. Constraint AASd-001: In case of a - referable element not being an identifiable element this id is mandatory and used for referring to the - element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore - ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. - Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used - for unique reference in its name space and thus allows better usability and a more performant - implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - - 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. - - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - Global reference to the data specification template used by the element. - - - - - Description or comments on the element. The description can be provided in several languages. This - attribute has the name of the label and has a value with the label written in the default language. The - individual languages are modelled as child attributes. The names of the child attributes are the prefix - “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child - attributes are the labels within the respective language. - - - - - - - A dictionary contains elements that can be reused. - - Identifying string of the element within its name space. Constraint AASd-001: In case of a - referable element not being an identifiable element this id is mandatory and used for referring to the - element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore - ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. - Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used - for unique reference in its name space and thus allows better usability and a more performant - implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - - 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. - - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - - - - - - - Explanation: The semantics of a property or other elements that may have a semantic description is - defined by a concept description. The description of the concept should follow a standardized schema (realized - as data specification template). - - - Identifying string of the element within its name space. Constraint AASd-001: In case of a - referable element not being an identifiable element this id is mandatory and used for referring to the - element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore - ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. - Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used - for unique reference in its name space and thus allows better usability and a more performant - implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - - 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. - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - Abstract attribute class for identification. Has the subattributes id and idType. - - - Identifier of the element. Its type is defined in idType. Id is a subproperty of - identification. - - - - - - Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the - enumeration “IdentifierType”. IdType is a subproperty of identification. - - - - - - - Abstract attribute for administration. Has the subattributes revision and version. - - - Revision of the element. Constraint AASd-005: A revision requires a version. This means, if - there is no version there is no revision neither. Revision is a subproperty of administration. - - - - - - Version of the element. Version is a subproperty of administration. - - - - - - Global reference to the data specification template used by the element. - - - - Global reference to an external definition the concept is compatible to or was derived from. - - - - - - - Description Role class of an element that has a data specification template. A template defines the - additional attributes an element may or shall have. - - - Identifying string of the element within its name space. Constraint AASd-001: In case of a - referable element not being an identifiable element this id is mandatory and used for referring to the - element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore - ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. - Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used - for unique reference in its name space and thus allows better usability and a more performant - implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - - 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. - - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - - - - - - Abstract attribute class for identification. Has the subattributes id and idType. - - - Identifier of the element. Its type is defined in idType. Id is a subproperty of - identification. - - - - - - Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the - enumeration “IdentifierType”. IdType is a subproperty of identification. - - - - - - - Abstract attribute for administration. Has the subattributes revision and version. - - - Revision of the element. Constraint AASd-005: A revision requires a version. This means, if - there is no version there is no revision neither. Revision is a subproperty of administration. - - - - - - Version of the element. Version is a subproperty of administration. - - - - - - - Content of the data specification template. - - diff --git a/dataformat-aml/src/main/resources/role-class-lib_automl_base.automl b/dataformat-aml/src/main/resources/role-class-lib_automl_base.automl deleted file mode 100644 index 9ab7721b..00000000 --- a/dataformat-aml/src/main/resources/role-class-lib_automl_base.automl +++ /dev/null @@ -1,80 +0,0 @@ - - Automation Markup Language Base Role Class Library - Part 1 Content extended with Part 3 and Part 4 - Content - - 2.2.2 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dataformat-aml/src/main/resources/role-class-lib_automl_bpr.automl b/dataformat-aml/src/main/resources/role-class-lib_automl_bpr.automl deleted file mode 100644 index e948c07e..00000000 --- a/dataformat-aml/src/main/resources/role-class-lib_automl_bpr.automl +++ /dev/null @@ -1,7 +0,0 @@ - - 1.0.0 - - diff --git a/dataformat-aml/src/main/resources/system-unit-class-lib_aas.automl b/dataformat-aml/src/main/resources/system-unit-class-lib_aas.automl deleted file mode 100644 index 742a3637..00000000 --- a/dataformat-aml/src/main/resources/system-unit-class-lib_aas.automl +++ /dev/null @@ -1,4 +0,0 @@ - - 0 - diff --git a/dataformat-aml/src/main/resources/system-unit-class-lib_aas_data_specification_templates.automl b/dataformat-aml/src/main/resources/system-unit-class-lib_aas_data_specification_templates.automl deleted file mode 100644 index b7780f38..00000000 --- a/dataformat-aml/src/main/resources/system-unit-class-lib_aas_data_specification_templates.automl +++ /dev/null @@ -1,206 +0,0 @@ - - 0 - - An AAS Data Specification template for IEC61369. A template consists of the DataSpecificationContent - containing the additional attributes to be added to the element instance that references the data specification - template and meta information about the template itself (this is why DataSpecification inherits from - Identifiable). In UML these are two separated classes. - - - Identifying string of the element within its name space. Constraint AASd-001: In case of a - referable element not being an identifiable element this id is mandatory and used for referring to the - element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore - ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. - Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used - for unique reference in its name space and thus allows better usability and a more performant - implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - - 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. - - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - - - - - - Abstract attribute class for identification. Has the subattributes id and idType. - - - Identifier of the element. Its type is defined in idType. Id is a subproperty of - identification. - - http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360 - - - - Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the - enumeration “IdentifierType”. IdType is a subproperty of identification. - - IRI - - - - - Abstract attribute for administration. Has the subattributes revision and version. - - - Revision of the element. Constraint AASd-005: A revision requires a version. This means, if - there is no version there is no revision neither. Revision is a subproperty of administration. - - - - - - Version of the element. Version is a subproperty of administration. - - - - - - - The content of an AAS Data Specification template for IEC61360. - - Identifies the attribute hierarchy for preferredName in above attribute hierachy. Subordinate - attributes are designated by the country code information (see aml-lang literal). - - - - - Identifies the attribute for shortName in above attribute hierarchy. - - - - Identifies the attribute for unit in above attribute hierarchy. - - - - Identifies the attribute for unitId in above attribute hierarchy in its string serialization. - - - - - Identifies the attribute for sourceOfDefinition in above attribute hierachy. Subordinate - attributes are designated by the country code information (see aml-lang literal). - - - - - Identifies the attribute for symbol in above attribute hierarchy. - - - - Identifies the attribute for dataType in above attribute hierarchy. - - - - Identifies the attribute for definition in above attribute hierachy. Subordinate attributes are - designated by the country code information (see aml-lang literal). - - - - - Identifies the attribute for valueFormat in above attribute hierarchy. - - - - Identifies the attribute for valueList in above attribute hierarchy. - - - - The attribute value. - - - - The id for the value. - - - - - - From 2ef64f39618347c5c678f1747af3cef51926e66f Mon Sep 17 00:00:00 2001 From: Jacoby Date: Mon, 2 Aug 2021 16:50:58 +0200 Subject: [PATCH 09/18] refactoring AML serializer --- dataformat-aml/pom.xml | 12 + .../aas/v3/dataformat/aml/AasToAmlMapper.java | 21 +- .../aas/v3/dataformat/aml/AmlGenerator.java | 149 + .../aml/AmlSerializationConfig.java | 81 + .../aas/v3/dataformat/aml/AmlSerializer.java | 14 +- .../aas/v3/dataformat/aml/IdGenerator.java | 21 + .../v3/dataformat/aml/IdentityProvider.java | 28 +- .../v3/dataformat/aml/IntegerIdGenerator.java | 27 + .../aas/v3/dataformat/aml/MappingContext.java | 174 +- .../aas/v3/dataformat/aml/UuidGenerator.java | 27 + .../dataformat/aml/header/WriterHeader.java | 6 +- .../aml/mapper/AbstractCollectionMapper.java | 12 +- ...tAdministrationShellEnvironmentMapper.java | 44 +- .../v3/dataformat/aml/mapper/BaseMapper.java | 35 +- .../mapper/ConstraintCollectionMapper.java | 5 +- .../DataSpecificationContentMapper.java | 16 +- .../DataSpecificationIEC61360Mapper.java | 17 +- .../aml/mapper/DataSpecificationMapper.java | 10 +- ...ddedDataSpecificationCollectionMapper.java | 21 +- .../v3/dataformat/aml/mapper/FileMapper.java | 13 +- .../mapper/LangStringCollectionMapper.java | 5 +- .../aas/v3/dataformat/aml/mapper/Mapper.java | 3 +- .../aml/mapper/OperationMapper.java | 7 +- .../OperationVariableCollectionMapper.java | 12 +- .../aml/mapper/OperationVariableMapper.java | 5 +- .../aml/mapper/QualifierMapper.java | 7 +- .../aml/mapper/ReferenceCollectionMapper.java | 5 +- .../aml/mapper/ReferenceElementMapper.java | 21 +- .../aml/mapper/ReferenceMapper.java | 7 +- .../aml/mapper/RelationshipElementMapper.java | 33 +- .../aml/mapper/SubmodelCollectionMapper.java | 7 +- .../dataformat/aml/mapper/SubmodelMapper.java | 11 +- .../aml/mapper/ToAttributeMapper.java | 5 +- .../v3/dataformat/aml/mapper/ViewMapper.java | 9 +- .../dataformat/aml/fixtures/TestExample.java | 2 +- .../aml/serialize/AmlSerializerTest.java | 48 +- .../test/resources/amlfile/example_test.aml | 2610 +++++++++++++++++ 37 files changed, 3200 insertions(+), 330 deletions(-) create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlGenerator.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlSerializationConfig.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/IdGenerator.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/IntegerIdGenerator.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/UuidGenerator.java create mode 100644 dataformat-aml/src/test/resources/amlfile/example_test.aml diff --git a/dataformat-aml/pom.xml b/dataformat-aml/pom.xml index c65826b1..d51550d6 100644 --- a/dataformat-aml/pom.xml +++ b/dataformat-aml/pom.xml @@ -59,6 +59,18 @@ jaxb2-rich-contract-plugin ${jaxb-rich-contract.version} + + org.xmlunit + xmlunit-core + ${xmlunit.version} + test + + + org.xmlunit + xmlunit-matchers + ${xmlunit.version} + test + diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AasToAmlMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AasToAmlMapper.java index 009f5eae..512b8985 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AasToAmlMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AasToAmlMapper.java @@ -51,6 +51,11 @@ public class AasToAmlMapper { private static final org.slf4j.Logger log = LoggerFactory.getLogger(AasToAmlMapper.class); private static final String DEFAULT_LANGUAGE = "EN"; private CAEXFile result; + private final AmlSerializationConfig config; + + public AasToAmlMapper(AmlSerializationConfig config) { + this.config = config; + } public CAEXFile map(AssetAdministrationShellEnvironment env) throws MappingException { return map(env, DEFAULT_SCHEMA_VERSION, DEFAULT_FILENAME); @@ -95,15 +100,17 @@ public CAEXFile map(AssetAdministrationShellEnvironment env, String schemaVersio // NOTE // This has implications on ID generator and requires additional lookup table // for Referable --> AML ID of ExternalInterface - MappingContext context = new MappingContext(mappingProvider, env); - context.getFileBuilder().withSchemaVersion(schemaVersion); - context.getFileBuilder().withFileName(filename); - context.getFileBuilder().withAdditionalInformation(new AutomationMLVersion("2.0")); + MappingContext context = new MappingContext(mappingProvider, config.getIdGenerator(), env); WriterHeader writerHeader = new WriterHeader(); writerHeader.setName("foo"); writerHeader.setId("bar"); - context.getFileBuilder().withAdditionalInformation(writerHeader.wrap()); - context.map(env); - return context.getFileBuilder().build(); + CAEXFile.Builder builder = CAEXFile.builder() + .withSchemaVersion(schemaVersion) + .withFileName(filename) + .addAdditionalInformation(new AutomationMLVersion("2.0")) + .addAdditionalInformation(writerHeader.wrap()); + AmlGenerator generator = new AmlGenerator(builder); + context.map(env, generator); + return builder.build(); } } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlGenerator.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlGenerator.java new file mode 100644 index 00000000..d4e0cf8d --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlGenerator.java @@ -0,0 +1,149 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml; + +import io.adminshell.aas.v3.dataformat.aml.model.caex.AttributeType; +import io.adminshell.aas.v3.dataformat.aml.model.caex.CAEXFile; +import io.adminshell.aas.v3.dataformat.aml.model.caex.CAEXObject; +import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; +import io.adminshell.aas.v3.dataformat.aml.model.caex.RoleClassType; +import io.adminshell.aas.v3.dataformat.aml.model.caex.SystemUnitClassType; +import io.adminshell.aas.v3.model.Referable; +import java.util.List; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class AmlGenerator { + + private static final Logger log = LoggerFactory.getLogger(AmlGenerator.class); + private CAEXObject.Builder current; + private CAEXFile.Builder fileBuilder; + + public AmlGenerator() { + this.fileBuilder = CAEXFile.builder(); + } + + public AmlGenerator(CAEXFile.Builder fileBuilder) { + this.fileBuilder = fileBuilder; + } + + private AmlGenerator(CAEXFile.Builder fileBuilder, CAEXObject.Builder current) { + this.fileBuilder = fileBuilder; + this.current = current; + } + + public AmlGenerator with(CAEXObject.Builder current) { + return new AmlGenerator(fileBuilder, current); + } + + public void addAdditionalInformation(List additionalInformation) { + fileBuilder.addAdditionalInformation(additionalInformation); + } + + public void addAttribute(AttributeType attribute) { + if (attribute == null) { + return; + } + if (AttributeType.Builder.class.isAssignableFrom(current.getClass())) { + AttributeType.Builder builder = (AttributeType.Builder) current; + builder.addAttribute(attribute); + } else if (InternalElementType.Builder.class.isAssignableFrom(current.getClass())) { + InternalElementType.Builder builder = (InternalElementType.Builder) current; + builder.addAttribute(attribute); + } else { + log.warn("adding attribute failed because no parent builder defined"); + } + } + + public void addInternalLink(SystemUnitClassType.InternalLink internalLink) { + if (internalLink == null) { + return; + } + if (InternalElementType.Builder.class.isAssignableFrom(current.getClass())) { + InternalElementType.Builder builder = (InternalElementType.Builder) current; + builder.addInternalLink(internalLink); + } else { + log.warn("adding internal link failed because no parent builder defined"); + } + } + + public void addExternalInterface(RoleClassType.ExternalInterface externalInterface) { + if (externalInterface == null) { + return; + } + if (InternalElementType.Builder.class.isAssignableFrom(current.getClass())) { + InternalElementType.Builder builder = (InternalElementType.Builder) current; + builder.addExternalInterface(externalInterface); + } else { + log.warn("adding external interface failed because no parent builder defined"); + } + } + + public void addSystemUnitClassLib(CAEXFile.SystemUnitClassLib systemUnitClassLib) { + if (systemUnitClassLib == null) { + return; + } + if (fileBuilder != null) { + fileBuilder = fileBuilder.addSystemUnitClassLib(systemUnitClassLib); + } + } + + public void addInstanceHierarchy(CAEXFile.InstanceHierarchy instanceHierarchy) { + if (instanceHierarchy == null) { + return; + } + if (fileBuilder != null) { + fileBuilder = fileBuilder.addInstanceHierarchy(instanceHierarchy); + } + } + + public void addInternalElement(InternalElementType internalElement) { + if (internalElement == null) { + return; + } + if (InternalElementType.Builder.class.isAssignableFrom(current.getClass())) { + InternalElementType.Builder builder = (InternalElementType.Builder) current; + builder.addInternalElement(internalElement); + } else if (CAEXFile.InstanceHierarchy.Builder.class.isAssignableFrom(current.getClass())) { + CAEXFile.InstanceHierarchy.Builder builder = (CAEXFile.InstanceHierarchy.Builder) current; + builder.addInternalElement(internalElement); + } else { + log.warn("adding internalElement failed because no parent builder defined"); + } + } + + public void appendReferenceTargetInterfaceIfRequired(Object obj, MappingContext context) { + RoleClassType.ExternalInterface referenceTargetInterface = getReferenceTargetInterface(obj, context); + if (referenceTargetInterface != null) { + addExternalInterface(referenceTargetInterface); + } + } + + public RoleClassType.ExternalInterface getReferenceTargetInterface(Object obj, MappingContext context) { + RoleClassType.ExternalInterface result = null; + if (obj != null && Referable.class.isAssignableFrom(obj.getClass())) { + Referable referable = (Referable) obj; + if (context.isTargetOfInternalLink(referable)) { + result = RoleClassType.ExternalInterface.builder() + .withID(context.generateId()) + .withName("externalReferenceTarget") + .withRefBaseClassPath("AutomationMLInterfaceClassLib/AutomationMLBaseInterface") + .build(); + } + } + return result; + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlSerializationConfig.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlSerializationConfig.java new file mode 100644 index 00000000..b6fe0049 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlSerializationConfig.java @@ -0,0 +1,81 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +public class AmlSerializationConfig { + + private final boolean includeLibraries; + private final IdGenerator idGenerator; + private final List additionalInformation; + public static final AmlSerializationConfig DEFAULT = new Builder().build(); + + public static Builder builder() { + return new Builder(); + } + + private AmlSerializationConfig(boolean includeLibraries, IdGenerator idGenerator, List additionalInformation) { + this.includeLibraries = includeLibraries; + this.idGenerator = idGenerator; + this.additionalInformation = additionalInformation; + } + + public boolean isIncludeLibraries() { + return includeLibraries; + } + + public IdGenerator getIdGenerator() { + return idGenerator; + } + + public List getAdditionalInformation() { + return additionalInformation; + } + + public static class Builder { + + private boolean includeLibraries = true; + private IdGenerator idGenerator = new UuidGenerator(); + private List additionalInformation = new ArrayList<>(); + + public AmlSerializationConfig build() { + return new AmlSerializationConfig(includeLibraries, idGenerator, additionalInformation); + } + + public Builder includeLibraries() { + this.includeLibraries = true; + return this; + } + + public Builder excludeLibraries() { + this.includeLibraries = true; + return this; + } + + public Builder idGenerator(IdGenerator idGenerator) { + this.idGenerator = idGenerator; + return this; + } + + public Builder additionalInformation(Object... values) { + this.additionalInformation.addAll(Arrays.asList(values)); + return this; + } + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlSerializer.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlSerializer.java index 218b1d07..090ef7ab 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlSerializer.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlSerializer.java @@ -35,26 +35,20 @@ public class AmlSerializer implements Serializer { private static final String AAS_LIB_SOURCE = "/AssetAdministrationShellLib.aml"; private static final Logger log = LoggerFactory.getLogger(AmlSerializer.class); - private AasToAmlMapper mapper = new AasToAmlMapper(); - - private boolean enableClassLibs = false; public AmlSerializer() { } - public AmlSerializer(boolean enableClassLibs) { - this.enableClassLibs = enableClassLibs; - } - @Override public String write(AssetAdministrationShellEnvironment aasEnvironment) throws SerializationException { - return write(aasEnvironment, true); + return write(aasEnvironment, AmlSerializationConfig.DEFAULT); } - public String write(AssetAdministrationShellEnvironment aasEnvironment, boolean withLibraries) throws SerializationException { + public String write(AssetAdministrationShellEnvironment aasEnvironment, AmlSerializationConfig config) throws SerializationException { + AasToAmlMapper mapper = new AasToAmlMapper(config); try { CAEXFile aml = mapper.map(aasEnvironment); - if (withLibraries) { + if (config.isIncludeLibraries()) { aml = addAASLibrary(aml); } Marshaller marshaller = JAXBContextFactory.createContext( diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/IdGenerator.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/IdGenerator.java new file mode 100644 index 00000000..10acfc14 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/IdGenerator.java @@ -0,0 +1,21 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml; + +public interface IdGenerator { + + public String generateId(); +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/IdentityProvider.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/IdentityProvider.java index ee7b0e3e..4a0e7917 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/IdentityProvider.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/IdentityProvider.java @@ -17,35 +17,35 @@ import java.util.HashMap; import java.util.Map; -import java.util.UUID; public class IdentityProvider { - private Map ids = new HashMap<>(); + private final Map cache; + private final IdGenerator idGenerator; - public String getId(Object obj) { -// if (ids.containsKey(obj)) { -// return ids.get(obj); -// } - String result = generateId(); -// ids.put(obj, result); - return result; + public IdentityProvider(IdGenerator idGenerator) { + this.cache = new HashMap<>(); + this.idGenerator = idGenerator; } public String getCachedId(Object obj) { - if (ids.containsKey(obj)) { - return ids.get(obj); + if (cache.containsKey(obj)) { + return cache.get(obj); } String result = generateId(); - ids.put(obj, result); + cache.put(obj, result); return result; } public String generateId() { String result = null; do { - result = UUID.randomUUID().toString(); - } while (ids.entrySet().contains(result)); + result = idGenerator.generateId(); + } while (cache.values().contains(result)); return result; } + + public IdGenerator getIdGenerator() { + return idGenerator; + } } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/IntegerIdGenerator.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/IntegerIdGenerator.java new file mode 100644 index 00000000..a2d73608 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/IntegerIdGenerator.java @@ -0,0 +1,27 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml; + +public class IntegerIdGenerator implements IdGenerator { + + private int id = 1; + + @Override + public String generateId() { + return Integer.toString(id++); + } + +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/MappingContext.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/MappingContext.java index f9da33a1..cf2ad2f3 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/MappingContext.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/MappingContext.java @@ -16,19 +16,14 @@ package io.adminshell.aas.v3.dataformat.aml; import io.adminshell.aas.v3.dataformat.aml.mapper.MappingException; -import io.adminshell.aas.v3.dataformat.aml.model.caex.AttributeType; -import io.adminshell.aas.v3.dataformat.aml.model.caex.CAEXFile; -import io.adminshell.aas.v3.dataformat.aml.model.caex.CAEXFile.InstanceHierarchy; -import io.adminshell.aas.v3.dataformat.aml.model.caex.CAEXFile.SystemUnitClassLib; -import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; import io.adminshell.aas.v3.dataformat.aml.model.caex.RoleClassType; import io.adminshell.aas.v3.dataformat.aml.util.ReferencedReferableCollector; import io.adminshell.aas.v3.model.AssetAdministrationShellEnvironment; import io.adminshell.aas.v3.model.Referable; import java.beans.PropertyDescriptor; import java.lang.reflect.Type; +import java.util.HashMap; import java.util.Map; -import java.util.Set; import java.util.stream.Collectors; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -37,144 +32,93 @@ public class MappingContext { private static final String EMPTY_STRING = ""; private static final Logger log = LoggerFactory.getLogger(MappingContext.class); - private IdentityProvider identityProvider; private final MappingProvider mappingProvider; + private final IdGenerator idGenerator; private final AssetAdministrationShellEnvironment environment; - private CAEXFile.Builder fileBuilder; - private final InstanceHierarchy.Builder hierarchyBuilder; - private final InternalElementType.Builder internalElementBuilder; - private final AttributeType.Builder attributeBuilder; + private final Map idCache; + private final PropertyDescriptor property; private final Map referecedReferableIDs; - public MappingContext(MappingProvider mappingProvider, AssetAdministrationShellEnvironment environment) { - this(mappingProvider, null, environment, null, null, null, null, null); - } - - public String getInternalLinkTargetId(Referable target) { - if (!isTargetOfInternalLink(target)) { - referecedReferableIDs.put(target, identityProvider.getCachedId(target)); - } - return referecedReferableIDs.get(target); - } - - public boolean isTargetOfInternalLink(Referable target) { - return referecedReferableIDs.containsKey(target) && !referecedReferableIDs.get(target).equals(EMPTY_STRING); - } - - public void appendReferenceTargetInterfaceIfRequired(Object obj) { - RoleClassType.ExternalInterface referenceTargetInterface = getReferenceTargetInterface(obj); - if (referenceTargetInterface != null) { - internalElementBuilder.addExternalInterface(referenceTargetInterface); - } - } - - public RoleClassType.ExternalInterface getReferenceTargetInterface(Object obj) { - RoleClassType.ExternalInterface result = null; - if (obj != null && Referable.class.isAssignableFrom(obj.getClass())) { - Referable referable = (Referable) obj; - if (isTargetOfInternalLink(referable)) { - result = RoleClassType.ExternalInterface.builder() - .withID(identityProvider.generateId()) - .withName("externalReferenceTarget") - .withRefBaseClassPath("AutomationMLInterfaceClassLib/AutomationMLBaseInterface") - .build(); - } - } - return result; + public MappingContext(MappingProvider mappingProvider, + IdGenerator idGenerator, + AssetAdministrationShellEnvironment environment) { + this(mappingProvider, idGenerator, environment, null, null, null); } - public MappingContext(MappingProvider mappingProvider, - IdentityProvider identityProvider, + private MappingContext(MappingProvider mappingProvider, + IdGenerator idGenerator, AssetAdministrationShellEnvironment environment, Map referecedReferableIDs, - InstanceHierarchy.Builder hierarchyBuilder, - InternalElementType.Builder internalElementBuilder, AttributeType.Builder attributeBuilder, + Map idCache, PropertyDescriptor property) { - if (identityProvider == null) { - this.identityProvider = new IdentityProvider(); - } else { - this.identityProvider = identityProvider; - } + this.mappingProvider = mappingProvider; + this.idGenerator = idGenerator; + this.environment = environment; + this.property = property; if (referecedReferableIDs == null) { this.referecedReferableIDs = new ReferencedReferableCollector(environment).collect().stream() .collect(Collectors.toMap(x -> x, x -> EMPTY_STRING)); } else { this.referecedReferableIDs = referecedReferableIDs; } - this.fileBuilder = CAEXFile.builder(); - this.mappingProvider = mappingProvider; - this.environment = environment; - this.hierarchyBuilder = hierarchyBuilder; - this.internalElementBuilder = internalElementBuilder; - this.attributeBuilder = attributeBuilder; - this.property = property; - } - - public void addAttribute(AttributeType attribute) { - if (attributeBuilder != null) { - attributeBuilder.addAttribute(attribute); - } else if (internalElementBuilder != null) { - internalElementBuilder.addAttribute(attribute); + if (idCache == null) { + this.idCache = new HashMap<>(); } else { - log.warn("adding attribute failed because no parent builder defined"); + this.idCache = idCache; } } - public void addSystemUnitClassLib(SystemUnitClassLib systemUnitClassLib) { - if (fileBuilder != null) { - fileBuilder = fileBuilder.withSystemUnitClassLib(systemUnitClassLib); - } - } - - public void addInternalElement(InternalElementType internalElement) { - if (internalElementBuilder != null) { - internalElementBuilder.addInternalElement(internalElement); - } else if (hierarchyBuilder != null) { - hierarchyBuilder.addInternalElement(internalElement); - } else { - log.warn("adding internalElement failed because no parent builder defined"); + public String getInternalLinkTargetId(Referable target) { + if (!isTargetOfInternalLink(target)) { + referecedReferableIDs.put(target, getCachedId(target)); } + return referecedReferableIDs.get(target); } - public void map(T value) throws MappingException { - mappingProvider.getMapper(value).map(value, this); + public String generateId() { + return idGenerator.generateId(); } - public void map(Type type, T value) throws MappingException { - mappingProvider.getMapper(type).map(value, this); + public String getCachedId(Object obj) { + if (idCache.containsKey(obj)) { + return idCache.get(obj); + } + String result = idGenerator.generateId(); + idCache.put(obj, result); + return result; } - public MappingContext with(InstanceHierarchy.Builder hierarchyBuilder) { - return new MappingContext(mappingProvider, identityProvider, environment, referecedReferableIDs, hierarchyBuilder, internalElementBuilder, attributeBuilder, property); + public boolean isTargetOfInternalLink(Referable target) { + return referecedReferableIDs.containsKey(target) && !referecedReferableIDs.get(target).equals(EMPTY_STRING); } - public MappingContext with(InternalElementType.Builder internalElementBuilder) { - return new MappingContext(mappingProvider, identityProvider, environment, referecedReferableIDs, hierarchyBuilder, internalElementBuilder, attributeBuilder, property); + public void map(T value, AmlGenerator generator) throws MappingException { + mappingProvider.getMapper(value).map(value, generator, this); } - public MappingContext with(AttributeType.Builder attributeBuilder) { - return new MappingContext(mappingProvider, identityProvider, environment, referecedReferableIDs, hierarchyBuilder, internalElementBuilder, attributeBuilder, property); + public void map(Type type, T value, AmlGenerator generator) throws MappingException { + mappingProvider.getMapper(type).map(value, generator, this); } +// +// public void map(T value) throws MappingException { +// mappingProvider.getMapper(value).map(value, this); +// } +// +// public void map(Type type, T value) throws MappingException { +// mappingProvider.getMapper(type).map(value, this); +// } public MappingContext with(PropertyDescriptor property) { - return new MappingContext(mappingProvider, identityProvider, environment, referecedReferableIDs, hierarchyBuilder, internalElementBuilder, attributeBuilder, property); + return new MappingContext(mappingProvider, idGenerator, environment, referecedReferableIDs, idCache, property); } public MappingContext withoutProperty() { - return new MappingContext(mappingProvider, identityProvider, environment, referecedReferableIDs, hierarchyBuilder, internalElementBuilder, attributeBuilder, null); + return new MappingContext(mappingProvider, idGenerator, environment, referecedReferableIDs, idCache, null); } - public MappingContext withoutIdentidyProvider() { - return new MappingContext(mappingProvider, new IdentityProvider(), environment, referecedReferableIDs, hierarchyBuilder, internalElementBuilder, attributeBuilder, null); - } - - public void resetIdentityProvider() { - this.identityProvider = new IdentityProvider(); - } - - public void etIdentityProvider(IdentityProvider identityProvider) { - this.identityProvider = identityProvider; + public MappingContext withoutIdCache() { + return new MappingContext(mappingProvider, idGenerator, environment, referecedReferableIDs, null, property); } public PropertyDescriptor getProperty() { @@ -189,26 +133,6 @@ public MappingProvider getMappingProvider() { return mappingProvider; } - public CAEXFile.Builder getFileBuilder() { - return fileBuilder; - } - - public IdentityProvider getIdentityProvider() { - return identityProvider; - } - - public InstanceHierarchy.Builder getHierarchyBuilder() { - return hierarchyBuilder; - } - - public InternalElementType.Builder getInternalElementBuilder() { - return internalElementBuilder; - } - - public AttributeType.Builder getAttributeBuilder() { - return attributeBuilder; - } - public Map getReferecedReferableIDs() { return referecedReferableIDs; } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/UuidGenerator.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/UuidGenerator.java new file mode 100644 index 00000000..0783eb3f --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/UuidGenerator.java @@ -0,0 +1,27 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml; + +import java.util.UUID; + +public class UuidGenerator implements IdGenerator { + + @Override + public String generateId() { + return UUID.randomUUID().toString(); + } + +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/header/WriterHeader.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/header/WriterHeader.java index e6aca9d6..57311f4e 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/header/WriterHeader.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/header/WriterHeader.java @@ -17,9 +17,11 @@ import java.text.SimpleDateFormat; import java.util.Date; +import javax.xml.bind.annotation.XmlAnyElement; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; +//@XmlType(name = EmployeeDesiredSkill.class) public class WriterHeader { @XmlElement(name = "WriterName") @@ -50,7 +52,7 @@ public String getName() { return name; } -// @XmlType(name = "xs:string") + @XmlType(name = "xs:anyType") public static class Wrapper { @XmlElement(name = "WriterHeader") @@ -141,4 +143,6 @@ public String getProjectID() { public void setProjectID(String projectID) { this.projectID = projectID; } + + } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/AbstractCollectionMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/AbstractCollectionMapper.java index ae1a3f25..676962f4 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/AbstractCollectionMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/AbstractCollectionMapper.java @@ -15,6 +15,7 @@ */ package io.adminshell.aas.v3.dataformat.aml.mapper; +import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; import io.adminshell.aas.v3.dataformat.aml.MappingContext; import io.adminshell.aas.v3.dataformat.aml.model.caex.AttributeType; import io.adminshell.aas.v3.dataformat.core.ReflectionHelper; @@ -35,14 +36,14 @@ protected Class getValueType(Collection collection, MappingContext context } @Override - protected void toInternalElement(Collection collection, MappingContext context) throws MappingException { + protected void toInternalElement(Collection collection, AmlGenerator generator, MappingContext context) throws MappingException { for (T element : collection) { - context.withoutProperty().map(element); + context.withoutProperty().map(element, generator); } } @Override - protected void toAttribute(Collection collection, MappingContext context) throws MappingException { + protected void toAttribute(Collection collection, AmlGenerator generator, MappingContext context) throws MappingException { Class aasType = context.getProperty().getReadMethod().getDeclaringClass(); AttributeType.Builder builder = AttributeType.builder() .withName(context.getMappingProvider().getAttributeNamingStrategy().getName( @@ -52,10 +53,9 @@ protected void toAttribute(Collection collection, MappingContext context) thr .withRefSemantic(refSemantic( aasType.getSimpleName(), context.getProperty().getName())); - MappingContext subContext = context.with(builder).withoutProperty(); for (T element : collection) { - subContext.map(element); + context.map(element, generator.with(builder)); } - context.addAttribute(builder.build()); + generator.addAttribute(builder.build()); } } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/AssetAdministrationShellEnvironmentMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/AssetAdministrationShellEnvironmentMapper.java index 3f54fbf0..bec5ffef 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/AssetAdministrationShellEnvironmentMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/AssetAdministrationShellEnvironmentMapper.java @@ -16,6 +16,7 @@ package io.adminshell.aas.v3.dataformat.aml.mapper; import com.google.inject.util.Types; +import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; import io.adminshell.aas.v3.dataformat.aml.IdentityProvider; import io.adminshell.aas.v3.dataformat.aml.MappingContext; import io.adminshell.aas.v3.dataformat.aml.MappingProvider; @@ -39,65 +40,46 @@ public class AssetAdministrationShellEnvironmentMapper extends BaseMapper { @Override - public void map(AssetAdministrationShellEnvironment value, MappingContext context) throws MappingException { + public void map(AssetAdministrationShellEnvironment value, AmlGenerator generator, MappingContext context) throws MappingException { List assetAdministrationShells = value.getAssetAdministrationShells().stream() .filter(x -> x.getSubmodels().stream() .anyMatch(sm -> AASUtils.resolveSubmodelReference(sm, value).get().getKind() == ModelingKind.INSTANCE)) .collect(Collectors.toList()); - toHierarchy(AssetAdministrationShell.class, assetAdministrationShells, context); - toHierarchy(ConceptDescription.class, value.getConceptDescriptions(), context); - mapTemplates(value, context); + toHierarchy(AssetAdministrationShell.class, assetAdministrationShells, generator, context); + toHierarchy(ConceptDescription.class, value.getConceptDescriptions(), generator, context); + mapTemplates(value, generator, context); } - protected void toHierarchy(Class type, Collection value, MappingContext context) throws MappingException { + protected void toHierarchy(Class type, Collection value, AmlGenerator generator, MappingContext context) throws MappingException { CAEXFile.InstanceHierarchy.Builder builder = CAEXFile.InstanceHierarchy.builder() .withName(type.getSimpleName() + "InstanceHierarchy"); - context.with(builder).map(Types.newParameterizedType(Collection.class, type), value); - context.getFileBuilder().addInstanceHierarchy(builder.build()); + context.map(Types.newParameterizedType(Collection.class, type), value, generator.with(builder)); + generator.addInstanceHierarchy(builder.build()); } - protected void mapTemplates(AssetAdministrationShellEnvironment env, MappingContext context) throws MappingException { - context.resetIdentityProvider(); + protected void mapTemplates(AssetAdministrationShellEnvironment env, AmlGenerator generator, MappingContext context) throws MappingException { boolean empty = true; SystemUnitClassLib.Builder builder = SystemUnitClassLib.builder() .withName("AssetAdministrationShellSystemUnitClasses"); // generate SystemUnitClass for each AAS with at least 1 Submodel with kind == TEMPLATE // generate SystemUnitClass for each Submodel with king == TEMPLATE + MappingContext subContext = context.withoutIdCache().withoutProperty(); for (AssetAdministrationShell aas : env.getAssetAdministrationShells()) { List submodelTemplates = AASUtils.getSubmodelTemplates(aas, env); if (!submodelTemplates.isEmpty()) { empty = false; InternalElementType.Builder temp = InternalElementType.builder(); - MappingContext subContext = new MappingContext( - context.getMappingProvider(), - new IdentityProvider(), - env, - context.getReferecedReferableIDs(), - null, - temp, - null, - null); - subContext.map(aas); + subContext.map(aas, generator.with(temp)); builder.addSystemUnitClass(internalElementToSystemUnitClass(temp.build().getInternalElement().get(0))); } for (Submodel submodel : submodelTemplates) { InternalElementType.Builder temp = InternalElementType.builder(); - MappingContext subContext = new MappingContext( - context.getMappingProvider(), - new IdentityProvider(), - env, - context.getReferecedReferableIDs(), - null, - temp, - null, - null); - subContext.map(submodel); + subContext.map(submodel, generator.with(temp)); builder.addSystemUnitClass(internalElementToSystemUnitClass(temp.build().getInternalElement().get(0))); } } if (!empty) { - context.addSystemUnitClassLib(builder.build()); -// context.getFileBuilder().addSystemUnitClassLib(builder.build()); + generator.addSystemUnitClassLib(builder.build()); } } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/BaseMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/BaseMapper.java index a97a64b8..248d4ec6 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/BaseMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/BaseMapper.java @@ -15,12 +15,11 @@ */ package io.adminshell.aas.v3.dataformat.aml.mapper; +import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; import io.adminshell.aas.v3.dataformat.aml.MappingContext; import io.adminshell.aas.v3.dataformat.aml.model.caex.AttributeType; import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; -import io.adminshell.aas.v3.dataformat.aml.model.caex.RoleClassType; import io.adminshell.aas.v3.dataformat.core.ReflectionHelper; -import io.adminshell.aas.v3.model.Referable; import java.beans.IntrospectionException; import java.beans.Introspector; import java.beans.PropertyDescriptor; @@ -30,8 +29,6 @@ import java.util.List; import java.util.Optional; import java.util.Set; -import java.util.logging.Level; -import java.util.logging.Logger; public abstract class BaseMapper implements Mapper { @@ -44,33 +41,33 @@ protected Class getValueType(T value, MappingContext context) { } @Override - public void map(T value, MappingContext context) throws MappingException { + public void map(T value, AmlGenerator generator, MappingContext context) throws MappingException { if (value == null || context == null) { return; } Class aasType = getValueType(value, context); Class aasTypeInfo = ReflectionHelper.getMostSpecificTypeWithModelType(aasType); if (aasTypeInfo != null) { - toInternalElement(value, context); + toInternalElement(value, generator, context); } else { - toAttribute(value, context); + toAttribute(value, generator, context); } } - protected void toInternalElement(T value, MappingContext context) throws MappingException { + protected void toInternalElement(T value, AmlGenerator generator, MappingContext context) throws MappingException { InternalElementType.Builder builder = InternalElementType.builder(); - builder = builder.withID(context.getIdentityProvider().getCachedId(value)) + builder = builder.withID(context.getCachedId(value)) .withName(context.getMappingProvider().getInternalElementNamingStrategy().getName( value.getClass(), value, null)) .withRoleRequirements(roleRequirement(ReflectionHelper.getModelType(value.getClass()))); - mapProperties(value, context.with(builder)); - context.with(builder).appendReferenceTargetInterfaceIfRequired(value); - context.addInternalElement(builder.build()); + mapProperties(value, generator.with(builder), context); + generator.with(builder).appendReferenceTargetInterfaceIfRequired(value, context); + generator.addInternalElement(builder.build()); } - protected void toAttribute(T value, MappingContext context) throws MappingException { + protected void toAttribute(T value, AmlGenerator generator, MappingContext context) throws MappingException { Class aasType = ReflectionHelper.getAasInterface(value.getClass()); AttributeType.Builder builder = AttributeType.builder(); if (context.getProperty() != null) { @@ -84,14 +81,14 @@ protected void toAttribute(T value, MappingContext context) throws MappingExcept context.getProperty().getName())); } if (aasType != null) { - mapProperties(value, context.with(builder)); + mapProperties(value, generator.with(builder), context); } else { builder = builder.withValue(value); } - context.addAttribute(builder.build()); + generator.addAttribute(builder.build()); } - protected void mapProperties(T value, MappingContext context, String... ignoreProperties) throws MappingException { + protected void mapProperties(T value, AmlGenerator generator, MappingContext context, String... ignoreProperties) throws MappingException { List ignored = Arrays.asList(ignoreProperties); Class aasType = ReflectionHelper.getAasInterface(value.getClass()); Set> types = new HashSet<>(); @@ -103,8 +100,10 @@ protected void mapProperties(T value, MappingContext context, String... ignorePr try { for (PropertyDescriptor property : Introspector.getBeanInfo(type).getPropertyDescriptors()) { if (!ignored.contains(property.getName())) { - context.with(property).map(property.getReadMethod().getGenericReturnType(), - getPropertyValue(value, property, context)); + context.with(property) + .map(property.getReadMethod().getGenericReturnType(), + getPropertyValue(value, property, context), + generator); } } } catch (IntrospectionException ex) { diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/ConstraintCollectionMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/ConstraintCollectionMapper.java index cd205c4e..d7568771 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/ConstraintCollectionMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/ConstraintCollectionMapper.java @@ -15,6 +15,7 @@ */ package io.adminshell.aas.v3.dataformat.aml.mapper; +import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; import io.adminshell.aas.v3.dataformat.aml.MappingContext; import io.adminshell.aas.v3.model.Constraint; import java.util.Collection; @@ -22,9 +23,9 @@ public class ConstraintCollectionMapper implements CollectionMapper { @Override - public void map(Collection value, MappingContext context) throws MappingException { + public void map(Collection value, AmlGenerator generator, MappingContext context) throws MappingException { for (Constraint element : value) { - context.map(element); + context.map(element, generator); } } } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/DataSpecificationContentMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/DataSpecificationContentMapper.java index 960f8bd3..567bf423 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/DataSpecificationContentMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/DataSpecificationContentMapper.java @@ -15,9 +15,9 @@ */ package io.adminshell.aas.v3.dataformat.aml.mapper; +import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; import io.adminshell.aas.v3.dataformat.aml.MappingContext; import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; -import io.adminshell.aas.v3.dataformat.core.ReflectionHelper; import io.adminshell.aas.v3.model.DataSpecificationContent; public class DataSpecificationContentMapper extends BaseMapper { @@ -26,21 +26,21 @@ public DataSpecificationContentMapper() { } @Override - public void map(DataSpecificationContent content, MappingContext context) throws MappingException { - toInternalElement(content, context); + public void map(DataSpecificationContent content, AmlGenerator generator, MappingContext context) throws MappingException { + toInternalElement(content, generator, context); } @Override - protected void toInternalElement(DataSpecificationContent value, MappingContext context) throws MappingException { + protected void toInternalElement(DataSpecificationContent value, AmlGenerator generator, MappingContext context) throws MappingException { InternalElementType.Builder builder = InternalElementType.builder(); - builder = builder.withID(context.getIdentityProvider().getId(value)) + builder = builder.withID(context.generateId()) .withName(context.getMappingProvider().getInternalElementNamingStrategy().getName( value.getClass(), value, null)) .withRoleRequirements(roleRequirement(DataSpecificationContent.class.getSimpleName())); - mapProperties(value, context.with(builder)); - context.with(builder).appendReferenceTargetInterfaceIfRequired(value); - context.addInternalElement(builder.build()); + mapProperties(value, generator.with(builder), context); + generator.with(builder).appendReferenceTargetInterfaceIfRequired(value, context); + generator.addInternalElement(builder.build()); } } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/DataSpecificationIEC61360Mapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/DataSpecificationIEC61360Mapper.java index 2d674def..e9bedf07 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/DataSpecificationIEC61360Mapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/DataSpecificationIEC61360Mapper.java @@ -15,9 +15,9 @@ */ package io.adminshell.aas.v3.dataformat.aml.mapper; +import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; import io.adminshell.aas.v3.dataformat.aml.MappingContext; import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; -import io.adminshell.aas.v3.dataformat.core.ReflectionHelper; import io.adminshell.aas.v3.model.DataSpecificationContent; import io.adminshell.aas.v3.model.DataSpecificationIEC61360; import java.beans.PropertyDescriptor; @@ -25,24 +25,25 @@ public class DataSpecificationIEC61360Mapper extends BaseMapper { @Override - public void map(DataSpecificationIEC61360 content, MappingContext context) throws MappingException { - toInternalElement(content, context); + public void map(DataSpecificationIEC61360 content, AmlGenerator generator, MappingContext context) throws MappingException { + toInternalElement(content, generator, context); } @Override - protected void toInternalElement(DataSpecificationIEC61360 value, MappingContext context) throws MappingException { + protected void toInternalElement(DataSpecificationIEC61360 value, AmlGenerator generator, MappingContext context) throws MappingException { InternalElementType.Builder builder = InternalElementType.builder(); - builder = builder.withID(context.getIdentityProvider().getId(value)) + builder = builder.withID(context.generateId()) .withName(context.getMappingProvider().getInternalElementNamingStrategy().getName( value.getClass(), value, null)) .withRoleRequirements(roleRequirement(DataSpecificationContent.class.getSimpleName())); - mapProperties(value, context.with(builder)); - context.with(builder).appendReferenceTargetInterfaceIfRequired(value); - context.addInternalElement(builder.build()); + mapProperties(value, generator.with(builder), context); + generator.with(builder).appendReferenceTargetInterfaceIfRequired(value, context); + generator.addInternalElement(builder.build()); } + @Override protected Object getPropertyValue(DataSpecificationIEC61360 value, PropertyDescriptor property, MappingContext context) throws MappingException { if (property.getName().equals("levelTypes") || property.getName().equals("valueList")) { return null; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/DataSpecificationMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/DataSpecificationMapper.java index 815f671f..762f2dc7 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/DataSpecificationMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/DataSpecificationMapper.java @@ -15,13 +15,9 @@ */ package io.adminshell.aas.v3.dataformat.aml.mapper; +import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; import io.adminshell.aas.v3.dataformat.aml.MappingContext; -import io.adminshell.aas.v3.dataformat.aml.model.caex.AttributeType; import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; -import io.adminshell.aas.v3.dataformat.aml.model.caex.RoleClassType; -import io.adminshell.aas.v3.dataformat.aml.model.caex.SystemUnitClassType.InternalLink; -import io.adminshell.aas.v3.dataformat.aml.util.AASUtils; -import io.adminshell.aas.v3.dataformat.core.ReflectionHelper; import io.adminshell.aas.v3.model.DataSpecificationContent; import io.adminshell.aas.v3.model.EmbeddedDataSpecification; @@ -31,13 +27,13 @@ public DataSpecificationMapper() { } @Override - public void map(EmbeddedDataSpecification value, MappingContext context) throws MappingException { + public void map(EmbeddedDataSpecification value, AmlGenerator generator, MappingContext context) throws MappingException { if (value.getDataSpecificationContent() != null) { //embedded DataSpecificationContent content = value.getDataSpecificationContent(); String refSystemUnitPath = "AssetAdministrationShellDataSpecificationTemplates/" + content.getClass().getSimpleName() + "Template/" + content.getClass().getSimpleName(); InternalElementType.Builder builder = InternalElementType.builder() - .withID(context.getIdentityProvider().getId(value)) + .withID(context.generateId()) .withRefBaseSystemUnitPath(refSystemUnitPath) .withName("EmbeddedDataSpecification"); // serialize properties, but with different attribute path ("IEC:DataSpecificationIEC63360/[propertyName]) diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/EmbeddedDataSpecificationCollectionMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/EmbeddedDataSpecificationCollectionMapper.java index fbda1b31..1cf7709c 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/EmbeddedDataSpecificationCollectionMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/EmbeddedDataSpecificationCollectionMapper.java @@ -15,6 +15,7 @@ */ package io.adminshell.aas.v3.dataformat.aml.mapper; +import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; import io.adminshell.aas.v3.dataformat.aml.MappingContext; import io.adminshell.aas.v3.dataformat.aml.model.caex.AttributeType; import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; @@ -28,7 +29,7 @@ public class EmbeddedDataSpecificationCollectionMapper extends BaseMapper> { @Override - public void map(Collection value, MappingContext context) throws MappingException { + public void map(Collection value, AmlGenerator generator, MappingContext context) throws MappingException { if (value == null || context == null || value.isEmpty()) { return; } @@ -48,27 +49,19 @@ public void map(Collection value, MappingContext cont // idea: get current attribute path via context? // for now do not care about correct attribute path InternalElementType.Builder temp = InternalElementType.builder(); - MappingContext subContext = new MappingContext( - context.getMappingProvider(), - context.getIdentityProvider(), - context.getEnvironment(), - context.getReferecedReferableIDs(), - null, - temp, - null, - null); - subContext.map(element.getDataSpecificationContent()); + AmlGenerator subGenerator = generator.with(temp); + context.map(element.getDataSpecificationContent(), subGenerator); InternalElementType.Builder builder = InternalElementType.copyOf(temp.build().getInternalElement().get(0)) .withName("EmbeddedDataSpecification" + (countInternalElement > 1 ? "_" + (internalElements.size() + 1) : "")) - .withID(context.getIdentityProvider().getId(element)) + .withID(context.generateId()) .withRefBaseSystemUnitPath("AssetAdministrationShellDataSpecificationTemplates/" + getDataSpecificationContentType(element.getDataSpecificationContent().getClass()) + "Template/" + getDataSpecificationContentType(element.getDataSpecificationContent().getClass())); internalElements.add(builder.build()); } } - attributes.forEach(x -> context.addAttribute(x)); - internalElements.forEach(x -> context.addInternalElement(x)); + attributes.forEach(x -> generator.addAttribute(x)); + internalElements.forEach(x -> generator.addInternalElement(x)); } private String getDataSpecificationContentType(Class type) { diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/FileMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/FileMapper.java index 925fa0ed..6346783e 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/FileMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/FileMapper.java @@ -15,6 +15,7 @@ */ package io.adminshell.aas.v3.dataformat.aml.mapper; +import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; import io.adminshell.aas.v3.dataformat.aml.MappingContext; import io.adminshell.aas.v3.dataformat.aml.model.caex.AttributeType; import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; @@ -28,12 +29,12 @@ public FileMapper() { } @Override - public void map(File file, MappingContext context) throws MappingException { + public void map(File file, AmlGenerator generator, MappingContext context) throws MappingException { if (file == null) { return; } InternalElementType.Builder builder = InternalElementType.builder(); - builder = builder.withID(context.getIdentityProvider().getCachedId(file)) + builder = builder.withID(context.getCachedId(file)) .withName(context.getMappingProvider().getInternalElementNamingStrategy().getName( file.getClass(), file, @@ -41,7 +42,7 @@ public void map(File file, MappingContext context) throws MappingException { .withRoleRequirements(roleRequirement(ReflectionHelper.getModelType(file.getClass()))) .withExternalInterface(RoleClassType.ExternalInterface.builder() .withName("FileDataReference") - .withID(context.getIdentityProvider().generateId()) + .withID(context.generateId()) .withRefBaseClassPath("AssetAdministrationShellInterfaceClassLib/FileDataReference") .addAttribute(AttributeType.builder() .withName("MIMEType") @@ -54,8 +55,8 @@ public void map(File file, MappingContext context) throws MappingException { .withAttributeDataType("xs:anyURI") .build()) .build()); - mapProperties(file, context.with(builder)); - context.with(builder).appendReferenceTargetInterfaceIfRequired(file); - context.addInternalElement(builder.build()); + mapProperties(file, generator.with(builder), context); + generator.with(builder).appendReferenceTargetInterfaceIfRequired(file, context); + generator.addInternalElement(builder.build()); } } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/LangStringCollectionMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/LangStringCollectionMapper.java index bfb51cd3..ee5ee44f 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/LangStringCollectionMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/LangStringCollectionMapper.java @@ -15,6 +15,7 @@ */ package io.adminshell.aas.v3.dataformat.aml.mapper; +import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; import io.adminshell.aas.v3.dataformat.aml.MappingContext; import io.adminshell.aas.v3.dataformat.aml.model.caex.AttributeType; import io.adminshell.aas.v3.model.LangString; @@ -25,7 +26,7 @@ public class LangStringCollectionMapper extends BaseMapper> { @Override - public void map(Collection value, MappingContext context) { + public void map(Collection value, AmlGenerator generator, MappingContext context) { if (context == null || context.getProperty() == null) { throw new IllegalArgumentException("context.property must be non-null"); } @@ -33,7 +34,7 @@ public void map(Collection value, MappingContext context) { return; } Object t = (Class) ((ParameterizedType) context.getProperty().getReadMethod().getGenericReturnType()).getActualTypeArguments()[0]; - context.addAttribute(AttributeType.builder() + generator.addAttribute(AttributeType.builder() // für collections funktioniert getName so nicht weil value.class == Collection + type erasure .withName(context.getMappingProvider().getAttributeNamingStrategy().getName( context.getProperty().getReadMethod().getDeclaringClass(), diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/Mapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/Mapper.java index 6fc26f1e..e5983963 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/Mapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/Mapper.java @@ -15,9 +15,10 @@ */ package io.adminshell.aas.v3.dataformat.aml.mapper; +import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; import io.adminshell.aas.v3.dataformat.aml.MappingContext; public interface Mapper { - public void map(T value, MappingContext context) throws MappingException; + public void map(T value, AmlGenerator generator, MappingContext context) throws MappingException; } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/OperationMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/OperationMapper.java index 92767282..a09d5870 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/OperationMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/OperationMapper.java @@ -15,6 +15,7 @@ */ package io.adminshell.aas.v3.dataformat.aml.mapper; +import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; import io.adminshell.aas.v3.dataformat.aml.MappingContext; import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; import io.adminshell.aas.v3.model.Operation; @@ -25,10 +26,10 @@ public OperationMapper() { } @Override - public void map(Operation operation, MappingContext context) { + public void map(Operation operation, AmlGenerator generator, MappingContext context) { InternalElementType.Builder builder = InternalElementType.builder() .withName(context.getMappingProvider().getInternalElementNamingStrategy().getName(Operation.class, operation, null)); - context.with(builder).appendReferenceTargetInterfaceIfRequired(operation); - context.addInternalElement(builder.build()); + generator.with(builder).appendReferenceTargetInterfaceIfRequired(operation, context); + generator.addInternalElement(builder.build()); } } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/OperationVariableCollectionMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/OperationVariableCollectionMapper.java index 3c600346..a1104f57 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/OperationVariableCollectionMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/OperationVariableCollectionMapper.java @@ -15,6 +15,7 @@ */ package io.adminshell.aas.v3.dataformat.aml.mapper; +import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; import io.adminshell.aas.v3.dataformat.aml.MappingContext; import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; import io.adminshell.aas.v3.model.OperationVariable; @@ -23,7 +24,7 @@ public class OperationVariableCollectionMapper extends AbstractCollectionMapper { @Override - public void map(Collection value, MappingContext context) throws MappingException { + public void map(Collection value, AmlGenerator generator, MappingContext context) throws MappingException { if (value == null || value.isEmpty()) { return; } @@ -34,15 +35,14 @@ public void map(Collection value, MappingContext context) thr name = name.substring(0, 1).toUpperCase() + name.substring(1); InternalElementType.Builder builder = InternalElementType.builder() .withName(name) - .withID(context.getIdentityProvider().getId(value)) + .withID(context.generateId()) .withRoleRequirements(roleRequirement("Operation" + name)); for (OperationVariable element : value) { context - .with(builder) .withoutProperty() - .withoutIdentidyProvider() - .map(element); + .withoutIdCache() + .map(element, generator.with(builder)); } - context.addInternalElement(builder.build()); + generator.addInternalElement(builder.build()); } } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/OperationVariableMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/OperationVariableMapper.java index 6a6464d8..59c73381 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/OperationVariableMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/OperationVariableMapper.java @@ -15,6 +15,7 @@ */ package io.adminshell.aas.v3.dataformat.aml.mapper; +import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; import io.adminshell.aas.v3.dataformat.aml.MappingContext; import io.adminshell.aas.v3.model.OperationVariable; @@ -24,10 +25,10 @@ public OperationVariableMapper() { } @Override - public void map(OperationVariable operationVariable, MappingContext context) throws MappingException { + public void map(OperationVariable operationVariable, AmlGenerator generator, MappingContext context) throws MappingException { // toInternalElement(operationVariable, context); if (operationVariable != null && operationVariable.getValue() != null) { - context.withoutProperty().map(operationVariable.getValue()); + context.withoutProperty().map(operationVariable.getValue(), generator); } } } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/QualifierMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/QualifierMapper.java index 34db6fde..45169409 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/QualifierMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/QualifierMapper.java @@ -15,6 +15,7 @@ */ package io.adminshell.aas.v3.dataformat.aml.mapper; +import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; import io.adminshell.aas.v3.dataformat.aml.MappingContext; import io.adminshell.aas.v3.dataformat.aml.model.caex.AttributeType; import io.adminshell.aas.v3.dataformat.aml.model.caex.AttributeType.RefSemantic; @@ -23,13 +24,13 @@ public class QualifierMapper extends BaseMapper { @Override - public void map(Qualifier qualifier, MappingContext context) throws MappingException { + public void map(Qualifier qualifier, AmlGenerator generator, MappingContext context) throws MappingException { AttributeType.Builder builder = AttributeType.builder() .withName("qualifier:" + qualifier.getType() + "=" + qualifier.getValue()) .addRefSemantic(RefSemantic.builder() .withCorrespondingAttributePath("AAS:" + context.getProperty().getReadMethod().getDeclaringClass().getSimpleName() + "/" + context.getProperty().getName()) .build()); - mapProperties(qualifier, context.with(builder)); - context.addAttribute(builder.build()); + mapProperties(qualifier, generator.with(builder), context); + generator.addAttribute(builder.build()); } } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/ReferenceCollectionMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/ReferenceCollectionMapper.java index 2f1cde78..f3f10b8d 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/ReferenceCollectionMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/ReferenceCollectionMapper.java @@ -15,6 +15,7 @@ */ package io.adminshell.aas.v3.dataformat.aml.mapper; +import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; import io.adminshell.aas.v3.dataformat.aml.MappingContext; import io.adminshell.aas.v3.model.Reference; import java.util.Collection; @@ -22,12 +23,12 @@ public class ReferenceCollectionMapper implements CollectionMapper { @Override - public void map(Collection value, MappingContext context) throws MappingException { + public void map(Collection value, AmlGenerator generator, MappingContext context) throws MappingException { if (value == null || value.isEmpty()) { return; } for (Reference element : value) { - context.withoutProperty().map(element); + context.withoutProperty().map(element, generator); } } } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/ReferenceElementMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/ReferenceElementMapper.java index f9a5da45..6af0115a 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/ReferenceElementMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/ReferenceElementMapper.java @@ -15,17 +15,16 @@ */ package io.adminshell.aas.v3.dataformat.aml.mapper; +import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; import io.adminshell.aas.v3.dataformat.aml.MappingContext; import io.adminshell.aas.v3.dataformat.aml.model.caex.AttributeType; import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; import io.adminshell.aas.v3.dataformat.aml.model.caex.RoleClassType; -import io.adminshell.aas.v3.dataformat.aml.model.caex.SystemUnitClassType; import io.adminshell.aas.v3.dataformat.aml.model.caex.SystemUnitClassType.InternalLink; import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.util.ReferenceConverterUtil; import io.adminshell.aas.v3.dataformat.aml.util.AASUtils; import io.adminshell.aas.v3.dataformat.core.ReflectionHelper; import io.adminshell.aas.v3.model.Referable; -import io.adminshell.aas.v3.model.Reference; import io.adminshell.aas.v3.model.ReferenceElement; public class ReferenceElementMapper extends BaseMapper { @@ -34,22 +33,22 @@ public ReferenceElementMapper() { } @Override - public void map(ReferenceElement element, MappingContext context) throws MappingException { + public void map(ReferenceElement element, AmlGenerator generator, MappingContext context) throws MappingException { if (element == null) { return; } // regular mapping InternalElementType.Builder builder = InternalElementType.builder() - .withID(context.getIdentityProvider().getCachedId(element)) + .withID(context.getCachedId(element)) .withName(context.getMappingProvider().getInternalElementNamingStrategy().getName( element.getClass(), element, null)) .withRoleRequirements(roleRequirement(ReflectionHelper.getModelType(element.getClass()))); - mapProperties(element, context.with(builder), "value"); + mapProperties(element, generator.with(builder), context, "value"); // add interface RoleClassType.ExternalInterface.Builder interfaceBuilder = RoleClassType.ExternalInterface.builder() - .withID(context.getIdentityProvider().generateId()) + .withID(context.generateId()) .withName("ReferableReference") .withRefBaseClassPath("AssetAdministrationShellInterfaceClassLib/ReferableReference"); Referable resolvedReference = AASUtils.resolve(element.getValue(), context.getEnvironment()); @@ -60,22 +59,22 @@ public void map(ReferenceElement element, MappingContext context) throws Mapping // !!! contradicts CAEX meta model as depicted on slide 13 https://www.plt.rwth-aachen.de/global/show_document.asp?id=aaaaaaaaaatmalk builder = builder.withInternalLink(InternalLink.builder() .withName("value") - .withID(context.getIdentityProvider().generateId()) - .withRefPartnerSideA(context.getIdentityProvider().getCachedId(element) + ":ReferableReference") + .withID(context.generateId()) + .withRefPartnerSideA(context.getCachedId(element) + ":ReferableReference") .withRefPartnerSideB(context.getInternalLinkTargetId(resolvedReference) + ":externalReferenceTarget") .build()); } else { interfaceBuilder = interfaceBuilder .addAttribute(AttributeType.builder() .withName("value") - .withID(context.getIdentityProvider().generateId()) + .withID(context.generateId()) .withAttributeDataType("xs:string") .withValue(ReferenceConverterUtil.convert(element.getValue())) .build()); } builder.withExternalInterface(interfaceBuilder.build()); - context.with(builder).appendReferenceTargetInterfaceIfRequired(element); - context.addInternalElement(builder.build()); + generator.with(builder).appendReferenceTargetInterfaceIfRequired(element, context); + generator.addInternalElement(builder.build()); } } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/ReferenceMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/ReferenceMapper.java index a28dd1de..9a4908a7 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/ReferenceMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/ReferenceMapper.java @@ -15,6 +15,7 @@ */ package io.adminshell.aas.v3.dataformat.aml.mapper; +import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; import io.adminshell.aas.v3.dataformat.aml.MappingContext; import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.util.ReferenceConverterUtil; import io.adminshell.aas.v3.dataformat.aml.util.AASUtils; @@ -26,17 +27,17 @@ public class ReferenceMapper extends ToAttributeMapper { @Override - public void map(Reference reference, MappingContext context) throws MappingException { + public void map(Reference reference, AmlGenerator generator, MappingContext context) throws MappingException { if (reference != null && !reference.getKeys().isEmpty()) { KeyElements referencedType = reference.getKeys().get(reference.getKeys().size() - 1).getType(); if (referencedType == KeyElements.SUBMODEL) { Optional resolvedSubmodel = AASUtils.resolveSubmodelReference(reference, context.getEnvironment()); if (resolvedSubmodel.isPresent()) { - context.withoutIdentidyProvider().map(resolvedSubmodel.get()); + context.withoutIdCache().map(resolvedSubmodel.get(), generator); return; } } } - mapAsAttribute(ReferenceConverterUtil.convert(reference), context); + mapAsAttribute(ReferenceConverterUtil.convert(reference), generator, context); } } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/RelationshipElementMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/RelationshipElementMapper.java index 4e5836e7..f69cfa1e 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/RelationshipElementMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/RelationshipElementMapper.java @@ -15,6 +15,7 @@ */ package io.adminshell.aas.v3.dataformat.aml.mapper; +import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; import io.adminshell.aas.v3.dataformat.aml.MappingContext; import io.adminshell.aas.v3.dataformat.aml.model.caex.AttributeType; import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; @@ -33,27 +34,28 @@ public RelationshipElementMapper() { } @Override - public void map(RelationshipElement element, MappingContext context) throws MappingException { + public void map(RelationshipElement element, AmlGenerator generator, MappingContext context) throws MappingException { if (element == null) { return; } // regular mapping InternalElementType.Builder builder = InternalElementType.builder() - .withID(context.getIdentityProvider().getCachedId(element)) + .withID(context.getCachedId(element)) .withName(context.getMappingProvider().getInternalElementNamingStrategy().getName( element.getClass(), element, null)) .withRoleRequirements(roleRequirement(ReflectionHelper.getModelType(element.getClass()))); - mapProperties(element, context.with(builder), "first", "second"); + AmlGenerator subGenerator = generator.with(builder); + mapProperties(element, subGenerator, context, "first", "second"); // add special mapping for first, second - mapProperty(element, element.getFirst(), "first", context.with(builder)); - mapProperty(element, element.getSecond(), "second", context.with(builder)); - context.with(builder).appendReferenceTargetInterfaceIfRequired(element); - context.addInternalElement(builder.build()); + mapProperty(element, element.getFirst(), "first", subGenerator, context); + mapProperty(element, element.getSecond(), "second", subGenerator, context); + generator.with(builder).appendReferenceTargetInterfaceIfRequired(element, context); + generator.addInternalElement(builder.build()); } - private void mapProperty(RelationshipElement element, Reference reference, String name, MappingContext context) { + private void mapProperty(RelationshipElement element, Reference reference, String name, AmlGenerator generator, MappingContext context) { RoleClassType.ExternalInterface.Builder builder = RoleClassType.ExternalInterface.builder() .withName(name) .withRefBaseClassPath("AssetAdministrationShellInterfaceClassLib/ReferableReference"); @@ -63,13 +65,12 @@ private void mapProperty(RelationshipElement element, Reference reference, Strin // check if it can also be added on higher levels as this would make things easier // !!! neither CAEXFile nor InstanceHierarchy allow definition of internalLinks which // !!! contradicts CAEX meta model as depicted on slide 13 https://www.plt.rwth-aachen.de/global/show_document.asp?id=aaaaaaaaaatmalk - context.getInternalElementBuilder() - .addInternalLink(InternalLink.builder() - .withName(name) - .withID(context.getIdentityProvider().generateId()) - .withRefPartnerSideA(context.getIdentityProvider().getCachedId(element) + ":name") - .withRefPartnerSideB(context.getInternalLinkTargetId(resolvedReference) + ":externalReferenceTarget") - .build()); + generator.addInternalLink(InternalLink.builder() + .withName(name) + .withID(context.generateId()) + .withRefPartnerSideA(context.getCachedId(element) + ":name") + .withRefPartnerSideB(context.getInternalLinkTargetId(resolvedReference) + ":externalReferenceTarget") + .build()); } else { builder = builder.addAttribute(AttributeType.builder() .withName("value") @@ -77,6 +78,6 @@ private void mapProperty(RelationshipElement element, Reference reference, Strin .withValue(ReferenceConverterUtil.convert(reference)) .build()); } - context.getInternalElementBuilder().addExternalInterface(builder.build()); + generator.addExternalInterface(builder.build()); } } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/SubmodelCollectionMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/SubmodelCollectionMapper.java index e8701aa7..ff2693a0 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/SubmodelCollectionMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/SubmodelCollectionMapper.java @@ -15,20 +15,19 @@ */ package io.adminshell.aas.v3.dataformat.aml.mapper; +import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; import io.adminshell.aas.v3.dataformat.aml.MappingContext; -import io.adminshell.aas.v3.model.ModelingKind; import io.adminshell.aas.v3.model.Submodel; import java.util.Collection; -import java.util.stream.Collectors; public class SubmodelCollectionMapper extends BaseMapper> { @Override - public void map(Collection value, MappingContext context) throws MappingException { + public void map(Collection value, AmlGenerator generator, MappingContext context) throws MappingException { if (value == null || context == null) { return; } - super.map(value, context); + super.map(value, generator, context); // super.map(value.stream() // .filter(x -> x.getKind() == ModelingKind.INSTANCE) // .collect(Collectors.toList()), diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/SubmodelMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/SubmodelMapper.java index 84c61b58..30b68722 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/SubmodelMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/SubmodelMapper.java @@ -15,6 +15,7 @@ */ package io.adminshell.aas.v3.dataformat.aml.mapper; +import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; import io.adminshell.aas.v3.dataformat.aml.MappingContext; import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; import io.adminshell.aas.v3.dataformat.core.ReflectionHelper; @@ -28,9 +29,9 @@ public SubmodelMapper() { } @Override - protected void toInternalElement(Submodel value, MappingContext context) throws MappingException { + protected void toInternalElement(Submodel value, AmlGenerator generator, MappingContext context) throws MappingException { InternalElementType.Builder builder = InternalElementType.builder(); - builder = builder.withID(context.getIdentityProvider().getCachedId(value)) + builder = builder.withID(context.getCachedId(value)) .withName(context.getMappingProvider().getInternalElementNamingStrategy().getName( value.getClass(), value, @@ -42,8 +43,8 @@ protected void toInternalElement(Submodel value, MappingContext context) throws value, null)); } - mapProperties(value, context.with(builder)); - context.with(builder).appendReferenceTargetInterfaceIfRequired(value); - context.addInternalElement(builder.build()); + mapProperties(value, generator.with(builder), context); + generator.with(builder).appendReferenceTargetInterfaceIfRequired(value, context); + generator.addInternalElement(builder.build()); } } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/ToAttributeMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/ToAttributeMapper.java index 7272fe13..a34ea660 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/ToAttributeMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/ToAttributeMapper.java @@ -15,14 +15,15 @@ */ package io.adminshell.aas.v3.dataformat.aml.mapper; +import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; import io.adminshell.aas.v3.dataformat.aml.MappingContext; import io.adminshell.aas.v3.dataformat.aml.model.caex.AttributeType; public abstract class ToAttributeMapper implements Mapper { - protected void mapAsAttribute(Object value, MappingContext context) { + protected void mapAsAttribute(Object value, AmlGenerator generator, MappingContext context) { if (value != null && context.getProperty() != null) { - context.addAttribute(AttributeType.builder() + generator.addAttribute(AttributeType.builder() .withName(context.getProperty().getName()) .withValue(value) .withRefSemantic(AttributeType.RefSemantic.builder() diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/ViewMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/ViewMapper.java index 94388af9..8a74cbe4 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/ViewMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/ViewMapper.java @@ -15,6 +15,7 @@ */ package io.adminshell.aas.v3.dataformat.aml.mapper; +import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; import io.adminshell.aas.v3.dataformat.aml.MappingContext; import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; import io.adminshell.aas.v3.dataformat.core.ReflectionHelper; @@ -23,12 +24,12 @@ public class ViewMapper extends BaseMapper { @Override - public void map(View view, MappingContext context) throws MappingException { + public void map(View view, AmlGenerator generator, MappingContext context) throws MappingException { if (view == null || view.getContainedElements() == null || view.getContainedElements().isEmpty()) { return; } InternalElementType.Builder builder = InternalElementType.builder(); - builder = builder.withID(context.getIdentityProvider().getCachedId(view)) + builder = builder.withID(context.getCachedId(view)) .withName(context.getMappingProvider().getInternalElementNamingStrategy().getName( view.getClass(), view, @@ -38,7 +39,7 @@ public void map(View view, MappingContext context) throws MappingException { // view.getContainedElements().get(0), // context.getEnvironment()))) .withRoleRequirements(roleRequirement(ReflectionHelper.getModelType(view.getClass()))); - context.with(builder).appendReferenceTargetInterfaceIfRequired(view); - context.addInternalElement(builder.build()); + generator.with(builder).appendReferenceTargetInterfaceIfRequired(view, context); + generator.addInternalElement(builder.build()); } } diff --git a/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/fixtures/TestExample.java b/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/fixtures/TestExample.java index e49c10e5..d4c0be72 100644 --- a/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/fixtures/TestExample.java +++ b/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/fixtures/TestExample.java @@ -25,7 +25,7 @@ public class TestExample { - public static final java.io.File FILE = new java.io.File("src/test/resources/test_demo_full_example.json"); + public static final java.io.File FILE = new java.io.File("src/test/resources/amlfile/example_test.aml"); private static KeyElements resolveKeyElement(Class type) { String potentialEnumName = EnumDeserializer.translate(ReflectionHelper.getAasInterface(type).getSimpleName()); diff --git a/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/serialize/AmlSerializerTest.java b/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/serialize/AmlSerializerTest.java index cc94f823..56d4502b 100644 --- a/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/serialize/AmlSerializerTest.java +++ b/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/serialize/AmlSerializerTest.java @@ -17,30 +17,62 @@ import io.adminshell.aas.v3.dataformat.aml.fixtures.FullExample; import io.adminshell.aas.v3.dataformat.SerializationException; +import io.adminshell.aas.v3.dataformat.aml.AmlSerializationConfig; import io.adminshell.aas.v3.dataformat.aml.AmlSerializer; +import io.adminshell.aas.v3.dataformat.aml.IntegerIdGenerator; import io.adminshell.aas.v3.dataformat.aml.fixtures.TestExample; -import io.adminshell.aas.v3.dataformat.aml.util.ReferencedReferableCollector; -import io.adminshell.aas.v3.model.Referable; -import java.util.Set; +import io.adminshell.aas.v3.model.AssetAdministrationShellEnvironment; +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.util.Iterator; import org.junit.Ignore; import org.junit.Test; +import org.xml.sax.SAXException; +import org.xmlunit.builder.DiffBuilder; +import org.xmlunit.diff.Diff; +import org.xmlunit.diff.Difference; public class AmlSerializerTest { private final AmlSerializer serializer = new AmlSerializer(); - - @Test + + @Test // @Ignore - public void testExample() throws SerializationException { - String actual = serializer.write(TestExample.ENVIRONMENT, true); - System.out.println(actual); + public void testExample() throws SerializationException, SAXException, IOException { + validateAmlSerializer(TestExample.FILE, TestExample.ENVIRONMENT); + } @Test @Ignore public void testSAPFullExample() throws SerializationException { String actual = serializer.write(FullExample.ENVIRONMENT); + } + + private void validateAmlSerializer(File expectedFile, AssetAdministrationShellEnvironment environment) + throws SerializationException, SAXException, IOException { + String expected = Files.readString(expectedFile.toPath()); + String actual = new AmlSerializer().write(environment, AmlSerializationConfig.builder() + .idGenerator(new IntegerIdGenerator()) + .build()); System.out.println(actual); + Diff diff = DiffBuilder + .compare(actual) + .withTest(expected) + .checkForSimilar().checkForIdentical() + .normalizeWhitespace() + .ignoreComments() + .ignoreWhitespace() + .withNodeFilter(node -> !node.getNodeName().equals("LastWritingDateTime")) + .build(); + Iterator iter = diff.getDifferences().iterator(); + int size = 0; + while (iter.hasNext()) { + System.out.println(iter.next()); + size++; + } + assert (size == 0); } } diff --git a/dataformat-aml/src/test/resources/amlfile/example_test.aml b/dataformat-aml/src/test/resources/amlfile/example_test.aml new file mode 100644 index 00000000..9e849536 --- /dev/null +++ b/dataformat-aml/src/test/resources/amlfile/example_test.aml @@ -0,0 +1,2610 @@ + + + + + + foo + bar + 02-08-2021 16:45:44 + + + + + + + + An Example Asset Administration Shell for the test application + + + Ein Beispiel-Verwaltungsschale für eine Test-Anwendung + + + + TestAssetAdministrationShell + + + + + + INSTANCE + + + + (ASSET)[IRI]https://acplt.org/Test_Asset + + + + + + + + (ASSET_ADMINISTRATION_SHELL)[IRI]https://acplt.org/TestAssetAdministrationShell2 + + + + + + 0 + + + + 0.9 + + + + + + + IRI + + + + https://acplt.org/Test_AssetAdministrationShell + + + + + + + + An example asset identification submodel for the test application + + + Ein Beispiel-Identifikations-Submodel für eine Test-Anwendung + + + + Identification + + + + + + 0 + + + + 0.9 + + + + + + + IRI + + + + http://acplt.org/Submodels/Assets/TestAsset/Identification + + + + + INSTANCE + + + + (SUBMODEL)[IRI]http://acplt.org/SubmodelTemplates/AssetIdentification + + + + + Parameter + + + + + + Example Reference Element object + + + Beispiel Reference Element Element + + + + ExampleReferenceElement + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ReferenceElements/ExampleReferenceElement + + + + + + + + + application/pdf + + + + /TestFile.pdf + + + + Parameter + + + + + + Example File object + + + Beispiel File Element + + + + ExampleFile + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Files/ExampleFile + + + + + application/pdf + + + /TestFile.pdf + + + + + + + Parameter + + + + + + Example Operation object + + + Beispiel Operation Element + + + + ExampleOperation + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Operations/ExampleOperation + + + + + + + Constant + + + + + + Example Property object + + + Beispiel Property Element + + + + ExampleProperty + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty + + + + exampleValue + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + string + + + + + + + + + + Constant + + + + + + Example Property object + + + Beispiel Property Element + + + + ExampleProperty + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty + + + + exampleValue + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + string + + + + + + + + + + Constant + + + + + + Example Property object + + + Beispiel Property Element + + + + ExampleProperty + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty + + + + exampleValue + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + string + + + + + + + + + + + + + + + http://acplt.org/Qualifier/ExampleQualifier + + + + 100 + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + int + + + + + + + http://acplt.org/Qualifier/ExampleQualifier2 + + + + 50 + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + int + + + + + + + An example bill of material submodel for the test application + + + Ein Beispiel-BillofMaterial-Submodel für eine Test-Anwendung + + + + BillOfMaterial + + + + + + 0.9 + + + + + + + IRI + + + + http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial + + + + + TEMPLATE + + + + (SUBMODEL)[IRI]http://acplt.org/SubmodelTemplates/BillOfMaterial + + + + + + + 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. + + + 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 + + + + ExampleEntity + + + + (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber + + + + CO_MANAGED_ENTITY + + + + + Constant + + + + + + Example Property object + + + Beispiel Property Element + + + + ExampleProperty2 + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty + + + + exampleValue2 + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + string + + + + + + + Constant + + + + + + Example Property object + + + Beispiel Property Element + + + + ExampleProperty + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty + + + + exampleValue + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + string + + + + + + + + + + + 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. + + + 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 + + + + ExampleEntity2 + + + + (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber + + + + SELF_MANAGED_ENTITY + + + + (ASSET)[IRI]https://acplt.org/Test_Asset2 + + + + + + + + + + + + + + + An example concept description for the test application + + + Ein Beispiel-ConceptDescription für eine Test-Anwendung + + + + TestConceptDescription + + + + + + 0 + + + + 0.9 + + + + + + + IRI + + + + https://acplt.org/Test_ConceptDescription + + + + + + REAL_MEASURE + + + + + + Dies ist eine Data Specification für Testzwecke + + + This is a DataSpecification for testing purposes + + + + + + Test Specification + + + TestSpecification + + + + + + Test Spec + + + TestSpec + + + + http://acplt.org/DataSpec/ExampleDef + + + + SU + + + + SpaceUnit + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Units/SpaceUnit + + + + TEST + + + + string + + + + + + + REAL_MEASURE + + + + + + Dies ist eine Data Specification für Testzwecke2 + + + This is a DataSpecification for testing purposes2 + + + + + + Test Specification2 + + + TestSpecification2 + + + + + + Test Spec2 + + + TestSpec2 + + + + http://acplt.org/DataSpec/ExampleDef + + + + SU + + + + SpaceUnit + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Units/SpaceUnit + + + + TEST2 + + + + string + + + + + + + + + Interface Class Library according to Details of the Asset Administration Shell V2.0. + 1.0.0 + + A FileDataReference represents the address to a File. FileDataReference is derived from the AutomationML Interface Class ExternalDataReference that is defined in AutomationML BPR_005E_ExternalDataReference_v1.0.0_2:The interface class “ExternalDataReference” shall be used in order to reference external documents out of the scope of AutomationML. + + + Reference to any other referable element of the same of any other AAS or a reference to an external object or entity. For local references inside the same Asset Administration Shell an InternalLink between two objects with this interface "ReferableReference" shall be set. In this case the attribute value has to be empty. For references between different Asset Administration Shells or external objects or entities the attribute value shall be used and no InternalLink shall be set. + + Reference to any other referable element of any other AAS or a reference to an external object or entity. Note: For references to any other referable element of the same AAS InternalLinks are used and this attribute value shall be empty. + + + + + + Standard Automation Markup Language Interface Class Library - Part 1 Content extended with Part 3 and Part 4 Content + 2.2.2 + + + + + + + + + + The attribute refURI is an IRI that can represent an absolute or relative path to an L document. An added fragment (with #) references inside the document + + + + + + + + + + + + + + + + + true + + + + + + + + + + + + + 1.0.0 + + + Mime type of the content of the File. + + + + + Role Class Library according to Details of the Asset Administration Shell V2.0. + 1.0.0 + + An Asset Administration Shell. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + + + + + + Abstract attribute class for identification. Has the subattributes id and idType. + + + Identifier of the element. Its type is defined in idType. Id is a subproperty of identification. + + + + + Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the enumeration “IdentifierType”. IdType is a subproperty of identification. + + + + + + Abstract attribute for administration. Has the subattributes revision and version. + + + Revision of the element. Constraint AASd-005: A revision requires a version. This means, if there is no version there is no revision neither. Revision is a subproperty of administration. + + + + + Version of the element. Version is a subproperty of administration. + + + + + + Global reference to the data specification template used by the element. + + + + + The derivedFrom attribute is used to establish a relationship between two Asset Administration Shells that are derived from each other. + + + + + + An Asset describes meta data of an asset that is represented by an AAS. The asset may either represent an asset type or an asset instance. The asset has a globally unique identifier plus – if needed – additional domain specific (proprietary) identifiers. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + Abstract attribute class for identification. Has the subattributes id and idType. + + + Identifier of the element. Its type is defined in idType. + + + + + Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the enumeration “IdentifierType”. IdType is a subproperty of identification. + + + + + + Abstract attribute for administration. Has the subattributes revision and version. + + + Revision of the element. Constraint AASd-005: A revision requires a version. This means, if there is no version there is no revision neither. Revision is a subproperty of administration. + + + + + Version of the element. Version is a subproperty of administration. + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the asset: either type or instance. + Instance + Instance + + + + Instance + Type + + + + + + A Submodel defines a specific aspect of the asset represented by the AAS. A submodel is used to structure the virtual representation and technical functionality of an Administration Shell into distinguishable parts. Each submodel refers to a well-defined domain or subject matter. Submodels can become standardized and thus become submodels types. Submodels can have different life-cycles. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + Abstract attribute class for identification. Has the subattributes id and idType. + + + Identifier of the element. Its type is defined in idType. Id is a subproperty of identification. + + + + + Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the enumeration “IdentifierType”. IdType is a subproperty of identification. + + + + + + Abstract attribute for administration. Has the subattributes revision and version. + + + Revision of the element. Constraint AASd-005: A revision requires a version. This means, if there is no version there is no revision neither. Revision is a subproperty of administration. + + + + + Version of the element. Version of the element. Version is a subproperty of administration. + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. + + + + + Reference to the global unqiue id of a coded value. + + + + + + + A submodel element collection is a set or list of submodel elements. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. + + + + + Reference to the global unqiue id of a coded value. + + + + + + If allowDuplicates=true, then it is allowed that the collection contains the same element several times. + false + + + + If ordered=false, then the elements in the property collection are not ordered. If ordered=true then the elements in the collection are ordered. Default = false. Note: An ordered submodel element collection is typically implemented as an indexed array. + false + + + + Submodel element contained in the collection. + + + + + A BLOB is a data element that represents a file that is contained with its source code in the value attribute. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. + + + + + Reference to the global unqiue id of a coded value. + + + + + + Mime type of the content of the BLOB. The mime type states which file extension the file has. Valid values are e.g. “application/json”, “application/xls”, ”image/jpg”. The allowed values are defined as in RFC2046. + + + + + The value of the BLOB instance of a blob data element. Note: In contrast to the file property the file content is stored directly as value in the Blob data element. + + + + + + A capability is the implementation-independent description of the potential of an asset to achieve a certain effect in the physical or virtual world. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. + + + + + Reference to the global unqiue id of a coded value. + + + + + + + A role class for a File that a data element that represents an address to a file. It is derived from the AutomationML role class ExternalData that is an role type for a document type and the base class for all document type roles. It describes different document types. ExternalData is defined in AutomationML BPR_005E_ExternalDataReference_v1.0.0_2. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. + + + + + Reference to the global unqiue id of a coded value. + + + + + + + The attribute refURI is an IRI that can represent an absolute or relative path to an L document. An added fragment (with #) references inside the document + + + Mime type of the content of the File. + + + + + A property is a data element that has a single value. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. + + + + + Reference to the global unqiue id of a coded value. + + + + + + The value of the property instance. + + + + Reference to the global unique id if a coded value. + + + + + A reference element is a data element that defines a logical reference to another element within the same or another AAS or a reference to an external object or entity. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. + + + + + Reference to the global unqiue id of a coded value. + + + + + + + Reference to any other referable element of any other AAS or a reference to an external object or entity. Note: For references to any other referable elment of the same AAS InternalLinks are used and this attribute value shall be empty. + + + + + + A relationship element is used to define a relationship between two referable elements. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. + + + + + Reference to the global unqiue id of a coded value. + + + + + + + Reference to any other referable element of any other AAS or a reference to an external object or entity. Note: For references to any other referable elment of the same AAS InternalLinks are used and this attribute value shall be empty. + + + + + Reference to any other referable element of any other AAS or a reference to an external object or entity. Note: For references to any other referable elment of the same AAS InternalLinks are used and this attribute value shall be empty. + + + + + An annotated relationship element is an relationship element that can be annotated with additional data elements. + + Annotations that hold for the relationships between the two elements. + + + + + An operation is a submodel element with input and output variables. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. + + + + + Reference to the global unqiue id of a coded value. + + + + + + + The list of AAS OperationVariableIn entities. In AML, the corresponding InternalElement with this role is a child of the InternalElement with the Operation role. + + + The list of AAS OperationVariableOut entities. In AML, the corresponding InternalElement with this role is a child of the InternalElement with the Operation role. + + + The list of AAS OperationVariableOut entities. In AML, the corresponding InternalElement with this role is a child of the InternalElement with the Operation role. + + + A view is a collection of referable elements w.r.t. to a specific viewpoint of one or more stakeholders. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + Global reference to the data specification template used by the element. + + + + + Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. + + + + + + A dictionary contains elements that can be reused. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + + + + + + + Explanation: The semantics of a property or other elements that may have a semantic description is defined by a concept description. The description of the concept should follow a standardized schema (realized as data specification template). + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + Abstract attribute class for identification. Has the subattributes id and idType. + + + Identifier of the element. Its type is defined in idType. Id is a subproperty of identification. + + + + + Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the enumeration “IdentifierType”. IdType is a subproperty of identification. + + + + + + Abstract attribute for administration. Has the subattributes revision and version. + + + Revision of the element. Constraint AASd-005: A revision requires a version. This means, if there is no version there is no revision neither. Revision is a subproperty of administration. + + + + + Version of the element. Version is a subproperty of administration. + + + + + + Global reference to the data specification template used by the element. + + + + Global reference to an external definition the concept is compatible to or was derived from. + + + + + + Description Role class of an element that has a data specification template. A template defines the additional attributes an element may or shall have. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + + + + + + Abstract attribute class for identification. Has the subattributes id and idType. + + + Identifier of the element. Its type is defined in idType. Id is a subproperty of identification. + + + + + Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the enumeration “IdentifierType”. IdType is a subproperty of identification. + + + + + + Abstract attribute for administration. Has the subattributes revision and version. + + + Revision of the element. Constraint AASd-005: A revision requires a version. This means, if there is no version there is no revision neither. Revision is a subproperty of administration. + + + + + Version of the element. Version is a subproperty of administration. + + + + + + + Content of the data specification template. + + + An entity is a submodel element that is used to model entities. Constraint AASd-056: If the semanticId of a Entity submodel element references a ConceptDescription then the ConceptDescription/category shall be one of following values: ENTITY. The ConceptDescription describes the elements assigned to the entity via Entity/statement. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. + + + + + Reference to the global unqiue id of a coded value. + + + + + + Describes statements applicable to the entity by a set of submodel elements, typically with a qualified value. + + + + Describes whether the entity is a co-managed entity or a self-managed entity. + SelfManagedEntity + SelfManagedEntity + + + + CoManagedEntity + SelfManagedEntity + + + + + Reference to an identifier key value pair representing a specific identifier of the asset represented by the asset administration shell. See Constraint AASd-014 + + + + Reference to the asset the entity is representing. Constraint AASd-014: Either the attribute globalAssetId or specificAssetId of an Entity must be set if Entity/entityType is set to "SelfManagedEntity". They are not existing otherwise. + + + + + + Automation Markup Language Base Role Class Library - Part 1 Content extended with Part 3 and Part 4 Content + 2.2.2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1.0.0 + + + + + + + + An Example Asset Administration Shell for the test application + + + Ein Beispiel-Verwaltungsschale für eine Test-Anwendung + + + + TestAssetAdministrationShell + + + + + + INSTANCE + + + + (ASSET)[IRI]https://acplt.org/Test_Asset + + + + + + + + (ASSET_ADMINISTRATION_SHELL)[IRI]https://acplt.org/TestAssetAdministrationShell2 + + + + + + 0 + + + + 0.9 + + + + + + + IRI + + + + https://acplt.org/Test_AssetAdministrationShell + + + + + + + + An example asset identification submodel for the test application + + + Ein Beispiel-Identifikations-Submodel für eine Test-Anwendung + + + + Identification + + + + + + 0 + + + + 0.9 + + + + + + + IRI + + + + http://acplt.org/Submodels/Assets/TestAsset/Identification + + + + + INSTANCE + + + + (SUBMODEL)[IRI]http://acplt.org/SubmodelTemplates/AssetIdentification + + + + + Parameter + + + + + + Example Reference Element object + + + Beispiel Reference Element Element + + + + ExampleReferenceElement + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ReferenceElements/ExampleReferenceElement + + + + + + + + + application/pdf + + + + /TestFile.pdf + + + + Parameter + + + + + + Example File object + + + Beispiel File Element + + + + ExampleFile + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Files/ExampleFile + + + + + application/pdf + + + /TestFile.pdf + + + + + + + Parameter + + + + + + Example Operation object + + + Beispiel Operation Element + + + + ExampleOperation + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Operations/ExampleOperation + + + + + + + Constant + + + + + + Example Property object + + + Beispiel Property Element + + + + ExampleProperty + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty + + + + exampleValue + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + string + + + + + + + + + + Constant + + + + + + Example Property object + + + Beispiel Property Element + + + + ExampleProperty + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty + + + + exampleValue + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + string + + + + + + + + + + Constant + + + + + + Example Property object + + + Beispiel Property Element + + + + ExampleProperty + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty + + + + exampleValue + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + string + + + + + + + + + + + + + + + http://acplt.org/Qualifier/ExampleQualifier + + + + 100 + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + int + + + + + + + http://acplt.org/Qualifier/ExampleQualifier2 + + + + 50 + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + int + + + + + + + An example bill of material submodel for the test application + + + Ein Beispiel-BillofMaterial-Submodel für eine Test-Anwendung + + + + BillOfMaterial + + + + + + 0.9 + + + + + + + IRI + + + + http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial + + + + + TEMPLATE + + + + (SUBMODEL)[IRI]http://acplt.org/SubmodelTemplates/BillOfMaterial + + + + + + + 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. + + + 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 + + + + ExampleEntity + + + + (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber + + + + CO_MANAGED_ENTITY + + + + + Constant + + + + + + Example Property object + + + Beispiel Property Element + + + + ExampleProperty2 + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty + + + + exampleValue2 + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + string + + + + + + + Constant + + + + + + Example Property object + + + Beispiel Property Element + + + + ExampleProperty + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty + + + + exampleValue + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + string + + + + + + + + + + + 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. + + + 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 + + + + ExampleEntity2 + + + + (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber + + + + SELF_MANAGED_ENTITY + + + + (ASSET)[IRI]https://acplt.org/Test_Asset2 + + + + + + + + + + + + + http://acplt.org/Qualifier/ExampleQualifier + + + + 100 + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + int + + + + + + + http://acplt.org/Qualifier/ExampleQualifier2 + + + + 50 + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + int + + + + + + + An example bill of material submodel for the test application + + + Ein Beispiel-BillofMaterial-Submodel für eine Test-Anwendung + + + + BillOfMaterial + + + + + + 0.9 + + + + + + + IRI + + + + http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial + + + + + TEMPLATE + + + + (SUBMODEL)[IRI]http://acplt.org/SubmodelTemplates/BillOfMaterial + + + + + + + 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. + + + 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 + + + + ExampleEntity + + + + (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber + + + + CO_MANAGED_ENTITY + + + + + Constant + + + + + + Example Property object + + + Beispiel Property Element + + + + ExampleProperty2 + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty + + + + exampleValue2 + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + string + + + + + + + Constant + + + + + + Example Property object + + + Beispiel Property Element + + + + ExampleProperty + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty + + + + exampleValue + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + string + + + + + + + + + + + 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. + + + 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 + + + + ExampleEntity2 + + + + (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber + + + + SELF_MANAGED_ENTITY + + + + (ASSET)[IRI]https://acplt.org/Test_Asset2 + + + + + + + + + 0 + + An AAS Data Specification template for IEC61369. A template consists of the DataSpecificationContent containing the additional attributes to be added to the element instance that references the data specification template and meta information about the template itself (this is why DataSpecification inherits from Identifiable). In UML these are two separated classes. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + + + + + + Abstract attribute class for identification. Has the subattributes id and idType. + + + Identifier of the element. Its type is defined in idType. Id is a subproperty of identification. + http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360 + + + + Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the enumeration “IdentifierType”. IdType is a subproperty of identification. + IRI + + + + + Abstract attribute for administration. Has the subattributes revision and version. + + + Revision of the element. Constraint AASd-005: A revision requires a version. This means, if there is no version there is no revision neither. Revision is a subproperty of administration. + + + + + Version of the element. Version is a subproperty of administration. + + + + + + + The content of an AAS Data Specification template for IEC61360. + + Identifies the attribute hierarchy for preferredName in above attribute hierachy. Subordinate attributes are designated by the country code information (see aml-lang literal). + + + + Identifies the attribute for shortName in above attribute hierarchy. + + + + Identifies the attribute for unit in above attribute hierarchy. + + + + Identifies the attribute for unitId in above attribute hierarchy in its string serialization. + + + + Identifies the attribute for sourceOfDefinition in above attribute hierachy. Subordinate attributes are designated by the country code information (see aml-lang literal). + + + + Identifies the attribute for symbol in above attribute hierarchy. + + + + Identifies the attribute for dataType in above attribute hierarchy. + + + + Identifies the attribute for definition in above attribute hierachy. Subordinate attributes are designated by the country code information (see aml-lang literal). + + + + Identifies the attribute for valueFormat in above attribute hierarchy. + + + + Identifies the attribute for valueList in above attribute hierarchy. + + + + The attribute value. + + + + The id for the value. + + + + + + + \ No newline at end of file From ec3dabf4a8ebe9c432daca0606b5a0a5fed5fea7 Mon Sep 17 00:00:00 2001 From: Jacoby Date: Tue, 3 Aug 2021 16:52:07 +0200 Subject: [PATCH 10/18] refactoring --- .../aas/v3/dataformat/aml/AasToAmlMapper.java | 116 ----- .../v3/dataformat/aml/AmlDocumentInfo.java | 63 +++ .../aas/v3/dataformat/aml/AmlGenerator.java | 100 +++- .../aml/AmlSerializationConfig.java | 2 + .../aas/v3/dataformat/aml/AmlSerializer.java | 3 +- .../v3/dataformat/aml/MappingProvider.java | 127 ----- .../aas/v3/dataformat/aml/ValueMapping.java | 53 -- .../Aas2AmlMappingContext.java} | 88 +++- .../aml/aas2aml/AasToAmlMapper.java | 128 +++++ .../aml/{ => aas2aml}/IdentityProvider.java | 3 +- .../mapper/Aas2AmlElementMapper.java} | 10 +- ...tAdministrationShellEnvironmentMapper.java | 41 +- .../mapper/ConstraintCollectionMapper.java | 12 +- .../DataSpecificationContentMapper.java | 43 ++ .../DataSpecificationIEC61360Mapper.java | 47 ++ .../mapper/DataSpecificationMapper.java | 13 +- .../mapper/DefaultCollectionMapper.java} | 35 +- .../aml/aas2aml/mapper/DefaultMapper.java | 139 ++++++ ...ddedDataSpecificationCollectionMapper.java | 22 +- .../aml/aas2aml/mapper/FileMapper.java | 59 +++ .../mapper/LangStringCollectionMapper.java | 15 +- .../{ => aas2aml}/mapper/OperationMapper.java | 10 +- .../OperationVariableCollectionMapper.java | 13 +- .../mapper/OperationVariableMapper.java | 10 +- .../aml/aas2aml/mapper/QualifierMapper.java | 37 ++ .../mapper/ReferenceCollectionMapper.java | 11 +- .../mapper/ReferenceElementMapper.java | 24 +- .../{ => aas2aml}/mapper/ReferenceMapper.java | 29 +- .../mapper/RelationshipElementMapper.java | 26 +- .../aml/aas2aml/mapper/SubmodelMapper.java | 38 ++ .../mapper/ToAttributeMapper.java | 8 +- .../aml/{ => aas2aml}/mapper/ViewMapper.java | 13 +- .../dataformat/aml/header/WriterHeader.java | 3 +- .../dataformat/aml/{ => id}/IdGenerator.java | 2 +- .../aml/{ => id}/IntegerIdGenerator.java | 2 +- .../aml/{ => id}/UuidGenerator.java | 2 +- .../v3/dataformat/aml/mapper/BaseMapper.java | 135 ----- .../DataSpecificationContentMapper.java | 46 -- .../DataSpecificationIEC61360Mapper.java | 53 -- .../v3/dataformat/aml/mapper/FileMapper.java | 62 --- .../aml/mapper/QualifierMapper.java | 36 -- .../aml/mapper/SubmodelCollectionMapper.java | 36 -- .../dataformat/aml/mapper/SubmodelMapper.java | 50 -- .../AbstractClassNamingStrategy.java | 5 +- .../{ => naming}/IdClassNamingStrategy.java | 2 +- .../aml/{ => naming}/NamingStrategy.java | 2 +- .../NumberingClassNamingStrategy.java | 2 +- .../{ => naming}/PropertyNamingStrategy.java | 5 +- .../mapper/util/ReferenceConverterUtil.java | 55 --- .../aas/v3/dataformat/aml/util/AASUtils.java | 10 + .../aas/v3/dataformat/aml/util/TypeUtils.java | 39 -- .../dataformat/aml/fixtures/TestExample.java | 53 +- .../aml/serialize/AmlSerializerTest.java | 8 +- .../test/resources/amlfile/example_test.aml | 464 +++++++++--------- .../v3/dataformat/core/ReflectionHelper.java | 2 +- .../deserialization/EnumDeserializer.java | 1 + .../v3/dataformat/mapping/ElementMapper.java | 7 +- .../aas/v3/dataformat/mapping/Mapper.java | 11 +- .../v3/dataformat/mapping/MappingContext.java | 15 +- .../dataformat/mapping}/MappingException.java | 2 +- .../dataformat/mapping/MappingProvider.java | 90 ++++ .../v3/dataformat/mapping/util/TypeUtils.java | 71 +++ 62 files changed, 1348 insertions(+), 1261 deletions(-) delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AasToAmlMapper.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlDocumentInfo.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/MappingProvider.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/ValueMapping.java rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/{MappingContext.java => aas2aml/Aas2AmlMappingContext.java} (56%) create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/AasToAmlMapper.java rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/{ => aas2aml}/IdentityProvider.java (90%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/{mapper/DefaultMapper.java => aas2aml/mapper/Aas2AmlElementMapper.java} (54%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/{ => aas2aml}/mapper/AssetAdministrationShellEnvironmentMapper.java (73%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/{ => aas2aml}/mapper/ConstraintCollectionMapper.java (67%) create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/DataSpecificationContentMapper.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/DataSpecificationIEC61360Mapper.java rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/{ => aas2aml}/mapper/DataSpecificationMapper.java (72%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/{mapper/AbstractCollectionMapper.java => aas2aml/mapper/DefaultCollectionMapper.java} (54%) create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/DefaultMapper.java rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/{ => aas2aml}/mapper/EmbeddedDataSpecificationCollectionMapper.java (78%) create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/FileMapper.java rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/{ => aas2aml}/mapper/LangStringCollectionMapper.java (75%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/{ => aas2aml}/mapper/OperationMapper.java (75%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/{ => aas2aml}/mapper/OperationVariableCollectionMapper.java (74%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/{ => aas2aml}/mapper/OperationVariableMapper.java (73%) create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/QualifierMapper.java rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/{ => aas2aml}/mapper/ReferenceCollectionMapper.java (69%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/{ => aas2aml}/mapper/ReferenceElementMapper.java (79%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/{ => aas2aml}/mapper/ReferenceMapper.java (51%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/{ => aas2aml}/mapper/RelationshipElementMapper.java (77%) create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/SubmodelMapper.java rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/{ => aas2aml}/mapper/ToAttributeMapper.java (83%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/{ => aas2aml}/mapper/ViewMapper.java (74%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/{ => id}/IdGenerator.java (91%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/{ => id}/IntegerIdGenerator.java (91%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/{ => id}/UuidGenerator.java (91%) delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/BaseMapper.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/DataSpecificationContentMapper.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/DataSpecificationIEC61360Mapper.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/FileMapper.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/QualifierMapper.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/SubmodelCollectionMapper.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/SubmodelMapper.java rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/{ => naming}/AbstractClassNamingStrategy.java (93%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/{ => naming}/IdClassNamingStrategy.java (92%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/{ => naming}/NamingStrategy.java (91%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/{ => naming}/NumberingClassNamingStrategy.java (93%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/{ => naming}/PropertyNamingStrategy.java (92%) delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/util/ReferenceConverterUtil.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util/TypeUtils.java rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/CollectionMapper.java => dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/ElementMapper.java (75%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/DefaultCollectionMapper.java => dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/Mapper.java (71%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/Mapper.java => dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/MappingContext.java (60%) rename {dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper => dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping}/MappingException.java (91%) create mode 100644 dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/MappingProvider.java create mode 100644 dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/util/TypeUtils.java diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AasToAmlMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AasToAmlMapper.java deleted file mode 100644 index 512b8985..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AasToAmlMapper.java +++ /dev/null @@ -1,116 +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 io.adminshell.aas.v3.dataformat.aml; - -import io.adminshell.aas.v3.dataformat.aml.header.AutomationMLVersion; -import io.adminshell.aas.v3.dataformat.aml.header.WriterHeader; -import io.adminshell.aas.v3.dataformat.aml.mapper.AssetAdministrationShellEnvironmentMapper; -import io.adminshell.aas.v3.dataformat.aml.mapper.ConstraintCollectionMapper; -import io.adminshell.aas.v3.dataformat.aml.mapper.DataSpecificationContentMapper; -import io.adminshell.aas.v3.dataformat.aml.mapper.DataSpecificationIEC61360Mapper; -import io.adminshell.aas.v3.dataformat.aml.mapper.DefaultCollectionMapper; -import io.adminshell.aas.v3.dataformat.aml.mapper.DefaultMapper; -import io.adminshell.aas.v3.dataformat.aml.mapper.EmbeddedDataSpecificationCollectionMapper; -import io.adminshell.aas.v3.dataformat.aml.mapper.FileMapper; -import io.adminshell.aas.v3.dataformat.aml.mapper.LangStringCollectionMapper; -import io.adminshell.aas.v3.dataformat.aml.mapper.MappingException; -import io.adminshell.aas.v3.dataformat.aml.mapper.OperationVariableCollectionMapper; -import io.adminshell.aas.v3.dataformat.aml.mapper.OperationVariableMapper; -import io.adminshell.aas.v3.dataformat.aml.mapper.QualifierMapper; -import io.adminshell.aas.v3.dataformat.aml.mapper.ReferenceCollectionMapper; -import io.adminshell.aas.v3.dataformat.aml.mapper.ReferenceElementMapper; -import io.adminshell.aas.v3.dataformat.aml.mapper.ReferenceMapper; -import io.adminshell.aas.v3.dataformat.aml.mapper.RelationshipElementMapper; -import io.adminshell.aas.v3.dataformat.aml.mapper.SubmodelCollectionMapper; -import io.adminshell.aas.v3.dataformat.aml.mapper.SubmodelMapper; -import io.adminshell.aas.v3.dataformat.aml.model.caex.CAEXFile; -import io.adminshell.aas.v3.model.AssetAdministrationShellEnvironment; -import io.adminshell.aas.v3.model.LangString; -import io.adminshell.aas.v3.model.Referable; -import java.util.List; -import org.slf4j.LoggerFactory; - -public class AasToAmlMapper { - - public static final String DEFAULT_SCHEMA_VERSION = "2.15"; - public static final String DEFAULT_AML_VERSION = "2.0"; - public static final String DEFAULT_FILENAME = "AssetAdministrationShellEnvironment.aml"; - private static final org.slf4j.Logger log = LoggerFactory.getLogger(AasToAmlMapper.class); - private static final String DEFAULT_LANGUAGE = "EN"; - private CAEXFile result; - private final AmlSerializationConfig config; - - public AasToAmlMapper(AmlSerializationConfig config) { - this.config = config; - } - - public CAEXFile map(AssetAdministrationShellEnvironment env) throws MappingException { - return map(env, DEFAULT_SCHEMA_VERSION, DEFAULT_FILENAME); - } - - public CAEXFile map(AssetAdministrationShellEnvironment env, String schemaVersion, String filename) throws MappingException { - AbstractClassNamingStrategy classNamingStrategy = new NumberingClassNamingStrategy(); - classNamingStrategy.registerCustomNaming(LangString.class, x -> "aml-lang=" + x.getLanguage()); - PropertyNamingStrategy propertyNamingStrategy = new PropertyNamingStrategy(); - propertyNamingStrategy.registerCustomNaming(Referable.class, "descriptions", "description"); - MappingProvider mappingProvider = new MappingProvider( - new DefaultMapper(), - new DefaultCollectionMapper(), - List.of( - new AssetAdministrationShellEnvironmentMapper(), - new SubmodelCollectionMapper(), - new LangStringCollectionMapper(), - new ReferenceMapper(), - new OperationVariableMapper(), - new OperationVariableCollectionMapper(), - new ReferenceCollectionMapper(), - new ConstraintCollectionMapper(), - new QualifierMapper(), - new FileMapper(), - new SubmodelMapper(), - new EmbeddedDataSpecificationCollectionMapper(), - new DataSpecificationContentMapper(), - new ReferenceElementMapper(), - new RelationshipElementMapper(), - new DataSpecificationIEC61360Mapper()), - classNamingStrategy, - propertyNamingStrategy - ); - // FIX - // ReferenceElement and RelationshipElement reference other Referables. - // Each such reference is represented as an InternalLink in AML. - // InternalLinks require target to be an interface but AAS AML serialization - // does not define creation of such interfaces. Therefore, we do a preprocessing - // step to identify all Referable which are targeted by such a reference - // to later add a generic interface to them upon serialization - - // NOTE - // This has implications on ID generator and requires additional lookup table - // for Referable --> AML ID of ExternalInterface - MappingContext context = new MappingContext(mappingProvider, config.getIdGenerator(), env); - WriterHeader writerHeader = new WriterHeader(); - writerHeader.setName("foo"); - writerHeader.setId("bar"); - CAEXFile.Builder builder = CAEXFile.builder() - .withSchemaVersion(schemaVersion) - .withFileName(filename) - .addAdditionalInformation(new AutomationMLVersion("2.0")) - .addAdditionalInformation(writerHeader.wrap()); - AmlGenerator generator = new AmlGenerator(builder); - context.map(env, generator); - return builder.build(); - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlDocumentInfo.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlDocumentInfo.java new file mode 100644 index 00000000..ba181849 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlDocumentInfo.java @@ -0,0 +1,63 @@ +package io.adminshell.aas.v3.dataformat.aml; + +public class AmlDocumentInfo { + + public static final String DEFAULT_ASSET_ADMINISTRATION_SHELL_INSTANCE_HIERARCHY = "AssetAdministrationShellInstanceHierarchy"; + public static final String DEFAULT_ASSET_ADMINISTRATION_SHELL_SYSTEM_UNIT_CLASS_LIB = "AssetAdministrationShellSystemUnitClasses"; + public static final String DEFAULT_ASSET_ADMINISTRATION_SHELL_ROLE_CLASS_LIB = "AssetAdministrationShellRoleClassLib"; + public static final String DEFAULT_ASSET_ADMINISTRATION_SHELL_INTERFACE_CLASS_LIB = "AssetAdministrationShellInterfaceClassLib"; + public static final String DEFAULT_DATA_SPECIFICATION_TEMPLATES_UNIT_CLASS_LIB = "AssetAdministrationShellDataSpecificationTemplates"; + public static final String DEFAULT_CONCEPT_DESCRIPTION_INSTANCE_HIERARCHY = "ConceptDescriptionInstanceHierarchy"; + + private final String assetAdministrationShellSystemUnitClassLib; + private final String dataSpecificationTemplatesSystemUnitClassLib; + private final String assetAdministrationShellInstanceHierarchy; + private final String conceptDescriptionInstanceHierarchy; + private final String assetAdministrationShellRoleClassLib; + private final String assetAdministrationShellInterfaceClassLib; + + public AmlDocumentInfo() { + this.assetAdministrationShellSystemUnitClassLib = DEFAULT_ASSET_ADMINISTRATION_SHELL_SYSTEM_UNIT_CLASS_LIB; + this.dataSpecificationTemplatesSystemUnitClassLib = DEFAULT_DATA_SPECIFICATION_TEMPLATES_UNIT_CLASS_LIB; + this.assetAdministrationShellInstanceHierarchy = DEFAULT_ASSET_ADMINISTRATION_SHELL_INSTANCE_HIERARCHY; + this.conceptDescriptionInstanceHierarchy = DEFAULT_CONCEPT_DESCRIPTION_INSTANCE_HIERARCHY; + this.assetAdministrationShellRoleClassLib = DEFAULT_ASSET_ADMINISTRATION_SHELL_ROLE_CLASS_LIB; + this.assetAdministrationShellInterfaceClassLib = DEFAULT_ASSET_ADMINISTRATION_SHELL_INTERFACE_CLASS_LIB; + } + + public AmlDocumentInfo( + String assetAdministrationShellInstanceHierarchy, + String conceptDescriptionInstanceHierarchy, + String assetAdministrationShellSystemUnitClassLib) { + this.assetAdministrationShellSystemUnitClassLib = assetAdministrationShellSystemUnitClassLib; + this.assetAdministrationShellInstanceHierarchy = assetAdministrationShellInstanceHierarchy; + this.conceptDescriptionInstanceHierarchy = conceptDescriptionInstanceHierarchy; + this.dataSpecificationTemplatesSystemUnitClassLib = DEFAULT_DATA_SPECIFICATION_TEMPLATES_UNIT_CLASS_LIB; + this.assetAdministrationShellRoleClassLib = DEFAULT_ASSET_ADMINISTRATION_SHELL_ROLE_CLASS_LIB; + this.assetAdministrationShellInterfaceClassLib = DEFAULT_ASSET_ADMINISTRATION_SHELL_INTERFACE_CLASS_LIB; + } + + public String getAssetAdministrationShellSystemUnitClassLib() { + return assetAdministrationShellSystemUnitClassLib; + } + + public String getDataSpecificationTemplatesSystemUnitClassLib() { + return dataSpecificationTemplatesSystemUnitClassLib; + } + + public String getAssetAdministrationShellInstanceHierarchy() { + return assetAdministrationShellInstanceHierarchy; + } + + public String getConceptDescriptionInstanceHierarchy() { + return conceptDescriptionInstanceHierarchy; + } + + public String getAssetAdministrationShellRoleClassLib() { + return assetAdministrationShellRoleClassLib; + } + + public String getAssetAdministrationShellInterfaceClassLib() { + return assetAdministrationShellInterfaceClassLib; + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlGenerator.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlGenerator.java index d4e0cf8d..ee95bea7 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlGenerator.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlGenerator.java @@ -15,6 +15,7 @@ */ package io.adminshell.aas.v3.dataformat.aml; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.Aas2AmlMappingContext; import io.adminshell.aas.v3.dataformat.aml.model.caex.AttributeType; import io.adminshell.aas.v3.dataformat.aml.model.caex.CAEXFile; import io.adminshell.aas.v3.dataformat.aml.model.caex.CAEXObject; @@ -22,6 +23,7 @@ import io.adminshell.aas.v3.dataformat.aml.model.caex.RoleClassType; import io.adminshell.aas.v3.dataformat.aml.model.caex.SystemUnitClassType; import io.adminshell.aas.v3.model.Referable; +import java.beans.PropertyDescriptor; import java.util.List; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -29,30 +31,76 @@ public class AmlGenerator { private static final Logger log = LoggerFactory.getLogger(AmlGenerator.class); + private static final String DEFAULT_REF_SEMANTIC_PREFIX = "AAS:"; + private final String refSemanticPrefix; private CAEXObject.Builder current; private CAEXFile.Builder fileBuilder; + private final AmlDocumentInfo documentInfo; - public AmlGenerator() { - this.fileBuilder = CAEXFile.builder(); - } - - public AmlGenerator(CAEXFile.Builder fileBuilder) { - this.fileBuilder = fileBuilder; - } - - private AmlGenerator(CAEXFile.Builder fileBuilder, CAEXObject.Builder current) { + private AmlGenerator(AmlDocumentInfo documentInfo, String refSemanticPrefix, CAEXFile.Builder fileBuilder, CAEXObject.Builder current) { + this.documentInfo = documentInfo; + this.refSemanticPrefix = refSemanticPrefix; this.fileBuilder = fileBuilder; this.current = current; } public AmlGenerator with(CAEXObject.Builder current) { - return new AmlGenerator(fileBuilder, current); + return new AmlGenerator(documentInfo, refSemanticPrefix, fileBuilder, current); } public void addAdditionalInformation(List additionalInformation) { fileBuilder.addAdditionalInformation(additionalInformation); } + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + + private String refSemanticPrefix = DEFAULT_REF_SEMANTIC_PREFIX; + private CAEXObject.Builder current; + private CAEXFile.Builder fileBuilder = CAEXFile.builder(); + private AmlDocumentInfo documentInfo = new AmlDocumentInfo(); + + public AmlGenerator build() { + return new AmlGenerator(documentInfo, refSemanticPrefix, fileBuilder, current); + } + + public Builder refSemanticPrefix(String value) { + this.refSemanticPrefix = value; + return this; + } + + public Builder current(CAEXObject.Builder value) { + this.current = value; + return this; + } + + public Builder file(CAEXFile.Builder value) { + this.fileBuilder = value; + return this; + } + + public Builder documentInfo(AmlDocumentInfo value) { + this.documentInfo = value; + return this; + } + } + + public void add(CAEXObject caexObject) { + if (caexObject == null) { + return; + } + if (AttributeType.class.isAssignableFrom(caexObject.getClass())) { + addAttribute((AttributeType) caexObject); + } else if (InternalElementType.class.isAssignableFrom(caexObject.getClass())) { + addInternalElement((InternalElementType) caexObject); + } else { + log.warn("adding caex object failed because unsupported type '{}'", caexObject.getClass()); + } + } + public void addAttribute(AttributeType attribute) { if (attribute == null) { return; @@ -125,14 +173,14 @@ public void addInternalElement(InternalElementType internalElement) { } } - public void appendReferenceTargetInterfaceIfRequired(Object obj, MappingContext context) { + public void appendReferenceTargetInterfaceIfRequired(Object obj, Aas2AmlMappingContext context) { RoleClassType.ExternalInterface referenceTargetInterface = getReferenceTargetInterface(obj, context); if (referenceTargetInterface != null) { addExternalInterface(referenceTargetInterface); } } - public RoleClassType.ExternalInterface getReferenceTargetInterface(Object obj, MappingContext context) { + public RoleClassType.ExternalInterface getReferenceTargetInterface(Object obj, Aas2AmlMappingContext context) { RoleClassType.ExternalInterface result = null; if (obj != null && Referable.class.isAssignableFrom(obj.getClass())) { Referable referable = (Referable) obj; @@ -146,4 +194,32 @@ public RoleClassType.ExternalInterface getReferenceTargetInterface(Object obj, M } return result; } + + public InternalElementType.RoleRequirements roleRequirement(String value) { + return InternalElementType.RoleRequirements.builder() + .withRefBaseRoleClassPath(documentInfo.getAssetAdministrationShellRoleClassLib() + "/" + value) + .build(); + } + + public AttributeType.RefSemantic refSemantic(Class type, String propertyName) { + return AttributeType.RefSemantic.builder() + .withCorrespondingAttributePath(refSemanticPrefix + type.getSimpleName() + "/" + propertyName) + .build(); + } + + public AttributeType.RefSemantic refSemantic(PropertyDescriptor property) { + return refSemantic(property.getReadMethod().getDeclaringClass(), property.getName()); + } + + public String refBaseSystemUnitPath(Object value, Aas2AmlMappingContext context) { + return documentInfo.getAssetAdministrationShellSystemUnitClassLib() + + "/" + context.getInternalElementNamingStrategy().getName( + value.getClass(), + value, + null); + } + + public AmlDocumentInfo getDocumentInfo() { + return documentInfo; + } } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlSerializationConfig.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlSerializationConfig.java index b6fe0049..ccae7655 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlSerializationConfig.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlSerializationConfig.java @@ -15,6 +15,8 @@ */ package io.adminshell.aas.v3.dataformat.aml; +import io.adminshell.aas.v3.dataformat.aml.id.UuidGenerator; +import io.adminshell.aas.v3.dataformat.aml.id.IdGenerator; import java.util.ArrayList; import java.util.Arrays; import java.util.List; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlSerializer.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlSerializer.java index 090ef7ab..1c8cb31e 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlSerializer.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlSerializer.java @@ -15,12 +15,13 @@ */ package io.adminshell.aas.v3.dataformat.aml; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.AasToAmlMapper; import io.adminshell.aas.v3.dataformat.SerializationException; import io.adminshell.aas.v3.dataformat.Serializer; import io.adminshell.aas.v3.dataformat.aml.header.AutomationMLVersion; import io.adminshell.aas.v3.dataformat.aml.header.WriterHeader; -import io.adminshell.aas.v3.dataformat.aml.mapper.MappingException; import io.adminshell.aas.v3.dataformat.aml.model.caex.CAEXFile; +import io.adminshell.aas.v3.dataformat.mapping.MappingException; import io.adminshell.aas.v3.model.AssetAdministrationShellEnvironment; import java.io.IOException; import java.io.StringWriter; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/MappingProvider.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/MappingProvider.java deleted file mode 100644 index 576cbe38..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/MappingProvider.java +++ /dev/null @@ -1,127 +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 io.adminshell.aas.v3.dataformat.aml; - -import com.google.common.reflect.TypeToken; -import io.adminshell.aas.v3.dataformat.aml.mapper.Mapper; -import io.adminshell.aas.v3.dataformat.aml.util.TypeUtils; -import java.lang.reflect.Type; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import java.util.stream.Collectors; -import static java.util.stream.Collectors.groupingBy; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class MappingProvider { - - private static final Logger log = LoggerFactory.getLogger(MappingProvider.class); - private final NamingStrategy internalElementNamingStrategy; - private final NamingStrategy attributeNamingStrategy; - private Mapper defaultMapper; - private Mapper> defaultCollectionMapper; - private Map, List> mappings; - - public MappingProvider(Mapper defaultMapper, - Mapper> defaultCollectionMapper, - List> mappers, - NamingStrategy internalElementNamingStrategy, - NamingStrategy attributeNamingStrategy) { - this.defaultMapper = defaultMapper; - this.defaultCollectionMapper = defaultCollectionMapper; - this.internalElementNamingStrategy = internalElementNamingStrategy; - this.attributeNamingStrategy = attributeNamingStrategy; - initializeMappings(mappers); - } - - public MappingProvider copy() { - return new MappingProvider(defaultMapper, defaultCollectionMapper, mappings, internalElementNamingStrategy, attributeNamingStrategy); - } - - public void forceMapper(TypeToken typeToken, Mapper mapper) { - mappings.put(typeToken, Arrays.asList(mapper)); - } - - public void forceMapper(Class type, Mapper mapper) { - mappings.put(TypeToken.of(type), Arrays.asList(mapper)); - } - - protected MappingProvider(Mapper defaultMapper, - Mapper> defaultCollectionMapper, - Map, List> mappings, - NamingStrategy internalElementNamingStrategy, - NamingStrategy attributeNamingStrategy) { - this.defaultMapper = defaultMapper; - this.defaultCollectionMapper = defaultCollectionMapper; - this.internalElementNamingStrategy = internalElementNamingStrategy; - this.attributeNamingStrategy = attributeNamingStrategy; - this.mappings = mappings; - } - - private void initializeMappings(List> mappers) { - // can be extremely simplified as same interface cannot be implemented twice in one class! - mappings = mappers.stream().flatMap(x -> TypeToken.of(x.getClass()) - .getTypes().stream() - .filter(y -> Mapper.class.equals(y.getRawType())) - .map(y -> new Object() { - TypeToken type = y.resolveType(Mapper.class.getTypeParameters()[0]); - Mapper mapper = x; - })).collect(groupingBy( - x -> x.type, - Collectors.mapping(x -> x.mapper, Collectors.toList()))); - } - - public Mapper getMapper(Object obj) { - if (obj == null) { - return getMapper(Object.class); - } - if (Type.class.isAssignableFrom(obj.getClass())) { - return getMapper((Type) obj); - } - return getMapper(obj.getClass()); - } - - public Mapper getMapper(Type type) { - Optional> customMapper = mappings.entrySet().stream() - .filter(x -> x.getKey().isSupertypeOf(type)) - .sorted((x, y) -> Objects.compare(x.getKey(), y.getKey(), new TypeUtils.TypeTokenComparator())) - .map(x -> x.getValue()) - .findFirst(); - if (!customMapper.isPresent() || customMapper.get().isEmpty()) { - if (TypeToken.of(Collection.class).isSupertypeOf(type) && defaultCollectionMapper != null) { - return (Mapper) 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); - } - - public NamingStrategy getInternalElementNamingStrategy() { - return internalElementNamingStrategy; - } - - public NamingStrategy getAttributeNamingStrategy() { - return attributeNamingStrategy; - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/ValueMapping.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/ValueMapping.java deleted file mode 100644 index 9c2fc560..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/ValueMapping.java +++ /dev/null @@ -1,53 +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 io.adminshell.aas.v3.dataformat.aml; - -public class ValueMapping { - - private Object value; - private MappingMode mappingMode; - - public ValueMapping(Object result) { - this.value = result; - this.mappingMode = MappingMode.VALUE; - } - - public ValueMapping(Object result, MappingMode mappingMode) { - this.value = result; - this.mappingMode = mappingMode; - } - - public Object getValue() { - return value; - } - - public void setValue(Object value) { - this.value = value; - } - - public MappingMode getMappingMode() { - return mappingMode; - } - - public void setMappingMode(MappingMode mappingMode) { - this.mappingMode = mappingMode; - } - - public static enum MappingMode { - VALUE, - RECURSIVE - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/MappingContext.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/Aas2AmlMappingContext.java similarity index 56% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/MappingContext.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/Aas2AmlMappingContext.java index cf2ad2f3..a3a6a9e7 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/MappingContext.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/Aas2AmlMappingContext.java @@ -13,11 +13,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml; +package io.adminshell.aas.v3.dataformat.aml.aas2aml; -import io.adminshell.aas.v3.dataformat.aml.mapper.MappingException; -import io.adminshell.aas.v3.dataformat.aml.model.caex.RoleClassType; +import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; +import io.adminshell.aas.v3.dataformat.aml.id.IdGenerator; +import io.adminshell.aas.v3.dataformat.aml.naming.NamingStrategy; import io.adminshell.aas.v3.dataformat.aml.util.ReferencedReferableCollector; +import io.adminshell.aas.v3.dataformat.mapping.MappingContext; +import io.adminshell.aas.v3.dataformat.mapping.MappingException; +import io.adminshell.aas.v3.dataformat.mapping.MappingProvider; import io.adminshell.aas.v3.model.AssetAdministrationShellEnvironment; import io.adminshell.aas.v3.model.Referable; import java.beans.PropertyDescriptor; @@ -28,32 +32,52 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public class MappingContext { +public class Aas2AmlMappingContext extends MappingContext { private static final String EMPTY_STRING = ""; - private static final Logger log = LoggerFactory.getLogger(MappingContext.class); - private final MappingProvider mappingProvider; + private static final Logger log = LoggerFactory.getLogger(Aas2AmlMappingContext.class); private final IdGenerator idGenerator; private final AssetAdministrationShellEnvironment environment; + private final NamingStrategy internalElementNamingStrategy; + private final NamingStrategy attributeNamingStrategy; private final Map idCache; private final PropertyDescriptor property; private final Map referecedReferableIDs; - public MappingContext(MappingProvider mappingProvider, + public Aas2AmlMappingContext(MappingProvider mappingProvider, IdGenerator idGenerator, + NamingStrategy internalElementNamingStrategy, + NamingStrategy attributeNamingStrategy, AssetAdministrationShellEnvironment environment) { - this(mappingProvider, idGenerator, environment, null, null, null); + this(mappingProvider, + idGenerator, + internalElementNamingStrategy, + attributeNamingStrategy, + environment, + null, null, null); } - private MappingContext(MappingProvider mappingProvider, + public NamingStrategy getInternalElementNamingStrategy() { + return internalElementNamingStrategy; + } + + public NamingStrategy getAttributeNamingStrategy() { + return attributeNamingStrategy; + } + + private Aas2AmlMappingContext(MappingProvider mappingProvider, IdGenerator idGenerator, + NamingStrategy internalElementNamingStrategy, + NamingStrategy attributeNamingStrategy, AssetAdministrationShellEnvironment environment, Map referecedReferableIDs, Map idCache, PropertyDescriptor property) { - this.mappingProvider = mappingProvider; + super(mappingProvider); this.idGenerator = idGenerator; + this.internalElementNamingStrategy = internalElementNamingStrategy; + this.attributeNamingStrategy = attributeNamingStrategy; this.environment = environment; this.property = property; if (referecedReferableIDs == null) { @@ -101,24 +125,40 @@ public void map(Type type, T value, AmlGenerator generator) throws MappingEx mappingProvider.getMapper(type).map(value, generator, this); } -// -// public void map(T value) throws MappingException { -// mappingProvider.getMapper(value).map(value, this); -// } -// -// public void map(Type type, T value) throws MappingException { -// mappingProvider.getMapper(type).map(value, this); -// } - public MappingContext with(PropertyDescriptor property) { - return new MappingContext(mappingProvider, idGenerator, environment, referecedReferableIDs, idCache, property); + public Aas2AmlMappingContext with(PropertyDescriptor property) { + return new Aas2AmlMappingContext( + mappingProvider, + idGenerator, + internalElementNamingStrategy, + attributeNamingStrategy, + environment, + referecedReferableIDs, + idCache, + property); } - public MappingContext withoutProperty() { - return new MappingContext(mappingProvider, idGenerator, environment, referecedReferableIDs, idCache, null); + public Aas2AmlMappingContext withoutProperty() { + return new Aas2AmlMappingContext( + mappingProvider, + idGenerator, + internalElementNamingStrategy, + attributeNamingStrategy, + environment, + referecedReferableIDs, + idCache, + null); } - public MappingContext withoutIdCache() { - return new MappingContext(mappingProvider, idGenerator, environment, referecedReferableIDs, null, property); + public Aas2AmlMappingContext withoutIdCache() { + return new Aas2AmlMappingContext( + mappingProvider, + idGenerator, + internalElementNamingStrategy, + attributeNamingStrategy, + environment, + referecedReferableIDs, + null, + property); } public PropertyDescriptor getProperty() { diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/AasToAmlMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/AasToAmlMapper.java new file mode 100644 index 00000000..fd69ed6e --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/AasToAmlMapper.java @@ -0,0 +1,128 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.aas2aml; + +import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; +import io.adminshell.aas.v3.dataformat.aml.AmlSerializationConfig; +import io.adminshell.aas.v3.dataformat.aml.naming.PropertyNamingStrategy; +import io.adminshell.aas.v3.dataformat.aml.naming.AbstractClassNamingStrategy; +import io.adminshell.aas.v3.dataformat.aml.naming.NumberingClassNamingStrategy; +import io.adminshell.aas.v3.dataformat.aml.header.AutomationMLVersion; +import io.adminshell.aas.v3.dataformat.aml.header.WriterHeader; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper.AssetAdministrationShellEnvironmentMapper; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper.ConstraintCollectionMapper; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper.DataSpecificationContentMapper; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper.DataSpecificationIEC61360Mapper; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper.DefaultCollectionMapper; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper.DefaultMapper; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper.EmbeddedDataSpecificationCollectionMapper; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper.FileMapper; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper.LangStringCollectionMapper; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper.OperationVariableCollectionMapper; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper.OperationVariableMapper; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper.QualifierMapper; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper.ReferenceCollectionMapper; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper.ReferenceElementMapper; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper.ReferenceMapper; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper.RelationshipElementMapper; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper.SubmodelMapper; +import io.adminshell.aas.v3.dataformat.aml.model.caex.CAEXFile; +import io.adminshell.aas.v3.dataformat.mapping.Mapper; +import io.adminshell.aas.v3.dataformat.mapping.MappingException; +import io.adminshell.aas.v3.dataformat.mapping.MappingProvider; +import io.adminshell.aas.v3.model.AssetAdministrationShellEnvironment; +import io.adminshell.aas.v3.model.ConceptDescription; +import io.adminshell.aas.v3.model.LangString; +import io.adminshell.aas.v3.model.Qualifier; +import io.adminshell.aas.v3.model.Referable; +import org.slf4j.LoggerFactory; + +public class AasToAmlMapper extends Mapper { + + public static final String DEFAULT_SCHEMA_VERSION = "2.15"; + public static final String DEFAULT_AML_VERSION = "2.0"; + public static final String DEFAULT_FILENAME = "AssetAdministrationShellEnvironment.aml"; + private static final org.slf4j.Logger log = LoggerFactory.getLogger(AasToAmlMapper.class); + private static final String DEFAULT_LANGUAGE = "EN"; + private CAEXFile result; + + public AasToAmlMapper(AmlSerializationConfig config) { + super(config); + } + + @Override + public CAEXFile map(AssetAdministrationShellEnvironment env) throws MappingException { + return map(env, DEFAULT_SCHEMA_VERSION, DEFAULT_FILENAME); + } + + public CAEXFile map(AssetAdministrationShellEnvironment env, String schemaVersion, String filename) throws MappingException { + AbstractClassNamingStrategy classNamingStrategy = new NumberingClassNamingStrategy(); + classNamingStrategy.registerCustomNaming(LangString.class, x -> "aml-lang=" + x.getLanguage()); + PropertyNamingStrategy propertyNamingStrategy = new PropertyNamingStrategy(); + propertyNamingStrategy.registerCustomNaming(Referable.class, "descriptions", "description"); + propertyNamingStrategy.registerCustomNaming(Qualifier.class, x -> "qualifier:" + x.getType() + "=" + x.getValue()); + propertyNamingStrategy.registerCustomNaming(ConceptDescription.class, "isCaseOfs", "isCaseOf"); + MappingProvider mappingProvider = new MappingProvider( + new DefaultMapper(), + new DefaultCollectionMapper()); + + mappingProvider.register(new AssetAdministrationShellEnvironmentMapper()); + mappingProvider.register(new LangStringCollectionMapper()); + mappingProvider.register(new ReferenceMapper()); + mappingProvider.register(new OperationVariableMapper()); + mappingProvider.register(new OperationVariableCollectionMapper()); + mappingProvider.register(new ReferenceCollectionMapper()); + mappingProvider.register(new ConstraintCollectionMapper()); + mappingProvider.register(new QualifierMapper()); + mappingProvider.register(new FileMapper()); + mappingProvider.register(new SubmodelMapper()); + mappingProvider.register(new EmbeddedDataSpecificationCollectionMapper()); + mappingProvider.register(new DataSpecificationContentMapper()); + mappingProvider.register(new ReferenceElementMapper()); + mappingProvider.register(new RelationshipElementMapper()); + mappingProvider.register(new DataSpecificationIEC61360Mapper()); + // FIX + // ReferenceElement and RelationshipElement reference other Referables. + // Each such reference is represented as an InternalLink in AML. + // InternalLinks require target to be an interface but AAS AML serialization + // does not define creation of such interfaces. Therefore, we do a preprocessing + // step to identify all Referable which are targeted by such a reference + // to later add a generic interface to them upon serialization + + // NOTE + // This has implications on ID generator and requires additional lookup table + // for Referable --> AML ID of ExternalInterface + Aas2AmlMappingContext context = new Aas2AmlMappingContext( + mappingProvider, + config.getIdGenerator(), + classNamingStrategy, + propertyNamingStrategy, + env); + WriterHeader writerHeader = new WriterHeader(); + writerHeader.setName("foo"); + writerHeader.setId("bar"); + CAEXFile.Builder builder = CAEXFile.builder() + .withSchemaVersion(schemaVersion) + .withFileName(filename) + .addAdditionalInformation(new AutomationMLVersion("2.0")) + .addAdditionalInformation(writerHeader.wrap()); + AmlGenerator generator = AmlGenerator.builder() + .file(builder) + .build(); + context.map(env, generator); + return builder.build(); + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/IdentityProvider.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/IdentityProvider.java similarity index 90% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/IdentityProvider.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/IdentityProvider.java index 4a0e7917..7af0b517 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/IdentityProvider.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/IdentityProvider.java @@ -13,8 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml; +package io.adminshell.aas.v3.dataformat.aml.aas2aml; +import io.adminshell.aas.v3.dataformat.aml.id.IdGenerator; import java.util.HashMap; import java.util.Map; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/DefaultMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/Aas2AmlElementMapper.java similarity index 54% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/DefaultMapper.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/Aas2AmlElementMapper.java index bab23d08..dc978fa7 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/DefaultMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/Aas2AmlElementMapper.java @@ -13,8 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.mapper; +package io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper; -public class DefaultMapper extends BaseMapper { +import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.Aas2AmlMappingContext; +import io.adminshell.aas.v3.dataformat.mapping.ElementMapper; +import io.adminshell.aas.v3.dataformat.mapping.MappingException; +public interface Aas2AmlElementMapper extends ElementMapper { + + public void map(T value, AmlGenerator generator, Aas2AmlMappingContext context) throws MappingException; } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/AssetAdministrationShellEnvironmentMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/AssetAdministrationShellEnvironmentMapper.java similarity index 73% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/AssetAdministrationShellEnvironmentMapper.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/AssetAdministrationShellEnvironmentMapper.java index bec5ffef..30951602 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/AssetAdministrationShellEnvironmentMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/AssetAdministrationShellEnvironmentMapper.java @@ -13,21 +13,18 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.mapper; +package io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper; import com.google.inject.util.Types; import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; -import io.adminshell.aas.v3.dataformat.aml.IdentityProvider; -import io.adminshell.aas.v3.dataformat.aml.MappingContext; -import io.adminshell.aas.v3.dataformat.aml.MappingProvider; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.Aas2AmlMappingContext; import io.adminshell.aas.v3.dataformat.aml.model.caex.CAEXFile; import io.adminshell.aas.v3.dataformat.aml.model.caex.CAEXFile.SystemUnitClassLib; import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; -import io.adminshell.aas.v3.dataformat.aml.model.caex.SystemUnitClassType; import io.adminshell.aas.v3.dataformat.aml.model.caex.SystemUnitClassType.SupportedRoleClass; import io.adminshell.aas.v3.dataformat.aml.model.caex.SystemUnitFamilyType; import io.adminshell.aas.v3.dataformat.aml.util.AASUtils; -import io.adminshell.aas.v3.dataformat.core.ReflectionHelper; +import io.adminshell.aas.v3.dataformat.mapping.MappingException; import io.adminshell.aas.v3.model.AssetAdministrationShell; import io.adminshell.aas.v3.model.AssetAdministrationShellEnvironment; import io.adminshell.aas.v3.model.ConceptDescription; @@ -37,33 +34,47 @@ import java.util.List; import java.util.stream.Collectors; -public class AssetAdministrationShellEnvironmentMapper extends BaseMapper { +public class AssetAdministrationShellEnvironmentMapper extends DefaultMapper { @Override - public void map(AssetAdministrationShellEnvironment value, AmlGenerator generator, MappingContext context) throws MappingException { + public void map(AssetAdministrationShellEnvironment value, AmlGenerator generator, Aas2AmlMappingContext context) throws MappingException { List assetAdministrationShells = value.getAssetAdministrationShells().stream() .filter(x -> x.getSubmodels().stream() .anyMatch(sm -> AASUtils.resolveSubmodelReference(sm, value).get().getKind() == ModelingKind.INSTANCE)) .collect(Collectors.toList()); - toHierarchy(AssetAdministrationShell.class, assetAdministrationShells, generator, context); - toHierarchy(ConceptDescription.class, value.getConceptDescriptions(), generator, context); + toHierarchy(generator.getDocumentInfo().getAssetAdministrationShellInstanceHierarchy(), + AssetAdministrationShell.class, + assetAdministrationShells, + generator, + context); + toHierarchy( + generator.getDocumentInfo().getConceptDescriptionInstanceHierarchy(), + ConceptDescription.class, + value.getConceptDescriptions(), + generator, + context); mapTemplates(value, generator, context); } - protected void toHierarchy(Class type, Collection value, AmlGenerator generator, MappingContext context) throws MappingException { + protected void toHierarchy( + String hierarchyName, + Class type, + Collection value, + AmlGenerator generator, + Aas2AmlMappingContext context) throws MappingException { CAEXFile.InstanceHierarchy.Builder builder = CAEXFile.InstanceHierarchy.builder() - .withName(type.getSimpleName() + "InstanceHierarchy"); + .withName(hierarchyName); context.map(Types.newParameterizedType(Collection.class, type), value, generator.with(builder)); generator.addInstanceHierarchy(builder.build()); } - protected void mapTemplates(AssetAdministrationShellEnvironment env, AmlGenerator generator, MappingContext context) throws MappingException { + protected void mapTemplates(AssetAdministrationShellEnvironment env, AmlGenerator generator, Aas2AmlMappingContext context) throws MappingException { boolean empty = true; SystemUnitClassLib.Builder builder = SystemUnitClassLib.builder() - .withName("AssetAdministrationShellSystemUnitClasses"); + .withName(generator.getDocumentInfo().getAssetAdministrationShellSystemUnitClassLib()); // generate SystemUnitClass for each AAS with at least 1 Submodel with kind == TEMPLATE // generate SystemUnitClass for each Submodel with king == TEMPLATE - MappingContext subContext = context.withoutIdCache().withoutProperty(); + Aas2AmlMappingContext subContext = context.withoutIdCache().withoutProperty(); for (AssetAdministrationShell aas : env.getAssetAdministrationShells()) { List submodelTemplates = AASUtils.getSubmodelTemplates(aas, env); if (!submodelTemplates.isEmpty()) { diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/ConstraintCollectionMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/ConstraintCollectionMapper.java similarity index 67% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/ConstraintCollectionMapper.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/ConstraintCollectionMapper.java index d7568771..897b9366 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/ConstraintCollectionMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/ConstraintCollectionMapper.java @@ -13,17 +13,21 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.mapper; +package io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper; import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; -import io.adminshell.aas.v3.dataformat.aml.MappingContext; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.Aas2AmlMappingContext; +import io.adminshell.aas.v3.dataformat.mapping.MappingException; import io.adminshell.aas.v3.model.Constraint; import java.util.Collection; -public class ConstraintCollectionMapper implements CollectionMapper { +public class ConstraintCollectionMapper implements Aas2AmlElementMapper> { @Override - public void map(Collection value, AmlGenerator generator, MappingContext context) throws MappingException { + public void map(Collection value, AmlGenerator generator, Aas2AmlMappingContext context) throws MappingException { + if (value == null || value.isEmpty()) { + return; + } for (Constraint element : value) { context.map(element, generator); } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/DataSpecificationContentMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/DataSpecificationContentMapper.java new file mode 100644 index 00000000..84ee3c12 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/DataSpecificationContentMapper.java @@ -0,0 +1,43 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper; + +import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.Aas2AmlMappingContext; +import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; +import io.adminshell.aas.v3.dataformat.mapping.MappingException; +import io.adminshell.aas.v3.model.DataSpecificationContent; + +public class DataSpecificationContentMapper extends DefaultMapper { + + public DataSpecificationContentMapper() { + } + + @Override + public void map(DataSpecificationContent content, AmlGenerator generator, Aas2AmlMappingContext context) throws MappingException { + toInternalElement(content, generator, context); + } + + @Override + protected String getId(DataSpecificationContent value, Aas2AmlMappingContext context) { + return context.generateId(); + } + + @Override + protected InternalElementType.RoleRequirements getRoleRequirementClass(DataSpecificationContent value, AmlGenerator generator, Aas2AmlMappingContext context) { + return generator.roleRequirement(DataSpecificationContent.class.getSimpleName()); + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/DataSpecificationIEC61360Mapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/DataSpecificationIEC61360Mapper.java new file mode 100644 index 00000000..cb3f0e13 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/DataSpecificationIEC61360Mapper.java @@ -0,0 +1,47 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper; + +import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.Aas2AmlMappingContext; +import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; +import io.adminshell.aas.v3.dataformat.mapping.MappingException; +import io.adminshell.aas.v3.model.DataSpecificationContent; +import io.adminshell.aas.v3.model.DataSpecificationIEC61360; +import java.beans.PropertyDescriptor; + +public class DataSpecificationIEC61360Mapper extends DefaultMapper { + + @Override + public void map(DataSpecificationIEC61360 content, AmlGenerator generator, Aas2AmlMappingContext context) throws MappingException { + asInternalElement(content, generator, context); + } + + @Override + protected String getId(DataSpecificationIEC61360 value, Aas2AmlMappingContext context) { + return context.generateId(); + } + + @Override + protected InternalElementType.RoleRequirements getRoleRequirementClass(DataSpecificationIEC61360 value, AmlGenerator generator, Aas2AmlMappingContext context) { + return generator.roleRequirement(DataSpecificationContent.class.getSimpleName()); + } + + @Override + protected boolean skipProperty(PropertyDescriptor property) { + return property.getName().equals("levelTypes") || property.getName().equals("valueList"); + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/DataSpecificationMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/DataSpecificationMapper.java similarity index 72% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/DataSpecificationMapper.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/DataSpecificationMapper.java index 762f2dc7..0583b969 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/DataSpecificationMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/DataSpecificationMapper.java @@ -13,25 +13,28 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.mapper; +package io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper; import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; -import io.adminshell.aas.v3.dataformat.aml.MappingContext; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.Aas2AmlMappingContext; import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; +import io.adminshell.aas.v3.dataformat.mapping.MappingException; import io.adminshell.aas.v3.model.DataSpecificationContent; import io.adminshell.aas.v3.model.EmbeddedDataSpecification; -public class DataSpecificationMapper extends BaseMapper { +public class DataSpecificationMapper extends DefaultMapper { public DataSpecificationMapper() { } @Override - public void map(EmbeddedDataSpecification value, AmlGenerator generator, MappingContext context) throws MappingException { + public void map(EmbeddedDataSpecification value, AmlGenerator generator, Aas2AmlMappingContext context) throws MappingException { if (value.getDataSpecificationContent() != null) { //embedded DataSpecificationContent content = value.getDataSpecificationContent(); - String refSystemUnitPath = "AssetAdministrationShellDataSpecificationTemplates/" + content.getClass().getSimpleName() + "Template/" + content.getClass().getSimpleName(); + String refSystemUnitPath = generator.getDocumentInfo().getDataSpecificationTemplatesSystemUnitClassLib() + + "/" + content.getClass().getSimpleName() + "Template/" + + content.getClass().getSimpleName(); InternalElementType.Builder builder = InternalElementType.builder() .withID(context.generateId()) .withRefBaseSystemUnitPath(refSystemUnitPath) diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/AbstractCollectionMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/DefaultCollectionMapper.java similarity index 54% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/AbstractCollectionMapper.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/DefaultCollectionMapper.java index 676962f4..6b8c70b7 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/AbstractCollectionMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/DefaultCollectionMapper.java @@ -13,19 +13,20 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.mapper; +package io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper; import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; -import io.adminshell.aas.v3.dataformat.aml.MappingContext; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.Aas2AmlMappingContext; import io.adminshell.aas.v3.dataformat.aml.model.caex.AttributeType; import io.adminshell.aas.v3.dataformat.core.ReflectionHelper; +import io.adminshell.aas.v3.dataformat.mapping.MappingException; import java.lang.reflect.ParameterizedType; import java.util.Collection; -public class AbstractCollectionMapper extends BaseMapper> { +public class DefaultCollectionMapper extends DefaultMapper> { @Override - protected Class getValueType(Collection collection, MappingContext context) { + protected Class getType(Collection collection, Aas2AmlMappingContext context) { if (context.getProperty() != null) { return (Class) ((ParameterizedType) context.getProperty().getReadMethod().getGenericReturnType()).getActualTypeArguments()[0]; } @@ -36,26 +37,24 @@ protected Class getValueType(Collection collection, MappingContext context } @Override - protected void toInternalElement(Collection collection, AmlGenerator generator, MappingContext context) throws MappingException { + protected void asInternalElement(Collection collection, AmlGenerator generator, Aas2AmlMappingContext context) throws MappingException { for (T element : collection) { context.withoutProperty().map(element, generator); } } @Override - protected void toAttribute(Collection collection, AmlGenerator generator, MappingContext context) throws MappingException { - Class aasType = context.getProperty().getReadMethod().getDeclaringClass(); - AttributeType.Builder builder = AttributeType.builder() - .withName(context.getMappingProvider().getAttributeNamingStrategy().getName( - context.getProperty().getReadMethod().getReturnType(), - collection, - context.getProperty().getName())) - .withRefSemantic(refSemantic( - aasType.getSimpleName(), - context.getProperty().getName())); - for (T element : collection) { - context.map(element, generator.with(builder)); + protected void mapProperties(Collection collection, AmlGenerator generator, Aas2AmlMappingContext context) throws MappingException { + } + + @Override + protected void asAttribute(Collection collection, AmlGenerator generator, Aas2AmlMappingContext context) throws MappingException { + if (collection != null && !collection.isEmpty()) { + AttributeType.Builder builder = super.toAttribute(collection, generator, context); + for (T element : collection) { + context.map(element, generator.with(builder)); + } + generator.add(builder.build()); } - generator.addAttribute(builder.build()); } } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/DefaultMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/DefaultMapper.java new file mode 100644 index 00000000..39f4fd81 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/DefaultMapper.java @@ -0,0 +1,139 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper; + +import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.Aas2AmlMappingContext; +import io.adminshell.aas.v3.dataformat.aml.model.caex.AttributeType; +import io.adminshell.aas.v3.dataformat.aml.model.caex.CAEXObject; +import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; +import io.adminshell.aas.v3.dataformat.core.ReflectionHelper; +import io.adminshell.aas.v3.dataformat.mapping.MappingException; +import io.adminshell.aas.v3.dataformat.mapping.util.TypeUtils; +import java.beans.PropertyDescriptor; +import java.lang.reflect.InvocationTargetException; + +public class DefaultMapper implements Aas2AmlElementMapper { + + protected Class getType(T value, Aas2AmlMappingContext context) { + return value.getClass(); + } + + @Override + public void map(T value, AmlGenerator generator, Aas2AmlMappingContext context) throws MappingException { + if (value == null || context == null) { + return; + } + Class aasType = getType(value, context); + Class aasTypeInfo = ReflectionHelper.getMostSpecificTypeWithModelType(aasType); + if (aasTypeInfo != null) { + asInternalElement(value, generator, context); + } else { + asAttribute(value, generator, context); + } + } + + protected void asInternalElement(T value, AmlGenerator generator, Aas2AmlMappingContext context) throws MappingException { + CAEXObject.Builder builder = toInternalElement(value, generator, context); + if (builder != null) { + generator.with(builder).appendReferenceTargetInterfaceIfRequired(value, context); + generator.add(builder.build()); + } + } + + protected void asAttribute(T value, AmlGenerator generator, Aas2AmlMappingContext context) throws MappingException { + AttributeType.Builder builder = toAttribute(value, generator, context); + if (builder != null) { + generator.add(builder.build()); + } + } + + protected InternalElementType.Builder toInternalElement(T value, AmlGenerator generator, Aas2AmlMappingContext context) throws MappingException { + InternalElementType.Builder builder = InternalElementType.builder(); + builder = builder + .withID(getId(value, context)) + .withName(getInternalElementName(value, context)) + .withRoleRequirements(getRoleRequirementClass(value, generator, context)); + mapProperties(value, generator.with(builder), context); + return builder; + } + + protected InternalElementType.RoleRequirements getRoleRequirementClass(T value, AmlGenerator generator, Aas2AmlMappingContext context) { + return generator.roleRequirement(ReflectionHelper.getModelType(value.getClass())); + } + + protected AttributeType.RefSemantic getRefSemantic(T value, AmlGenerator generator, Aas2AmlMappingContext context) { + return generator.refSemantic(context.getProperty()); + } + + protected String getInternalElementName(T value, Aas2AmlMappingContext context) { + return context.getInternalElementNamingStrategy().getName( + value.getClass(), + value, + null); + } + + protected String getId(T value, Aas2AmlMappingContext context) { + return context.getCachedId(value); + } + + protected String getAttributeName(T value, Aas2AmlMappingContext context) { + return context.getAttributeNamingStrategy().getName( + context.getProperty().getReadMethod().getGenericReturnType(), + value, + context.getProperty().getName()); + } + + protected AttributeType.Builder toAttribute(T value, AmlGenerator generator, Aas2AmlMappingContext context) throws MappingException { + Class aasType = ReflectionHelper.getAasInterface(value.getClass()); + AttributeType.Builder builder = AttributeType.builder(); + if (context.getProperty() != null) { + builder = builder + .withName(getAttributeName(value, context)) + .withRefSemantic(getRefSemantic(value, generator, context)); + } + if (aasType != null) { + mapProperties(value, generator.with(builder), context); + } else { + builder = builder.withValue(value); + } + return builder; + } + + protected boolean skipProperty(PropertyDescriptor property) { + return false; + } + + protected void mapProperties(T value, AmlGenerator generator, Aas2AmlMappingContext context) throws MappingException { + for (PropertyDescriptor property : TypeUtils.getAASProperties(value.getClass())) { + if (!skipProperty(property)) { + context.with(property) + .map(property.getReadMethod().getGenericReturnType(), + getPropertyValue(value, property, context), + generator); + } + } + } + + protected Object getPropertyValue(T value, PropertyDescriptor property, Aas2AmlMappingContext context) throws MappingException { + try { + return property.getReadMethod().invoke(value); + } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException ex) { + throw new MappingException("failed to get property value for property " + property.getName(), ex); + } + } + +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/EmbeddedDataSpecificationCollectionMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/EmbeddedDataSpecificationCollectionMapper.java similarity index 78% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/EmbeddedDataSpecificationCollectionMapper.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/EmbeddedDataSpecificationCollectionMapper.java index 1cf7709c..84eccd6d 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/EmbeddedDataSpecificationCollectionMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/EmbeddedDataSpecificationCollectionMapper.java @@ -13,23 +13,25 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.mapper; +package io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper; import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; -import io.adminshell.aas.v3.dataformat.aml.MappingContext; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.Aas2AmlMappingContext; import io.adminshell.aas.v3.dataformat.aml.model.caex.AttributeType; import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; -import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.util.ReferenceConverterUtil; +import io.adminshell.aas.v3.dataformat.aml.util.AASUtils; +import io.adminshell.aas.v3.dataformat.mapping.MappingException; +import io.adminshell.aas.v3.model.ConceptDescription; import io.adminshell.aas.v3.model.DataSpecificationContent; import io.adminshell.aas.v3.model.EmbeddedDataSpecification; import java.util.ArrayList; import java.util.Collection; import java.util.List; -public class EmbeddedDataSpecificationCollectionMapper extends BaseMapper> { +public class EmbeddedDataSpecificationCollectionMapper extends DefaultMapper> { @Override - public void map(Collection value, AmlGenerator generator, MappingContext context) throws MappingException { + public void map(Collection value, AmlGenerator generator, Aas2AmlMappingContext context) throws MappingException { if (value == null || context == null || value.isEmpty()) { return; } @@ -41,21 +43,21 @@ public void map(Collection value, AmlGenerator genera if (element.getDataSpecificationContent() == null) { AttributeType.Builder builder = AttributeType.builder() .withName("hasDataSpecification" + (countAttributes > 1 ? "_" + (attributes.size() + 1) : "")) - .withValue(ReferenceConverterUtil.convert(element.getDataSpecification())) - .withRefSemantic(refSemantic("ConceptDescription", "dataSpecification")); + .withValue(AASUtils.asString(element.getDataSpecification())) + .withRefSemantic(generator.refSemantic(ConceptDescription.class, "dataSpecification")); attributes.add(builder.build()); } else { // need to map all properties but with specific attribute path // idea: get current attribute path via context? // for now do not care about correct attribute path InternalElementType.Builder temp = InternalElementType.builder(); - AmlGenerator subGenerator = generator.with(temp); + AmlGenerator subGenerator = generator.with(temp); context.map(element.getDataSpecificationContent(), subGenerator); InternalElementType.Builder builder = InternalElementType.copyOf(temp.build().getInternalElement().get(0)) .withName("EmbeddedDataSpecification" + (countInternalElement > 1 ? "_" + (internalElements.size() + 1) : "")) .withID(context.generateId()) - .withRefBaseSystemUnitPath("AssetAdministrationShellDataSpecificationTemplates/" - + getDataSpecificationContentType(element.getDataSpecificationContent().getClass()) + "Template/" + .withRefBaseSystemUnitPath(generator.getDocumentInfo().getDataSpecificationTemplatesSystemUnitClassLib() + + "/" + getDataSpecificationContentType(element.getDataSpecificationContent().getClass()) + "Template/" + getDataSpecificationContentType(element.getDataSpecificationContent().getClass())); internalElements.add(builder.build()); } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/FileMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/FileMapper.java new file mode 100644 index 00000000..057bf348 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/FileMapper.java @@ -0,0 +1,59 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper; + +import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.Aas2AmlMappingContext; +import io.adminshell.aas.v3.dataformat.aml.model.caex.AttributeType; +import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; +import io.adminshell.aas.v3.dataformat.aml.model.caex.RoleClassType; +import io.adminshell.aas.v3.dataformat.mapping.MappingException; +import io.adminshell.aas.v3.model.File; + +public class FileMapper extends DefaultMapper { + + private static final String FILE_INTERFACE_NAME = "FileDataReference"; + private static final String ATTRIBUTE_MIMETYPE_NAME = "MIMEType"; + private static final String ATTRIBUTE_MIMETYPE_DATATYPE = "xs:string"; + private static final String ATTRIBUTE_REFURI_NAME = "refURI"; + private static final String ATTRIBUTE_REFURI_DATATYPE = "xs:anyURI"; + + public FileMapper() { + } + + @Override + protected InternalElementType.Builder toInternalElement(File value, AmlGenerator generator, Aas2AmlMappingContext context) throws MappingException { + InternalElementType.Builder builder = super.toInternalElement(value, generator, context); + if (builder != null) { + builder.withExternalInterface(RoleClassType.ExternalInterface.builder() + .withName(FILE_INTERFACE_NAME) + .withID(context.generateId()) + .withRefBaseClassPath(generator.getDocumentInfo().getAssetAdministrationShellInterfaceClassLib() + "/" + FILE_INTERFACE_NAME) + .addAttribute(AttributeType.builder() + .withName(ATTRIBUTE_MIMETYPE_NAME) + .withAttributeDataType(ATTRIBUTE_MIMETYPE_DATATYPE) + .withValue(value.getMimeType()) + .build()) + .addAttribute(AttributeType.builder() + .withName(ATTRIBUTE_REFURI_NAME) + .withValue(value.getValue()) + .withAttributeDataType(ATTRIBUTE_REFURI_DATATYPE) + .build()) + .build()); + } + return builder; + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/LangStringCollectionMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/LangStringCollectionMapper.java similarity index 75% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/LangStringCollectionMapper.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/LangStringCollectionMapper.java index ee5ee44f..2eabe2ec 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/LangStringCollectionMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/LangStringCollectionMapper.java @@ -13,20 +13,20 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.mapper; +package io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper; import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; -import io.adminshell.aas.v3.dataformat.aml.MappingContext; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.Aas2AmlMappingContext; import io.adminshell.aas.v3.dataformat.aml.model.caex.AttributeType; import io.adminshell.aas.v3.model.LangString; import java.lang.reflect.ParameterizedType; import java.util.Collection; import java.util.stream.Collectors; -public class LangStringCollectionMapper extends BaseMapper> { +public class LangStringCollectionMapper extends DefaultMapper> { @Override - public void map(Collection value, AmlGenerator generator, MappingContext context) { + public void map(Collection value, AmlGenerator generator, Aas2AmlMappingContext context) { if (context == null || context.getProperty() == null) { throw new IllegalArgumentException("context.property must be non-null"); } @@ -34,15 +34,14 @@ public void map(Collection value, AmlGenerator generator, MappingCon return; } Object t = (Class) ((ParameterizedType) context.getProperty().getReadMethod().getGenericReturnType()).getActualTypeArguments()[0]; + generator.addAttribute(AttributeType.builder() // für collections funktioniert getName so nicht weil value.class == Collection + type erasure - .withName(context.getMappingProvider().getAttributeNamingStrategy().getName( + .withName(context.getAttributeNamingStrategy().getName( context.getProperty().getReadMethod().getDeclaringClass(), value, context.getProperty().getName())) - .withRefSemantic(AttributeType.RefSemantic.builder() - .withCorrespondingAttributePath("AAS:" + context.getProperty().getReadMethod().getDeclaringClass().getSimpleName() + "/" + context.getProperty().getName()) - .build()) + .withRefSemantic(generator.refSemantic(context.getProperty())) .addAttribute(value.stream() .map(x -> AttributeType.builder() .withName("aml-lang=" + x.getLanguage()) diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/OperationMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/OperationMapper.java similarity index 75% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/OperationMapper.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/OperationMapper.java index a09d5870..aa5cdc87 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/OperationMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/OperationMapper.java @@ -13,22 +13,22 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.mapper; +package io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper; import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; -import io.adminshell.aas.v3.dataformat.aml.MappingContext; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.Aas2AmlMappingContext; import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; import io.adminshell.aas.v3.model.Operation; -public class OperationMapper implements Mapper { +public class OperationMapper implements Aas2AmlElementMapper { public OperationMapper() { } @Override - public void map(Operation operation, AmlGenerator generator, MappingContext context) { + public void map(Operation operation, AmlGenerator generator, Aas2AmlMappingContext context) { InternalElementType.Builder builder = InternalElementType.builder() - .withName(context.getMappingProvider().getInternalElementNamingStrategy().getName(Operation.class, operation, null)); + .withName(context.getInternalElementNamingStrategy().getName(Operation.class, operation, null)); generator.with(builder).appendReferenceTargetInterfaceIfRequired(operation, context); generator.addInternalElement(builder.build()); } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/OperationVariableCollectionMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/OperationVariableCollectionMapper.java similarity index 74% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/OperationVariableCollectionMapper.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/OperationVariableCollectionMapper.java index a1104f57..8c2a8d09 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/OperationVariableCollectionMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/OperationVariableCollectionMapper.java @@ -13,22 +13,23 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.mapper; +package io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper; import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; -import io.adminshell.aas.v3.dataformat.aml.MappingContext; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.Aas2AmlMappingContext; import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; +import io.adminshell.aas.v3.dataformat.mapping.MappingException; import io.adminshell.aas.v3.model.OperationVariable; import java.util.Collection; -public class OperationVariableCollectionMapper extends AbstractCollectionMapper { +public class OperationVariableCollectionMapper extends DefaultCollectionMapper { @Override - public void map(Collection value, AmlGenerator generator, MappingContext context) throws MappingException { + public void map(Collection value, AmlGenerator generator, Aas2AmlMappingContext context) throws MappingException { if (value == null || value.isEmpty()) { return; } - String name = context.getMappingProvider().getAttributeNamingStrategy().getName( + String name = context.getAttributeNamingStrategy().getName( value.getClass(), value, context.getProperty().getName()); @@ -36,7 +37,7 @@ public void map(Collection value, AmlGenerator generator, Map InternalElementType.Builder builder = InternalElementType.builder() .withName(name) .withID(context.generateId()) - .withRoleRequirements(roleRequirement("Operation" + name)); + .withRoleRequirements(generator.roleRequirement("Operation" + name)); for (OperationVariable element : value) { context .withoutProperty() diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/OperationVariableMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/OperationVariableMapper.java similarity index 73% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/OperationVariableMapper.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/OperationVariableMapper.java index 59c73381..9d26be6c 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/OperationVariableMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/OperationVariableMapper.java @@ -13,20 +13,20 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.mapper; +package io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper; import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; -import io.adminshell.aas.v3.dataformat.aml.MappingContext; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.Aas2AmlMappingContext; +import io.adminshell.aas.v3.dataformat.mapping.MappingException; import io.adminshell.aas.v3.model.OperationVariable; -public class OperationVariableMapper extends BaseMapper { +public class OperationVariableMapper extends DefaultMapper { public OperationVariableMapper() { } @Override - public void map(OperationVariable operationVariable, AmlGenerator generator, MappingContext context) throws MappingException { -// toInternalElement(operationVariable, context); + public void map(OperationVariable operationVariable, AmlGenerator generator, Aas2AmlMappingContext context) throws MappingException { if (operationVariable != null && operationVariable.getValue() != null) { context.withoutProperty().map(operationVariable.getValue(), generator); } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/QualifierMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/QualifierMapper.java new file mode 100644 index 00000000..ff130d91 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/QualifierMapper.java @@ -0,0 +1,37 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper; + +import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.Aas2AmlMappingContext; +import io.adminshell.aas.v3.dataformat.mapping.MappingException; +import io.adminshell.aas.v3.model.Qualifier; + +public class QualifierMapper extends DefaultMapper { + + @Override + public void map(Qualifier value, AmlGenerator generator, Aas2AmlMappingContext context) throws MappingException { + asAttribute(value, generator, context); + } + + @Override + protected String getAttributeName(Qualifier value, Aas2AmlMappingContext context) { + return context.getAttributeNamingStrategy().getName( + Qualifier.class, + value, + context.getProperty().getName()); + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/ReferenceCollectionMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/ReferenceCollectionMapper.java similarity index 69% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/ReferenceCollectionMapper.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/ReferenceCollectionMapper.java index f3f10b8d..db753003 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/ReferenceCollectionMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/ReferenceCollectionMapper.java @@ -13,22 +13,23 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.mapper; +package io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper; import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; -import io.adminshell.aas.v3.dataformat.aml.MappingContext; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.Aas2AmlMappingContext; +import io.adminshell.aas.v3.dataformat.mapping.MappingException; import io.adminshell.aas.v3.model.Reference; import java.util.Collection; -public class ReferenceCollectionMapper implements CollectionMapper { +public class ReferenceCollectionMapper implements Aas2AmlElementMapper> { @Override - public void map(Collection value, AmlGenerator generator, MappingContext context) throws MappingException { + public void map(Collection value, AmlGenerator generator, Aas2AmlMappingContext context) throws MappingException { if (value == null || value.isEmpty()) { return; } for (Reference element : value) { - context.withoutProperty().map(element, generator); + context.map(element, generator); } } } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/ReferenceElementMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/ReferenceElementMapper.java similarity index 79% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/ReferenceElementMapper.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/ReferenceElementMapper.java index 6af0115a..9cda071d 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/ReferenceElementMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/ReferenceElementMapper.java @@ -13,39 +13,40 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.mapper; +package io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper; import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; -import io.adminshell.aas.v3.dataformat.aml.MappingContext; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.Aas2AmlMappingContext; import io.adminshell.aas.v3.dataformat.aml.model.caex.AttributeType; import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; import io.adminshell.aas.v3.dataformat.aml.model.caex.RoleClassType; import io.adminshell.aas.v3.dataformat.aml.model.caex.SystemUnitClassType.InternalLink; -import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.util.ReferenceConverterUtil; import io.adminshell.aas.v3.dataformat.aml.util.AASUtils; import io.adminshell.aas.v3.dataformat.core.ReflectionHelper; +import io.adminshell.aas.v3.dataformat.mapping.MappingException; import io.adminshell.aas.v3.model.Referable; import io.adminshell.aas.v3.model.ReferenceElement; +import java.beans.PropertyDescriptor; -public class ReferenceElementMapper extends BaseMapper { +public class ReferenceElementMapper extends DefaultMapper { public ReferenceElementMapper() { } @Override - public void map(ReferenceElement element, AmlGenerator generator, MappingContext context) throws MappingException { + public void map(ReferenceElement element, AmlGenerator generator, Aas2AmlMappingContext context) throws MappingException { if (element == null) { return; } // regular mapping InternalElementType.Builder builder = InternalElementType.builder() .withID(context.getCachedId(element)) - .withName(context.getMappingProvider().getInternalElementNamingStrategy().getName( + .withName(context.getInternalElementNamingStrategy().getName( element.getClass(), element, null)) - .withRoleRequirements(roleRequirement(ReflectionHelper.getModelType(element.getClass()))); - mapProperties(element, generator.with(builder), context, "value"); + .withRoleRequirements(generator.roleRequirement(ReflectionHelper.getModelType(element.getClass()))); + mapProperties(element, generator.with(builder), context); // add interface RoleClassType.ExternalInterface.Builder interfaceBuilder = RoleClassType.ExternalInterface.builder() .withID(context.generateId()) @@ -69,7 +70,7 @@ public void map(ReferenceElement element, AmlGenerator generator, MappingContext .withName("value") .withID(context.generateId()) .withAttributeDataType("xs:string") - .withValue(ReferenceConverterUtil.convert(element.getValue())) + .withValue(AASUtils.asString(element.getValue())) .build()); } builder.withExternalInterface(interfaceBuilder.build()); @@ -77,4 +78,9 @@ public void map(ReferenceElement element, AmlGenerator generator, MappingContext generator.addInternalElement(builder.build()); } + @Override + protected boolean skipProperty(PropertyDescriptor property) { + return property.getName().equals("value"); + } + } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/ReferenceMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/ReferenceMapper.java similarity index 51% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/ReferenceMapper.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/ReferenceMapper.java index 9a4908a7..d8be2ee8 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/ReferenceMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/ReferenceMapper.java @@ -13,31 +13,32 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.mapper; +package io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper; import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; -import io.adminshell.aas.v3.dataformat.aml.MappingContext; -import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.util.ReferenceConverterUtil; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.Aas2AmlMappingContext; import io.adminshell.aas.v3.dataformat.aml.util.AASUtils; +import io.adminshell.aas.v3.dataformat.mapping.MappingException; import io.adminshell.aas.v3.model.KeyElements; import io.adminshell.aas.v3.model.Reference; import io.adminshell.aas.v3.model.Submodel; import java.util.Optional; -public class ReferenceMapper extends ToAttributeMapper { +public class ReferenceMapper extends DefaultMapper { @Override - public void map(Reference reference, AmlGenerator generator, MappingContext context) throws MappingException { - if (reference != null && !reference.getKeys().isEmpty()) { - KeyElements referencedType = reference.getKeys().get(reference.getKeys().size() - 1).getType(); - if (referencedType == KeyElements.SUBMODEL) { - Optional resolvedSubmodel = AASUtils.resolveSubmodelReference(reference, context.getEnvironment()); - if (resolvedSubmodel.isPresent()) { - context.withoutIdCache().map(resolvedSubmodel.get(), generator); - return; - } + public void map(Reference reference, AmlGenerator generator, Aas2AmlMappingContext context) throws MappingException { + if (reference == null || reference.getKeys().isEmpty()) { + return; + } + KeyElements referencedType = reference.getKeys().get(reference.getKeys().size() - 1).getType(); + if (referencedType == KeyElements.SUBMODEL) { + Optional resolvedSubmodel = AASUtils.resolveSubmodelReference(reference, context.getEnvironment()); + if (resolvedSubmodel.isPresent()) { + context.withoutIdCache().map(resolvedSubmodel.get(), generator); + return; } } - mapAsAttribute(ReferenceConverterUtil.convert(reference), generator, context); + context.map(AASUtils.asString(reference), generator); } } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/RelationshipElementMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/RelationshipElementMapper.java similarity index 77% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/RelationshipElementMapper.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/RelationshipElementMapper.java index f69cfa1e..a32069f8 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/RelationshipElementMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/RelationshipElementMapper.java @@ -13,41 +13,42 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.mapper; +package io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper; import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; -import io.adminshell.aas.v3.dataformat.aml.MappingContext; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.Aas2AmlMappingContext; import io.adminshell.aas.v3.dataformat.aml.model.caex.AttributeType; import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; import io.adminshell.aas.v3.dataformat.aml.model.caex.RoleClassType; import io.adminshell.aas.v3.dataformat.aml.model.caex.SystemUnitClassType.InternalLink; -import io.adminshell.aas.v3.dataformat.aml.serialize.mapper.util.ReferenceConverterUtil; import io.adminshell.aas.v3.dataformat.aml.util.AASUtils; import io.adminshell.aas.v3.dataformat.core.ReflectionHelper; +import io.adminshell.aas.v3.dataformat.mapping.MappingException; import io.adminshell.aas.v3.model.Referable; import io.adminshell.aas.v3.model.Reference; import io.adminshell.aas.v3.model.RelationshipElement; +import java.beans.PropertyDescriptor; -public class RelationshipElementMapper extends BaseMapper { +public class RelationshipElementMapper extends DefaultMapper { public RelationshipElementMapper() { } @Override - public void map(RelationshipElement element, AmlGenerator generator, MappingContext context) throws MappingException { + public void map(RelationshipElement element, AmlGenerator generator, Aas2AmlMappingContext context) throws MappingException { if (element == null) { return; } // regular mapping InternalElementType.Builder builder = InternalElementType.builder() .withID(context.getCachedId(element)) - .withName(context.getMappingProvider().getInternalElementNamingStrategy().getName( + .withName(context.getInternalElementNamingStrategy().getName( element.getClass(), element, null)) - .withRoleRequirements(roleRequirement(ReflectionHelper.getModelType(element.getClass()))); + .withRoleRequirements(generator.roleRequirement(ReflectionHelper.getModelType(element.getClass()))); AmlGenerator subGenerator = generator.with(builder); - mapProperties(element, subGenerator, context, "first", "second"); + mapProperties(element, subGenerator, context); // add special mapping for first, second mapProperty(element, element.getFirst(), "first", subGenerator, context); mapProperty(element, element.getSecond(), "second", subGenerator, context); @@ -55,7 +56,7 @@ public void map(RelationshipElement element, AmlGenerator generator, MappingCont generator.addInternalElement(builder.build()); } - private void mapProperty(RelationshipElement element, Reference reference, String name, AmlGenerator generator, MappingContext context) { + private void mapProperty(RelationshipElement element, Reference reference, String name, AmlGenerator generator, Aas2AmlMappingContext context) { RoleClassType.ExternalInterface.Builder builder = RoleClassType.ExternalInterface.builder() .withName(name) .withRefBaseClassPath("AssetAdministrationShellInterfaceClassLib/ReferableReference"); @@ -75,9 +76,14 @@ private void mapProperty(RelationshipElement element, Reference reference, Strin builder = builder.addAttribute(AttributeType.builder() .withName("value") .withAttributeDataType("xs:string") - .withValue(ReferenceConverterUtil.convert(reference)) + .withValue(AASUtils.asString(reference)) .build()); } generator.addExternalInterface(builder.build()); } + + @Override + protected boolean skipProperty(PropertyDescriptor property) { + return property.getName().equals("first") || property.getName().equals("second"); + } } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/SubmodelMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/SubmodelMapper.java new file mode 100644 index 00000000..fadfeb4c --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/SubmodelMapper.java @@ -0,0 +1,38 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper; + +import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.Aas2AmlMappingContext; +import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; +import io.adminshell.aas.v3.dataformat.mapping.MappingException; +import io.adminshell.aas.v3.model.ModelingKind; +import io.adminshell.aas.v3.model.Submodel; + +public class SubmodelMapper extends DefaultMapper { + + public SubmodelMapper() { + } + + @Override + protected InternalElementType.Builder toInternalElement(Submodel value, AmlGenerator generator, Aas2AmlMappingContext context) throws MappingException { + InternalElementType.Builder builder = super.toInternalElement(value, generator, context); + if (value.getKind() == ModelingKind.TEMPLATE) { + builder = builder.withRefBaseSystemUnitPath(generator.refBaseSystemUnitPath(value, context)); + } + return builder; + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/ToAttributeMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/ToAttributeMapper.java similarity index 83% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/ToAttributeMapper.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/ToAttributeMapper.java index a34ea660..e7a55b03 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/ToAttributeMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/ToAttributeMapper.java @@ -13,15 +13,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.mapper; +package io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper; import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; -import io.adminshell.aas.v3.dataformat.aml.MappingContext; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.Aas2AmlMappingContext; import io.adminshell.aas.v3.dataformat.aml.model.caex.AttributeType; -public abstract class ToAttributeMapper implements Mapper { +public abstract class ToAttributeMapper implements Aas2AmlElementMapper { - protected void mapAsAttribute(Object value, AmlGenerator generator, MappingContext context) { + protected void mapAsAttribute(Object value, AmlGenerator generator, Aas2AmlMappingContext context) { if (value != null && context.getProperty() != null) { generator.addAttribute(AttributeType.builder() .withName(context.getProperty().getName()) diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/ViewMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/ViewMapper.java similarity index 74% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/ViewMapper.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/ViewMapper.java index 8a74cbe4..5b8f30d6 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/ViewMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/ViewMapper.java @@ -13,24 +13,25 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.mapper; +package io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper; import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; -import io.adminshell.aas.v3.dataformat.aml.MappingContext; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.Aas2AmlMappingContext; import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; import io.adminshell.aas.v3.dataformat.core.ReflectionHelper; +import io.adminshell.aas.v3.dataformat.mapping.MappingException; import io.adminshell.aas.v3.model.View; -public class ViewMapper extends BaseMapper { +public class ViewMapper extends DefaultMapper { @Override - public void map(View view, AmlGenerator generator, MappingContext context) throws MappingException { + public void map(View view, AmlGenerator generator, Aas2AmlMappingContext context) throws MappingException { if (view == null || view.getContainedElements() == null || view.getContainedElements().isEmpty()) { return; } InternalElementType.Builder builder = InternalElementType.builder(); builder = builder.withID(context.getCachedId(view)) - .withName(context.getMappingProvider().getInternalElementNamingStrategy().getName( + .withName(context.getInternalElementNamingStrategy().getName( view.getClass(), view, null)) @@ -38,7 +39,7 @@ public void map(View view, AmlGenerator generator, MappingContext context) throw // AASUtils.resolve( // view.getContainedElements().get(0), // context.getEnvironment()))) - .withRoleRequirements(roleRequirement(ReflectionHelper.getModelType(view.getClass()))); + .withRoleRequirements(generator.roleRequirement(ReflectionHelper.getModelType(view.getClass()))); generator.with(builder).appendReferenceTargetInterfaceIfRequired(view, context); generator.addInternalElement(builder.build()); } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/header/WriterHeader.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/header/WriterHeader.java index 57311f4e..315dd5cb 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/header/WriterHeader.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/header/WriterHeader.java @@ -143,6 +143,5 @@ public String getProjectID() { public void setProjectID(String projectID) { this.projectID = projectID; } - - + } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/IdGenerator.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/id/IdGenerator.java similarity index 91% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/IdGenerator.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/id/IdGenerator.java index 10acfc14..c5ee76fe 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/IdGenerator.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/id/IdGenerator.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml; +package io.adminshell.aas.v3.dataformat.aml.id; public interface IdGenerator { diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/IntegerIdGenerator.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/id/IntegerIdGenerator.java similarity index 91% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/IntegerIdGenerator.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/id/IntegerIdGenerator.java index a2d73608..e27536da 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/IntegerIdGenerator.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/id/IntegerIdGenerator.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml; +package io.adminshell.aas.v3.dataformat.aml.id; public class IntegerIdGenerator implements IdGenerator { diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/UuidGenerator.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/id/UuidGenerator.java similarity index 91% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/UuidGenerator.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/id/UuidGenerator.java index 0783eb3f..ea7b46e6 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/UuidGenerator.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/id/UuidGenerator.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml; +package io.adminshell.aas.v3.dataformat.aml.id; import java.util.UUID; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/BaseMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/BaseMapper.java deleted file mode 100644 index 248d4ec6..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/BaseMapper.java +++ /dev/null @@ -1,135 +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 io.adminshell.aas.v3.dataformat.aml.mapper; - -import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; -import io.adminshell.aas.v3.dataformat.aml.MappingContext; -import io.adminshell.aas.v3.dataformat.aml.model.caex.AttributeType; -import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; -import io.adminshell.aas.v3.dataformat.core.ReflectionHelper; -import java.beans.IntrospectionException; -import java.beans.Introspector; -import java.beans.PropertyDescriptor; -import java.lang.reflect.InvocationTargetException; -import java.util.Arrays; -import java.util.HashSet; -import java.util.List; -import java.util.Optional; -import java.util.Set; - -public abstract class BaseMapper implements Mapper { - - protected Optional findMapper(Class type) { - return Optional.empty(); - } - - protected Class getValueType(T value, MappingContext context) { - return value.getClass(); - } - - @Override - public void map(T value, AmlGenerator generator, MappingContext context) throws MappingException { - if (value == null || context == null) { - return; - } - Class aasType = getValueType(value, context); - Class aasTypeInfo = ReflectionHelper.getMostSpecificTypeWithModelType(aasType); - if (aasTypeInfo != null) { - toInternalElement(value, generator, context); - } else { - toAttribute(value, generator, context); - } - } - - protected void toInternalElement(T value, AmlGenerator generator, MappingContext context) throws MappingException { - InternalElementType.Builder builder = InternalElementType.builder(); - builder = builder.withID(context.getCachedId(value)) - .withName(context.getMappingProvider().getInternalElementNamingStrategy().getName( - value.getClass(), - value, - null)) - .withRoleRequirements(roleRequirement(ReflectionHelper.getModelType(value.getClass()))); - mapProperties(value, generator.with(builder), context); - generator.with(builder).appendReferenceTargetInterfaceIfRequired(value, context); - generator.addInternalElement(builder.build()); - } - - protected void toAttribute(T value, AmlGenerator generator, MappingContext context) throws MappingException { - Class aasType = ReflectionHelper.getAasInterface(value.getClass()); - AttributeType.Builder builder = AttributeType.builder(); - if (context.getProperty() != null) { - builder = builder - .withName(context.getMappingProvider().getAttributeNamingStrategy().getName( - context.getProperty().getReadMethod().getGenericReturnType(), - value, - context.getProperty().getName())) - .withRefSemantic(refSemantic( - context.getProperty().getReadMethod().getDeclaringClass().getSimpleName(), - context.getProperty().getName())); - } - if (aasType != null) { - mapProperties(value, generator.with(builder), context); - } else { - builder = builder.withValue(value); - } - generator.addAttribute(builder.build()); - } - - protected void mapProperties(T value, AmlGenerator generator, MappingContext context, String... ignoreProperties) throws MappingException { - List ignored = Arrays.asList(ignoreProperties); - Class aasType = ReflectionHelper.getAasInterface(value.getClass()); - Set> types = new HashSet<>(); - if (aasType != null) { - types.add(aasType); - types.addAll(ReflectionHelper.getSuperTypes(aasType, true)); - } - for (Class type : types) { - try { - for (PropertyDescriptor property : Introspector.getBeanInfo(type).getPropertyDescriptors()) { - if (!ignored.contains(property.getName())) { - context.with(property) - .map(property.getReadMethod().getGenericReturnType(), - getPropertyValue(value, property, context), - generator); - } - } - } catch (IntrospectionException ex) { - throw new MappingException("error listing properties of class " + type, ex); - } - } - } - - protected Object getPropertyValue(T value, PropertyDescriptor property, MappingContext context) throws MappingException { - try { - return property.getReadMethod().invoke(value); - } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException ex) { - throw new MappingException("failed to get property value for property " + property.getName(), ex); - } - } - - protected InternalElementType.RoleRequirements roleRequirement(String value) { - return InternalElementType.RoleRequirements.builder() - .withRefBaseRoleClassPath("AssetAdministrationShellRoleClassLib/" + value) - .build(); - } - - protected AttributeType.RefSemantic refSemantic(String className, String propertyName) { - return AttributeType.RefSemantic.builder() - .withCorrespondingAttributePath("AAS:" + className + "/" + propertyName) - .build(); - } - -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/DataSpecificationContentMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/DataSpecificationContentMapper.java deleted file mode 100644 index 567bf423..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/DataSpecificationContentMapper.java +++ /dev/null @@ -1,46 +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 io.adminshell.aas.v3.dataformat.aml.mapper; - -import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; -import io.adminshell.aas.v3.dataformat.aml.MappingContext; -import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; -import io.adminshell.aas.v3.model.DataSpecificationContent; - -public class DataSpecificationContentMapper extends BaseMapper { - - public DataSpecificationContentMapper() { - } - - @Override - public void map(DataSpecificationContent content, AmlGenerator generator, MappingContext context) throws MappingException { - toInternalElement(content, generator, context); - } - - @Override - protected void toInternalElement(DataSpecificationContent value, AmlGenerator generator, MappingContext context) throws MappingException { - InternalElementType.Builder builder = InternalElementType.builder(); - builder = builder.withID(context.generateId()) - .withName(context.getMappingProvider().getInternalElementNamingStrategy().getName( - value.getClass(), - value, - null)) - .withRoleRequirements(roleRequirement(DataSpecificationContent.class.getSimpleName())); - mapProperties(value, generator.with(builder), context); - generator.with(builder).appendReferenceTargetInterfaceIfRequired(value, context); - generator.addInternalElement(builder.build()); - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/DataSpecificationIEC61360Mapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/DataSpecificationIEC61360Mapper.java deleted file mode 100644 index e9bedf07..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/DataSpecificationIEC61360Mapper.java +++ /dev/null @@ -1,53 +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 io.adminshell.aas.v3.dataformat.aml.mapper; - -import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; -import io.adminshell.aas.v3.dataformat.aml.MappingContext; -import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; -import io.adminshell.aas.v3.model.DataSpecificationContent; -import io.adminshell.aas.v3.model.DataSpecificationIEC61360; -import java.beans.PropertyDescriptor; - -public class DataSpecificationIEC61360Mapper extends BaseMapper { - - @Override - public void map(DataSpecificationIEC61360 content, AmlGenerator generator, MappingContext context) throws MappingException { - toInternalElement(content, generator, context); - } - - @Override - protected void toInternalElement(DataSpecificationIEC61360 value, AmlGenerator generator, MappingContext context) throws MappingException { - InternalElementType.Builder builder = InternalElementType.builder(); - builder = builder.withID(context.generateId()) - .withName(context.getMappingProvider().getInternalElementNamingStrategy().getName( - value.getClass(), - value, - null)) - .withRoleRequirements(roleRequirement(DataSpecificationContent.class.getSimpleName())); - mapProperties(value, generator.with(builder), context); - generator.with(builder).appendReferenceTargetInterfaceIfRequired(value, context); - generator.addInternalElement(builder.build()); - } - - @Override - protected Object getPropertyValue(DataSpecificationIEC61360 value, PropertyDescriptor property, MappingContext context) throws MappingException { - if (property.getName().equals("levelTypes") || property.getName().equals("valueList")) { - return null; - } - return super.getPropertyValue(value, property, context); - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/FileMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/FileMapper.java deleted file mode 100644 index 6346783e..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/FileMapper.java +++ /dev/null @@ -1,62 +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 io.adminshell.aas.v3.dataformat.aml.mapper; - -import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; -import io.adminshell.aas.v3.dataformat.aml.MappingContext; -import io.adminshell.aas.v3.dataformat.aml.model.caex.AttributeType; -import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; -import io.adminshell.aas.v3.dataformat.aml.model.caex.RoleClassType; -import io.adminshell.aas.v3.dataformat.core.ReflectionHelper; -import io.adminshell.aas.v3.model.File; - -public class FileMapper extends BaseMapper { - - public FileMapper() { - } - - @Override - public void map(File file, AmlGenerator generator, MappingContext context) throws MappingException { - if (file == null) { - return; - } - InternalElementType.Builder builder = InternalElementType.builder(); - builder = builder.withID(context.getCachedId(file)) - .withName(context.getMappingProvider().getInternalElementNamingStrategy().getName( - file.getClass(), - file, - null)) - .withRoleRequirements(roleRequirement(ReflectionHelper.getModelType(file.getClass()))) - .withExternalInterface(RoleClassType.ExternalInterface.builder() - .withName("FileDataReference") - .withID(context.generateId()) - .withRefBaseClassPath("AssetAdministrationShellInterfaceClassLib/FileDataReference") - .addAttribute(AttributeType.builder() - .withName("MIMEType") - .withAttributeDataType("xs:string") - .withValue(file.getMimeType()) - .build()) - .addAttribute(AttributeType.builder() - .withName("refURI") - .withValue(file.getValue()) - .withAttributeDataType("xs:anyURI") - .build()) - .build()); - mapProperties(file, generator.with(builder), context); - generator.with(builder).appendReferenceTargetInterfaceIfRequired(file, context); - generator.addInternalElement(builder.build()); - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/QualifierMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/QualifierMapper.java deleted file mode 100644 index 45169409..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/QualifierMapper.java +++ /dev/null @@ -1,36 +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 io.adminshell.aas.v3.dataformat.aml.mapper; - -import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; -import io.adminshell.aas.v3.dataformat.aml.MappingContext; -import io.adminshell.aas.v3.dataformat.aml.model.caex.AttributeType; -import io.adminshell.aas.v3.dataformat.aml.model.caex.AttributeType.RefSemantic; -import io.adminshell.aas.v3.model.Qualifier; - -public class QualifierMapper extends BaseMapper { - - @Override - public void map(Qualifier qualifier, AmlGenerator generator, MappingContext context) throws MappingException { - AttributeType.Builder builder = AttributeType.builder() - .withName("qualifier:" + qualifier.getType() + "=" + qualifier.getValue()) - .addRefSemantic(RefSemantic.builder() - .withCorrespondingAttributePath("AAS:" + context.getProperty().getReadMethod().getDeclaringClass().getSimpleName() + "/" + context.getProperty().getName()) - .build()); - mapProperties(qualifier, generator.with(builder), context); - generator.addAttribute(builder.build()); - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/SubmodelCollectionMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/SubmodelCollectionMapper.java deleted file mode 100644 index ff2693a0..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/SubmodelCollectionMapper.java +++ /dev/null @@ -1,36 +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 io.adminshell.aas.v3.dataformat.aml.mapper; - -import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; -import io.adminshell.aas.v3.dataformat.aml.MappingContext; -import io.adminshell.aas.v3.model.Submodel; -import java.util.Collection; - -public class SubmodelCollectionMapper extends BaseMapper> { - - @Override - public void map(Collection value, AmlGenerator generator, MappingContext context) throws MappingException { - if (value == null || context == null) { - return; - } - super.map(value, generator, context); -// super.map(value.stream() -// .filter(x -> x.getKind() == ModelingKind.INSTANCE) -// .collect(Collectors.toList()), -// context); - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/SubmodelMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/SubmodelMapper.java deleted file mode 100644 index 30b68722..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/SubmodelMapper.java +++ /dev/null @@ -1,50 +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 io.adminshell.aas.v3.dataformat.aml.mapper; - -import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; -import io.adminshell.aas.v3.dataformat.aml.MappingContext; -import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; -import io.adminshell.aas.v3.dataformat.core.ReflectionHelper; -import io.adminshell.aas.v3.model.ModelingKind; -import io.adminshell.aas.v3.model.Operation; -import io.adminshell.aas.v3.model.Submodel; - -public class SubmodelMapper extends BaseMapper { - - public SubmodelMapper() { - } - - @Override - protected void toInternalElement(Submodel value, AmlGenerator generator, MappingContext context) throws MappingException { - InternalElementType.Builder builder = InternalElementType.builder(); - builder = builder.withID(context.getCachedId(value)) - .withName(context.getMappingProvider().getInternalElementNamingStrategy().getName( - value.getClass(), - value, - null)) - .withRoleRequirements(roleRequirement(ReflectionHelper.getModelType(value.getClass()))); - if (value.getKind() == ModelingKind.TEMPLATE) { - builder = builder.withRefBaseSystemUnitPath("AssetAdministrationShellSystemUnitClasses/" + context.getMappingProvider().getInternalElementNamingStrategy().getName( - value.getClass(), - value, - null)); - } - mapProperties(value, generator.with(builder), context); - generator.with(builder).appendReferenceTargetInterfaceIfRequired(value, context); - generator.addInternalElement(builder.build()); - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AbstractClassNamingStrategy.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/naming/AbstractClassNamingStrategy.java similarity index 93% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AbstractClassNamingStrategy.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/naming/AbstractClassNamingStrategy.java index 60cd8ff3..0fd4ad33 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AbstractClassNamingStrategy.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/naming/AbstractClassNamingStrategy.java @@ -13,11 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml; +package io.adminshell.aas.v3.dataformat.aml.naming; import com.google.common.reflect.TypeToken; -import io.adminshell.aas.v3.dataformat.aml.util.TypeUtils; -import io.adminshell.aas.v3.model.LangString; +import io.adminshell.aas.v3.dataformat.mapping.util.TypeUtils; import io.adminshell.aas.v3.model.Referable; import java.lang.reflect.Type; import java.util.ArrayList; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/IdClassNamingStrategy.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/naming/IdClassNamingStrategy.java similarity index 92% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/IdClassNamingStrategy.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/naming/IdClassNamingStrategy.java index 33f4427e..c4982800 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/IdClassNamingStrategy.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/naming/IdClassNamingStrategy.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml; +package io.adminshell.aas.v3.dataformat.aml.naming; import java.util.UUID; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/NamingStrategy.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/naming/NamingStrategy.java similarity index 91% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/NamingStrategy.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/naming/NamingStrategy.java index 233e23f0..a3531b97 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/NamingStrategy.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/naming/NamingStrategy.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml; +package io.adminshell.aas.v3.dataformat.aml.naming; import java.lang.reflect.Type; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/NumberingClassNamingStrategy.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/naming/NumberingClassNamingStrategy.java similarity index 93% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/NumberingClassNamingStrategy.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/naming/NumberingClassNamingStrategy.java index 03b6a13c..7ff69764 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/NumberingClassNamingStrategy.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/naming/NumberingClassNamingStrategy.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml; +package io.adminshell.aas.v3.dataformat.aml.naming; import java.util.HashMap; import java.util.Map; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/PropertyNamingStrategy.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/naming/PropertyNamingStrategy.java similarity index 92% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/PropertyNamingStrategy.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/naming/PropertyNamingStrategy.java index c55d23e5..67702c5d 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/PropertyNamingStrategy.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/naming/PropertyNamingStrategy.java @@ -13,15 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml; +package io.adminshell.aas.v3.dataformat.aml.naming; import com.google.common.reflect.TypeToken; -import io.adminshell.aas.v3.dataformat.aml.util.TypeUtils; +import io.adminshell.aas.v3.dataformat.mapping.util.TypeUtils; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.List; import java.util.Objects; -import java.util.Optional; import java.util.function.BiFunction; import java.util.function.Function; import java.util.stream.Collectors; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/util/ReferenceConverterUtil.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/util/ReferenceConverterUtil.java deleted file mode 100644 index c60630ea..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialize/mapper/util/ReferenceConverterUtil.java +++ /dev/null @@ -1,55 +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 io.adminshell.aas.v3.dataformat.aml.serialize.mapper.util; - -//import de.fraunhofer.iosb.ilt.aas.service.model.common.types.reference.Key; -//import de.fraunhofer.iosb.ilt.aas.service.model.common.types.reference.Reference; -import io.adminshell.aas.v3.model.*; - -import java.util.Iterator; - -public class ReferenceConverterUtil { - - public static String convert(Reference reference) { - if (reference == null) { - return null; - } - - StringBuilder builder = new StringBuilder(); - - Iterator stringIterator = reference.getKeys().iterator(); - while (stringIterator.hasNext()) { - Key key = stringIterator.next(); - builder.append("("); - builder.append(key.getType()); - builder.append(")"); - - // No local attr. in v3 -// builder.append("("); -// builder.append(key.isLocal() ? "local" : "no-local"); -// builder.append(")"); - builder.append("["); - builder.append(key.getIdType()); - builder.append("]"); - - builder.append(key.getValue()); - - builder.append(stringIterator.hasNext() ? "," : ""); - } - - return builder.toString(); - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util/AASUtils.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util/AASUtils.java index 33a737ad..dda89583 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util/AASUtils.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util/AASUtils.java @@ -31,6 +31,7 @@ import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.ArrayList; +import java.util.Iterator; import java.util.List; import java.util.Optional; import java.util.stream.Collectors; @@ -40,6 +41,15 @@ public class AASUtils { private AASUtils() { } + public static String asString(Reference reference) { + if (reference == null) { + return null; + } + return reference.getKeys().stream() + .map(x -> String.format("(%s)[%s]%s", x.getType(), x.getIdType(), x.getValue())) + .collect(Collectors.joining(",")); + } + public static Optional resolveSubmodelReference(Reference reference, AssetAdministrationShellEnvironment environment) { return environment.getSubmodels().stream() .filter(sm -> Objects.equal(sm.getIdentification().getIdentifier(), reference.getKeys().get(0).getValue())) diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util/TypeUtils.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util/TypeUtils.java deleted file mode 100644 index bf085b0c..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util/TypeUtils.java +++ /dev/null @@ -1,39 +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 io.adminshell.aas.v3.dataformat.aml.util; - -import com.google.common.reflect.TypeToken; -import java.util.Comparator; - -public class TypeUtils { - - private TypeUtils() { - } - - public static class TypeTokenComparator 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-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/fixtures/TestExample.java b/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/fixtures/TestExample.java index d4c0be72..b96d5805 100644 --- a/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/fixtures/TestExample.java +++ b/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/fixtures/TestExample.java @@ -21,7 +21,6 @@ import io.adminshell.aas.v3.model.impl.*; import java.util.Arrays; -import java.util.Base64; public class TestExample { @@ -87,28 +86,28 @@ private static final Reference asReference(Identifiable identifiable) { .build()) .build()) .build()) -// .submodelElement(new DefaultRelationshipElement.Builder() -// .idShort("ExampleRelationshipElement") -// .first(new DefaultReference.Builder() -// .key(new DefaultKey.Builder() -// .idType(KeyType.IRI) -// .type(KeyElements.SUBMODEL) -// .value("http://acplt.org/Submodels/Assets/TestAsset/Identification") -// .build()) -// .key(new DefaultKey.Builder() -// .type(KeyElements.SUBMODEL_ELEMENT) -// .idType(KeyType.ID_SHORT) -// .value("ExampleOperation") -// .build()) -// .build()) -// .second(new DefaultReference.Builder() -// .key(new DefaultKey.Builder() -// .idType(KeyType.IRI) -// .type(KeyElements.SUBMODEL) -// .value("http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial") -// .build()) -// .build()) -// .build()) + // .submodelElement(new DefaultRelationshipElement.Builder() + // .idShort("ExampleRelationshipElement") + // .first(new DefaultReference.Builder() + // .key(new DefaultKey.Builder() + // .idType(KeyType.IRI) + // .type(KeyElements.SUBMODEL) + // .value("http://acplt.org/Submodels/Assets/TestAsset/Identification") + // .build()) + // .key(new DefaultKey.Builder() + // .type(KeyElements.SUBMODEL_ELEMENT) + // .idType(KeyType.ID_SHORT) + // .value("ExampleOperation") + // .build()) + // .build()) + // .second(new DefaultReference.Builder() + // .key(new DefaultKey.Builder() + // .idType(KeyType.IRI) + // .type(KeyElements.SUBMODEL) + // .value("http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial") + // .build()) + // .build()) + // .build()) .submodelElement(new DefaultFile.Builder() .idShort("ExampleFile") .category("Parameter") @@ -552,10 +551,10 @@ private static final Reference asReference(Identifiable identifiable) { .build()) .submodel(asReference(SUBMODEL_1)) .submodel(asReference(SUBMODEL_2)) -// .view(new DefaultView.Builder() -// .idShort("ExampleView") -// .containedElement(asReference(SUBMODEL_1)) -// .build()) + // .view(new DefaultView.Builder() + // .idShort("ExampleView") + // .containedElement(asReference(SUBMODEL_1)) + // .build()) .build(); public static final AssetAdministrationShellEnvironment ENVIRONMENT = new DefaultAssetAdministrationShellEnvironment.Builder() diff --git a/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/serialize/AmlSerializerTest.java b/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/serialize/AmlSerializerTest.java index 56d4502b..44a9c188 100644 --- a/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/serialize/AmlSerializerTest.java +++ b/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/serialize/AmlSerializerTest.java @@ -19,7 +19,7 @@ import io.adminshell.aas.v3.dataformat.SerializationException; import io.adminshell.aas.v3.dataformat.aml.AmlSerializationConfig; import io.adminshell.aas.v3.dataformat.aml.AmlSerializer; -import io.adminshell.aas.v3.dataformat.aml.IntegerIdGenerator; +import io.adminshell.aas.v3.dataformat.aml.id.IntegerIdGenerator; import io.adminshell.aas.v3.dataformat.aml.fixtures.TestExample; import io.adminshell.aas.v3.model.AssetAdministrationShellEnvironment; import java.io.File; @@ -30,8 +30,10 @@ import org.junit.Test; import org.xml.sax.SAXException; import org.xmlunit.builder.DiffBuilder; +import org.xmlunit.diff.DefaultNodeMatcher; import org.xmlunit.diff.Diff; import org.xmlunit.diff.Difference; +import org.xmlunit.diff.ElementSelectors; public class AmlSerializerTest { @@ -60,8 +62,10 @@ private void validateAmlSerializer(File expectedFile, AssetAdministrationShellEn Diff diff = DiffBuilder .compare(actual) .withTest(expected) - .checkForSimilar().checkForIdentical() +// .checkForSimilar() +// .checkForIdentical() .normalizeWhitespace() + .withNodeMatcher(new DefaultNodeMatcher(ElementSelectors.byNameAndText)) .ignoreComments() .ignoreWhitespace() .withNodeFilter(node -> !node.getNodeName().equals("LastWritingDateTime")) diff --git a/dataformat-aml/src/test/resources/amlfile/example_test.aml b/dataformat-aml/src/test/resources/amlfile/example_test.aml index 9e849536..8788cb2b 100644 --- a/dataformat-aml/src/test/resources/amlfile/example_test.aml +++ b/dataformat-aml/src/test/resources/amlfile/example_test.aml @@ -5,24 +5,22 @@ foo bar - 02-08-2021 16:45:44 + 03-08-2021 15:40:37 - - - - An Example Asset Administration Shell for the test application + + + + 0 + - - Ein Beispiel-Verwaltungsschale für eine Test-Anwendung + + 0.9 + - - TestAssetAdministrationShell - - @@ -33,25 +31,24 @@ (ASSET)[IRI]https://acplt.org/Test_Asset - - - (ASSET_ADMINISTRATION_SHELL)[IRI]https://acplt.org/TestAssetAdministrationShell2 - - - - 0 - + + + + An Example Asset Administration Shell for the test application - - 0.9 - + + Ein Beispiel-Verwaltungsschale für eine Test-Anwendung + + TestAssetAdministrationShell + + @@ -64,6 +61,17 @@ + + + + 0 + + + + 0.9 + + + @@ -77,17 +85,6 @@ Identification - - - - 0 - - - - 0.9 - - - @@ -134,14 +131,6 @@ - - application/pdf - - - - /TestFile.pdf - - Parameter @@ -159,10 +148,18 @@ ExampleFile + + application/pdf + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Files/ExampleFile + + /TestFile.pdf + + application/pdf @@ -318,6 +315,41 @@ + + + + 0.9 + + + + + + + An example bill of material submodel for the test application + + + Ein Beispiel-BillofMaterial-Submodel für eine Test-Anwendung + + + + BillOfMaterial + + + + + + IRI + + + + http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial + + + + + TEMPLATE + + @@ -356,41 +388,6 @@ - - - - An example bill of material submodel for the test application - - - Ein Beispiel-BillofMaterial-Submodel für eine Test-Anwendung - - - - BillOfMaterial - - - - - - 0.9 - - - - - - - IRI - - - - http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial - - - - - TEMPLATE - - (SUBMODEL)[IRI]http://acplt.org/SubmodelTemplates/BillOfMaterial @@ -405,6 +402,10 @@ 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 + + CO_MANAGED_ENTITY + + ExampleEntity @@ -413,10 +414,6 @@ (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber - - CO_MANAGED_ENTITY - - Constant @@ -501,14 +498,6 @@ 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 - - ExampleEntity2 - - - - (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber - - SELF_MANAGED_ENTITY @@ -517,6 +506,14 @@ (ASSET)[IRI]https://acplt.org/Test_Asset2 + + ExampleEntity2 + + + + (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber + + @@ -526,6 +523,17 @@ + + + + 0 + + + + 0.9 + + + @@ -539,17 +547,6 @@ TestConceptDescription - - - - 0 - - - - 0.9 - - - @@ -561,6 +558,10 @@ + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/DataSpecifications/ConceptDescriptions/TestConceptDescription + + REAL_MEASURE @@ -1782,19 +1783,17 @@ - - - - An Example Asset Administration Shell for the test application + + + + 0 + - - Ein Beispiel-Verwaltungsschale für eine Test-Anwendung + + 0.9 + - - TestAssetAdministrationShell - - @@ -1805,25 +1804,24 @@ (ASSET)[IRI]https://acplt.org/Test_Asset - - - (ASSET_ADMINISTRATION_SHELL)[IRI]https://acplt.org/TestAssetAdministrationShell2 - - - - 0 - + + + + An Example Asset Administration Shell for the test application - - 0.9 - + + Ein Beispiel-Verwaltungsschale für eine Test-Anwendung + + TestAssetAdministrationShell + + @@ -1836,6 +1834,17 @@ + + + + 0 + + + + 0.9 + + + @@ -1849,17 +1858,6 @@ Identification - - - - 0 - - - - 0.9 - - - @@ -1906,14 +1904,6 @@ - - application/pdf - - - - /TestFile.pdf - - Parameter @@ -1931,10 +1921,18 @@ ExampleFile + + application/pdf + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Files/ExampleFile + + /TestFile.pdf + + application/pdf @@ -2090,6 +2088,41 @@ + + + + 0.9 + + + + + + + An example bill of material submodel for the test application + + + Ein Beispiel-BillofMaterial-Submodel für eine Test-Anwendung + + + + BillOfMaterial + + + + + + IRI + + + + http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial + + + + + TEMPLATE + + @@ -2128,41 +2161,6 @@ - - - - An example bill of material submodel for the test application - - - Ein Beispiel-BillofMaterial-Submodel für eine Test-Anwendung - - - - BillOfMaterial - - - - - - 0.9 - - - - - - - IRI - - - - http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial - - - - - TEMPLATE - - (SUBMODEL)[IRI]http://acplt.org/SubmodelTemplates/BillOfMaterial @@ -2177,6 +2175,10 @@ 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 + + CO_MANAGED_ENTITY + + ExampleEntity @@ -2185,10 +2187,6 @@ (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber - - CO_MANAGED_ENTITY - - Constant @@ -2273,14 +2271,6 @@ 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 - - ExampleEntity2 - - - - (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber - - SELF_MANAGED_ENTITY @@ -2289,6 +2279,14 @@ (ASSET)[IRI]https://acplt.org/Test_Asset2 + + ExampleEntity2 + + + + (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber + + @@ -2296,6 +2294,41 @@ + + + + 0.9 + + + + + + + An example bill of material submodel for the test application + + + Ein Beispiel-BillofMaterial-Submodel für eine Test-Anwendung + + + + BillOfMaterial + + + + + + IRI + + + + http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial + + + + + TEMPLATE + + @@ -2334,41 +2367,6 @@ - - - - An example bill of material submodel for the test application - - - Ein Beispiel-BillofMaterial-Submodel für eine Test-Anwendung - - - - BillOfMaterial - - - - - - 0.9 - - - - - - - IRI - - - - http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial - - - - - TEMPLATE - - (SUBMODEL)[IRI]http://acplt.org/SubmodelTemplates/BillOfMaterial @@ -2383,6 +2381,10 @@ 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 + + CO_MANAGED_ENTITY + + ExampleEntity @@ -2391,10 +2393,6 @@ (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber - - CO_MANAGED_ENTITY - - Constant @@ -2479,14 +2477,6 @@ 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 - - ExampleEntity2 - - - - (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber - - SELF_MANAGED_ENTITY @@ -2495,6 +2485,14 @@ (ASSET)[IRI]https://acplt.org/Test_Asset2 + + ExampleEntity2 + + + + (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber + + diff --git a/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/ReflectionHelper.java b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/ReflectionHelper.java index 7d5e173c..b920a783 100644 --- a/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/ReflectionHelper.java +++ b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/ReflectionHelper.java @@ -225,7 +225,7 @@ public static String getModelType(Class clazz) { * type information or null if there is none */ public static Class getMostSpecificTypeWithModelType(Class clazz) { - if(clazz == null) { + if (clazz == null) { return null; } return TYPES_WITH_MODEL_TYPE.stream() diff --git a/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/deserialization/EnumDeserializer.java b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/deserialization/EnumDeserializer.java index a1769054..104247d0 100644 --- a/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/deserialization/EnumDeserializer.java +++ b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/deserialization/EnumDeserializer.java @@ -44,6 +44,7 @@ public T deserialize(JsonParser parser, DeserializationContext context) throws I /** * Translates an enum value from CamelCase to SCREAMING_SNAKE_CASE + * * @param input input name in CamelCase * @return name in SCREAMING_SNAKE_CASE */ diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/CollectionMapper.java b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/ElementMapper.java similarity index 75% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/CollectionMapper.java rename to dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/ElementMapper.java index 10fe1719..46885767 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/CollectionMapper.java +++ b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/ElementMapper.java @@ -13,10 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.mapper; +package io.adminshell.aas.v3.dataformat.mapping; -import java.util.Collection; - -public interface CollectionMapper extends Mapper> { +public interface ElementMapper { + public void map(T value, G generator, C context) throws MappingException; } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/DefaultCollectionMapper.java b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/Mapper.java similarity index 71% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/DefaultCollectionMapper.java rename to dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/Mapper.java index b342911a..860b48ed 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/DefaultCollectionMapper.java +++ b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/Mapper.java @@ -13,8 +13,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.mapper; +package io.adminshell.aas.v3.dataformat.mapping; -public class DefaultCollectionMapper extends AbstractCollectionMapper { +public abstract class Mapper { + protected C config; + + public Mapper(C config) { + this.config = config; + } + + public abstract O map(I value) throws MappingException; } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/Mapper.java b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/MappingContext.java similarity index 60% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/Mapper.java rename to dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/MappingContext.java index e5983963..f9d56208 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/Mapper.java +++ b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/MappingContext.java @@ -13,12 +13,17 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.mapper; +package io.adminshell.aas.v3.dataformat.mapping; -import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; -import io.adminshell.aas.v3.dataformat.aml.MappingContext; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; -public interface Mapper { +public abstract class MappingContext { - public void map(T value, AmlGenerator generator, MappingContext context) throws MappingException; + protected static final Logger log = LoggerFactory.getLogger(MappingContext.class); + protected final MappingProvider mappingProvider; + + public MappingContext(MappingProvider mappingProvider) { + this.mappingProvider = mappingProvider; + } } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/MappingException.java b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/MappingException.java similarity index 91% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/MappingException.java rename to dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/MappingException.java index 226195c4..1b4c0f4a 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/mapper/MappingException.java +++ b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/MappingException.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.mapper; +package io.adminshell.aas.v3.dataformat.mapping; public class MappingException extends Exception { diff --git a/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/MappingProvider.java b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/MappingProvider.java new file mode 100644 index 00000000..1383b0d7 --- /dev/null +++ b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/MappingProvider.java @@ -0,0 +1,90 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.mapping; + +import com.google.common.reflect.TypeToken; +import io.adminshell.aas.v3.dataformat.mapping.util.TypeUtils; +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; + +public class MappingProvider { + + private static final Logger log = LoggerFactory.getLogger(MappingProvider.class); + + private final ElementMapper defaultMapper; + private final ElementMapper, G, C> defaultCollectionMapper; + private Map, List> mappings = new HashMap<>(); + + public MappingProvider(ElementMapper defaultMapper, + ElementMapper, G, C> defaultCollectionMapper) { + this.defaultMapper = defaultMapper; + this.defaultCollectionMapper = defaultCollectionMapper; + } + + public void register(ElementMapper 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 -> ElementMapper.class.equals(y.getRawType())) + .findFirst() + .get() + .resolveType(ElementMapper.class.getTypeParameters()[0]); + } + + public ElementMapper getMapper(Object obj) { + if (obj == null) { + return getMapper(Object.class); + } + if (Type.class.isAssignableFrom(obj.getClass())) { + return getMapper((Type) obj); + } + return getMapper(obj.getClass()); + } + + public ElementMapper getMapper(Type type) { + Optional> customMapper = mappings.entrySet().stream() + .filter(x -> x.getKey().isSupertypeOf(type)) + .sorted((x, y) -> Objects.compare(x.getKey(), y.getKey(), new TypeUtils.TypeTokenComparator())) + .map(x -> x.getValue()) + .findFirst(); + if (!customMapper.isPresent() || customMapper.get().isEmpty()) { + if (TypeToken.of(Collection.class).isSupertypeOf(type) && defaultCollectionMapper != null) { + return (ElementMapper) 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/io/adminshell/aas/v3/dataformat/mapping/util/TypeUtils.java b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/util/TypeUtils.java new file mode 100644 index 00000000..d6f352da --- /dev/null +++ b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/util/TypeUtils.java @@ -0,0 +1,71 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.mapping.util; + +import com.google.common.reflect.TypeToken; +import io.adminshell.aas.v3.dataformat.core.ReflectionHelper; +import java.beans.IntrospectionException; +import java.beans.Introspector; +import java.beans.PropertyDescriptor; +import java.util.Comparator; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import org.slf4j.LoggerFactory; + +public class TypeUtils { + + private static final org.slf4j.Logger log = LoggerFactory.getLogger(TypeUtils.class); + + private TypeUtils() { + } + + public static List getAASProperties(Class type) { + Class aasType = ReflectionHelper.getAasInterface(type); + Set> types = new HashSet<>(); + if (aasType != null) { + types.add(aasType); + types.addAll(ReflectionHelper.getSuperTypes(aasType, true)); + } + return types.stream() + .flatMap(x -> { + try { + return Stream.of(Introspector.getBeanInfo(x).getPropertyDescriptors()); + } catch (IntrospectionException ex) { + log.warn("error finding properties of class '{}'", type, ex); + } + return Stream.empty(); + }) + .sorted(Comparator.comparing(x -> x.getName())) + .collect(Collectors.toList()); + } + + public static class TypeTokenComparator implements Comparator { + + @Override + public int compare(TypeToken x, TypeToken y) { + if (x.isSubtypeOf(y)) { + if (y.isSubtypeOf(x)) { + return 0; + } + return -1; + } + return 1; + } + } +} From 645d08cf84a15959d756e39837d3557dd13c468e Mon Sep 17 00:00:00 2001 From: Jacoby Date: Mon, 9 Aug 2021 11:46:52 +0200 Subject: [PATCH 11/18] latest working version --- ...lizationConfig.java => Aas2AmlConfig.java} | 10 +- .../aas/v3/dataformat/aml/Aml2AasConfig.java | 5 + .../v3/dataformat/aml/AmlDeserializer.java | 6 +- .../aas/v3/dataformat/aml/AmlGenerator.java | 45 +- .../aas/v3/dataformat/aml/AmlSerializer.java | 4 +- .../aml/aas2aml/Aas2AmlMappingContext.java | 94 +- .../aml/aas2aml/AasToAmlMapper.java | 17 +- .../aas2aml/mapper/Aas2AmlElementMapper.java | 6 +- ...tAdministrationShellEnvironmentMapper.java | 5 +- .../DataSpecificationContentMapper.java | 9 +- .../DataSpecificationIEC61360Mapper.java | 9 +- .../mapper/DataSpecificationMapper.java | 2 +- .../mapper/DefaultCollectionMapper.java | 2 +- .../aml/aas2aml/mapper/DefaultMapper.java | 23 +- ...ddedDataSpecificationCollectionMapper.java | 2 +- .../aml/aas2aml/mapper/FileMapper.java | 2 +- .../aml/aas2aml/mapper/OperationMapper.java | 35 - .../OperationVariableCollectionMapper.java | 2 +- .../mapper/ReferenceElementMapper.java | 12 +- .../aml/aas2aml/mapper/ReferenceMapper.java | 6 +- .../mapper/RelationshipElementMapper.java | 8 +- .../aml/aas2aml/mapper/ViewMapper.java | 23 +- .../aml/aml2aas/AasTypeFactory.java | 29 + .../dataformat/aml/aml2aas/Aml2AasMapper.java | 21 + .../aml/aml2aas/Aml2AasMappingContext.java | 45 + .../aml/aml2aas/Aml2AasObjectMapper.java | 32 + .../v3/dataformat/aml/aml2aas/AmlParser.java | 27 + ...tAdministrationShellEnvironmentMapper.java | 41 + .../dataformat/aml/aml2aas/DefaultMapper.java | 174 + .../aas/v3/dataformat/aml/util/AASUtils.java | 117 +- .../aml/util/ReferencedByViewCollector.java | 59 + .../util/ReferencedReferableCollector.java | 6 +- .../dataformat/aml/fixtures/FullExample.java | 7 + .../dataformat/aml/fixtures/TestExample.java | 38 +- .../aml/serialize/AmlDeserializerTest.java | 36 + .../aml/serialize/AmlSerializerTest.java | 10 +- .../test/resources/amlfile/example_test.aml | 4982 ++++++++--------- .../aas/v3/dataformat/mapping/Mapper.java | 9 +- .../v3/dataformat/mapping/MappingContext.java | 10 +- .../dataformat/mapping/MappingProvider.java | 46 +- ...mentMapper.java => SourceBasedMapper.java} | 2 +- .../mapping/SourceBasedMappingContext.java | 12 +- .../dataformat/mapping/TargetBasedMapper.java | 21 + .../mapping/TargetBasedMappingContext.java | 24 + 44 files changed, 3387 insertions(+), 2688 deletions(-) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/{AmlSerializationConfig.java => Aas2AmlConfig.java} (83%) create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/Aml2AasConfig.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/OperationMapper.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/AasTypeFactory.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/Aml2AasMapper.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/Aml2AasMappingContext.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/Aml2AasObjectMapper.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/AmlParser.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/AssetAdministrationShellEnvironmentMapper.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/DefaultMapper.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util/ReferencedByViewCollector.java create mode 100644 dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/serialize/AmlDeserializerTest.java rename dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/{ElementMapper.java => SourceBasedMapper.java} (86%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlToAasMapper.java => dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/SourceBasedMappingContext.java (65%) create mode 100644 dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/TargetBasedMapper.java create mode 100644 dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/TargetBasedMappingContext.java diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlSerializationConfig.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/Aas2AmlConfig.java similarity index 83% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlSerializationConfig.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/Aas2AmlConfig.java index ccae7655..d00196b3 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlSerializationConfig.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/Aas2AmlConfig.java @@ -21,18 +21,18 @@ import java.util.Arrays; import java.util.List; -public class AmlSerializationConfig { +public class Aas2AmlConfig { private final boolean includeLibraries; private final IdGenerator idGenerator; private final List additionalInformation; - public static final AmlSerializationConfig DEFAULT = new Builder().build(); + public static final Aas2AmlConfig DEFAULT = new Builder().build(); public static Builder builder() { return new Builder(); } - private AmlSerializationConfig(boolean includeLibraries, IdGenerator idGenerator, List additionalInformation) { + private Aas2AmlConfig(boolean includeLibraries, IdGenerator idGenerator, List additionalInformation) { this.includeLibraries = includeLibraries; this.idGenerator = idGenerator; this.additionalInformation = additionalInformation; @@ -56,8 +56,8 @@ public static class Builder { private IdGenerator idGenerator = new UuidGenerator(); private List additionalInformation = new ArrayList<>(); - public AmlSerializationConfig build() { - return new AmlSerializationConfig(includeLibraries, idGenerator, additionalInformation); + public Aas2AmlConfig build() { + return new Aas2AmlConfig(includeLibraries, idGenerator, additionalInformation); } public Builder includeLibraries() { diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/Aml2AasConfig.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/Aml2AasConfig.java new file mode 100644 index 00000000..4c98888e --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/Aml2AasConfig.java @@ -0,0 +1,5 @@ +package io.adminshell.aas.v3.dataformat.aml; + +public class Aml2AasConfig { + +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlDeserializer.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlDeserializer.java index 87038fe8..c392a773 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlDeserializer.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlDeserializer.java @@ -17,7 +17,9 @@ import io.adminshell.aas.v3.dataformat.DeserializationException; import io.adminshell.aas.v3.dataformat.Deserializer; +import io.adminshell.aas.v3.dataformat.aml.aml2aas.Aml2AasObjectMapper; import io.adminshell.aas.v3.dataformat.aml.model.caex.CAEXFile; +import io.adminshell.aas.v3.dataformat.mapping.MappingException; import io.adminshell.aas.v3.model.AssetAdministrationShellEnvironment; import java.io.StringReader; import javax.xml.bind.JAXBException; @@ -29,7 +31,6 @@ public class AmlDeserializer implements Deserializer { private static final Logger log = LoggerFactory.getLogger(AmlDeserializer.class); - private AmlToAasMapper mapper = new AmlToAasMapper(); @Override public AssetAdministrationShellEnvironment read(String value) throws DeserializationException { @@ -37,9 +38,12 @@ public AssetAdministrationShellEnvironment read(String value) throws Deserializa Unmarshaller unmarshaller = JAXBContextFactory.createContext(new Class[]{CAEXFile.class}, null).createUnmarshaller(); StringReader reader = new StringReader(value); CAEXFile aml = (CAEXFile) unmarshaller.unmarshal(reader); + Aml2AasObjectMapper mapper = new Aml2AasObjectMapper(new Aml2AasConfig()); return mapper.map(aml); } catch (JAXBException ex) { throw new DeserializationException("error deserializing AssetAdministrationShellEnvironment", ex); + } catch (MappingException ex) { + throw new DeserializationException("error mapping AML document to AssetAdministrationShellEnvironment", ex); } } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlGenerator.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlGenerator.java index ee95bea7..d4ae2bc2 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlGenerator.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlGenerator.java @@ -22,9 +22,17 @@ import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; import io.adminshell.aas.v3.dataformat.aml.model.caex.RoleClassType; import io.adminshell.aas.v3.dataformat.aml.model.caex.SystemUnitClassType; +import io.adminshell.aas.v3.dataformat.aml.util.AASUtils; +import io.adminshell.aas.v3.model.Identifiable; +import io.adminshell.aas.v3.model.KeyType; import io.adminshell.aas.v3.model.Referable; +import io.adminshell.aas.v3.model.Reference; +import io.adminshell.aas.v3.model.impl.DefaultKey; +import io.adminshell.aas.v3.model.impl.DefaultReference; import java.beans.PropertyDescriptor; +import java.util.Arrays; import java.util.List; +import java.util.stream.Collectors; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -36,16 +44,32 @@ public class AmlGenerator { private CAEXObject.Builder current; private CAEXFile.Builder fileBuilder; private final AmlDocumentInfo documentInfo; - - private AmlGenerator(AmlDocumentInfo documentInfo, String refSemanticPrefix, CAEXFile.Builder fileBuilder, CAEXObject.Builder current) { + private final Reference reference; + + private AmlGenerator( + AmlDocumentInfo documentInfo, + String refSemanticPrefix, + CAEXFile.Builder fileBuilder, + CAEXObject.Builder current, + Reference reference) { this.documentInfo = documentInfo; this.refSemanticPrefix = refSemanticPrefix; this.fileBuilder = fileBuilder; this.current = current; + this.reference = reference; } public AmlGenerator with(CAEXObject.Builder current) { - return new AmlGenerator(documentInfo, refSemanticPrefix, fileBuilder, current); + return new AmlGenerator(documentInfo, refSemanticPrefix, fileBuilder, current, reference); + } + + public AmlGenerator with(Referable parent) { + return new AmlGenerator( + documentInfo, + refSemanticPrefix, + fileBuilder, + current, + AASUtils.asReference(reference, parent)); } public void addAdditionalInformation(List additionalInformation) { @@ -64,7 +88,7 @@ public static class Builder { private AmlDocumentInfo documentInfo = new AmlDocumentInfo(); public AmlGenerator build() { - return new AmlGenerator(documentInfo, refSemanticPrefix, fileBuilder, current); + return new AmlGenerator(documentInfo, refSemanticPrefix, fileBuilder, current, new DefaultReference.Builder().build()); } public Builder refSemanticPrefix(String value) { @@ -184,11 +208,12 @@ public RoleClassType.ExternalInterface getReferenceTargetInterface(Object obj, A RoleClassType.ExternalInterface result = null; if (obj != null && Referable.class.isAssignableFrom(obj.getClass())) { Referable referable = (Referable) obj; - if (context.isTargetOfInternalLink(referable)) { + Reference targetRef = AASUtils.asReference(reference, referable); + if (context.isTargetOfInternalLink(targetRef)) { result = RoleClassType.ExternalInterface.builder() - .withID(context.generateId()) - .withName("externalReferenceTarget") - .withRefBaseClassPath("AutomationMLInterfaceClassLib/AutomationMLBaseInterface") + .withID(context.newId()) + .withName("ReferableReference") + .withRefBaseClassPath(documentInfo.getAssetAdministrationShellInterfaceClassLib() + "/ReferableReference") .build(); } } @@ -222,4 +247,8 @@ public String refBaseSystemUnitPath(Object value, Aas2AmlMappingContext context) public AmlDocumentInfo getDocumentInfo() { return documentInfo; } + + public Reference getReference() { + return reference; + } } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlSerializer.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlSerializer.java index 1c8cb31e..44be3eed 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlSerializer.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlSerializer.java @@ -42,10 +42,10 @@ public AmlSerializer() { @Override public String write(AssetAdministrationShellEnvironment aasEnvironment) throws SerializationException { - return write(aasEnvironment, AmlSerializationConfig.DEFAULT); + return write(aasEnvironment, Aas2AmlConfig.DEFAULT); } - public String write(AssetAdministrationShellEnvironment aasEnvironment, AmlSerializationConfig config) throws SerializationException { + public String write(AssetAdministrationShellEnvironment aasEnvironment, Aas2AmlConfig config) throws SerializationException { AasToAmlMapper mapper = new AasToAmlMapper(config); try { CAEXFile aml = mapper.map(aasEnvironment); diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/Aas2AmlMappingContext.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/Aas2AmlMappingContext.java index a3a6a9e7..ea37e9fd 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/Aas2AmlMappingContext.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/Aas2AmlMappingContext.java @@ -18,10 +18,12 @@ import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; import io.adminshell.aas.v3.dataformat.aml.id.IdGenerator; import io.adminshell.aas.v3.dataformat.aml.naming.NamingStrategy; +import io.adminshell.aas.v3.dataformat.aml.util.AASUtils; +import io.adminshell.aas.v3.dataformat.aml.util.ReferencedByViewCollector; import io.adminshell.aas.v3.dataformat.aml.util.ReferencedReferableCollector; -import io.adminshell.aas.v3.dataformat.mapping.MappingContext; import io.adminshell.aas.v3.dataformat.mapping.MappingException; import io.adminshell.aas.v3.dataformat.mapping.MappingProvider; +import io.adminshell.aas.v3.dataformat.mapping.SourceBasedMappingContext; import io.adminshell.aas.v3.model.AssetAdministrationShellEnvironment; import io.adminshell.aas.v3.model.Referable; import java.beans.PropertyDescriptor; @@ -31,8 +33,11 @@ import java.util.stream.Collectors; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import io.adminshell.aas.v3.model.Reference; +import java.util.Optional; +import java.util.Set; -public class Aas2AmlMappingContext extends MappingContext { +public class Aas2AmlMappingContext extends SourceBasedMappingContext { private static final String EMPTY_STRING = ""; private static final Logger log = LoggerFactory.getLogger(Aas2AmlMappingContext.class); @@ -43,7 +48,7 @@ public class Aas2AmlMappingContext extends MappingContext { private final Map idCache; private final PropertyDescriptor property; - private final Map referecedReferableIDs; + private final Set referencedReferables; public Aas2AmlMappingContext(MappingProvider mappingProvider, IdGenerator idGenerator, @@ -55,7 +60,10 @@ public Aas2AmlMappingContext(MappingProvider mappingProvider, internalElementNamingStrategy, attributeNamingStrategy, environment, - null, null, null); + null, + null, + null); + } public NamingStrategy getInternalElementNamingStrategy() { @@ -71,7 +79,7 @@ private Aas2AmlMappingContext(MappingProvider mappingProvider, NamingStrategy internalElementNamingStrategy, NamingStrategy attributeNamingStrategy, AssetAdministrationShellEnvironment environment, - Map referecedReferableIDs, + Set referencedReferables, Map idCache, PropertyDescriptor property) { super(mappingProvider); @@ -80,11 +88,10 @@ private Aas2AmlMappingContext(MappingProvider mappingProvider, this.attributeNamingStrategy = attributeNamingStrategy; this.environment = environment; this.property = property; - if (referecedReferableIDs == null) { - this.referecedReferableIDs = new ReferencedReferableCollector(environment).collect().stream() - .collect(Collectors.toMap(x -> x, x -> EMPTY_STRING)); + if (referencedReferables == null) { + this.referencedReferables = new ReferencedReferableCollector(environment).collect(); } else { - this.referecedReferableIDs = referecedReferableIDs; + this.referencedReferables = referencedReferables; } if (idCache == null) { this.idCache = new HashMap<>(); @@ -92,29 +99,49 @@ private Aas2AmlMappingContext(MappingProvider mappingProvider, this.idCache = idCache; } } +// +// public String generateId() { +// return idGenerator.generateId(); +// } - public String getInternalLinkTargetId(Referable target) { - if (!isTargetOfInternalLink(target)) { - referecedReferableIDs.put(target, getCachedId(target)); - } - return referecedReferableIDs.get(target); - } - - public String generateId() { + public String newId() { return idGenerator.generateId(); } - public String getCachedId(Object obj) { - if (idCache.containsKey(obj)) { - return idCache.get(obj); + public String getId(Reference reference) { + if (reference == null) { + return idGenerator.generateId(); + } + Optional cacheKey = findMatchingKey(reference); + if (cacheKey.isPresent()) { + return idCache.get(cacheKey.get()); } String result = idGenerator.generateId(); - idCache.put(obj, result); + idCache.put(reference, result); return result; } - public boolean isTargetOfInternalLink(Referable target) { - return referecedReferableIDs.containsKey(target) && !referecedReferableIDs.get(target).equals(EMPTY_STRING); + private Optional findMatchingKey(Reference reference) { + return idCache.keySet().stream() + .filter(x -> Reference.class.isAssignableFrom(x.getClass())) + .map(x -> (Reference) x) + .filter(x -> AASUtils.equals(x, reference)) + .findFirst(); + } + +// public String getCachedId(Object obj) { +// if (elementsReferencedByViews.containsKey(obj)) { +// return elementsReferencedByViews.get(obj); +// } +// if (idCache.containsKey(obj)) { +// return idCache.get(obj); +// } +// String result = idGenerator.generateId(); +// idCache.put(obj, result); +// return result; +// } + public boolean isTargetOfInternalLink(Reference targetRef) { + return referencedReferables.stream().anyMatch(x -> AASUtils.equals(x, targetRef)); } public void map(T value, AmlGenerator generator) throws MappingException { @@ -127,36 +154,36 @@ public void map(Type type, T value, AmlGenerator generator) throws MappingEx public Aas2AmlMappingContext with(PropertyDescriptor property) { return new Aas2AmlMappingContext( - mappingProvider, + getMappingProvider(), idGenerator, internalElementNamingStrategy, attributeNamingStrategy, environment, - referecedReferableIDs, + referencedReferables, idCache, property); } public Aas2AmlMappingContext withoutProperty() { return new Aas2AmlMappingContext( - mappingProvider, + getMappingProvider(), idGenerator, internalElementNamingStrategy, attributeNamingStrategy, environment, - referecedReferableIDs, + referencedReferables, idCache, null); } public Aas2AmlMappingContext withoutIdCache() { return new Aas2AmlMappingContext( - mappingProvider, + getMappingProvider(), idGenerator, internalElementNamingStrategy, attributeNamingStrategy, environment, - referecedReferableIDs, + referencedReferables, null, property); } @@ -168,13 +195,4 @@ public PropertyDescriptor getProperty() { public AssetAdministrationShellEnvironment getEnvironment() { return environment; } - - public MappingProvider getMappingProvider() { - return mappingProvider; - } - - public Map getReferecedReferableIDs() { - return referecedReferableIDs; - } - } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/AasToAmlMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/AasToAmlMapper.java index fd69ed6e..61b90756 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/AasToAmlMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/AasToAmlMapper.java @@ -15,8 +15,8 @@ */ package io.adminshell.aas.v3.dataformat.aml.aas2aml; +import io.adminshell.aas.v3.dataformat.aml.Aas2AmlConfig; import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; -import io.adminshell.aas.v3.dataformat.aml.AmlSerializationConfig; import io.adminshell.aas.v3.dataformat.aml.naming.PropertyNamingStrategy; import io.adminshell.aas.v3.dataformat.aml.naming.AbstractClassNamingStrategy; import io.adminshell.aas.v3.dataformat.aml.naming.NumberingClassNamingStrategy; @@ -39,8 +39,8 @@ import io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper.ReferenceMapper; import io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper.RelationshipElementMapper; import io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper.SubmodelMapper; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper.ViewMapper; import io.adminshell.aas.v3.dataformat.aml.model.caex.CAEXFile; -import io.adminshell.aas.v3.dataformat.mapping.Mapper; import io.adminshell.aas.v3.dataformat.mapping.MappingException; import io.adminshell.aas.v3.dataformat.mapping.MappingProvider; import io.adminshell.aas.v3.model.AssetAdministrationShellEnvironment; @@ -49,21 +49,22 @@ import io.adminshell.aas.v3.model.Qualifier; import io.adminshell.aas.v3.model.Referable; import org.slf4j.LoggerFactory; +import io.adminshell.aas.v3.dataformat.mapping.SourceBasedMapper; -public class AasToAmlMapper extends Mapper { +public class AasToAmlMapper { public static final String DEFAULT_SCHEMA_VERSION = "2.15"; public static final String DEFAULT_AML_VERSION = "2.0"; public static final String DEFAULT_FILENAME = "AssetAdministrationShellEnvironment.aml"; private static final org.slf4j.Logger log = LoggerFactory.getLogger(AasToAmlMapper.class); private static final String DEFAULT_LANGUAGE = "EN"; + private final Aas2AmlConfig config; private CAEXFile result; - public AasToAmlMapper(AmlSerializationConfig config) { - super(config); + public AasToAmlMapper(Aas2AmlConfig config) { + this.config = config; } - @Override public CAEXFile map(AssetAdministrationShellEnvironment env) throws MappingException { return map(env, DEFAULT_SCHEMA_VERSION, DEFAULT_FILENAME); } @@ -75,7 +76,8 @@ public CAEXFile map(AssetAdministrationShellEnvironment env, String schemaVersio propertyNamingStrategy.registerCustomNaming(Referable.class, "descriptions", "description"); propertyNamingStrategy.registerCustomNaming(Qualifier.class, x -> "qualifier:" + x.getType() + "=" + x.getValue()); propertyNamingStrategy.registerCustomNaming(ConceptDescription.class, "isCaseOfs", "isCaseOf"); - MappingProvider mappingProvider = new MappingProvider( + MappingProvider mappingProvider = new MappingProvider<>( + SourceBasedMapper.class, new DefaultMapper(), new DefaultCollectionMapper()); @@ -94,6 +96,7 @@ public CAEXFile map(AssetAdministrationShellEnvironment env, String schemaVersio mappingProvider.register(new ReferenceElementMapper()); mappingProvider.register(new RelationshipElementMapper()); mappingProvider.register(new DataSpecificationIEC61360Mapper()); + mappingProvider.register(new ViewMapper()); // FIX // ReferenceElement and RelationshipElement reference other Referables. // Each such reference is represented as an InternalLink in AML. diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/Aas2AmlElementMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/Aas2AmlElementMapper.java index dc978fa7..199b2fa2 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/Aas2AmlElementMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/Aas2AmlElementMapper.java @@ -17,10 +17,8 @@ import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; import io.adminshell.aas.v3.dataformat.aml.aas2aml.Aas2AmlMappingContext; -import io.adminshell.aas.v3.dataformat.mapping.ElementMapper; -import io.adminshell.aas.v3.dataformat.mapping.MappingException; +import io.adminshell.aas.v3.dataformat.mapping.SourceBasedMapper; -public interface Aas2AmlElementMapper extends ElementMapper { +public interface Aas2AmlElementMapper extends SourceBasedMapper { - public void map(T value, AmlGenerator generator, Aas2AmlMappingContext context) throws MappingException; } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/AssetAdministrationShellEnvironmentMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/AssetAdministrationShellEnvironmentMapper.java index 30951602..83e2808b 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/AssetAdministrationShellEnvironmentMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/AssetAdministrationShellEnvironmentMapper.java @@ -74,18 +74,17 @@ protected void mapTemplates(AssetAdministrationShellEnvironment env, AmlGenerato .withName(generator.getDocumentInfo().getAssetAdministrationShellSystemUnitClassLib()); // generate SystemUnitClass for each AAS with at least 1 Submodel with kind == TEMPLATE // generate SystemUnitClass for each Submodel with king == TEMPLATE - Aas2AmlMappingContext subContext = context.withoutIdCache().withoutProperty(); for (AssetAdministrationShell aas : env.getAssetAdministrationShells()) { List submodelTemplates = AASUtils.getSubmodelTemplates(aas, env); if (!submodelTemplates.isEmpty()) { empty = false; InternalElementType.Builder temp = InternalElementType.builder(); - subContext.map(aas, generator.with(temp)); + context.withoutIdCache().withoutProperty().map(aas, generator.with(temp)); builder.addSystemUnitClass(internalElementToSystemUnitClass(temp.build().getInternalElement().get(0))); } for (Submodel submodel : submodelTemplates) { InternalElementType.Builder temp = InternalElementType.builder(); - subContext.map(submodel, generator.with(temp)); + context.withoutIdCache().withoutProperty().map(submodel, generator.with(temp)); builder.addSystemUnitClass(internalElementToSystemUnitClass(temp.build().getInternalElement().get(0))); } } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/DataSpecificationContentMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/DataSpecificationContentMapper.java index 84ee3c12..b5b29c8f 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/DataSpecificationContentMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/DataSpecificationContentMapper.java @@ -31,11 +31,10 @@ public void map(DataSpecificationContent content, AmlGenerator generator, Aas2Am toInternalElement(content, generator, context); } - @Override - protected String getId(DataSpecificationContent value, Aas2AmlMappingContext context) { - return context.generateId(); - } - +// @Override +// protected String getId(DataSpecificationContent value, AmlGenerator generator, Aas2AmlMappingContext context) { +// return context.generateId(); +// } @Override protected InternalElementType.RoleRequirements getRoleRequirementClass(DataSpecificationContent value, AmlGenerator generator, Aas2AmlMappingContext context) { return generator.roleRequirement(DataSpecificationContent.class.getSimpleName()); diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/DataSpecificationIEC61360Mapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/DataSpecificationIEC61360Mapper.java index cb3f0e13..b083b18f 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/DataSpecificationIEC61360Mapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/DataSpecificationIEC61360Mapper.java @@ -30,11 +30,10 @@ public void map(DataSpecificationIEC61360 content, AmlGenerator generator, Aas2A asInternalElement(content, generator, context); } - @Override - protected String getId(DataSpecificationIEC61360 value, Aas2AmlMappingContext context) { - return context.generateId(); - } - +// @Override +// protected String getId(DataSpecificationIEC61360 value, AmlGenerator generator, Aas2AmlMappingContext context) { +// return context.generateId(); +// } @Override protected InternalElementType.RoleRequirements getRoleRequirementClass(DataSpecificationIEC61360 value, AmlGenerator generator, Aas2AmlMappingContext context) { return generator.roleRequirement(DataSpecificationContent.class.getSimpleName()); diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/DataSpecificationMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/DataSpecificationMapper.java index 0583b969..1e051e7b 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/DataSpecificationMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/DataSpecificationMapper.java @@ -36,7 +36,7 @@ public void map(EmbeddedDataSpecification value, AmlGenerator generator, Aas2Aml + "/" + content.getClass().getSimpleName() + "Template/" + content.getClass().getSimpleName(); InternalElementType.Builder builder = InternalElementType.builder() - .withID(context.generateId()) + .withID(getId(value, generator, context)) .withRefBaseSystemUnitPath(refSystemUnitPath) .withName("EmbeddedDataSpecification"); // serialize properties, but with different attribute path ("IEC:DataSpecificationIEC63360/[propertyName]) diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/DefaultCollectionMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/DefaultCollectionMapper.java index 6b8c70b7..fe921c64 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/DefaultCollectionMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/DefaultCollectionMapper.java @@ -33,7 +33,7 @@ protected Class getType(Collection collection, Aas2AmlMappingContext conte if (collection != null && !collection.isEmpty()) { return (Class) ReflectionHelper.getAasInterface(collection.iterator().next().getClass()); } - return (Class) ((ParameterizedType) getClass().getGenericSuperclass()).getActualTypeArguments()[0]; + return null; } @Override diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/DefaultMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/DefaultMapper.java index 39f4fd81..9115896f 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/DefaultMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/DefaultMapper.java @@ -20,9 +20,11 @@ import io.adminshell.aas.v3.dataformat.aml.model.caex.AttributeType; import io.adminshell.aas.v3.dataformat.aml.model.caex.CAEXObject; import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; +import io.adminshell.aas.v3.dataformat.aml.util.AASUtils; import io.adminshell.aas.v3.dataformat.core.ReflectionHelper; import io.adminshell.aas.v3.dataformat.mapping.MappingException; import io.adminshell.aas.v3.dataformat.mapping.util.TypeUtils; +import io.adminshell.aas.v3.model.Referable; import java.beans.PropertyDescriptor; import java.lang.reflect.InvocationTargetException; @@ -38,6 +40,9 @@ public void map(T value, AmlGenerator generator, Aas2AmlMappingContext context) return; } Class aasType = getType(value, context); + if (aasType == null) { + return; + } Class aasTypeInfo = ReflectionHelper.getMostSpecificTypeWithModelType(aasType); if (aasTypeInfo != null) { asInternalElement(value, generator, context); @@ -64,10 +69,14 @@ protected void asAttribute(T value, AmlGenerator generator, Aas2AmlMappingContex protected InternalElementType.Builder toInternalElement(T value, AmlGenerator generator, Aas2AmlMappingContext context) throws MappingException { InternalElementType.Builder builder = InternalElementType.builder(); builder = builder - .withID(getId(value, context)) + .withID(getId(value, generator, context)) .withName(getInternalElementName(value, context)) .withRoleRequirements(getRoleRequirementClass(value, generator, context)); - mapProperties(value, generator.with(builder), context); + AmlGenerator subGenerator = generator; + if (Referable.class.isAssignableFrom(value.getClass())) { + subGenerator = generator.with((Referable) value); + } + mapProperties(value, subGenerator.with(builder), context); return builder; } @@ -79,15 +88,18 @@ protected AttributeType.RefSemantic getRefSemantic(T value, AmlGenerator generat return generator.refSemantic(context.getProperty()); } - protected String getInternalElementName(T value, Aas2AmlMappingContext context) { + protected String getInternalElementName(Object value, Aas2AmlMappingContext context) { return context.getInternalElementNamingStrategy().getName( value.getClass(), value, null); } - protected String getId(T value, Aas2AmlMappingContext context) { - return context.getCachedId(value); + protected String getId(T value, AmlGenerator generator, Aas2AmlMappingContext context) { + if (value != null && Referable.class.isAssignableFrom(value.getClass())) { + return context.getId(AASUtils.asReference(generator.getReference(), (Referable) value)); + } + return context.getId(null); } protected String getAttributeName(T value, Aas2AmlMappingContext context) { @@ -108,6 +120,7 @@ protected AttributeType.Builder toAttribute(T value, AmlGenerator generator, Aas if (aasType != null) { mapProperties(value, generator.with(builder), context); } else { + builder = builder.withValue(value); } return builder; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/EmbeddedDataSpecificationCollectionMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/EmbeddedDataSpecificationCollectionMapper.java index 84eccd6d..4c12bf24 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/EmbeddedDataSpecificationCollectionMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/EmbeddedDataSpecificationCollectionMapper.java @@ -55,7 +55,7 @@ public void map(Collection value, AmlGenerator genera context.map(element.getDataSpecificationContent(), subGenerator); InternalElementType.Builder builder = InternalElementType.copyOf(temp.build().getInternalElement().get(0)) .withName("EmbeddedDataSpecification" + (countInternalElement > 1 ? "_" + (internalElements.size() + 1) : "")) - .withID(context.generateId()) + .withID(getId(value, generator, context)) .withRefBaseSystemUnitPath(generator.getDocumentInfo().getDataSpecificationTemplatesSystemUnitClassLib() + "/" + getDataSpecificationContentType(element.getDataSpecificationContent().getClass()) + "Template/" + getDataSpecificationContentType(element.getDataSpecificationContent().getClass())); diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/FileMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/FileMapper.java index 057bf348..bf9de357 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/FileMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/FileMapper.java @@ -40,7 +40,7 @@ protected InternalElementType.Builder toInternalElement(File value, AmlGenerator if (builder != null) { builder.withExternalInterface(RoleClassType.ExternalInterface.builder() .withName(FILE_INTERFACE_NAME) - .withID(context.generateId()) + .withID(getId(value, generator, context)) .withRefBaseClassPath(generator.getDocumentInfo().getAssetAdministrationShellInterfaceClassLib() + "/" + FILE_INTERFACE_NAME) .addAttribute(AttributeType.builder() .withName(ATTRIBUTE_MIMETYPE_NAME) diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/OperationMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/OperationMapper.java deleted file mode 100644 index aa5cdc87..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/OperationMapper.java +++ /dev/null @@ -1,35 +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 io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper; - -import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.Aas2AmlMappingContext; -import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; -import io.adminshell.aas.v3.model.Operation; - -public class OperationMapper implements Aas2AmlElementMapper { - - public OperationMapper() { - } - - @Override - public void map(Operation operation, AmlGenerator generator, Aas2AmlMappingContext context) { - InternalElementType.Builder builder = InternalElementType.builder() - .withName(context.getInternalElementNamingStrategy().getName(Operation.class, operation, null)); - generator.with(builder).appendReferenceTargetInterfaceIfRequired(operation, context); - generator.addInternalElement(builder.build()); - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/OperationVariableCollectionMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/OperationVariableCollectionMapper.java index 8c2a8d09..e360ab98 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/OperationVariableCollectionMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/OperationVariableCollectionMapper.java @@ -36,7 +36,7 @@ public void map(Collection value, AmlGenerator generator, Aas name = name.substring(0, 1).toUpperCase() + name.substring(1); InternalElementType.Builder builder = InternalElementType.builder() .withName(name) - .withID(context.generateId()) + .withID(getId(value, generator, context)) .withRoleRequirements(generator.roleRequirement("Operation" + name)); for (OperationVariable element : value) { context diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/ReferenceElementMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/ReferenceElementMapper.java index 9cda071d..04c37deb 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/ReferenceElementMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/ReferenceElementMapper.java @@ -40,7 +40,7 @@ public void map(ReferenceElement element, AmlGenerator generator, Aas2AmlMapping } // regular mapping InternalElementType.Builder builder = InternalElementType.builder() - .withID(context.getCachedId(element)) + .withID(getId(element, generator, context)) .withName(context.getInternalElementNamingStrategy().getName( element.getClass(), element, @@ -49,7 +49,7 @@ public void map(ReferenceElement element, AmlGenerator generator, Aas2AmlMapping mapProperties(element, generator.with(builder), context); // add interface RoleClassType.ExternalInterface.Builder interfaceBuilder = RoleClassType.ExternalInterface.builder() - .withID(context.generateId()) + .withID(context.getId(null)) .withName("ReferableReference") .withRefBaseClassPath("AssetAdministrationShellInterfaceClassLib/ReferableReference"); Referable resolvedReference = AASUtils.resolve(element.getValue(), context.getEnvironment()); @@ -60,15 +60,15 @@ public void map(ReferenceElement element, AmlGenerator generator, Aas2AmlMapping // !!! contradicts CAEX meta model as depicted on slide 13 https://www.plt.rwth-aachen.de/global/show_document.asp?id=aaaaaaaaaatmalk builder = builder.withInternalLink(InternalLink.builder() .withName("value") - .withID(context.generateId()) - .withRefPartnerSideA(context.getCachedId(element) + ":ReferableReference") - .withRefPartnerSideB(context.getInternalLinkTargetId(resolvedReference) + ":externalReferenceTarget") + .withID(getId(element, generator, context)) + .withRefPartnerSideA(getId(element, generator, context) + ":ReferableReference") + .withRefPartnerSideB(context.getId(element.getValue()) + ":ReferableReference") .build()); } else { interfaceBuilder = interfaceBuilder .addAttribute(AttributeType.builder() .withName("value") - .withID(context.generateId()) + .withID(getId(element, generator, context)) .withAttributeDataType("xs:string") .withValue(AASUtils.asString(element.getValue())) .build()); diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/ReferenceMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/ReferenceMapper.java index d8be2ee8..780154cd 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/ReferenceMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/ReferenceMapper.java @@ -35,7 +35,11 @@ public void map(Reference reference, AmlGenerator generator, Aas2AmlMappingConte if (referencedType == KeyElements.SUBMODEL) { Optional resolvedSubmodel = AASUtils.resolveSubmodelReference(reference, context.getEnvironment()); if (resolvedSubmodel.isPresent()) { - context.withoutIdCache().map(resolvedSubmodel.get(), generator); + context + // not having this causes duplicate IDs + // maybe this can be "fixed" by not shortening References + // .withoutIdCache() + .map(resolvedSubmodel.get(), generator); return; } } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/RelationshipElementMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/RelationshipElementMapper.java index a32069f8..c85610d0 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/RelationshipElementMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/RelationshipElementMapper.java @@ -41,7 +41,7 @@ public void map(RelationshipElement element, AmlGenerator generator, Aas2AmlMapp } // regular mapping InternalElementType.Builder builder = InternalElementType.builder() - .withID(context.getCachedId(element)) + .withID(getId(element, generator, context)) .withName(context.getInternalElementNamingStrategy().getName( element.getClass(), element, @@ -68,9 +68,9 @@ private void mapProperty(RelationshipElement element, Reference reference, Strin // !!! contradicts CAEX meta model as depicted on slide 13 https://www.plt.rwth-aachen.de/global/show_document.asp?id=aaaaaaaaaatmalk generator.addInternalLink(InternalLink.builder() .withName(name) - .withID(context.generateId()) - .withRefPartnerSideA(context.getCachedId(element) + ":name") - .withRefPartnerSideB(context.getInternalLinkTargetId(resolvedReference) + ":externalReferenceTarget") + .withID(context.newId()) + .withRefPartnerSideA(getId(element, generator, context) + ":name") + .withRefPartnerSideB(context.getId(reference) + ":ReferableReference") .build()); } else { builder = builder.addAttribute(AttributeType.builder() diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/ViewMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/ViewMapper.java index 5b8f30d6..474b8f23 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/ViewMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/ViewMapper.java @@ -18,9 +18,13 @@ import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; import io.adminshell.aas.v3.dataformat.aml.aas2aml.Aas2AmlMappingContext; import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; +import io.adminshell.aas.v3.dataformat.aml.util.AASUtils; import io.adminshell.aas.v3.dataformat.core.ReflectionHelper; import io.adminshell.aas.v3.dataformat.mapping.MappingException; +import io.adminshell.aas.v3.model.Referable; +import io.adminshell.aas.v3.model.Reference; import io.adminshell.aas.v3.model.View; +import java.beans.PropertyDescriptor; public class ViewMapper extends DefaultMapper { @@ -30,7 +34,7 @@ public void map(View view, AmlGenerator generator, Aas2AmlMappingContext context return; } InternalElementType.Builder builder = InternalElementType.builder(); - builder = builder.withID(context.getCachedId(view)) + builder = builder.withID(getId(view, generator, context)) .withName(context.getInternalElementNamingStrategy().getName( view.getClass(), view, @@ -41,6 +45,23 @@ public void map(View view, AmlGenerator generator, Aas2AmlMappingContext context // context.getEnvironment()))) .withRoleRequirements(generator.roleRequirement(ReflectionHelper.getModelType(view.getClass()))); generator.with(builder).appendReferenceTargetInterfaceIfRequired(view, context); + for (Reference reference : view.getContainedElements()) { + Referable referable = AASUtils.resolve(reference, context.getEnvironment()); + builder.addInternalElement(InternalElementType.builder() + .withName(getInternalElementName(referable, context)) + .withID(context.newId()) + .withRefBaseSystemUnitPath(context.getId(reference)) + .build()); + + } + generator.addInternalElement(builder.build()); } + + @Override + protected boolean skipProperty(PropertyDescriptor property) { + return property != null && property.getName().equals("containedElements"); + } + + // } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/AasTypeFactory.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/AasTypeFactory.java new file mode 100644 index 00000000..e86cf6e7 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/AasTypeFactory.java @@ -0,0 +1,29 @@ +package io.adminshell.aas.v3.dataformat.aml.aml2aas; + +import io.adminshell.aas.v3.dataformat.core.ReflectionHelper; +import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationTargetException; +import java.util.Map; + +public class AasTypeFactory { + + private Map, Class> typeMapping; + + public AasTypeFactory() { + ReflectionHelper.DEFAULT_IMPLEMENTATIONS.forEach(x -> typeMapping.put(x.getInterfaceType(), x.getImplementationType())); + } + + public void useImplementation(Class aasInterface, Class implementation) { + typeMapping.put(aasInterface, implementation); + } + + public T newInstance(Class aasInterface) throws NoSuchMethodException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + Class classToInstantiate = aasInterface; + if (typeMapping.containsKey(aasInterface)) { + classToInstantiate = typeMapping.get(aasInterface); + } + Constructor constructor = classToInstantiate.getConstructor(); + constructor.setAccessible(true); + return (T) constructor.newInstance(); + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/Aml2AasMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/Aml2AasMapper.java new file mode 100644 index 00000000..6ec67f55 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/Aml2AasMapper.java @@ -0,0 +1,21 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.aml2aas; + +import io.adminshell.aas.v3.dataformat.mapping.TargetBasedMapper; + +public interface Aml2AasMapper extends TargetBasedMapper { +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/Aml2AasMappingContext.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/Aml2AasMappingContext.java new file mode 100644 index 00000000..53d917bc --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/Aml2AasMappingContext.java @@ -0,0 +1,45 @@ +package io.adminshell.aas.v3.dataformat.aml.aml2aas; + +import io.adminshell.aas.v3.dataformat.aml.AmlDocumentInfo; +import io.adminshell.aas.v3.dataformat.mapping.MappingProvider; +import io.adminshell.aas.v3.dataformat.mapping.TargetBasedMappingContext; + +public class Aml2AasMappingContext extends TargetBasedMappingContext { + + private AmlDocumentInfo documentInfo; + private AasTypeFactory typeFactory; + private Class type; + + public Aml2AasMappingContext(MappingProvider mappingProvider, AasTypeFactory typeFactory) { + super(mappingProvider); + this.typeFactory = typeFactory; + this.type = null; + } + + private Aml2AasMappingContext(MappingProvider mappingProvider, AasTypeFactory typeFactory, Class type) { + super(mappingProvider); + this.typeFactory = typeFactory; + this.type = type; + } + + public Aml2AasMappingContext with(Class type) { + return new Aml2AasMappingContext(mappingProvider, typeFactory, type); + } + + public AmlDocumentInfo getDocumentInfo() { + return documentInfo; + } + + public void setDocumentInfo(AmlDocumentInfo documentInfo) { + this.documentInfo = documentInfo; + } + + public Class getType() { + return type; + } + + public AasTypeFactory getTypeFactory() { + return typeFactory; + } + +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/Aml2AasObjectMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/Aml2AasObjectMapper.java new file mode 100644 index 00000000..6fb9117b --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/Aml2AasObjectMapper.java @@ -0,0 +1,32 @@ +package io.adminshell.aas.v3.dataformat.aml.aml2aas; + +import io.adminshell.aas.v3.dataformat.aml.Aml2AasConfig; +import io.adminshell.aas.v3.dataformat.aml.model.caex.CAEXFile; +import io.adminshell.aas.v3.dataformat.core.ReflectionHelper; +import io.adminshell.aas.v3.dataformat.mapping.MappingException; +import io.adminshell.aas.v3.dataformat.mapping.MappingProvider; +import io.adminshell.aas.v3.model.AssetAdministrationShellEnvironment; +import java.util.List; + +public class Aml2AasObjectMapper { + + private Aml2AasConfig config; + + public Aml2AasObjectMapper(Aml2AasConfig config) { + this.config = config; + } + + public AssetAdministrationShellEnvironment map(CAEXFile aml) throws MappingException { + // unclear how to handle additional information + List additionalInformation = aml.getAdditionalInformation(); + // find AAS elements throughout all instance hierarchies + AmlParser parser = new AmlParser(aml); + MappingProvider mappingProvider = new MappingProvider(Aml2AasMapper.class, new DefaultMapper(), new DefaultMapper()); + mappingProvider.register(new AssetAdministrationShellEnvironmentMapper()); + AasTypeFactory typeFactory = new AasTypeFactory(); + Aml2AasMappingContext context = new Aml2AasMappingContext(mappingProvider, typeFactory); + Object result = context.getMappingProvider().getMapper(AssetAdministrationShellEnvironment.class).map(parser, context); + String foo = ""; + return (AssetAdministrationShellEnvironment) result; + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/AmlParser.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/AmlParser.java new file mode 100644 index 00000000..872e1852 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/AmlParser.java @@ -0,0 +1,27 @@ +package io.adminshell.aas.v3.dataformat.aml.aml2aas; + +import io.adminshell.aas.v3.dataformat.aml.model.caex.CAEXFile; +import io.adminshell.aas.v3.dataformat.aml.model.caex.CAEXObject; + +public class AmlParser { + + private final CAEXFile content; + private CAEXObject current; + + public AmlParser(CAEXFile content) { + this.content = content; + } + + public CAEXFile getContent() { + return content; + } + + public CAEXObject getCurrent() { + return current; + } + + public void setCurrent(CAEXObject current) { + this.current = current; + } + +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/AssetAdministrationShellEnvironmentMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/AssetAdministrationShellEnvironmentMapper.java new file mode 100644 index 00000000..8150ae20 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/AssetAdministrationShellEnvironmentMapper.java @@ -0,0 +1,41 @@ +package io.adminshell.aas.v3.dataformat.aml.aml2aas; + +import io.adminshell.aas.v3.dataformat.aml.AmlDocumentInfo; +import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; +import io.adminshell.aas.v3.dataformat.mapping.MappingException; +import io.adminshell.aas.v3.model.AssetAdministrationShell; +import io.adminshell.aas.v3.model.AssetAdministrationShellEnvironment; +import io.adminshell.aas.v3.model.impl.DefaultAssetAdministrationShellEnvironment; +import java.util.List; +import java.util.function.Predicate; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.stream.Collectors; + +public class AssetAdministrationShellEnvironmentMapper implements Aml2AasMapper { + + @Override + public AssetAdministrationShellEnvironment map(AmlParser parser, Aml2AasMappingContext context) throws MappingException { + AssetAdministrationShellEnvironment result = new DefaultAssetAdministrationShellEnvironment.Builder().build(); + List shells = parser.getContent().getInstanceHierarchy().stream() + .flatMap(x -> x.getInternalElement().stream().filter(filterByRole(AssetAdministrationShell.class))) + .collect(Collectors.toList()); + shells.forEach(x -> { + parser.setCurrent(x); + try { + AssetAdministrationShell aas = (AssetAdministrationShell) context.getMappingProvider().getMapper(AssetAdministrationShell.class).map(parser, context); + result.getAssetAdministrationShells().add(aas); + } catch (MappingException ex) { + Logger.getLogger(AssetAdministrationShellEnvironmentMapper.class.getName()).log(Level.SEVERE, null, ex); + } + }); + return result; + } + + private Predicate filterByRole(Class type) { + return x -> x.getRoleRequirements() != null + && x.getRoleRequirements().getRefBaseRoleClassPath().equals( + AmlDocumentInfo.DEFAULT_ASSET_ADMINISTRATION_SHELL_ROLE_CLASS_LIB + "/" + type.getSimpleName()); + } + +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/DefaultMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/DefaultMapper.java new file mode 100644 index 00000000..6b2d752e --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/DefaultMapper.java @@ -0,0 +1,174 @@ +package io.adminshell.aas.v3.dataformat.aml.aml2aas; + +import com.google.common.reflect.TypeToken; +import io.adminshell.aas.v3.dataformat.aml.model.caex.AttributeType; +import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; +import io.adminshell.aas.v3.dataformat.core.ReflectionHelper; +import io.adminshell.aas.v3.dataformat.mapping.MappingException; +import io.adminshell.aas.v3.dataformat.mapping.util.TypeUtils; +import java.beans.PropertyDescriptor; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.stream.Collectors; + +public class DefaultMapper implements Aml2AasMapper { + + @Override + public Object map(AmlParser parser, Aml2AasMappingContext context) throws MappingException { + if (parser.getCurrent() == null) { + return null; + } + if (InternalElementType.class.isAssignableFrom(parser.getCurrent().getClass())) { + handleInternalElement(parser, context); + } else if (AttributeType.class.isAssignableFrom(parser.getCurrent().getClass())) { + handleAttribute(parser, context); + } + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } + + protected Object handleInternalElement(AmlParser parser, Aml2AasMappingContext context) { + Object result = null; + InternalElementType current = (InternalElementType) parser.getCurrent(); + String role = current.getRoleRequirements().getRefBaseRoleClassPath(); + if (role.startsWith(context.getDocumentInfo().getAssetAdministrationShellRoleClassLib())) { + String aasClassName = role.substring(context.getDocumentInfo().getAssetAdministrationShellRoleClassLib().length()); + Optional implementationInfo = ReflectionHelper.DEFAULT_IMPLEMENTATIONS.stream() + .filter(x -> x.getInterfaceType().getSimpleName().equals(aasClassName)) + .findFirst(); + final Class aasClass; + // check if custom implementation should be used + if (implementationInfo.isPresent()) { + aasClass = implementationInfo.get().getImplementationType(); + } else { + aasClass = null; + } + if (aasClass != null) { + try { + result = context.getTypeFactory().newInstance(aasClass); + List properties = TypeUtils.getAASProperties(aasClass); + List propertiesGivenAsAttribute = new ArrayList<>(); + for (AttributeType attribute : current.getAttribute()) { + Optional property = properties.stream() + .filter(x -> x.getName().equals(attribute.getName())) + .findFirst(); + if (property.isPresent()) { + parser.setCurrent(attribute); + Object attributeValue = context.getMappingProvider() + .getMapper(property.get().getReadMethod().getReturnType()) + .map(parser, context.with(property.get().getReadMethod().getReturnType())); + property.get().getWriteMethod().invoke(result, attributeValue); + propertiesGivenAsAttribute.add(property.get()); + } + } + + Map singleValueProperties = properties.stream() + .filter(x -> !Collection.class.isAssignableFrom(x.getReadMethod().getReturnType())) + .map(x -> new Object() { + PropertyDescriptor type = x; + String aasType = ReflectionHelper.getModelType(x.getReadMethod().getReturnType()); + }) + .filter(x -> x.aasType != null) + .collect(Collectors.toMap( + x -> x.type, + x -> x.aasType)); + + Map collectionValueProperties = properties.stream() + .filter(x -> Collection.class.isAssignableFrom(x.getReadMethod().getReturnType())) + .map(x -> new Object() { + PropertyDescriptor type = x; + String aasType = ReflectionHelper.getModelType(TypeToken.of(x.getReadMethod().getGenericReturnType()).resolveType(Collection.class).getRawType()); + }) + .filter(x -> x.aasType != null) + .collect(Collectors.toMap( + x -> x.type, + x -> x.aasType)); + + List propertyTypes = new ArrayList<>(); + propertyTypes.addAll(singleValueProperties.values()); + propertyTypes.addAll(collectionValueProperties.values()); + List duplicateTypes = propertyTypes.stream() + .filter(e -> Collections.frequency(propertyTypes, e) > 1) + .distinct() + .collect(Collectors.toList()); + if (!duplicateTypes.isEmpty()) { + throw new MappingException(duplicateTypes.stream().map(x + -> String.format("found multiple properties of type '%s' on type '%s'", x, aasClass)) + .collect(Collectors.joining(System.lineSeparator())) + ); + } + // single values + // find matching internal element, deserialize, assign + for (Map.Entry property : singleValueProperties.entrySet()) { + String propertyRole = context.getDocumentInfo().getAssetAdministrationShellRoleClassLib() + "/" + property.getValue(); + List valueElements = current.getInternalElement().stream() + .filter(y -> y.getRoleRequirements().getRefBaseRoleClassPath().equals(propertyRole)) + .collect(Collectors.toList()); + if (!valueElements.isEmpty()) { + if (valueElements.size() > 1) { + throw new MappingException(String.format( + "found multiple InternalElement with role '%s' but only 1 allowed (ids: %s)", + propertyRole, + valueElements.stream() + .map(x -> x.getID()) + .collect(Collectors.joining(", ")))); + } + parser.setCurrent(valueElements.get(0)); + Object propertyValue = context.getMappingProvider() + .getMapper(property.getKey().getReadMethod().getReturnType()) + .map(parser, context); + property.getKey().getWriteMethod().invoke(result, propertyValue); + } + } + + // collection values + // 1. find all internal elements + // 2. deserialize + // 3. build collection (based on actual type, might be collection, list, set,...) + // 4. add to collection + // 5. assign to property + for (Map.Entry property : collectionValueProperties.entrySet()) { + String propertyRole = context.getDocumentInfo().getAssetAdministrationShellRoleClassLib() + "/" + property.getValue(); + List valueElements = current.getInternalElement().stream() + .filter(y -> y.getRoleRequirements().getRefBaseRoleClassPath().equals(propertyRole)) + .collect(Collectors.toList()); + if (!valueElements.isEmpty()) { + Collection propertyValue = (Collection) property.getKey().getReadMethod().getReturnType().getConstructor().newInstance(); + for (InternalElementType element : valueElements) { + parser.setCurrent(element); + Object elementValue = context.getMappingProvider() + .getMapper(property.getKey().getReadMethod().getReturnType()) + .map(parser, context); + propertyValue.add(elementValue); + } + property.getKey().getWriteMethod().invoke(result, propertyValue); + } + } + } catch (Exception ex) { + Logger.getLogger(DefaultMapper.class.getName()).log(Level.SEVERE, null, ex); + } + } + } + return result; + } + + protected Object handleAttribute(AmlParser parser, Aml2AasMappingContext context) throws MappingException { + AttributeType current = (AttributeType) parser.getCurrent(); + if (context.getType() == null) { + throw new MappingException(String.format("error processing Attribute '%s', missing type information in context", current.getName())); + } + Object result = null; +// result = context.getTypeFactory().newInstance(context.getType()); + // distinguish between AASType and other + // AASType needs reflection + return result; + } + +// private void T instanceFromRoleRequirements(Inter) +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util/AASUtils.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util/AASUtils.java index dda89583..5252bb48 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util/AASUtils.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util/AASUtils.java @@ -17,6 +17,7 @@ import com.google.common.base.Objects; import io.adminshell.aas.v3.dataformat.core.ReflectionHelper; +import io.adminshell.aas.v3.dataformat.core.deserialization.EnumDeserializer; import io.adminshell.aas.v3.dataformat.core.serialization.EnumSerializer; import io.adminshell.aas.v3.model.AssetAdministrationShell; import io.adminshell.aas.v3.model.AssetAdministrationShellEnvironment; @@ -28,6 +29,8 @@ import io.adminshell.aas.v3.model.Referable; import io.adminshell.aas.v3.model.Reference; import io.adminshell.aas.v3.model.Submodel; +import io.adminshell.aas.v3.model.impl.DefaultKey; +import io.adminshell.aas.v3.model.impl.DefaultReference; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.ArrayList; @@ -35,6 +38,7 @@ import java.util.List; import java.util.Optional; import java.util.stream.Collectors; +import java.util.stream.Stream; public class AASUtils { @@ -74,8 +78,119 @@ public static boolean hasTemplate(AssetAdministrationShell aas, AssetAdministrat return !getSubmodelTemplates(aas, environment).isEmpty(); } - public static Referable resolve(Reference reference, AssetAdministrationShellEnvironment env) { + public static Reference identifiableToReference(Identifiable identifiable) { + return new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(referableToKeyType(identifiable)) + .idType(KeyType.valueOf(identifiable.getIdentification().getIdType().toString())) + .value(identifiable.getIdentification().getIdentifier()) + .build()) + .build(); + } + + public static KeyElements referableToKeyType(Referable referable) { + Class aasInterface = ReflectionHelper.getAasInterface(referable.getClass()); + if (aasInterface != null) { + return KeyElements.valueOf(EnumDeserializer.translate(aasInterface.getSimpleName())); + } + return null; + } + + public static Optional keyTypeToClass(KeyElements key) { + return Stream.concat(ReflectionHelper.INTERFACES.stream(), ReflectionHelper.INTERFACES_WITHOUT_DEFAULT_IMPLEMENTATION.stream()) + .filter(x -> x.getSimpleName().equals(EnumSerializer.translate(key.name()))) + .findAny(); + } + + public static Reference asReference(Reference parent, Referable element) { +// if (element == null) { +// return null; +// } +// Reference result = AASUtils.cloneReference(parent); +// if (result == null && Identifiable.class.isAssignableFrom(element.getClass())) { +// return AASUtils.identifiableToReference((Identifiable) element); +// } +// if (result != null) { +// result.getKeys().add(new DefaultKey.Builder() +// .type(AASUtils.referableToKeyType(element)) +// .idType(KeyType.ID_SHORT) +// .value(element.getIdShort()) +// .build()); +// } +// return result; + + if (element == null) { + return null; + } else if (Identifiable.class.isAssignableFrom(element.getClass())) { + return AASUtils.identifiableToReference((Identifiable) element); + } else { + Reference result = AASUtils.cloneReference(parent); + if (result != null) { + result.getKeys().add(new DefaultKey.Builder() + .type(AASUtils.referableToKeyType(element)) + .idType(KeyType.ID_SHORT) + .value(element.getIdShort()) + .build()); + } + return result; + } + } + + public static boolean equals(Reference ref1, Reference ref2) { + boolean ref1Empty = ref1 == null || ref1.getKeys() == null || ref1.getKeys().isEmpty(); + boolean ref2Empty = ref2 == null || ref2.getKeys() == null || ref2.getKeys().isEmpty(); + if (ref1Empty && ref2Empty) { + return true; + } + if (ref1Empty != ref2Empty) { + return false; + } + int keyLength = Math.min(ref1.getKeys().size(), ref2.getKeys().size()); + for (int i = 0; i < keyLength; i++) { + Key ref1Key = ref1.getKeys().get(ref1.getKeys().size() - (i + 1)); + Key ref2Key = ref2.getKeys().get(ref2.getKeys().size() - (i + 1)); + Optional ref1Type = keyTypeToClass(ref1Key.getType()); + Optional ref2Type = keyTypeToClass(ref2Key.getType()); + if (ref1Type.isPresent() != ref2Type.isPresent()) { + return false; + } + if (ref1Type.isPresent()) { + if (!(ref1Type.get().isAssignableFrom(ref2Type.get()) + || ref2Type.get().isAssignableFrom(ref1Type.get()))) { + return false; + } + } + if (!(Objects.equal(ref1Key.getIdType(), ref2Key.getIdType()) + && Objects.equal(ref1Key.getValue(), ref2Key.getValue()))) { + return false; + } + if ((ref1Key.getIdType() == KeyType.IRI) + || (ref1Key.getIdType() == KeyType.IRDI) + || (ref1Key.getIdType() == KeyType.CUSTOM)) { + return true; + } + } + return true; + } + + public static Reference cloneReference(Reference reference) { + if (reference == null || reference.getKeys() == null || reference.getKeys().isEmpty()) { + return null; + } + return new DefaultReference.Builder() + .keys(reference.getKeys().stream().map(x -> new DefaultKey.Builder() + .idType(x.getIdType()) + .type(x.getType()) + .value(x.getValue()) + .build()) + .collect(Collectors.toList())) + .build(); + } + public static Referable resolve(Reference reference, AssetAdministrationShellEnvironment env) { + if (reference == null || reference.getKeys() == null || reference.getKeys().isEmpty()) { + return null; + } List keys = reference.getKeys(); //get reduced Key list from last identifiable key to end diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util/ReferencedByViewCollector.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util/ReferencedByViewCollector.java new file mode 100644 index 00000000..332edd99 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util/ReferencedByViewCollector.java @@ -0,0 +1,59 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.util; + +import io.adminshell.aas.v3.model.AssetAdministrationShellEnvironment; +import io.adminshell.aas.v3.model.Referable; +import io.adminshell.aas.v3.model.Reference; +import io.adminshell.aas.v3.model.ReferenceElement; +import io.adminshell.aas.v3.model.RelationshipElement; +import io.adminshell.aas.v3.model.View; +import java.util.HashSet; +import java.util.Set; + +public class ReferencedByViewCollector { + + private AssetAdministrationShellEnvironment env; + + public ReferencedByViewCollector(AssetAdministrationShellEnvironment env) { + this.env = env; + } + + public Set collect() { + Visitor visitor = new Visitor(); + visitor.visit(env); + return visitor.referencedElements; + } + + private class Visitor implements AssetAdministrationShellElementWalkerVisitor { + + Set referencedElements = new HashSet<>(); + + @Override + public void visit(View view) { + view.getContainedElements().forEach(x -> handleReference(x)); + AssetAdministrationShellElementWalkerVisitor.super.visit(view); + } + + private void handleReference(Reference reference) { + Referable target = AASUtils.resolve(reference, env); + if (target != null) { + referencedElements.add(target); + } + } + + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util/ReferencedReferableCollector.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util/ReferencedReferableCollector.java index 2f2cf646..be34087f 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util/ReferencedReferableCollector.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util/ReferencedReferableCollector.java @@ -31,7 +31,7 @@ public ReferencedReferableCollector(AssetAdministrationShellEnvironment env) { this.env = env; } - public Set collect() { + public Set collect() { Visitor visitor = new Visitor(); visitor.visit(env); return visitor.referencedElements; @@ -39,7 +39,7 @@ public Set collect() { private class Visitor implements AssetAdministrationShellElementWalkerVisitor { - Set referencedElements = new HashSet<>(); + Set referencedElements = new HashSet<>(); @Override public void visit(ReferenceElement referenceElement) { @@ -50,7 +50,7 @@ public void visit(ReferenceElement referenceElement) { private void handleReference(Reference reference) { Referable target = AASUtils.resolve(reference, env); if (target != null) { - referencedElements.add(target); + referencedElements.add(reference); } } diff --git a/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/fixtures/FullExample.java b/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/fixtures/FullExample.java index d7144fb4..80ef152f 100644 --- a/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/fixtures/FullExample.java +++ b/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/fixtures/FullExample.java @@ -190,6 +190,7 @@ public class FullExample { .version("0.9") .revision("0") .build()) + .kind(ModelingKind.INSTANCE) .semanticId(new DefaultReference.Builder() .key(new DefaultKey.Builder() .type(KeyElements.SUBMODEL) @@ -276,6 +277,7 @@ public class FullExample { .administration(new DefaultAdministrativeInformation.Builder() .version("0.9") .build()) + .kind(ModelingKind.INSTANCE) .semanticId(new DefaultReference.Builder() .key(new DefaultKey.Builder() .type(KeyElements.SUBMODEL) @@ -374,6 +376,7 @@ public class FullExample { .version("0.9") .revision("0") .build()) + .kind(ModelingKind.INSTANCE) .semanticId(new DefaultReference.Builder() .key(new DefaultKey.Builder() .type(KeyElements.GLOBAL_REFERENCE) @@ -705,6 +708,7 @@ public class FullExample { .idType(IdentifierType.IRI) .identifier("https://acplt.org/Test_Submodel_Mandatory") .build()) + .kind(ModelingKind.TEMPLATE) .submodelElement(new DefaultRelationshipElement.Builder() .idShort("ExampleRelationshipElement") .first(new DefaultReference.Builder() @@ -797,6 +801,7 @@ public class FullExample { public static final Submodel SUBMODEL_5 = new DefaultSubmodel.Builder() .idShort("") + .kind(ModelingKind.INSTANCE) .identification(new DefaultIdentifier.Builder() .idType(IdentifierType.IRI) .identifier("https://acplt.org/Test_Submodel2_Mandatory") @@ -811,6 +816,7 @@ public class FullExample { .idType(IdentifierType.IRI) .identifier("https://acplt.org/Test_Submodel_Missing") .build()) + .kind(ModelingKind.INSTANCE) .administration(new DefaultAdministrativeInformation.Builder() .version("0.9") .revision("0").build()) @@ -1129,6 +1135,7 @@ public class FullExample { .idType(IdentifierType.IRI) .identifier("https://acplt.org/Test_Submodel_Template") .build()) + .kind(ModelingKind.INSTANCE) .administration(new DefaultAdministrativeInformation.Builder() .version("0.9") .revision("0") diff --git a/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/fixtures/TestExample.java b/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/fixtures/TestExample.java index b96d5805..1a493aa7 100644 --- a/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/fixtures/TestExample.java +++ b/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/fixtures/TestExample.java @@ -108,21 +108,21 @@ private static final Reference asReference(Identifiable identifiable) { // .build()) // .build()) // .build()) - .submodelElement(new DefaultFile.Builder() - .idShort("ExampleFile") - .category("Parameter") - .description(new LangString("Example File object", "en-us")) - .description(new LangString("Beispiel File Element", "de")) - .semanticId(new DefaultReference.Builder() - .key(new DefaultKey.Builder() - .type(KeyElements.GLOBAL_REFERENCE) - .value("http://acplt.org/Files/ExampleFile") - .idType(KeyType.IRI) - .build()) - .build()) - .value("/TestFile.pdf") - .mimeType("application/pdf") - .build()) + // .submodelElement(new DefaultFile.Builder() + // .idShort("ExampleFile") + // .category("Parameter") + // .description(new LangString("Example File object", "en-us")) + // .description(new LangString("Beispiel File Element", "de")) + // .semanticId(new DefaultReference.Builder() + // .key(new DefaultKey.Builder() + // .type(KeyElements.GLOBAL_REFERENCE) + // .value("http://acplt.org/Files/ExampleFile") + // .idType(KeyType.IRI) + // .build()) + // .build()) + // .value("/TestFile.pdf") + // .mimeType("application/pdf") + // .build()) .submodelElement(new DefaultOperation.Builder() .idShort("ExampleOperation") .category("Parameter") @@ -551,10 +551,10 @@ private static final Reference asReference(Identifiable identifiable) { .build()) .submodel(asReference(SUBMODEL_1)) .submodel(asReference(SUBMODEL_2)) - // .view(new DefaultView.Builder() - // .idShort("ExampleView") - // .containedElement(asReference(SUBMODEL_1)) - // .build()) + .view(new DefaultView.Builder() + .idShort("ExampleView") + .containedElement(asReference(SUBMODEL_1)) + .build()) .build(); public static final AssetAdministrationShellEnvironment ENVIRONMENT = new DefaultAssetAdministrationShellEnvironment.Builder() diff --git a/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/serialize/AmlDeserializerTest.java b/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/serialize/AmlDeserializerTest.java new file mode 100644 index 00000000..fdd0d1a9 --- /dev/null +++ b/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/serialize/AmlDeserializerTest.java @@ -0,0 +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 io.adminshell.aas.v3.dataformat.aml.serialize; + +import io.adminshell.aas.v3.dataformat.DeserializationException; +import io.adminshell.aas.v3.dataformat.aml.AmlDeserializer; +import io.adminshell.aas.v3.dataformat.aml.fixtures.TestExample; +import io.adminshell.aas.v3.model.AssetAdministrationShellEnvironment; +import java.io.FileNotFoundException; +import static org.junit.Assert.assertEquals; +import org.junit.Test; + +public class AmlDeserializerTest { + + private final AmlDeserializer deserializer = new AmlDeserializer(); + + @Test +// @Ignore + public void testExample() throws FileNotFoundException, DeserializationException { + AssetAdministrationShellEnvironment actual = deserializer.read(TestExample.FILE); + assertEquals(TestExample.ENVIRONMENT, actual); + } +} diff --git a/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/serialize/AmlSerializerTest.java b/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/serialize/AmlSerializerTest.java index 44a9c188..ca59937a 100644 --- a/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/serialize/AmlSerializerTest.java +++ b/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/serialize/AmlSerializerTest.java @@ -17,7 +17,7 @@ import io.adminshell.aas.v3.dataformat.aml.fixtures.FullExample; import io.adminshell.aas.v3.dataformat.SerializationException; -import io.adminshell.aas.v3.dataformat.aml.AmlSerializationConfig; +import io.adminshell.aas.v3.dataformat.aml.Aas2AmlConfig; import io.adminshell.aas.v3.dataformat.aml.AmlSerializer; import io.adminshell.aas.v3.dataformat.aml.id.IntegerIdGenerator; import io.adminshell.aas.v3.dataformat.aml.fixtures.TestExample; @@ -55,15 +55,15 @@ public void testSAPFullExample() throws SerializationException { private void validateAmlSerializer(File expectedFile, AssetAdministrationShellEnvironment environment) throws SerializationException, SAXException, IOException { String expected = Files.readString(expectedFile.toPath()); - String actual = new AmlSerializer().write(environment, AmlSerializationConfig.builder() + String actual = new AmlSerializer().write(environment, Aas2AmlConfig.builder() .idGenerator(new IntegerIdGenerator()) .build()); System.out.println(actual); Diff diff = DiffBuilder .compare(actual) .withTest(expected) -// .checkForSimilar() -// .checkForIdentical() + // .checkForSimilar() + // .checkForIdentical() .normalizeWhitespace() .withNodeMatcher(new DefaultNodeMatcher(ElementSelectors.byNameAndText)) .ignoreComments() @@ -73,7 +73,7 @@ private void validateAmlSerializer(File expectedFile, AssetAdministrationShellEn Iterator iter = diff.getDifferences().iterator(); int size = 0; while (iter.hasNext()) { - System.out.println(iter.next()); + System.out.println(iter.next()); size++; } assert (size == 0); diff --git a/dataformat-aml/src/test/resources/amlfile/example_test.aml b/dataformat-aml/src/test/resources/amlfile/example_test.aml index 8788cb2b..e0dca540 100644 --- a/dataformat-aml/src/test/resources/amlfile/example_test.aml +++ b/dataformat-aml/src/test/resources/amlfile/example_test.aml @@ -1,2608 +1,2608 @@ - - - - foo - bar - 03-08-2021 15:40:37 - - - - - - - - 0 - - - - 0.9 - - - - - - - INSTANCE - - - - (ASSET)[IRI]https://acplt.org/Test_Asset - - - - - (ASSET_ADMINISTRATION_SHELL)[IRI]https://acplt.org/TestAssetAdministrationShell2 - - - - - - An Example Asset Administration Shell for the test application - - - Ein Beispiel-Verwaltungsschale für eine Test-Anwendung - - - - TestAssetAdministrationShell - - - - - - IRI - - - - https://acplt.org/Test_AssetAdministrationShell - - - - + + + + foo + bar + 03-08-2021 15:40:37 + + + + - - - 0 - - - - 0.9 - - + + + 0 + + + + 0.9 + + + + + + + INSTANCE + + + + (ASSET)[IRI]https://acplt.org/Test_Asset + + + + + (ASSET_ADMINISTRATION_SHELL)[IRI]https://acplt.org/TestAssetAdministrationShell2 + - - - An example asset identification submodel for the test application - - - Ein Beispiel-Identifikations-Submodel für eine Test-Anwendung - + + + An Example Asset Administration Shell for the test application + + + Ein Beispiel-Verwaltungsschale für eine Test-Anwendung + - Identification - + TestAssetAdministrationShell + - - - IRI - - - - http://acplt.org/Submodels/Assets/TestAsset/Identification - - - - - INSTANCE - - - - (SUBMODEL)[IRI]http://acplt.org/SubmodelTemplates/AssetIdentification - - - - - Parameter - - - - - - Example Reference Element object - - - Beispiel Reference Element Element - - - - ExampleReferenceElement - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ReferenceElements/ExampleReferenceElement - - - - - - - - - Parameter - - - - - - Example File object - - - Beispiel File Element - - - - ExampleFile - - - - application/pdf - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Files/ExampleFile - - - - /TestFile.pdf - - - - - application/pdf - - - /TestFile.pdf - - - - - - - Parameter - - - - - - Example Operation object - - - Beispiel Operation Element - - - - ExampleOperation - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Operations/ExampleOperation - - - - - - - Constant + + + IRI + + + + https://acplt.org/Test_AssetAdministrationShell + + + + + + + + 0 + + + + 0.9 + + + + + + + An example asset identification submodel for the test application + + + Ein Beispiel-Identifikations-Submodel für eine Test-Anwendung + + + + Identification + + + + + + IRI + + + + http://acplt.org/Submodels/Assets/TestAsset/Identification + + + + + INSTANCE + + + + (SUBMODEL)[IRI]http://acplt.org/SubmodelTemplates/AssetIdentification + + + + + Parameter - - + + - Example Property object + Example Reference Element object - Beispiel Property Element + Beispiel Reference Element Element - - - ExampleProperty + + + ExampleReferenceElement - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ReferenceElements/ExampleReferenceElement - - - exampleValue - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId - - - - string - - - - - - - - - - Constant + + + + + + + + Parameter - - + + - Example Property object + Example File object - Beispiel Property Element + Beispiel File Element - - - ExampleProperty + + + ExampleFile - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty + + + application/pdf + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Files/ExampleFile - - - exampleValue - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId - - - - string - - - - - - - - - - Constant + + + /TestFile.pdf + + + + + application/pdf + + + /TestFile.pdf + + + + + + + Parameter - - + + - Example Property object + Example Operation object - Beispiel Property Element + Beispiel Operation Element - - - ExampleProperty + + + ExampleOperation - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Operations/ExampleOperation - - - exampleValue - - - + + + + + + Constant + + + + + + Example Property object + + + Beispiel Property Element + + + + ExampleProperty + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty + + + + exampleValue + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + string + + + + + + + + + + Constant + + + + + + Example Property object + + + Beispiel Property Element + + + + ExampleProperty + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty + + + + exampleValue + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + string + + + + + + + + + + Constant + + + + + + Example Property object + + + Beispiel Property Element + + + + ExampleProperty + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty + + + + exampleValue + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + string + + + + + + + + + + + + + + + 0.9 + + + + + + + An example bill of material submodel for the test application + + + Ein Beispiel-BillofMaterial-Submodel für eine Test-Anwendung + + + + BillOfMaterial + + + + + + IRI + + + + http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial + + + + + TEMPLATE + + + + + + http://acplt.org/Qualifier/ExampleQualifier + + + + 100 + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId - - - - string - - - - - - - + + + + int + + + + + + + http://acplt.org/Qualifier/ExampleQualifier2 + + + + 50 + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + int + + + + + (SUBMODEL)[IRI]http://acplt.org/SubmodelTemplates/BillOfMaterial + + + + + + + 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. + + + 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 + + + + CO_MANAGED_ENTITY + + + + ExampleEntity + + + + (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber + + + + + Constant + + + + + + Example Property object + + + Beispiel Property Element + + + + ExampleProperty2 + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty + + + + exampleValue2 + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + string + + + + + + + Constant + + + + + + Example Property object + + + Beispiel Property Element + + + + ExampleProperty + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty + + + + exampleValue + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + string + + + + + + + + + + + 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. + + + 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 + + + + SELF_MANAGED_ENTITY + + + + (ASSET)[IRI]https://acplt.org/Test_Asset2 + + + + ExampleEntity2 + + + + (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber + + + + + - - - + + + + + - - - 0.9 - - + + + 0 + + + + 0.9 + + - - - An example bill of material submodel for the test application - - - Ein Beispiel-BillofMaterial-Submodel für eine Test-Anwendung - + + + An example concept description for the test application + + + Ein Beispiel-ConceptDescription für eine Test-Anwendung + - BillOfMaterial - + TestConceptDescription + - - - IRI - - - - http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial - - - - - TEMPLATE - - - - - - http://acplt.org/Qualifier/ExampleQualifier - - - - 100 - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId - - - - int - - - - - - - http://acplt.org/Qualifier/ExampleQualifier2 - - - - 50 - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId - - - - int - - - - - (SUBMODEL)[IRI]http://acplt.org/SubmodelTemplates/BillOfMaterial - - - - - - - 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. - - - 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 - - - - CO_MANAGED_ENTITY - - - - ExampleEntity - - - - (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber - - - - - Constant - - - - - - Example Property object - - - Beispiel Property Element - - - - ExampleProperty2 - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty - - - - exampleValue2 - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId - - - - string - - - - - - - Constant - - - - - - Example Property object - - - Beispiel Property Element - - - - ExampleProperty - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty - - - - exampleValue - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId - - - - string - - - - - + + + IRI + + + + https://acplt.org/Test_ConceptDescription + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/DataSpecifications/ConceptDescriptions/TestConceptDescription + + + + + REAL_MEASURE + + + + + + Dies ist eine Data Specification für Testzwecke + + + This is a DataSpecification for testing purposes + + + + + + Test Specification + + + TestSpecification + + + + + + Test Spec + + + TestSpec + + + + http://acplt.org/DataSpec/ExampleDef + + + + SU + + + + SpaceUnit + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Units/SpaceUnit + + + + TEST + + + + string + + + - - - - - 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. - - - 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 - - - - SELF_MANAGED_ENTITY - - - - (ASSET)[IRI]https://acplt.org/Test_Asset2 - - - - ExampleEntity2 - - - - (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber - - - + + + REAL_MEASURE + + + + + + Dies ist eine Data Specification für Testzwecke2 + + + This is a DataSpecification for testing purposes2 + + + + + + Test Specification2 + + + TestSpecification2 + + + + + + Test Spec2 + + + TestSpec2 + + + + http://acplt.org/DataSpec/ExampleDef + + + + SU + + + + SpaceUnit + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Units/SpaceUnit + + + + TEST2 + + + + string + + + - - - - - - - - - - - 0 - - - - 0.9 - - - - - - - An example concept description for the test application - - - Ein Beispiel-ConceptDescription für eine Test-Anwendung - - - - TestConceptDescription - - - - - - IRI - - - - https://acplt.org/Test_ConceptDescription - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/DataSpecifications/ConceptDescriptions/TestConceptDescription - - - - - REAL_MEASURE - - - - - - Dies ist eine Data Specification für Testzwecke - - - This is a DataSpecification for testing purposes - - - - - - Test Specification - - - TestSpecification - - - - - - Test Spec - - - TestSpec - - - - http://acplt.org/DataSpec/ExampleDef - - - - SU - - - - SpaceUnit - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Units/SpaceUnit - - - - TEST - - - - string - - - - - - - REAL_MEASURE - - - - - - Dies ist eine Data Specification für Testzwecke2 - - - This is a DataSpecification for testing purposes2 - - - - - - Test Specification2 - - - TestSpecification2 - - - - - - Test Spec2 - - - TestSpec2 - - - - http://acplt.org/DataSpec/ExampleDef - - - - SU - - - - SpaceUnit - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Units/SpaceUnit - - - - TEST2 - - - - string - - - - - - - - - Interface Class Library according to Details of the Asset Administration Shell V2.0. - 1.0.0 - - A FileDataReference represents the address to a File. FileDataReference is derived from the AutomationML Interface Class ExternalDataReference that is defined in AutomationML BPR_005E_ExternalDataReference_v1.0.0_2:The interface class “ExternalDataReference” shall be used in order to reference external documents out of the scope of AutomationML. - - - Reference to any other referable element of the same of any other AAS or a reference to an external object or entity. For local references inside the same Asset Administration Shell an InternalLink between two objects with this interface "ReferableReference" shall be set. In this case the attribute value has to be empty. For references between different Asset Administration Shells or external objects or entities the attribute value shall be used and no InternalLink shall be set. - - Reference to any other referable element of any other AAS or a reference to an external object or entity. Note: For references to any other referable element of the same AAS InternalLinks are used and this attribute value shall be empty. - - - - - - Standard Automation Markup Language Interface Class Library - Part 1 Content extended with Part 3 and Part 4 Content - 2.2.2 - - - - - - - - - - The attribute refURI is an IRI that can represent an absolute or relative path to an L document. An added fragment (with #) references inside the document - - - - + + + + + Interface Class Library according to Details of the Asset Administration Shell V2.0. + 1.0.0 + + A FileDataReference represents the address to a File. FileDataReference is derived from the AutomationML Interface Class ExternalDataReference that is defined in AutomationML BPR_005E_ExternalDataReference_v1.0.0_2:The interface class “ExternalDataReference” shall be used in order to reference external documents out of the scope of AutomationML. + + + Reference to any other referable element of the same of any other AAS or a reference to an external object or entity. For local references inside the same Asset Administration Shell an InternalLink between two objects with this interface "ReferableReference" shall be set. In this case the attribute value has to be empty. For references between different Asset Administration Shells or external objects or entities the attribute value shall be used and no InternalLink shall be set. + + Reference to any other referable element of any other AAS or a reference to an external object or entity. Note: For references to any other referable element of the same AAS InternalLinks are used and this attribute value shall be empty. + + + + + + Standard Automation Markup Language Interface Class Library - Part 1 Content extended with Part 3 and Part 4 Content + 2.2.2 + + + - - - - - - - - - - - - true - - - + + + + + + The attribute refURI is an IRI that can represent an absolute or relative path to an L document. An added fragment (with #) references inside the document + + + + + + + + + + + + + + + + + true + + + + - - - - - - - - - 1.0.0 - - - Mime type of the content of the File. - - - - - Role Class Library according to Details of the Asset Administration Shell V2.0. - 1.0.0 - - An Asset Administration Shell. - - Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - 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. - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - - - - - Abstract attribute class for identification. Has the subattributes id and idType. - - - Identifier of the element. Its type is defined in idType. Id is a subproperty of identification. - - - - - Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the enumeration “IdentifierType”. IdType is a subproperty of identification. - - - - - - Abstract attribute for administration. Has the subattributes revision and version. - - - Revision of the element. Constraint AASd-005: A revision requires a version. This means, if there is no version there is no revision neither. Revision is a subproperty of administration. - - - - - Version of the element. Version is a subproperty of administration. - - - - - - Global reference to the data specification template used by the element. - - - - - The derivedFrom attribute is used to establish a relationship between two Asset Administration Shells that are derived from each other. - - - - - - An Asset describes meta data of an asset that is represented by an AAS. The asset may either represent an asset type or an asset instance. The asset has a globally unique identifier plus – if needed – additional domain specific (proprietary) identifiers. - - Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - 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. - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - Abstract attribute class for identification. Has the subattributes id and idType. - - - Identifier of the element. Its type is defined in idType. - - - - - Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the enumeration “IdentifierType”. IdType is a subproperty of identification. - - - - - - Abstract attribute for administration. Has the subattributes revision and version. - - - Revision of the element. Constraint AASd-005: A revision requires a version. This means, if there is no version there is no revision neither. Revision is a subproperty of administration. - - - - - Version of the element. Version is a subproperty of administration. - - - - - - Global reference to the data specification template used by the element. - - - - - Kind of the asset: either type or instance. - Instance - Instance - - - - Instance - Type - - - - - - A Submodel defines a specific aspect of the asset represented by the AAS. A submodel is used to structure the virtual representation and technical functionality of an Administration Shell into distinguishable parts. Each submodel refers to a well-defined domain or subject matter. Submodels can become standardized and thus become submodels types. Submodels can have different life-cycles. - - Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - 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. - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - Abstract attribute class for identification. Has the subattributes id and idType. - - - Identifier of the element. Its type is defined in idType. Id is a subproperty of identification. - - - - - Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the enumeration “IdentifierType”. IdType is a subproperty of identification. - - - - - - Abstract attribute for administration. Has the subattributes revision and version. - - - Revision of the element. Constraint AASd-005: A revision requires a version. This means, if there is no version there is no revision neither. Revision is a subproperty of administration. - - - - - Version of the element. Version of the element. Version is a subproperty of administration. - - - - - - Global reference to the data specification template used by the element. - - - - - Kind of the element: either template or instance. - Instance - Instance - - - - Instance - Type - - - - - Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. - - - - - A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. - - - The type describes the type of the qualifier that is applied to the element. - - - - - The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. - - - - - Reference to the global unqiue id of a coded value. - - - - - - - A submodel element collection is a set or list of submodel elements. - - Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - 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. - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - Global reference to the data specification template used by the element. - - - - - Kind of the element: either template or instance. - Instance - Instance - - - - Instance - Type - - - - - Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. - - - - - A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. - - - The type describes the type of the qualifier that is applied to the element. - - - - - The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. - - - - - Reference to the global unqiue id of a coded value. - - - - - - If allowDuplicates=true, then it is allowed that the collection contains the same element several times. - false - - - - If ordered=false, then the elements in the property collection are not ordered. If ordered=true then the elements in the collection are ordered. Default = false. Note: An ordered submodel element collection is typically implemented as an indexed array. - false - - - - Submodel element contained in the collection. - - - - - A BLOB is a data element that represents a file that is contained with its source code in the value attribute. - - Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - 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. - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - Global reference to the data specification template used by the element. - - - - - Kind of the element: either template or instance. - Instance - Instance - - - - Instance - Type - - - - - Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. - - - - - A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. - - - The type describes the type of the qualifier that is applied to the element. - - - - - The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. - - - - - Reference to the global unqiue id of a coded value. - - - - - - Mime type of the content of the BLOB. The mime type states which file extension the file has. Valid values are e.g. “application/json”, “application/xls”, ”image/jpg”. The allowed values are defined as in RFC2046. - - - - - The value of the BLOB instance of a blob data element. Note: In contrast to the file property the file content is stored directly as value in the Blob data element. - - - - - - A capability is the implementation-independent description of the potential of an asset to achieve a certain effect in the physical or virtual world. - - Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - 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. - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - Global reference to the data specification template used by the element. - - - - - Kind of the element: either template or instance. - Instance - Instance - - - - Instance - Type - - - - - Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. - - - - - A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. - - - The type describes the type of the qualifier that is applied to the element. - - - - - The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. - - - - - Reference to the global unqiue id of a coded value. - - - - - - - A role class for a File that a data element that represents an address to a file. It is derived from the AutomationML role class ExternalData that is an role type for a document type and the base class for all document type roles. It describes different document types. ExternalData is defined in AutomationML BPR_005E_ExternalDataReference_v1.0.0_2. - - Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - 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. - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - Global reference to the data specification template used by the element. - - - - - Kind of the element: either template or instance. - Instance - Instance - - - - Instance - Type - - - - - Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. - - - - - A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. - - - The type describes the type of the qualifier that is applied to the element. - - + + + + + + + + 1.0.0 + + + Mime type of the content of the File. + + + + + Role Class Library according to Details of the Asset Administration Shell V2.0. + 1.0.0 + + An Asset Administration Shell. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + + + - - The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. - - + + Abstract attribute class for identification. Has the subattributes id and idType. + + + Identifier of the element. Its type is defined in idType. Id is a subproperty of identification. + + + + + Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the enumeration “IdentifierType”. IdType is a subproperty of identification. + + + - - Reference to the global unqiue id of a coded value. - - + + Abstract attribute for administration. Has the subattributes revision and version. + + + Revision of the element. Constraint AASd-005: A revision requires a version. This means, if there is no version there is no revision neither. Revision is a subproperty of administration. + + + + + Version of the element. Version is a subproperty of administration. + + + + + + Global reference to the data specification template used by the element. + + + + + The derivedFrom attribute is used to establish a relationship between two Asset Administration Shells that are derived from each other. + + + + + + An Asset describes meta data of an asset that is represented by an AAS. The asset may either represent an asset type or an asset instance. The asset has a globally unique identifier plus – if needed – additional domain specific (proprietary) identifiers. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + - - - - The attribute refURI is an IRI that can represent an absolute or relative path to an L document. An added fragment (with #) references inside the document + + Abstract attribute class for identification. Has the subattributes id and idType. + + + Identifier of the element. Its type is defined in idType. + + + + + Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the enumeration “IdentifierType”. IdType is a subproperty of identification. + + + - - Mime type of the content of the File. - - - - - A property is a data element that has a single value. - - Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - 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. - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - Global reference to the data specification template used by the element. - - - - - Kind of the element: either template or instance. - Instance - Instance - - - - Instance - Type - - - - - Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. - - - - - A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. - - - The type describes the type of the qualifier that is applied to the element. - - + + Abstract attribute for administration. Has the subattributes revision and version. + + + Revision of the element. Constraint AASd-005: A revision requires a version. This means, if there is no version there is no revision neither. Revision is a subproperty of administration. + + + + + Version of the element. Version is a subproperty of administration. + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the asset: either type or instance. + Instance + Instance + + + + Instance + Type + + + + + + A Submodel defines a specific aspect of the asset represented by the AAS. A submodel is used to structure the virtual representation and technical functionality of an Administration Shell into distinguishable parts. Each submodel refers to a well-defined domain or subject matter. Submodels can become standardized and thus become submodels types. Submodels can have different life-cycles. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + - - The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. - - + + Abstract attribute class for identification. Has the subattributes id and idType. + + + Identifier of the element. Its type is defined in idType. Id is a subproperty of identification. + + + + + Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the enumeration “IdentifierType”. IdType is a subproperty of identification. + + + - - Reference to the global unqiue id of a coded value. - - - - - - The value of the property instance. - - - - Reference to the global unique id if a coded value. - - - - - A reference element is a data element that defines a logical reference to another element within the same or another AAS or a reference to an external object or entity. - - Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - 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. - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - Global reference to the data specification template used by the element. - - - - - Kind of the element: either template or instance. - Instance - Instance - - - - Instance - Type - - - - - Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. - - - - - A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. - - - The type describes the type of the qualifier that is applied to the element. - - + + Abstract attribute for administration. Has the subattributes revision and version. + + + Revision of the element. Constraint AASd-005: A revision requires a version. This means, if there is no version there is no revision neither. Revision is a subproperty of administration. + + + + + Version of the element. Version of the element. Version is a subproperty of administration. + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. + + + + + Reference to the global unqiue id of a coded value. + + + + + + + A submodel element collection is a set or list of submodel elements. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. + + + + + Reference to the global unqiue id of a coded value. + + + + + + If allowDuplicates=true, then it is allowed that the collection contains the same element several times. + false + + + + If ordered=false, then the elements in the property collection are not ordered. If ordered=true then the elements in the collection are ordered. Default = false. Note: An ordered submodel element collection is typically implemented as an indexed array. + false + - The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. - - - - - Reference to the global unqiue id of a coded value. - - + Submodel element contained in the collection. + + + + + A BLOB is a data element that represents a file that is contained with its source code in the value attribute. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. + + + + + Reference to the global unqiue id of a coded value. + + + + + + Mime type of the content of the BLOB. The mime type states which file extension the file has. Valid values are e.g. “application/json”, “application/xls”, ”image/jpg”. The allowed values are defined as in RFC2046. + + - - - Reference to any other referable element of any other AAS or a reference to an external object or entity. Note: For references to any other referable elment of the same AAS InternalLinks are used and this attribute value shall be empty. - - - - - - A relationship element is used to define a relationship between two referable elements. - - Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - 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. - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - Global reference to the data specification template used by the element. - - - - - Kind of the element: either template or instance. - Instance - Instance - - - - Instance - Type - - - - - Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. - - - - - A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. - - - The type describes the type of the qualifier that is applied to the element. - - + The value of the BLOB instance of a blob data element. Note: In contrast to the file property the file content is stored directly as value in the Blob data element. + + + + + + A capability is the implementation-independent description of the potential of an asset to achieve a certain effect in the physical or virtual world. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. + + + + + Reference to the global unqiue id of a coded value. + + + + + + + A role class for a File that a data element that represents an address to a file. It is derived from the AutomationML role class ExternalData that is an role type for a document type and the base class for all document type roles. It describes different document types. ExternalData is defined in AutomationML BPR_005E_ExternalDataReference_v1.0.0_2. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. + + + + + Reference to the global unqiue id of a coded value. + + + + + + + The attribute refURI is an IRI that can represent an absolute or relative path to an L document. An added fragment (with #) references inside the document + + + Mime type of the content of the File. + + + + + A property is a data element that has a single value. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. + + + + + Reference to the global unqiue id of a coded value. + + + - The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. - - + The value of the property instance. + - Reference to the global unqiue id of a coded value. - - - - - - - Reference to any other referable element of any other AAS or a reference to an external object or entity. Note: For references to any other referable elment of the same AAS InternalLinks are used and this attribute value shall be empty. - - - - - Reference to any other referable element of any other AAS or a reference to an external object or entity. Note: For references to any other referable elment of the same AAS InternalLinks are used and this attribute value shall be empty. - - - - - An annotated relationship element is an relationship element that can be annotated with additional data elements. - - Annotations that hold for the relationships between the two elements. - - - - - An operation is a submodel element with input and output variables. - - Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - 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. - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - Global reference to the data specification template used by the element. - - - - - Kind of the element: either template or instance. - Instance - Instance - - - - Instance - Type - - - - - Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. - - - - - A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. - - - The type describes the type of the qualifier that is applied to the element. - - + Reference to the global unique id if a coded value. + + + + + A reference element is a data element that defines a logical reference to another element within the same or another AAS or a reference to an external object or entity. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. + + + + + Reference to the global unqiue id of a coded value. + + + + + + + Reference to any other referable element of any other AAS or a reference to an external object or entity. Note: For references to any other referable elment of the same AAS InternalLinks are used and this attribute value shall be empty. + + + + + + A relationship element is used to define a relationship between two referable elements. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. + + + + + Reference to the global unqiue id of a coded value. + + + + + + + Reference to any other referable element of any other AAS or a reference to an external object or entity. Note: For references to any other referable elment of the same AAS InternalLinks are used and this attribute value shall be empty. + + + + + Reference to any other referable element of any other AAS or a reference to an external object or entity. Note: For references to any other referable elment of the same AAS InternalLinks are used and this attribute value shall be empty. + + + + + An annotated relationship element is an relationship element that can be annotated with additional data elements. + + Annotations that hold for the relationships between the two elements. + + + + + An operation is a submodel element with input and output variables. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. + + + + + Reference to the global unqiue id of a coded value. + + + + + + + The list of AAS OperationVariableIn entities. In AML, the corresponding InternalElement with this role is a child of the InternalElement with the Operation role. + + + The list of AAS OperationVariableOut entities. In AML, the corresponding InternalElement with this role is a child of the InternalElement with the Operation role. + + + The list of AAS OperationVariableOut entities. In AML, the corresponding InternalElement with this role is a child of the InternalElement with the Operation role. + + + A view is a collection of referable elements w.r.t. to a specific viewpoint of one or more stakeholders. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + Global reference to the data specification template used by the element. + + + + + Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. + + + + + + A dictionary contains elements that can be reused. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + + + + + + + Explanation: The semantics of a property or other elements that may have a semantic description is defined by a concept description. The description of the concept should follow a standardized schema (realized as data specification template). + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + Description or comments on the element. The description can be provided in several languages. + + + - - The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. - - + + Abstract attribute class for identification. Has the subattributes id and idType. + + + Identifier of the element. Its type is defined in idType. Id is a subproperty of identification. + + + + + Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the enumeration “IdentifierType”. IdType is a subproperty of identification. + + + - - Reference to the global unqiue id of a coded value. - - - - - - - The list of AAS OperationVariableIn entities. In AML, the corresponding InternalElement with this role is a child of the InternalElement with the Operation role. - - - The list of AAS OperationVariableOut entities. In AML, the corresponding InternalElement with this role is a child of the InternalElement with the Operation role. - - - The list of AAS OperationVariableOut entities. In AML, the corresponding InternalElement with this role is a child of the InternalElement with the Operation role. - - - A view is a collection of referable elements w.r.t. to a specific viewpoint of one or more stakeholders. - - Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - 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. - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - Global reference to the data specification template used by the element. - - - - - Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. - - - - - - A dictionary contains elements that can be reused. - - Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - 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. - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - - - - - - Explanation: The semantics of a property or other elements that may have a semantic description is defined by a concept description. The description of the concept should follow a standardized schema (realized as data specification template). - - Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - 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. - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - Abstract attribute class for identification. Has the subattributes id and idType. - - - Identifier of the element. Its type is defined in idType. Id is a subproperty of identification. - - - - - Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the enumeration “IdentifierType”. IdType is a subproperty of identification. - - - - - - Abstract attribute for administration. Has the subattributes revision and version. - - - Revision of the element. Constraint AASd-005: A revision requires a version. This means, if there is no version there is no revision neither. Revision is a subproperty of administration. - - - - - Version of the element. Version is a subproperty of administration. - - - - - - Global reference to the data specification template used by the element. - - - - Global reference to an external definition the concept is compatible to or was derived from. - - - - - - Description Role class of an element that has a data specification template. A template defines the additional attributes an element may or shall have. - - Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - 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. - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - - - - - Abstract attribute class for identification. Has the subattributes id and idType. - - - Identifier of the element. Its type is defined in idType. Id is a subproperty of identification. - - - - - Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the enumeration “IdentifierType”. IdType is a subproperty of identification. - - - - - - Abstract attribute for administration. Has the subattributes revision and version. - - - Revision of the element. Constraint AASd-005: A revision requires a version. This means, if there is no version there is no revision neither. Revision is a subproperty of administration. - - - - - Version of the element. Version is a subproperty of administration. - - - - - - - Content of the data specification template. - - - An entity is a submodel element that is used to model entities. Constraint AASd-056: If the semanticId of a Entity submodel element references a ConceptDescription then the ConceptDescription/category shall be one of following values: ENTITY. The ConceptDescription describes the elements assigned to the entity via Entity/statement. - - Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - 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. - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - Global reference to the data specification template used by the element. - - - - - Kind of the element: either template or instance. - Instance - Instance - - - - Instance - Type - - - - - Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. - - - - - A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. - - - The type describes the type of the qualifier that is applied to the element. - - + + Abstract attribute for administration. Has the subattributes revision and version. + + + Revision of the element. Constraint AASd-005: A revision requires a version. This means, if there is no version there is no revision neither. Revision is a subproperty of administration. + + + + + Version of the element. Version is a subproperty of administration. + + + + + + Global reference to the data specification template used by the element. + + + + Global reference to an external definition the concept is compatible to or was derived from. + + + + + + Description Role class of an element that has a data specification template. A template defines the additional attributes an element may or shall have. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + + + - - The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. - - + + Abstract attribute class for identification. Has the subattributes id and idType. + + + Identifier of the element. Its type is defined in idType. Id is a subproperty of identification. + + + + + Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the enumeration “IdentifierType”. IdType is a subproperty of identification. + + + - - Reference to the global unqiue id of a coded value. - - - - - - Describes statements applicable to the entity by a set of submodel elements, typically with a qualified value. - - - - Describes whether the entity is a co-managed entity or a self-managed entity. - SelfManagedEntity - SelfManagedEntity - - - - CoManagedEntity - SelfManagedEntity - - - - - Reference to an identifier key value pair representing a specific identifier of the asset represented by the asset administration shell. See Constraint AASd-014 - - - - Reference to the asset the entity is representing. Constraint AASd-014: Either the attribute globalAssetId or specificAssetId of an Entity must be set if Entity/entityType is set to "SelfManagedEntity". They are not existing otherwise. - - - - - - Automation Markup Language Base Role Class Library - Part 1 Content extended with Part 3 and Part 4 Content - 2.2.2 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1.0.0 - - - - - - - - 0 - - - - 0.9 - - - - - - - INSTANCE - - - - (ASSET)[IRI]https://acplt.org/Test_Asset - - - - - (ASSET_ADMINISTRATION_SHELL)[IRI]https://acplt.org/TestAssetAdministrationShell2 - - - - - - An Example Asset Administration Shell for the test application - - - Ein Beispiel-Verwaltungsschale für eine Test-Anwendung - - - - TestAssetAdministrationShell - - - - - - IRI - - - - https://acplt.org/Test_AssetAdministrationShell - - - - - - - 0 - - - - 0.9 - - + Abstract attribute for administration. Has the subattributes revision and version. + + + Revision of the element. Constraint AASd-005: A revision requires a version. This means, if there is no version there is no revision neither. Revision is a subproperty of administration. + + + + + Version of the element. Version is a subproperty of administration. + + + + + + + Content of the data specification template. + + + An entity is a submodel element that is used to model entities. Constraint AASd-056: If the semanticId of a Entity submodel element references a ConceptDescription then the ConceptDescription/category shall be one of following values: ENTITY. The ConceptDescription describes the elements assigned to the entity via Entity/statement. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. + + + + + Reference to the global unqiue id of a coded value. + + + + + + Describes statements applicable to the entity by a set of submodel elements, typically with a qualified value. + + + + Describes whether the entity is a co-managed entity or a self-managed entity. + SelfManagedEntity + SelfManagedEntity + + + + CoManagedEntity + SelfManagedEntity + + + + + Reference to an identifier key value pair representing a specific identifier of the asset represented by the asset administration shell. See Constraint AASd-014 + + + + Reference to the asset the entity is representing. Constraint AASd-014: Either the attribute globalAssetId or specificAssetId of an Entity must be set if Entity/entityType is set to "SelfManagedEntity". They are not existing otherwise. + + + + + + Automation Markup Language Base Role Class Library - Part 1 Content extended with Part 3 and Part 4 Content + 2.2.2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1.0.0 + + + + + + + + 0 + + + + 0.9 + + + + + + + INSTANCE + + + + (ASSET)[IRI]https://acplt.org/Test_Asset + + + + + (ASSET_ADMINISTRATION_SHELL)[IRI]https://acplt.org/TestAssetAdministrationShell2 + - - - An example asset identification submodel for the test application - - - Ein Beispiel-Identifikations-Submodel für eine Test-Anwendung - + + + An Example Asset Administration Shell for the test application + + + Ein Beispiel-Verwaltungsschale für eine Test-Anwendung + - Identification - + TestAssetAdministrationShell + - - - IRI - - - - http://acplt.org/Submodels/Assets/TestAsset/Identification - - - - - INSTANCE - - - - (SUBMODEL)[IRI]http://acplt.org/SubmodelTemplates/AssetIdentification - - - - - Parameter - - - - - - Example Reference Element object - - - Beispiel Reference Element Element - - - - ExampleReferenceElement - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ReferenceElements/ExampleReferenceElement - - - - - - - - - Parameter - - - - - - Example File object - - - Beispiel File Element - - - - ExampleFile - - - - application/pdf - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Files/ExampleFile - - - - /TestFile.pdf - - - - - application/pdf - - - /TestFile.pdf - - - - - - - Parameter - - - - - - Example Operation object - - - Beispiel Operation Element - - - - ExampleOperation - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Operations/ExampleOperation - - - - - - - Constant + + + IRI + + + + https://acplt.org/Test_AssetAdministrationShell + + + + + + + + 0 + + + + 0.9 + + + + + + + An example asset identification submodel for the test application + + + Ein Beispiel-Identifikations-Submodel für eine Test-Anwendung + + + + Identification + + + + + + IRI + + + + http://acplt.org/Submodels/Assets/TestAsset/Identification + + + + + INSTANCE + + + + (SUBMODEL)[IRI]http://acplt.org/SubmodelTemplates/AssetIdentification + + + + + Parameter - - + + - Example Property object + Example Reference Element object - Beispiel Property Element + Beispiel Reference Element Element - - - ExampleProperty + + + ExampleReferenceElement - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ReferenceElements/ExampleReferenceElement - - - exampleValue - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId - - - - string - - - - - - - - - - Constant + + + + + + + + Parameter - - + + - Example Property object + Example File object - Beispiel Property Element + Beispiel File Element - - - ExampleProperty + + + ExampleFile - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty + + + application/pdf + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Files/ExampleFile - - - exampleValue - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId - - - - string - - - - - - - - - - Constant + + + /TestFile.pdf + + + + + application/pdf + + + /TestFile.pdf + + + + + + + Parameter - - + + - Example Property object + Example Operation object - Beispiel Property Element + Beispiel Operation Element - - - ExampleProperty + + + ExampleOperation - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Operations/ExampleOperation - - - exampleValue - - - + + + + + + Constant + + + + + + Example Property object + + + Beispiel Property Element + + + + ExampleProperty + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty + + + + exampleValue + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + string + + + + + + + + + + Constant + + + + + + Example Property object + + + Beispiel Property Element + + + + ExampleProperty + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty + + + + exampleValue + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + string + + + + + + + + + + Constant + + + + + + Example Property object + + + Beispiel Property Element + + + + ExampleProperty + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty + + + + exampleValue + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + string + + + + + + + + + + + + + + + 0.9 + + + + + + + An example bill of material submodel for the test application + + + Ein Beispiel-BillofMaterial-Submodel für eine Test-Anwendung + + + + BillOfMaterial + + + + + + IRI + + + + http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial + + + + + TEMPLATE + + + + + + http://acplt.org/Qualifier/ExampleQualifier + + + + 100 + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId - - - - string - - - - - - - + + + + int + + + + + + + http://acplt.org/Qualifier/ExampleQualifier2 + + + + 50 + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + int + + + + + (SUBMODEL)[IRI]http://acplt.org/SubmodelTemplates/BillOfMaterial + + + + + + + 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. + + + 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 + + + + CO_MANAGED_ENTITY + + + + ExampleEntity + + + + (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber + + + + + Constant + + + + + + Example Property object + + + Beispiel Property Element + + + + ExampleProperty2 + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty + + + + exampleValue2 + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + string + + + + + + + Constant + + + + + + Example Property object + + + Beispiel Property Element + + + + ExampleProperty + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty + + + + exampleValue + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + string + + + + + + + + + + + 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. + + + 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 + + + + SELF_MANAGED_ENTITY + + + + (ASSET)[IRI]https://acplt.org/Test_Asset2 + + + + ExampleEntity2 + + + + (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber + + + + + - - - + + + - - - 0.9 - - + + + 0.9 + + - - - An example bill of material submodel for the test application - - - Ein Beispiel-BillofMaterial-Submodel für eine Test-Anwendung - + + + An example bill of material submodel for the test application + + + Ein Beispiel-BillofMaterial-Submodel für eine Test-Anwendung + - BillOfMaterial - + BillOfMaterial + - - - IRI - - - - http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial - - + + + IRI + + + + http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial + + - TEMPLATE - + TEMPLATE + - - - http://acplt.org/Qualifier/ExampleQualifier - - - - 100 - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId - - - - int - - + + + http://acplt.org/Qualifier/ExampleQualifier + + + + 100 + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + int + + - - - http://acplt.org/Qualifier/ExampleQualifier2 - - - - 50 - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId - - - - int - - - - - (SUBMODEL)[IRI]http://acplt.org/SubmodelTemplates/BillOfMaterial - - - - - - - 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. - - - 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 - - - - CO_MANAGED_ENTITY - - - - ExampleEntity - - - - (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber - - - - - Constant - - - - - - Example Property object - - - Beispiel Property Element - - - - ExampleProperty2 - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty - - - - exampleValue2 - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId - - - - string - - - - - - - Constant - - - - - - Example Property object - - - Beispiel Property Element - - - - ExampleProperty - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty - - - - exampleValue - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId - - - - string - - - - - - - - - - - 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. - - - 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 - - - - SELF_MANAGED_ENTITY - - - - (ASSET)[IRI]https://acplt.org/Test_Asset2 - - - - ExampleEntity2 - - - - (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber - - - - - - - - - - - - - 0.9 - - - - - - - An example bill of material submodel for the test application - - - Ein Beispiel-BillofMaterial-Submodel für eine Test-Anwendung - - - - BillOfMaterial - - - - - - IRI - - - - http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial - - - - - TEMPLATE - - - - - - http://acplt.org/Qualifier/ExampleQualifier - - - - 100 - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId - - - - int - - - - - - - http://acplt.org/Qualifier/ExampleQualifier2 - - - - 50 - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId - - - - int - - - - - (SUBMODEL)[IRI]http://acplt.org/SubmodelTemplates/BillOfMaterial - - - - - - - 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. - - - 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 - - - - CO_MANAGED_ENTITY - - - - ExampleEntity - + + + http://acplt.org/Qualifier/ExampleQualifier2 + + + + 50 + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + int + + - (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber - - - - - Constant - - - - - - Example Property object - - - Beispiel Property Element - - - - ExampleProperty2 - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty - - - - exampleValue2 - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId - - - - string - - - + (SUBMODEL)[IRI]http://acplt.org/SubmodelTemplates/BillOfMaterial + + + + + + + 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. + + + 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 + + + + CO_MANAGED_ENTITY + + + + ExampleEntity + + + + (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber + + + + + Constant + + + + + + Example Property object + + + Beispiel Property Element + + + + ExampleProperty2 + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty + + + + exampleValue2 + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + string + + + + + + + Constant + + + + + + Example Property object + + + Beispiel Property Element + + + + ExampleProperty + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty + + + + exampleValue + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + string + + + + + - - - Constant - - - - - - Example Property object - - - Beispiel Property Element - - - - ExampleProperty - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty - - - - exampleValue - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId - - - - string - - - + + + + + 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. + + + 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 + + + + SELF_MANAGED_ENTITY + + + + (ASSET)[IRI]https://acplt.org/Test_Asset2 + + + + ExampleEntity2 + + + + (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber + + + - - - - - - - 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. - - - 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 - - - - SELF_MANAGED_ENTITY - - - - (ASSET)[IRI]https://acplt.org/Test_Asset2 - - - - ExampleEntity2 - + + + + + 0 + + An AAS Data Specification template for IEC61369. A template consists of the DataSpecificationContent containing the additional attributes to be added to the element instance that references the data specification template and meta information about the template itself (this is why DataSpecification inherits from Identifiable). In UML these are two separated classes. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + + + - - (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber - - - - - - - - - 0 - - An AAS Data Specification template for IEC61369. A template consists of the DataSpecificationContent containing the additional attributes to be added to the element instance that references the data specification template and meta information about the template itself (this is why DataSpecification inherits from Identifiable). In UML these are two separated classes. - - Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - 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. - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - - - - - Abstract attribute class for identification. Has the subattributes id and idType. - - - Identifier of the element. Its type is defined in idType. Id is a subproperty of identification. - http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360 - - - - Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the enumeration “IdentifierType”. IdType is a subproperty of identification. - IRI - - - - - Abstract attribute for administration. Has the subattributes revision and version. - - - Revision of the element. Constraint AASd-005: A revision requires a version. This means, if there is no version there is no revision neither. Revision is a subproperty of administration. - - - - - Version of the element. Version is a subproperty of administration. - - - - - - - The content of an AAS Data Specification template for IEC61360. - - Identifies the attribute hierarchy for preferredName in above attribute hierachy. Subordinate attributes are designated by the country code information (see aml-lang literal). - - - - Identifies the attribute for shortName in above attribute hierarchy. - - - - Identifies the attribute for unit in above attribute hierarchy. - - - - Identifies the attribute for unitId in above attribute hierarchy in its string serialization. - - - - Identifies the attribute for sourceOfDefinition in above attribute hierachy. Subordinate attributes are designated by the country code information (see aml-lang literal). - - - - Identifies the attribute for symbol in above attribute hierarchy. - - - - Identifies the attribute for dataType in above attribute hierarchy. - - - - Identifies the attribute for definition in above attribute hierachy. Subordinate attributes are designated by the country code information (see aml-lang literal). - - - - Identifies the attribute for valueFormat in above attribute hierarchy. - - - - Identifies the attribute for valueList in above attribute hierarchy. - - - - The attribute value. - - - - The id for the value. - + + Abstract attribute class for identification. Has the subattributes id and idType. + + + Identifier of the element. Its type is defined in idType. Id is a subproperty of identification. + http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360 + + + + Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the enumeration “IdentifierType”. IdType is a subproperty of identification. + IRI + + - - - - + + Abstract attribute for administration. Has the subattributes revision and version. + + + Revision of the element. Constraint AASd-005: A revision requires a version. This means, if there is no version there is no revision neither. Revision is a subproperty of administration. + + + + + Version of the element. Version is a subproperty of administration. + + + + + + + The content of an AAS Data Specification template for IEC61360. + + Identifies the attribute hierarchy for preferredName in above attribute hierachy. Subordinate attributes are designated by the country code information (see aml-lang literal). + + + + Identifies the attribute for shortName in above attribute hierarchy. + + + + Identifies the attribute for unit in above attribute hierarchy. + + + + Identifies the attribute for unitId in above attribute hierarchy in its string serialization. + + + + Identifies the attribute for sourceOfDefinition in above attribute hierachy. Subordinate attributes are designated by the country code information (see aml-lang literal). + + + + Identifies the attribute for symbol in above attribute hierarchy. + + + + Identifies the attribute for dataType in above attribute hierarchy. + + + + Identifies the attribute for definition in above attribute hierachy. Subordinate attributes are designated by the country code information (see aml-lang literal). + + + + Identifies the attribute for valueFormat in above attribute hierarchy. + + + + Identifies the attribute for valueList in above attribute hierarchy. + + + + The attribute value. + + + + The id for the value. + + + + + + \ No newline at end of file diff --git a/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/Mapper.java b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/Mapper.java index 860b48ed..140b5f8d 100644 --- a/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/Mapper.java +++ b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/Mapper.java @@ -15,13 +15,6 @@ */ package io.adminshell.aas.v3.dataformat.mapping; -public abstract class Mapper { +public interface Mapper { - protected C config; - - public Mapper(C config) { - this.config = config; - } - - public abstract O map(I value) throws MappingException; } diff --git a/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/MappingContext.java b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/MappingContext.java index f9d56208..66053bae 100644 --- a/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/MappingContext.java +++ b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/MappingContext.java @@ -18,12 +18,16 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public abstract class MappingContext { +public abstract class MappingContext { protected static final Logger log = LoggerFactory.getLogger(MappingContext.class); - protected final MappingProvider mappingProvider; + protected final MappingProvider mappingProvider; - public MappingContext(MappingProvider mappingProvider) { + public MappingContext(MappingProvider mappingProvider) { this.mappingProvider = mappingProvider; } + + public MappingProvider getMappingProvider() { + return mappingProvider; + } } diff --git a/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/MappingProvider.java b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/MappingProvider.java index 1383b0d7..43c2c7bc 100644 --- a/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/MappingProvider.java +++ b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/MappingProvider.java @@ -28,21 +28,37 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public class MappingProvider { +public class MappingProvider { private static final Logger log = LoggerFactory.getLogger(MappingProvider.class); - private final ElementMapper defaultMapper; - private final ElementMapper, G, C> defaultCollectionMapper; - private Map, List> mappings = new HashMap<>(); + private final T defaultMapper; + private final T defaultCollectionMapper; + private final Map, List> mappings = new HashMap<>(); - public MappingProvider(ElementMapper defaultMapper, - ElementMapper, G, C> defaultCollectionMapper) { - this.defaultMapper = defaultMapper; - this.defaultCollectionMapper = defaultCollectionMapper; + 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(ElementMapper mapper) { + public void register(T mapper) { TypeToken key = getMappedType(mapper.getClass()); if (!mappings.containsKey(key)) { mappings.put(key, new ArrayList<>()); @@ -53,13 +69,13 @@ public void register(ElementMapper mapper) { private TypeToken getMappedType(Class type) { return TypeToken.of(type) .getTypes().stream() - .filter(y -> ElementMapper.class.equals(y.getRawType())) + .filter(y -> Mapper.class.equals(y.getRawType())) .findFirst() .get() - .resolveType(ElementMapper.class.getTypeParameters()[0]); + .resolveType(Mapper.class.getTypeParameters()[0]); } - public ElementMapper getMapper(Object obj) { + public T getMapper(Object obj) { if (obj == null) { return getMapper(Object.class); } @@ -69,15 +85,15 @@ public ElementMapper getMapper(Object obj) { return getMapper(obj.getClass()); } - public ElementMapper getMapper(Type type) { - Optional> customMapper = mappings.entrySet().stream() + 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 TypeUtils.TypeTokenComparator())) .map(x -> x.getValue()) .findFirst(); if (!customMapper.isPresent() || customMapper.get().isEmpty()) { if (TypeToken.of(Collection.class).isSupertypeOf(type) && defaultCollectionMapper != null) { - return (ElementMapper) defaultCollectionMapper; + return defaultCollectionMapper; } return defaultMapper; } diff --git a/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/ElementMapper.java b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/SourceBasedMapper.java similarity index 86% rename from dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/ElementMapper.java rename to dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/SourceBasedMapper.java index 46885767..29bc9ed2 100644 --- a/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/ElementMapper.java +++ b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/SourceBasedMapper.java @@ -15,7 +15,7 @@ */ package io.adminshell.aas.v3.dataformat.mapping; -public interface ElementMapper { +public interface SourceBasedMapper extends Mapper { public void map(T value, G generator, C context) throws MappingException; } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlToAasMapper.java b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/SourceBasedMappingContext.java similarity index 65% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlToAasMapper.java rename to dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/SourceBasedMappingContext.java index 50acb2a5..54b1e432 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlToAasMapper.java +++ b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/SourceBasedMappingContext.java @@ -13,14 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml; +package io.adminshell.aas.v3.dataformat.mapping; -import io.adminshell.aas.v3.dataformat.aml.model.caex.CAEXFile; -import io.adminshell.aas.v3.model.AssetAdministrationShellEnvironment; +public abstract class SourceBasedMappingContext extends MappingContext { -public class AmlToAasMapper { - - public AssetAdministrationShellEnvironment map(CAEXFile aml) { - throw new UnsupportedOperationException(); + public SourceBasedMappingContext(MappingProvider mappingProvider) { + super(mappingProvider); } + } diff --git a/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/TargetBasedMapper.java b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/TargetBasedMapper.java new file mode 100644 index 00000000..7b57d3fc --- /dev/null +++ b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/TargetBasedMapper.java @@ -0,0 +1,21 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.mapping; + +public interface TargetBasedMapper extends Mapper { + + public T map(P parser, C context) throws MappingException; +} diff --git a/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/TargetBasedMappingContext.java b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/TargetBasedMappingContext.java new file mode 100644 index 00000000..d87531bf --- /dev/null +++ b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/TargetBasedMappingContext.java @@ -0,0 +1,24 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.mapping; + +public abstract class TargetBasedMappingContext extends MappingContext { + + public TargetBasedMappingContext(MappingProvider mappingProvider) { + super(mappingProvider); + } + +} From 99c216fcd9f9c116484e6c0bd08fda401996dad4 Mon Sep 17 00:00:00 2001 From: Jacoby Date: Wed, 11 Aug 2021 14:37:02 +0200 Subject: [PATCH 12/18] updated dataformat-core, dataformat-aml, dataformat-xml --- .../aas/v3/dataformat/aml/Aas2AmlConfig.java | 83 ------- .../aas/v3/dataformat/aml/Aml2AasConfig.java | 5 - .../aml/AmlDeserializationConfig.java | 20 ++ .../v3/dataformat/aml/AmlDeserializer.java | 4 +- .../v3/dataformat/aml/AmlDocumentInfo.java | 15 ++ .../aml/AmlSerializationConfig.java | 150 +++++++++++++ .../aas/v3/dataformat/aml/AmlSerializer.java | 22 +- .../aml/aas2aml/AasToAmlMapper.java | 81 +++---- .../aml/{ => aas2aml}/AmlGenerator.java | 182 ++++++++++++--- .../{mapper => }/DefaultCollectionMapper.java | 12 +- .../aas2aml/{mapper => }/DefaultMapper.java | 64 +++--- .../aml/aas2aml/IdentityProvider.java | 2 +- .../Aas2AmlElementMapper.java => Mapper.java} | 6 +- ...appingContext.java => MappingContext.java} | 99 +-------- ...tAdministrationShellEnvironmentMapper.java | 30 ++- .../AssetAdministrationShellMapper.java | 61 +++++ .../ConstraintCollectionMapper.java | 11 +- .../DataSpecificationContentMapper.java | 15 +- .../DataSpecificationIEC61360Mapper.java | 11 +- .../DataSpecificationMapper.java | 10 +- ...ddedDataSpecificationCollectionMapper.java | 36 ++- .../{mapper => custom}/FileMapper.java | 10 +- .../LangStringCollectionMapper.java | 14 +- .../OperationVariableCollectionMapper.java | 15 +- .../OperationVariableMapper.java | 9 +- .../{mapper => custom}/QualifierMapper.java | 11 +- .../ReferenceCollectionMapper.java | 11 +- .../custom/ReferenceElementMapper.java | 61 +++++ .../custom/RelationshipElementMapper.java | 66 ++++++ .../{mapper => custom}/SubmodelMapper.java | 9 +- .../{mapper => custom}/ViewMapper.java | 40 ++-- .../mapper/ReferenceElementMapper.java | 86 -------- .../aml/aas2aml/mapper/ReferenceMapper.java | 48 ---- .../mapper/RelationshipElementMapper.java | 89 -------- .../aml/aas2aml/mapper/ToAttributeMapper.java | 35 --- .../aml/aml2aas/AasTypeFactory.java | 15 ++ .../dataformat/aml/aml2aas/Aml2AasMapper.java | 31 ++- .../aml/aml2aas/Aml2AasMappingContext.java | 45 ---- .../aml/aml2aas/Aml2AasObjectMapper.java | 32 --- .../v3/dataformat/aml/aml2aas/AmlParser.java | 15 ++ .../dataformat/aml/aml2aas/DefaultMapper.java | 23 +- .../aas/v3/dataformat/aml/aml2aas/Mapper.java | 21 ++ .../aml/aml2aas/MappingContext.java | 60 +++++ ...tAdministrationShellEnvironmentMapper.java | 24 +- .../aml/header/AutomationMLVersion.java | 5 +- .../{WriterHeader.java => WriterInfo.java} | 12 +- .../aas/v3/dataformat/aml/id/IdGenerator.java | 2 +- .../dataformat/aml/id/IntegerIdGenerator.java | 2 +- .../v3/dataformat/aml/id/UuidGenerator.java | 2 +- .../aml/util/ReferencedByViewCollector.java | 6 +- .../util/ReferencedReferableCollector.java | 4 +- .../dataformat/aml/fixtures/TestExample.java | 8 +- .../aml/serialize/AmlDeserializerTest.java | 3 +- .../aml/serialize/AmlSerializerTest.java | 155 ++++++++++++- .../core/DataSpecificationInfo.java | 44 ++++ .../core/DataSpecificationManager.java | 100 +++------ ...EmbeddedDataSpecificationDeserializer.java | 2 +- .../EmbeddedDataSpecificationSerializer.java | 4 +- .../aas/v3/dataformat/core/util/AasUtils.java | 208 +++++++++++++----- .../visitor}/AbstractReferableVisitor.java | 2 +- .../core/visitor}/AbstractVisitor.java | 2 +- ...ssetAdministrationShellElementVisitor.java | 2 +- ...ministrationShellElementWalkerVisitor.java | 2 +- .../core/visitor/IdentifiableCollector.java | 69 ++++++ .../DataSpecificationDeserializer.java | 2 +- .../EmbeddedDataSpecificationSerializer.java | 4 +- 66 files changed, 1416 insertions(+), 913 deletions(-) delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/Aas2AmlConfig.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/Aml2AasConfig.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlDeserializationConfig.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlSerializationConfig.java rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/{ => aas2aml}/AmlGenerator.java (57%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/{mapper => }/DefaultCollectionMapper.java (78%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/{mapper => }/DefaultMapper.java (71%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/{mapper/Aas2AmlElementMapper.java => Mapper.java} (69%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/{Aas2AmlMappingContext.java => MappingContext.java} (53%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/{mapper => custom}/AssetAdministrationShellEnvironmentMapper.java (79%) create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/AssetAdministrationShellMapper.java rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/{mapper => custom}/ConstraintCollectionMapper.java (71%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/{mapper => custom}/DataSpecificationContentMapper.java (72%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/{mapper => custom}/DataSpecificationIEC61360Mapper.java (81%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/{mapper => custom}/DataSpecificationMapper.java (84%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/{mapper => custom}/EmbeddedDataSpecificationCollectionMapper.java (72%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/{mapper => custom}/FileMapper.java (86%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/{mapper => custom}/LangStringCollectionMapper.java (81%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/{mapper => custom}/OperationVariableCollectionMapper.java (78%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/{mapper => custom}/OperationVariableMapper.java (76%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/{mapper => custom}/QualifierMapper.java (69%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/{mapper => custom}/ReferenceCollectionMapper.java (71%) create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/ReferenceElementMapper.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/RelationshipElementMapper.java rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/{mapper => custom}/SubmodelMapper.java (78%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/{mapper => custom}/ViewMapper.java (66%) delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/ReferenceElementMapper.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/ReferenceMapper.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/RelationshipElementMapper.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/ToAttributeMapper.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/Aml2AasMappingContext.java delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/Aml2AasObjectMapper.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/Mapper.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/MappingContext.java rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/{ => custom}/AssetAdministrationShellEnvironmentMapper.java (64%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/header/{WriterHeader.java => WriterInfo.java} (88%) create mode 100644 dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/DataSpecificationInfo.java rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util/AASUtils.java => dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/util/AasUtils.java (55%) rename {dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util => dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/visitor}/AbstractReferableVisitor.java (94%) rename {dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util => dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/visitor}/AbstractVisitor.java (94%) rename {dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util => dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/visitor}/AssetAdministrationShellElementVisitor.java (96%) rename {dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util => dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/visitor}/AssetAdministrationShellElementWalkerVisitor.java (97%) create mode 100644 dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/visitor/IdentifiableCollector.java diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/Aas2AmlConfig.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/Aas2AmlConfig.java deleted file mode 100644 index d00196b3..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/Aas2AmlConfig.java +++ /dev/null @@ -1,83 +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 io.adminshell.aas.v3.dataformat.aml; - -import io.adminshell.aas.v3.dataformat.aml.id.UuidGenerator; -import io.adminshell.aas.v3.dataformat.aml.id.IdGenerator; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -public class Aas2AmlConfig { - - private final boolean includeLibraries; - private final IdGenerator idGenerator; - private final List additionalInformation; - public static final Aas2AmlConfig DEFAULT = new Builder().build(); - - public static Builder builder() { - return new Builder(); - } - - private Aas2AmlConfig(boolean includeLibraries, IdGenerator idGenerator, List additionalInformation) { - this.includeLibraries = includeLibraries; - this.idGenerator = idGenerator; - this.additionalInformation = additionalInformation; - } - - public boolean isIncludeLibraries() { - return includeLibraries; - } - - public IdGenerator getIdGenerator() { - return idGenerator; - } - - public List getAdditionalInformation() { - return additionalInformation; - } - - public static class Builder { - - private boolean includeLibraries = true; - private IdGenerator idGenerator = new UuidGenerator(); - private List additionalInformation = new ArrayList<>(); - - public Aas2AmlConfig build() { - return new Aas2AmlConfig(includeLibraries, idGenerator, additionalInformation); - } - - public Builder includeLibraries() { - this.includeLibraries = true; - return this; - } - - public Builder excludeLibraries() { - this.includeLibraries = true; - return this; - } - - public Builder idGenerator(IdGenerator idGenerator) { - this.idGenerator = idGenerator; - return this; - } - - public Builder additionalInformation(Object... values) { - this.additionalInformation.addAll(Arrays.asList(values)); - return this; - } - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/Aml2AasConfig.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/Aml2AasConfig.java deleted file mode 100644 index 4c98888e..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/Aml2AasConfig.java +++ /dev/null @@ -1,5 +0,0 @@ -package io.adminshell.aas.v3.dataformat.aml; - -public class Aml2AasConfig { - -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlDeserializationConfig.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlDeserializationConfig.java new file mode 100644 index 00000000..6211703b --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlDeserializationConfig.java @@ -0,0 +1,20 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml; + +public class AmlDeserializationConfig { + +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlDeserializer.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlDeserializer.java index c392a773..55e72177 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlDeserializer.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlDeserializer.java @@ -17,7 +17,7 @@ import io.adminshell.aas.v3.dataformat.DeserializationException; import io.adminshell.aas.v3.dataformat.Deserializer; -import io.adminshell.aas.v3.dataformat.aml.aml2aas.Aml2AasObjectMapper; +import io.adminshell.aas.v3.dataformat.aml.aml2aas.Aml2AasMapper; import io.adminshell.aas.v3.dataformat.aml.model.caex.CAEXFile; import io.adminshell.aas.v3.dataformat.mapping.MappingException; import io.adminshell.aas.v3.model.AssetAdministrationShellEnvironment; @@ -38,7 +38,7 @@ public AssetAdministrationShellEnvironment read(String value) throws Deserializa Unmarshaller unmarshaller = JAXBContextFactory.createContext(new Class[]{CAEXFile.class}, null).createUnmarshaller(); StringReader reader = new StringReader(value); CAEXFile aml = (CAEXFile) unmarshaller.unmarshal(reader); - Aml2AasObjectMapper mapper = new Aml2AasObjectMapper(new Aml2AasConfig()); + Aml2AasMapper mapper = new Aml2AasMapper(new AmlDeserializationConfig()); return mapper.map(aml); } catch (JAXBException ex) { throw new DeserializationException("error deserializing AssetAdministrationShellEnvironment", ex); diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlDocumentInfo.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlDocumentInfo.java index ba181849..d91cf891 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlDocumentInfo.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlDocumentInfo.java @@ -1,3 +1,18 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml; public class AmlDocumentInfo { diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlSerializationConfig.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlSerializationConfig.java new file mode 100644 index 00000000..5fcacbb3 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlSerializationConfig.java @@ -0,0 +1,150 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml; + +import io.adminshell.aas.v3.dataformat.aml.header.WriterInfo; +import io.adminshell.aas.v3.dataformat.aml.id.UuidGenerator; +import io.adminshell.aas.v3.dataformat.aml.id.IdGenerator; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +public class AmlSerializationConfig { + + public static final String DEFAULT_SCHEMA_VERSION = "2.15"; + public static final String DEFAULT_AML_VERSION = "2.0"; + public static final String DEFAULT_FILENAME = "AssetAdministrationShellEnvironment.aml"; + public static final AmlSerializationConfig DEFAULT = new Builder().build(); + + public static Builder builder() { + return new Builder(); + } + + private final IdGenerator idGenerator; + private final String schemaVersion; + private final String amlVersion; + private final String filename; + private final boolean includeLibraries; + private final WriterInfo writerInfo; + private final List additionalInformation; + + private AmlSerializationConfig( + IdGenerator idGenerator, + String schemaVersion, + String amlVersion, + String filename, + boolean includeLibraries, + WriterInfo writerInfo, + List additionalInformation) { + this.idGenerator = idGenerator; + this.schemaVersion = schemaVersion; + this.amlVersion = amlVersion; + this.filename = filename; + this.includeLibraries = includeLibraries; + this.writerInfo = writerInfo; + this.additionalInformation = additionalInformation; + } + + public boolean isIncludeLibraries() { + return includeLibraries; + } + + public IdGenerator getIdGenerator() { + return idGenerator; + } + + public List getAdditionalInformation() { + return additionalInformation; + } + + public String getSchemaVersion() { + return schemaVersion; + } + + public String getAmlVersion() { + return amlVersion; + } + + public WriterInfo getWriterInfo() { + return writerInfo; + } + + public static class Builder { + + private IdGenerator idGenerator = new UuidGenerator(); + private String schemaVersion = DEFAULT_SCHEMA_VERSION; + private String amlVersion = DEFAULT_AML_VERSION; + private String filename = DEFAULT_FILENAME; + private boolean includeLibraries = true; + private WriterInfo writerInfo = null; + private List additionalInformation = new ArrayList<>(); + + public AmlSerializationConfig build() { + return new AmlSerializationConfig( + idGenerator, + schemaVersion, + amlVersion, + filename, + includeLibraries, + writerInfo, + additionalInformation); + } + + public Builder includeLibraries() { + this.includeLibraries = true; + return this; + } + + public Builder excludeLibraries() { + this.includeLibraries = true; + return this; + } + + public Builder idGenerator(IdGenerator idGenerator) { + this.idGenerator = idGenerator; + return this; + } + + public Builder schemaVersion(String value) { + this.schemaVersion = value; + return this; + } + + public Builder amlVersion(String value) { + this.amlVersion = value; + return this; + } + + public Builder filename(String value) { + this.filename = value; + return this; + } + + public Builder writerInfo(WriterInfo value) { + this.writerInfo = value; + return this; + } + + public Builder additionalInformation(Object... values) { + this.additionalInformation.addAll(Arrays.asList(values)); + return this; + } + } + + public String getFilename() { + return filename; + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlSerializer.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlSerializer.java index 44be3eed..58cbf9cc 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlSerializer.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlSerializer.java @@ -19,7 +19,7 @@ import io.adminshell.aas.v3.dataformat.SerializationException; import io.adminshell.aas.v3.dataformat.Serializer; import io.adminshell.aas.v3.dataformat.aml.header.AutomationMLVersion; -import io.adminshell.aas.v3.dataformat.aml.header.WriterHeader; +import io.adminshell.aas.v3.dataformat.aml.header.WriterInfo; import io.adminshell.aas.v3.dataformat.aml.model.caex.CAEXFile; import io.adminshell.aas.v3.dataformat.mapping.MappingException; import io.adminshell.aas.v3.model.AssetAdministrationShellEnvironment; @@ -42,23 +42,21 @@ public AmlSerializer() { @Override public String write(AssetAdministrationShellEnvironment aasEnvironment) throws SerializationException { - return write(aasEnvironment, Aas2AmlConfig.DEFAULT); + return write(aasEnvironment, AmlSerializationConfig.DEFAULT); } - public String write(AssetAdministrationShellEnvironment aasEnvironment, Aas2AmlConfig config) throws SerializationException { - AasToAmlMapper mapper = new AasToAmlMapper(config); + public String write(AssetAdministrationShellEnvironment aasEnvironment, AmlSerializationConfig config) throws SerializationException { try { - CAEXFile aml = mapper.map(aasEnvironment); + CAEXFile aml = new AasToAmlMapper().map(aasEnvironment, config); if (config.isIncludeLibraries()) { aml = addAASLibrary(aml); } - Marshaller marshaller = JAXBContextFactory.createContext( - new Class[]{ - CAEXFile.class, - AutomationMLVersion.class, - WriterHeader.class, - WriterHeader.Wrapper.class - }, + Marshaller marshaller = JAXBContextFactory.createContext(new Class[]{ + CAEXFile.class, + AutomationMLVersion.class, + WriterInfo.class, + WriterInfo.Wrapper.class + }, null).createMarshaller(); marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); StringWriter writer = new StringWriter(); diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/AasToAmlMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/AasToAmlMapper.java index 61b90756..dfc72a56 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/AasToAmlMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/AasToAmlMapper.java @@ -15,31 +15,28 @@ */ package io.adminshell.aas.v3.dataformat.aml.aas2aml; -import io.adminshell.aas.v3.dataformat.aml.Aas2AmlConfig; -import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; +import io.adminshell.aas.v3.dataformat.aml.AmlSerializationConfig; import io.adminshell.aas.v3.dataformat.aml.naming.PropertyNamingStrategy; import io.adminshell.aas.v3.dataformat.aml.naming.AbstractClassNamingStrategy; import io.adminshell.aas.v3.dataformat.aml.naming.NumberingClassNamingStrategy; import io.adminshell.aas.v3.dataformat.aml.header.AutomationMLVersion; -import io.adminshell.aas.v3.dataformat.aml.header.WriterHeader; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper.AssetAdministrationShellEnvironmentMapper; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper.ConstraintCollectionMapper; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper.DataSpecificationContentMapper; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper.DataSpecificationIEC61360Mapper; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper.DefaultCollectionMapper; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper.DefaultMapper; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper.EmbeddedDataSpecificationCollectionMapper; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper.FileMapper; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper.LangStringCollectionMapper; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper.OperationVariableCollectionMapper; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper.OperationVariableMapper; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper.QualifierMapper; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper.ReferenceCollectionMapper; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper.ReferenceElementMapper; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper.ReferenceMapper; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper.RelationshipElementMapper; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper.SubmodelMapper; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper.ViewMapper; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.custom.AssetAdministrationShellEnvironmentMapper; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.custom.AssetAdministrationShellMapper; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.custom.ConstraintCollectionMapper; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.custom.DataSpecificationContentMapper; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.custom.DataSpecificationIEC61360Mapper; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.custom.EmbeddedDataSpecificationCollectionMapper; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.custom.FileMapper; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.custom.LangStringCollectionMapper; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.custom.OperationVariableCollectionMapper; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.custom.OperationVariableMapper; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.custom.QualifierMapper; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.custom.ReferenceCollectionMapper; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.custom.ReferenceElementMapper; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.custom.RelationshipElementMapper; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.custom.SubmodelMapper; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.custom.ViewMapper; +import io.adminshell.aas.v3.dataformat.aml.id.IntegerIdGenerator; import io.adminshell.aas.v3.dataformat.aml.model.caex.CAEXFile; import io.adminshell.aas.v3.dataformat.mapping.MappingException; import io.adminshell.aas.v3.dataformat.mapping.MappingProvider; @@ -53,23 +50,11 @@ public class AasToAmlMapper { - public static final String DEFAULT_SCHEMA_VERSION = "2.15"; - public static final String DEFAULT_AML_VERSION = "2.0"; - public static final String DEFAULT_FILENAME = "AssetAdministrationShellEnvironment.aml"; private static final org.slf4j.Logger log = LoggerFactory.getLogger(AasToAmlMapper.class); private static final String DEFAULT_LANGUAGE = "EN"; - private final Aas2AmlConfig config; private CAEXFile result; - public AasToAmlMapper(Aas2AmlConfig config) { - this.config = config; - } - - public CAEXFile map(AssetAdministrationShellEnvironment env) throws MappingException { - return map(env, DEFAULT_SCHEMA_VERSION, DEFAULT_FILENAME); - } - - public CAEXFile map(AssetAdministrationShellEnvironment env, String schemaVersion, String filename) throws MappingException { + public CAEXFile map(AssetAdministrationShellEnvironment env, AmlSerializationConfig config) throws MappingException { AbstractClassNamingStrategy classNamingStrategy = new NumberingClassNamingStrategy(); classNamingStrategy.registerCustomNaming(LangString.class, x -> "aml-lang=" + x.getLanguage()); PropertyNamingStrategy propertyNamingStrategy = new PropertyNamingStrategy(); @@ -83,7 +68,8 @@ public CAEXFile map(AssetAdministrationShellEnvironment env, String schemaVersio mappingProvider.register(new AssetAdministrationShellEnvironmentMapper()); mappingProvider.register(new LangStringCollectionMapper()); - mappingProvider.register(new ReferenceMapper()); +// mappingProvider.register(new ReferenceMapper()); + mappingProvider.register(new AssetAdministrationShellMapper()); mappingProvider.register(new OperationVariableMapper()); mappingProvider.register(new OperationVariableCollectionMapper()); mappingProvider.register(new ReferenceCollectionMapper()); @@ -108,24 +94,25 @@ public CAEXFile map(AssetAdministrationShellEnvironment env, String schemaVersio // NOTE // This has implications on ID generator and requires additional lookup table // for Referable --> AML ID of ExternalInterface - Aas2AmlMappingContext context = new Aas2AmlMappingContext( + MappingContext context = new MappingContext( mappingProvider, - config.getIdGenerator(), classNamingStrategy, propertyNamingStrategy, env); - WriterHeader writerHeader = new WriterHeader(); - writerHeader.setName("foo"); - writerHeader.setId("bar"); CAEXFile.Builder builder = CAEXFile.builder() - .withSchemaVersion(schemaVersion) - .withFileName(filename) - .addAdditionalInformation(new AutomationMLVersion("2.0")) - .addAdditionalInformation(writerHeader.wrap()); - AmlGenerator generator = AmlGenerator.builder() + .withSchemaVersion(config.getSchemaVersion()) + .withFileName(config.getFilename()) + .addAdditionalInformation(new AutomationMLVersion(config.getAmlVersion())); + if (config.getWriterInfo() != null) { + builder = builder.addAdditionalInformation(config.getWriterInfo().wrap()); + } + if (!config.getAdditionalInformation().isEmpty()) { + builder = builder.addAdditionalInformation(config.getAdditionalInformation()); + } + context.map(env, AmlGenerator.builder() .file(builder) - .build(); - context.map(env, generator); + .idGenerator(config.getIdGenerator()) + .build()); return builder.build(); } } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlGenerator.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/AmlGenerator.java similarity index 57% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlGenerator.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/AmlGenerator.java index d4ae2bc2..e7a63bcf 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlGenerator.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/AmlGenerator.java @@ -13,46 +13,53 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml; +package io.adminshell.aas.v3.dataformat.aml.aas2aml; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.Aas2AmlMappingContext; +import io.adminshell.aas.v3.dataformat.aml.AmlDocumentInfo; +import io.adminshell.aas.v3.dataformat.aml.id.IdGenerator; +import io.adminshell.aas.v3.dataformat.aml.id.UuidGenerator; import io.adminshell.aas.v3.dataformat.aml.model.caex.AttributeType; import io.adminshell.aas.v3.dataformat.aml.model.caex.CAEXFile; import io.adminshell.aas.v3.dataformat.aml.model.caex.CAEXObject; import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; import io.adminshell.aas.v3.dataformat.aml.model.caex.RoleClassType; import io.adminshell.aas.v3.dataformat.aml.model.caex.SystemUnitClassType; -import io.adminshell.aas.v3.dataformat.aml.util.AASUtils; -import io.adminshell.aas.v3.model.Identifiable; -import io.adminshell.aas.v3.model.KeyType; +import io.adminshell.aas.v3.dataformat.core.util.AasUtils; import io.adminshell.aas.v3.model.Referable; import io.adminshell.aas.v3.model.Reference; -import io.adminshell.aas.v3.model.impl.DefaultKey; import io.adminshell.aas.v3.model.impl.DefaultReference; import java.beans.PropertyDescriptor; -import java.util.Arrays; +import java.util.HashMap; import java.util.List; -import java.util.stream.Collectors; +import java.util.Map; +import java.util.Optional; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class AmlGenerator { private static final Logger log = LoggerFactory.getLogger(AmlGenerator.class); - private static final String DEFAULT_REF_SEMANTIC_PREFIX = "AAS:"; + public static final String REFERABLE_REFERENCE_INTERFACE_CLASS = "ReferableReference"; + private static final String DEFAULT_REF_SEMANTIC_PREFIX = "AAS"; private final String refSemanticPrefix; - private CAEXObject.Builder current; - private CAEXFile.Builder fileBuilder; + private final CAEXObject.Builder current; private final AmlDocumentInfo documentInfo; private final Reference reference; + private final IdGenerator idGenerator; + private final Map idCache; + private CAEXFile.Builder fileBuilder; private AmlGenerator( AmlDocumentInfo documentInfo, + IdGenerator idGenerator, + Map idCache, String refSemanticPrefix, CAEXFile.Builder fileBuilder, CAEXObject.Builder current, Reference reference) { this.documentInfo = documentInfo; + this.idGenerator = idGenerator; + this.idCache = idCache; this.refSemanticPrefix = refSemanticPrefix; this.fileBuilder = fileBuilder; this.current = current; @@ -60,16 +67,35 @@ private AmlGenerator( } public AmlGenerator with(CAEXObject.Builder current) { - return new AmlGenerator(documentInfo, refSemanticPrefix, fileBuilder, current, reference); + return new AmlGenerator(documentInfo, + idGenerator, + idCache, + refSemanticPrefix, + fileBuilder, + current, + reference); } public AmlGenerator with(Referable parent) { return new AmlGenerator( documentInfo, + idGenerator, + idCache, refSemanticPrefix, fileBuilder, current, - AASUtils.asReference(reference, parent)); + AasUtils.asReference(reference, parent)); + } + + public AmlGenerator withRefSemanticPrefix(String value) { + return new AmlGenerator( + documentInfo, + idGenerator, + idCache, + value, + fileBuilder, + current, + reference); } public void addAdditionalInformation(List additionalInformation) { @@ -86,9 +112,16 @@ public static class Builder { private CAEXObject.Builder current; private CAEXFile.Builder fileBuilder = CAEXFile.builder(); private AmlDocumentInfo documentInfo = new AmlDocumentInfo(); + private IdGenerator idGenerator = new UuidGenerator(); public AmlGenerator build() { - return new AmlGenerator(documentInfo, refSemanticPrefix, fileBuilder, current, new DefaultReference.Builder().build()); + return new AmlGenerator(documentInfo, + idGenerator, + new HashMap<>(), + refSemanticPrefix, + fileBuilder, + current, + new DefaultReference.Builder().build()); } public Builder refSemanticPrefix(String value) { @@ -101,6 +134,11 @@ public Builder current(CAEXObject.Builder value) { return this; } + public Builder idGenerator(IdGenerator value) { + this.idGenerator = value; + return this; + } + public Builder file(CAEXFile.Builder value) { this.fileBuilder = value; return this; @@ -112,6 +150,33 @@ public Builder documentInfo(AmlDocumentInfo value) { } } + public String newId() { + return idGenerator.next(); + } + + public String getId(Object obj) { + if (obj == null) { + return idGenerator.next(); + } + Reference key; + if (Reference.class.isAssignableFrom(obj.getClass())) { + key = (Reference) obj; + } else if (Referable.class.isAssignableFrom(obj.getClass())) { + key = AasUtils.asReference(reference, (Referable) obj); + } else { + return idGenerator.next(); + } + Optional cacheKey = idCache.keySet().stream() + .filter(x -> AasUtils.sameAs(x, key)) + .findFirst(); + if (cacheKey.isPresent()) { + return idCache.get(cacheKey.get()); + } + String result = idGenerator.next(); + idCache.put(key, result); + return result; + } + public void add(CAEXObject caexObject) { if (caexObject == null) { return; @@ -140,30 +205,63 @@ public void addAttribute(AttributeType attribute) { } } - public void addInternalLink(SystemUnitClassType.InternalLink internalLink) { - if (internalLink == null) { + private void addExternalInterface(RoleClassType.ExternalInterface externalInterface, boolean allowDuplicate) { + if (externalInterface == null) { return; } if (InternalElementType.Builder.class.isAssignableFrom(current.getClass())) { InternalElementType.Builder builder = (InternalElementType.Builder) current; - builder.addInternalLink(internalLink); + if (!builder.build().getExternalInterface().stream() + .anyMatch(x -> x.getName().equals(externalInterface.getName()) + && x.getRefBaseClassPath().equals(externalInterface.getRefBaseClassPath()))) { + builder.addExternalInterface(externalInterface); + } } else { - log.warn("adding internal link failed because no parent builder defined"); + log.warn("adding external interface failed because no parent builder defined"); } } - public void addExternalInterface(RoleClassType.ExternalInterface externalInterface) { - if (externalInterface == null) { - return; - } + public void addExternalInterfaceForReference(MappingContext context) { + addExternalInterface(RoleClassType.ExternalInterface.builder() + .withID(newId()) + .withName(REFERABLE_REFERENCE_INTERFACE_CLASS) + .withRefBaseClassPath(documentInfo.getAssetAdministrationShellInterfaceClassLib() + "/" + REFERABLE_REFERENCE_INTERFACE_CLASS) + .build(), false); + } + + public void addInternalLink(String name, Referable source, Reference target) { if (InternalElementType.Builder.class.isAssignableFrom(current.getClass())) { InternalElementType.Builder builder = (InternalElementType.Builder) current; - builder.addExternalInterface(externalInterface); + builder.addInternalLink((SystemUnitClassType.InternalLink.builder() + .withName(name) + .withID(newId()) + .withRefPartnerSideA(getId(source) + ":" + REFERABLE_REFERENCE_INTERFACE_CLASS) + .withRefPartnerSideB(getId(target) + ":" + REFERABLE_REFERENCE_INTERFACE_CLASS) + .build())); } else { - log.warn("adding external interface failed because no parent builder defined"); + log.warn("adding internal link failed because no parent builder defined"); } } + public void addExternalInterfaceForUnresolvableReference(Reference reference, MappingContext context) { + addExternalInterface(RoleClassType.ExternalInterface.builder() + .withID(idGenerator.next()) + .withName(REFERABLE_REFERENCE_INTERFACE_CLASS) + .withRefBaseClassPath(documentInfo.getAssetAdministrationShellInterfaceClassLib() + "/" + REFERABLE_REFERENCE_INTERFACE_CLASS) + .addAttribute(AttributeType.builder() + .withName("value") + .withID(newId()) + .withAttributeDataType("xs:string") + .withValue(AasUtils.asString(reference)) + .build()) + .build(), + false); + } + + public void clearIdCache() { + idCache.clear(); + } + public void addSystemUnitClassLib(CAEXFile.SystemUnitClassLib systemUnitClassLib) { if (systemUnitClassLib == null) { return; @@ -182,36 +280,50 @@ public void addInstanceHierarchy(CAEXFile.InstanceHierarchy instanceHierarchy) { } } - public void addInternalElement(InternalElementType internalElement) { - if (internalElement == null) { + public void addInternalElement(InternalElementType internalElement, Object source) { + addInternalElement(InternalElementType + .copyOf(internalElement) + .withID(getId(source)) + .build()); + } + + public void addInternalElement(InternalElementType element) { + if (element == null) { return; } + InternalElementType value = element; + if (value.getID() == null || value.getID().isBlank()) { + value = InternalElementType + .copyOf(element) + .withID(idGenerator.next()) + .build(); + } if (InternalElementType.Builder.class.isAssignableFrom(current.getClass())) { InternalElementType.Builder builder = (InternalElementType.Builder) current; - builder.addInternalElement(internalElement); + builder.addInternalElement(value); } else if (CAEXFile.InstanceHierarchy.Builder.class.isAssignableFrom(current.getClass())) { CAEXFile.InstanceHierarchy.Builder builder = (CAEXFile.InstanceHierarchy.Builder) current; - builder.addInternalElement(internalElement); + builder.addInternalElement(value); } else { log.warn("adding internalElement failed because no parent builder defined"); } } - public void appendReferenceTargetInterfaceIfRequired(Object obj, Aas2AmlMappingContext context) { + public void appendReferenceTargetInterfaceIfRequired(Object obj, MappingContext context) { RoleClassType.ExternalInterface referenceTargetInterface = getReferenceTargetInterface(obj, context); if (referenceTargetInterface != null) { - addExternalInterface(referenceTargetInterface); + addExternalInterface(referenceTargetInterface, false); } } - public RoleClassType.ExternalInterface getReferenceTargetInterface(Object obj, Aas2AmlMappingContext context) { + public RoleClassType.ExternalInterface getReferenceTargetInterface(Object obj, MappingContext context) { RoleClassType.ExternalInterface result = null; if (obj != null && Referable.class.isAssignableFrom(obj.getClass())) { Referable referable = (Referable) obj; - Reference targetRef = AASUtils.asReference(reference, referable); + Reference targetRef = AasUtils.asReference(reference, referable); if (context.isTargetOfInternalLink(targetRef)) { result = RoleClassType.ExternalInterface.builder() - .withID(context.newId()) + .withID(newId()) .withName("ReferableReference") .withRefBaseClassPath(documentInfo.getAssetAdministrationShellInterfaceClassLib() + "/ReferableReference") .build(); @@ -228,7 +340,7 @@ public InternalElementType.RoleRequirements roleRequirement(String value) { public AttributeType.RefSemantic refSemantic(Class type, String propertyName) { return AttributeType.RefSemantic.builder() - .withCorrespondingAttributePath(refSemanticPrefix + type.getSimpleName() + "/" + propertyName) + .withCorrespondingAttributePath(refSemanticPrefix + (refSemanticPrefix.isBlank() ? "" : ":") + type.getSimpleName() + "/" + propertyName) .build(); } @@ -236,7 +348,7 @@ public AttributeType.RefSemantic refSemantic(PropertyDescriptor property) { return refSemantic(property.getReadMethod().getDeclaringClass(), property.getName()); } - public String refBaseSystemUnitPath(Object value, Aas2AmlMappingContext context) { + public String refBaseSystemUnitPath(Object value, MappingContext context) { return documentInfo.getAssetAdministrationShellSystemUnitClassLib() + "/" + context.getInternalElementNamingStrategy().getName( value.getClass(), diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/DefaultCollectionMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/DefaultCollectionMapper.java similarity index 78% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/DefaultCollectionMapper.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/DefaultCollectionMapper.java index fe921c64..76f7144f 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/DefaultCollectionMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/DefaultCollectionMapper.java @@ -13,10 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper; +package io.adminshell.aas.v3.dataformat.aml.aas2aml; -import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.Aas2AmlMappingContext; import io.adminshell.aas.v3.dataformat.aml.model.caex.AttributeType; import io.adminshell.aas.v3.dataformat.core.ReflectionHelper; import io.adminshell.aas.v3.dataformat.mapping.MappingException; @@ -26,7 +24,7 @@ public class DefaultCollectionMapper extends DefaultMapper> { @Override - protected Class getType(Collection collection, Aas2AmlMappingContext context) { + protected Class getType(Collection collection, MappingContext context) { if (context.getProperty() != null) { return (Class) ((ParameterizedType) context.getProperty().getReadMethod().getGenericReturnType()).getActualTypeArguments()[0]; } @@ -37,18 +35,18 @@ protected Class getType(Collection collection, Aas2AmlMappingContext conte } @Override - protected void asInternalElement(Collection collection, AmlGenerator generator, Aas2AmlMappingContext context) throws MappingException { + protected void asInternalElement(Collection collection, AmlGenerator generator, MappingContext context) throws MappingException { for (T element : collection) { context.withoutProperty().map(element, generator); } } @Override - protected void mapProperties(Collection collection, AmlGenerator generator, Aas2AmlMappingContext context) throws MappingException { + protected void mapProperties(Collection collection, AmlGenerator generator, MappingContext context) throws MappingException { } @Override - protected void asAttribute(Collection collection, AmlGenerator generator, Aas2AmlMappingContext context) throws MappingException { + protected void asAttribute(Collection collection, AmlGenerator generator, MappingContext context) throws MappingException { if (collection != null && !collection.isEmpty()) { AttributeType.Builder builder = super.toAttribute(collection, generator, context); for (T element : collection) { diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/DefaultMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/DefaultMapper.java similarity index 71% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/DefaultMapper.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/DefaultMapper.java index 9115896f..bb8f7be7 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/DefaultMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/DefaultMapper.java @@ -13,29 +13,37 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper; +package io.adminshell.aas.v3.dataformat.aml.aas2aml; -import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.Aas2AmlMappingContext; import io.adminshell.aas.v3.dataformat.aml.model.caex.AttributeType; -import io.adminshell.aas.v3.dataformat.aml.model.caex.CAEXObject; import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; -import io.adminshell.aas.v3.dataformat.aml.util.AASUtils; import io.adminshell.aas.v3.dataformat.core.ReflectionHelper; import io.adminshell.aas.v3.dataformat.mapping.MappingException; import io.adminshell.aas.v3.dataformat.mapping.util.TypeUtils; import io.adminshell.aas.v3.model.Referable; import java.beans.PropertyDescriptor; import java.lang.reflect.InvocationTargetException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; -public class DefaultMapper implements Aas2AmlElementMapper { +public class DefaultMapper implements Mapper { - protected Class getType(T value, Aas2AmlMappingContext context) { + private final Set ignoredProperties = new HashSet<>(); + + public DefaultMapper() { + } + + public DefaultMapper(String... ignoredProperties) { + this.ignoredProperties.addAll(Arrays.asList(ignoredProperties)); + } + + protected Class getType(T value, MappingContext context) { return value.getClass(); } @Override - public void map(T value, AmlGenerator generator, Aas2AmlMappingContext context) throws MappingException { + public void map(T value, AmlGenerator generator, MappingContext context) throws MappingException { if (value == null || context == null) { return; } @@ -51,25 +59,24 @@ public void map(T value, AmlGenerator generator, Aas2AmlMappingContext context) } } - protected void asInternalElement(T value, AmlGenerator generator, Aas2AmlMappingContext context) throws MappingException { - CAEXObject.Builder builder = toInternalElement(value, generator, context); + protected void asInternalElement(T value, AmlGenerator generator, MappingContext context) throws MappingException { + InternalElementType.Builder builder = toInternalElement(value, generator, context); if (builder != null) { generator.with(builder).appendReferenceTargetInterfaceIfRequired(value, context); - generator.add(builder.build()); + generator.addInternalElement(builder.build(), value); } } - protected void asAttribute(T value, AmlGenerator generator, Aas2AmlMappingContext context) throws MappingException { + protected void asAttribute(T value, AmlGenerator generator, MappingContext context) throws MappingException { AttributeType.Builder builder = toAttribute(value, generator, context); if (builder != null) { generator.add(builder.build()); } } - protected InternalElementType.Builder toInternalElement(T value, AmlGenerator generator, Aas2AmlMappingContext context) throws MappingException { + protected InternalElementType.Builder toInternalElement(T value, AmlGenerator generator, MappingContext context) throws MappingException { InternalElementType.Builder builder = InternalElementType.builder(); builder = builder - .withID(getId(value, generator, context)) .withName(getInternalElementName(value, context)) .withRoleRequirements(getRoleRequirementClass(value, generator, context)); AmlGenerator subGenerator = generator; @@ -80,36 +87,35 @@ protected InternalElementType.Builder toInternalElement(T value, AmlGenerator ge return builder; } - protected InternalElementType.RoleRequirements getRoleRequirementClass(T value, AmlGenerator generator, Aas2AmlMappingContext context) { + protected InternalElementType.RoleRequirements getRoleRequirementClass(T value, AmlGenerator generator, MappingContext context) { return generator.roleRequirement(ReflectionHelper.getModelType(value.getClass())); } - protected AttributeType.RefSemantic getRefSemantic(T value, AmlGenerator generator, Aas2AmlMappingContext context) { + protected AttributeType.RefSemantic getRefSemantic(T value, AmlGenerator generator, MappingContext context) { return generator.refSemantic(context.getProperty()); } - protected String getInternalElementName(Object value, Aas2AmlMappingContext context) { + protected String getInternalElementName(Object value, MappingContext context) { return context.getInternalElementNamingStrategy().getName( value.getClass(), value, null); } - protected String getId(T value, AmlGenerator generator, Aas2AmlMappingContext context) { - if (value != null && Referable.class.isAssignableFrom(value.getClass())) { - return context.getId(AASUtils.asReference(generator.getReference(), (Referable) value)); - } - return context.getId(null); - } - - protected String getAttributeName(T value, Aas2AmlMappingContext context) { +// protected String getId(T value, AmlGenerator generator, MappingContext context) { +// if (value != null && Referable.class.isAssignableFrom(value.getClass())) { +// return context.getId(AasUtils.asReference(generator.getReference(), (Referable) value)); +// } +// return context.getId(null); +// } + protected String getAttributeName(T value, MappingContext context) { return context.getAttributeNamingStrategy().getName( context.getProperty().getReadMethod().getGenericReturnType(), value, context.getProperty().getName()); } - protected AttributeType.Builder toAttribute(T value, AmlGenerator generator, Aas2AmlMappingContext context) throws MappingException { + protected AttributeType.Builder toAttribute(T value, AmlGenerator generator, MappingContext context) throws MappingException { Class aasType = ReflectionHelper.getAasInterface(value.getClass()); AttributeType.Builder builder = AttributeType.builder(); if (context.getProperty() != null) { @@ -127,10 +133,10 @@ protected AttributeType.Builder toAttribute(T value, AmlGenerator generator, Aas } protected boolean skipProperty(PropertyDescriptor property) { - return false; + return ignoredProperties.contains(property.getName()); } - protected void mapProperties(T value, AmlGenerator generator, Aas2AmlMappingContext context) throws MappingException { + protected void mapProperties(T value, AmlGenerator generator, MappingContext context) throws MappingException { for (PropertyDescriptor property : TypeUtils.getAASProperties(value.getClass())) { if (!skipProperty(property)) { context.with(property) @@ -141,7 +147,7 @@ protected void mapProperties(T value, AmlGenerator generator, Aas2AmlMappingCont } } - protected Object getPropertyValue(T value, PropertyDescriptor property, Aas2AmlMappingContext context) throws MappingException { + protected Object getPropertyValue(T value, PropertyDescriptor property, MappingContext context) throws MappingException { try { return property.getReadMethod().invoke(value); } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException ex) { diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/IdentityProvider.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/IdentityProvider.java index 7af0b517..31bdecf1 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/IdentityProvider.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/IdentityProvider.java @@ -41,7 +41,7 @@ public String getCachedId(Object obj) { public String generateId() { String result = null; do { - result = idGenerator.generateId(); + result = idGenerator.next(); } while (cache.values().contains(result)); return result; } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/Aas2AmlElementMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/Mapper.java similarity index 69% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/Aas2AmlElementMapper.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/Mapper.java index 199b2fa2..9b64d5ff 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/Aas2AmlElementMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/Mapper.java @@ -13,12 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper; +package io.adminshell.aas.v3.dataformat.aml.aas2aml; -import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.Aas2AmlMappingContext; import io.adminshell.aas.v3.dataformat.mapping.SourceBasedMapper; -public interface Aas2AmlElementMapper extends SourceBasedMapper { +public interface Mapper extends SourceBasedMapper { } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/Aas2AmlMappingContext.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/MappingContext.java similarity index 53% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/Aas2AmlMappingContext.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/MappingContext.java index ea37e9fd..97405b31 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/Aas2AmlMappingContext.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/MappingContext.java @@ -15,55 +15,40 @@ */ package io.adminshell.aas.v3.dataformat.aml.aas2aml; -import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; -import io.adminshell.aas.v3.dataformat.aml.id.IdGenerator; import io.adminshell.aas.v3.dataformat.aml.naming.NamingStrategy; -import io.adminshell.aas.v3.dataformat.aml.util.AASUtils; -import io.adminshell.aas.v3.dataformat.aml.util.ReferencedByViewCollector; import io.adminshell.aas.v3.dataformat.aml.util.ReferencedReferableCollector; +import io.adminshell.aas.v3.dataformat.core.util.AasUtils; import io.adminshell.aas.v3.dataformat.mapping.MappingException; import io.adminshell.aas.v3.dataformat.mapping.MappingProvider; import io.adminshell.aas.v3.dataformat.mapping.SourceBasedMappingContext; import io.adminshell.aas.v3.model.AssetAdministrationShellEnvironment; -import io.adminshell.aas.v3.model.Referable; import java.beans.PropertyDescriptor; import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.Map; -import java.util.stream.Collectors; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import io.adminshell.aas.v3.model.Reference; -import java.util.Optional; import java.util.Set; -public class Aas2AmlMappingContext extends SourceBasedMappingContext { +public class MappingContext extends SourceBasedMappingContext { - private static final String EMPTY_STRING = ""; - private static final Logger log = LoggerFactory.getLogger(Aas2AmlMappingContext.class); - private final IdGenerator idGenerator; + private static final Logger log = LoggerFactory.getLogger(MappingContext.class); private final AssetAdministrationShellEnvironment environment; private final NamingStrategy internalElementNamingStrategy; private final NamingStrategy attributeNamingStrategy; - private final Map idCache; private final PropertyDescriptor property; private final Set referencedReferables; - public Aas2AmlMappingContext(MappingProvider mappingProvider, - IdGenerator idGenerator, + public MappingContext(MappingProvider mappingProvider, NamingStrategy internalElementNamingStrategy, NamingStrategy attributeNamingStrategy, AssetAdministrationShellEnvironment environment) { this(mappingProvider, - idGenerator, internalElementNamingStrategy, attributeNamingStrategy, environment, null, - null, null); - } public NamingStrategy getInternalElementNamingStrategy() { @@ -74,16 +59,13 @@ public NamingStrategy getAttributeNamingStrategy() { return attributeNamingStrategy; } - private Aas2AmlMappingContext(MappingProvider mappingProvider, - IdGenerator idGenerator, + private MappingContext(MappingProvider mappingProvider, NamingStrategy internalElementNamingStrategy, NamingStrategy attributeNamingStrategy, AssetAdministrationShellEnvironment environment, Set referencedReferables, - Map idCache, PropertyDescriptor property) { super(mappingProvider); - this.idGenerator = idGenerator; this.internalElementNamingStrategy = internalElementNamingStrategy; this.attributeNamingStrategy = attributeNamingStrategy; this.environment = environment; @@ -93,55 +75,10 @@ private Aas2AmlMappingContext(MappingProvider mappingProvider, } else { this.referencedReferables = referencedReferables; } - if (idCache == null) { - this.idCache = new HashMap<>(); - } else { - this.idCache = idCache; - } - } -// -// public String generateId() { -// return idGenerator.generateId(); -// } - - public String newId() { - return idGenerator.generateId(); } - public String getId(Reference reference) { - if (reference == null) { - return idGenerator.generateId(); - } - Optional cacheKey = findMatchingKey(reference); - if (cacheKey.isPresent()) { - return idCache.get(cacheKey.get()); - } - String result = idGenerator.generateId(); - idCache.put(reference, result); - return result; - } - - private Optional findMatchingKey(Reference reference) { - return idCache.keySet().stream() - .filter(x -> Reference.class.isAssignableFrom(x.getClass())) - .map(x -> (Reference) x) - .filter(x -> AASUtils.equals(x, reference)) - .findFirst(); - } - -// public String getCachedId(Object obj) { -// if (elementsReferencedByViews.containsKey(obj)) { -// return elementsReferencedByViews.get(obj); -// } -// if (idCache.containsKey(obj)) { -// return idCache.get(obj); -// } -// String result = idGenerator.generateId(); -// idCache.put(obj, result); -// return result; -// } public boolean isTargetOfInternalLink(Reference targetRef) { - return referencedReferables.stream().anyMatch(x -> AASUtils.equals(x, targetRef)); + return referencedReferables.stream().anyMatch(x -> AasUtils.sameAs(x, targetRef)); } public void map(T value, AmlGenerator generator) throws MappingException { @@ -152,42 +89,26 @@ public void map(Type type, T value, AmlGenerator generator) throws MappingEx mappingProvider.getMapper(type).map(value, generator, this); } - public Aas2AmlMappingContext with(PropertyDescriptor property) { - return new Aas2AmlMappingContext( + public MappingContext with(PropertyDescriptor property) { + return new MappingContext( getMappingProvider(), - idGenerator, internalElementNamingStrategy, attributeNamingStrategy, environment, referencedReferables, - idCache, property); } - public Aas2AmlMappingContext withoutProperty() { - return new Aas2AmlMappingContext( + public MappingContext withoutProperty() { + return new MappingContext( getMappingProvider(), - idGenerator, internalElementNamingStrategy, attributeNamingStrategy, environment, referencedReferables, - idCache, null); } - public Aas2AmlMappingContext withoutIdCache() { - return new Aas2AmlMappingContext( - getMappingProvider(), - idGenerator, - internalElementNamingStrategy, - attributeNamingStrategy, - environment, - referencedReferables, - null, - property); - } - public PropertyDescriptor getProperty() { return property; } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/AssetAdministrationShellEnvironmentMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/AssetAdministrationShellEnvironmentMapper.java similarity index 79% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/AssetAdministrationShellEnvironmentMapper.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/AssetAdministrationShellEnvironmentMapper.java index 83e2808b..04dd01fb 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/AssetAdministrationShellEnvironmentMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/AssetAdministrationShellEnvironmentMapper.java @@ -13,17 +13,18 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper; +package io.adminshell.aas.v3.dataformat.aml.aas2aml.custom; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.DefaultMapper; import com.google.inject.util.Types; -import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.Aas2AmlMappingContext; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.AmlGenerator; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.MappingContext; import io.adminshell.aas.v3.dataformat.aml.model.caex.CAEXFile; import io.adminshell.aas.v3.dataformat.aml.model.caex.CAEXFile.SystemUnitClassLib; import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; import io.adminshell.aas.v3.dataformat.aml.model.caex.SystemUnitClassType.SupportedRoleClass; import io.adminshell.aas.v3.dataformat.aml.model.caex.SystemUnitFamilyType; -import io.adminshell.aas.v3.dataformat.aml.util.AASUtils; +import io.adminshell.aas.v3.dataformat.core.util.AasUtils; import io.adminshell.aas.v3.dataformat.mapping.MappingException; import io.adminshell.aas.v3.model.AssetAdministrationShell; import io.adminshell.aas.v3.model.AssetAdministrationShellEnvironment; @@ -32,15 +33,19 @@ import io.adminshell.aas.v3.model.Submodel; import java.util.Collection; import java.util.List; +import java.util.Optional; import java.util.stream.Collectors; public class AssetAdministrationShellEnvironmentMapper extends DefaultMapper { @Override - public void map(AssetAdministrationShellEnvironment value, AmlGenerator generator, Aas2AmlMappingContext context) throws MappingException { + public void map(AssetAdministrationShellEnvironment value, AmlGenerator generator, MappingContext context) throws MappingException { List assetAdministrationShells = value.getAssetAdministrationShells().stream() .filter(x -> x.getSubmodels().stream() - .anyMatch(sm -> AASUtils.resolveSubmodelReference(sm, value).get().getKind() == ModelingKind.INSTANCE)) + .anyMatch(sm -> { + Optional submodel = AasUtils.resolveSubmodelReference(sm, value); + return submodel.isPresent() && submodel.get().getKind() == ModelingKind.INSTANCE; + })) .collect(Collectors.toList()); toHierarchy(generator.getDocumentInfo().getAssetAdministrationShellInstanceHierarchy(), AssetAdministrationShell.class, @@ -61,30 +66,33 @@ protected void toHierarchy( Class type, Collection value, AmlGenerator generator, - Aas2AmlMappingContext context) throws MappingException { + MappingContext context) throws MappingException { CAEXFile.InstanceHierarchy.Builder builder = CAEXFile.InstanceHierarchy.builder() .withName(hierarchyName); context.map(Types.newParameterizedType(Collection.class, type), value, generator.with(builder)); generator.addInstanceHierarchy(builder.build()); } - protected void mapTemplates(AssetAdministrationShellEnvironment env, AmlGenerator generator, Aas2AmlMappingContext context) throws MappingException { + protected void mapTemplates(AssetAdministrationShellEnvironment env, AmlGenerator generator, MappingContext context) throws MappingException { boolean empty = true; SystemUnitClassLib.Builder builder = SystemUnitClassLib.builder() .withName(generator.getDocumentInfo().getAssetAdministrationShellSystemUnitClassLib()); + // generate SystemUnitClass for each AAS with at least 1 Submodel with kind == TEMPLATE // generate SystemUnitClass for each Submodel with king == TEMPLATE for (AssetAdministrationShell aas : env.getAssetAdministrationShells()) { - List submodelTemplates = AASUtils.getSubmodelTemplates(aas, env); + List submodelTemplates = AasUtils.getSubmodelTemplates(aas, env); if (!submodelTemplates.isEmpty()) { empty = false; + generator.clearIdCache(); InternalElementType.Builder temp = InternalElementType.builder(); - context.withoutIdCache().withoutProperty().map(aas, generator.with(temp)); + context.withoutProperty().map(aas, generator.with(temp)); builder.addSystemUnitClass(internalElementToSystemUnitClass(temp.build().getInternalElement().get(0))); } + generator.clearIdCache(); for (Submodel submodel : submodelTemplates) { InternalElementType.Builder temp = InternalElementType.builder(); - context.withoutIdCache().withoutProperty().map(submodel, generator.with(temp)); + context.withoutProperty().map(submodel, generator.with(temp)); builder.addSystemUnitClass(internalElementToSystemUnitClass(temp.build().getInternalElement().get(0))); } } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/AssetAdministrationShellMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/AssetAdministrationShellMapper.java new file mode 100644 index 00000000..1a8621e1 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/AssetAdministrationShellMapper.java @@ -0,0 +1,61 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.aas2aml.custom; + +import io.adminshell.aas.v3.dataformat.aml.aas2aml.AmlGenerator; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.DefaultMapper; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.MappingContext; +import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; +import io.adminshell.aas.v3.dataformat.core.util.AasUtils; +import io.adminshell.aas.v3.dataformat.mapping.MappingException; +import io.adminshell.aas.v3.model.AssetAdministrationShell; +import io.adminshell.aas.v3.model.Reference; +import io.adminshell.aas.v3.model.Submodel; +import java.beans.PropertyDescriptor; +import java.util.Optional; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class AssetAdministrationShellMapper extends DefaultMapper { + + private static final Logger log = LoggerFactory.getLogger(AssetAdministrationShellMapper.class); + + @Override + protected boolean skipProperty(PropertyDescriptor property) { + return "submodels".equals(property.getName()); + } + + @Override + public void map(AssetAdministrationShell aas, AmlGenerator generator, MappingContext context) throws MappingException { + if (aas == null) { + return; + } + InternalElementType.Builder builder = toInternalElement(aas, generator, context); + for (Reference reference : aas.getSubmodels()) { + Optional resolvedSubmodel = AasUtils.resolveSubmodelReference(reference, context.getEnvironment()); + if (resolvedSubmodel.isPresent()) { + context.map(resolvedSubmodel.get(), generator.with(builder)); + } else { + log.warn("unresolvable submodel reference '{}' found in AssetAdministrationShell '{}'", + AasUtils.asString(reference), + aas.getIdentification().getIdentifier()); + context.map(AasUtils.asString(reference), generator); + } + } + generator.with(builder).appendReferenceTargetInterfaceIfRequired(aas, context); + generator.add(builder.build()); + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/ConstraintCollectionMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/ConstraintCollectionMapper.java similarity index 71% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/ConstraintCollectionMapper.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/ConstraintCollectionMapper.java index 897b9366..835ba875 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/ConstraintCollectionMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/ConstraintCollectionMapper.java @@ -13,18 +13,19 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper; +package io.adminshell.aas.v3.dataformat.aml.aas2aml.custom; -import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.Aas2AmlMappingContext; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.Mapper; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.AmlGenerator; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.MappingContext; import io.adminshell.aas.v3.dataformat.mapping.MappingException; import io.adminshell.aas.v3.model.Constraint; import java.util.Collection; -public class ConstraintCollectionMapper implements Aas2AmlElementMapper> { +public class ConstraintCollectionMapper implements Mapper> { @Override - public void map(Collection value, AmlGenerator generator, Aas2AmlMappingContext context) throws MappingException { + public void map(Collection value, AmlGenerator generator, MappingContext context) throws MappingException { if (value == null || value.isEmpty()) { return; } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/DataSpecificationContentMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/DataSpecificationContentMapper.java similarity index 72% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/DataSpecificationContentMapper.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/DataSpecificationContentMapper.java index b5b29c8f..2e189bfe 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/DataSpecificationContentMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/DataSpecificationContentMapper.java @@ -13,10 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper; +package io.adminshell.aas.v3.dataformat.aml.aas2aml.custom; -import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.Aas2AmlMappingContext; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.DefaultMapper; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.AmlGenerator; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.MappingContext; import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; import io.adminshell.aas.v3.dataformat.mapping.MappingException; import io.adminshell.aas.v3.model.DataSpecificationContent; @@ -27,16 +28,12 @@ public DataSpecificationContentMapper() { } @Override - public void map(DataSpecificationContent content, AmlGenerator generator, Aas2AmlMappingContext context) throws MappingException { + public void map(DataSpecificationContent content, AmlGenerator generator, MappingContext context) throws MappingException { toInternalElement(content, generator, context); } -// @Override -// protected String getId(DataSpecificationContent value, AmlGenerator generator, Aas2AmlMappingContext context) { -// return context.generateId(); -// } @Override - protected InternalElementType.RoleRequirements getRoleRequirementClass(DataSpecificationContent value, AmlGenerator generator, Aas2AmlMappingContext context) { + protected InternalElementType.RoleRequirements getRoleRequirementClass(DataSpecificationContent value, AmlGenerator generator, MappingContext context) { return generator.roleRequirement(DataSpecificationContent.class.getSimpleName()); } } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/DataSpecificationIEC61360Mapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/DataSpecificationIEC61360Mapper.java similarity index 81% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/DataSpecificationIEC61360Mapper.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/DataSpecificationIEC61360Mapper.java index b083b18f..5fa9a088 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/DataSpecificationIEC61360Mapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/DataSpecificationIEC61360Mapper.java @@ -13,10 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper; +package io.adminshell.aas.v3.dataformat.aml.aas2aml.custom; -import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.Aas2AmlMappingContext; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.DefaultMapper; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.AmlGenerator; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.MappingContext; import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; import io.adminshell.aas.v3.dataformat.mapping.MappingException; import io.adminshell.aas.v3.model.DataSpecificationContent; @@ -26,7 +27,7 @@ public class DataSpecificationIEC61360Mapper extends DefaultMapper { @Override - public void map(DataSpecificationIEC61360 content, AmlGenerator generator, Aas2AmlMappingContext context) throws MappingException { + public void map(DataSpecificationIEC61360 content, AmlGenerator generator, MappingContext context) throws MappingException { asInternalElement(content, generator, context); } @@ -35,7 +36,7 @@ public void map(DataSpecificationIEC61360 content, AmlGenerator generator, Aas2A // return context.generateId(); // } @Override - protected InternalElementType.RoleRequirements getRoleRequirementClass(DataSpecificationIEC61360 value, AmlGenerator generator, Aas2AmlMappingContext context) { + protected InternalElementType.RoleRequirements getRoleRequirementClass(DataSpecificationIEC61360 value, AmlGenerator generator, MappingContext context) { return generator.roleRequirement(DataSpecificationContent.class.getSimpleName()); } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/DataSpecificationMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/DataSpecificationMapper.java similarity index 84% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/DataSpecificationMapper.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/DataSpecificationMapper.java index 1e051e7b..54c68782 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/DataSpecificationMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/DataSpecificationMapper.java @@ -13,10 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper; +package io.adminshell.aas.v3.dataformat.aml.aas2aml.custom; -import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.Aas2AmlMappingContext; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.DefaultMapper; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.AmlGenerator; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.MappingContext; import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; import io.adminshell.aas.v3.dataformat.mapping.MappingException; import io.adminshell.aas.v3.model.DataSpecificationContent; @@ -28,7 +29,7 @@ public DataSpecificationMapper() { } @Override - public void map(EmbeddedDataSpecification value, AmlGenerator generator, Aas2AmlMappingContext context) throws MappingException { + public void map(EmbeddedDataSpecification value, AmlGenerator generator, MappingContext context) throws MappingException { if (value.getDataSpecificationContent() != null) { //embedded DataSpecificationContent content = value.getDataSpecificationContent(); @@ -36,7 +37,6 @@ public void map(EmbeddedDataSpecification value, AmlGenerator generator, Aas2Aml + "/" + content.getClass().getSimpleName() + "Template/" + content.getClass().getSimpleName(); InternalElementType.Builder builder = InternalElementType.builder() - .withID(getId(value, generator, context)) .withRefBaseSystemUnitPath(refSystemUnitPath) .withName("EmbeddedDataSpecification"); // serialize properties, but with different attribute path ("IEC:DataSpecificationIEC63360/[propertyName]) diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/EmbeddedDataSpecificationCollectionMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/EmbeddedDataSpecificationCollectionMapper.java similarity index 72% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/EmbeddedDataSpecificationCollectionMapper.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/EmbeddedDataSpecificationCollectionMapper.java index 4c12bf24..fe9e106a 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/EmbeddedDataSpecificationCollectionMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/EmbeddedDataSpecificationCollectionMapper.java @@ -13,13 +13,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper; +package io.adminshell.aas.v3.dataformat.aml.aas2aml.custom; -import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.Aas2AmlMappingContext; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.DefaultMapper; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.AmlGenerator; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.MappingContext; import io.adminshell.aas.v3.dataformat.aml.model.caex.AttributeType; import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; -import io.adminshell.aas.v3.dataformat.aml.util.AASUtils; +import io.adminshell.aas.v3.dataformat.core.DataSpecificationInfo; +import io.adminshell.aas.v3.dataformat.core.DataSpecificationManager; +import io.adminshell.aas.v3.dataformat.core.util.AasUtils; import io.adminshell.aas.v3.dataformat.mapping.MappingException; import io.adminshell.aas.v3.model.ConceptDescription; import io.adminshell.aas.v3.model.DataSpecificationContent; @@ -31,7 +34,7 @@ public class EmbeddedDataSpecificationCollectionMapper extends DefaultMapper> { @Override - public void map(Collection value, AmlGenerator generator, Aas2AmlMappingContext context) throws MappingException { + public void map(Collection value, AmlGenerator generator, MappingContext context) throws MappingException { if (value == null || context == null || value.isEmpty()) { return; } @@ -43,19 +46,20 @@ public void map(Collection value, AmlGenerator genera if (element.getDataSpecificationContent() == null) { AttributeType.Builder builder = AttributeType.builder() .withName("hasDataSpecification" + (countAttributes > 1 ? "_" + (attributes.size() + 1) : "")) - .withValue(AASUtils.asString(element.getDataSpecification())) + .withValue(AasUtils.asString(element.getDataSpecification())) .withRefSemantic(generator.refSemantic(ConceptDescription.class, "dataSpecification")); attributes.add(builder.build()); } else { - // need to map all properties but with specific attribute path - // idea: get current attribute path via context? - // for now do not care about correct attribute path + DataSpecificationInfo dataSpecification = DataSpecificationManager.getDataSpecification(element.getDataSpecificationContent().getClass()); + if (dataSpecification == null) { + throw new MappingException("unkown data specification " + element.getDataSpecificationContent().getClass()); + } InternalElementType.Builder temp = InternalElementType.builder(); - AmlGenerator subGenerator = generator.with(temp); + AmlGenerator subGenerator = generator.with(temp).withRefSemanticPrefix(dataSpecification.getPrefix()); context.map(element.getDataSpecificationContent(), subGenerator); InternalElementType.Builder builder = InternalElementType.copyOf(temp.build().getInternalElement().get(0)) .withName("EmbeddedDataSpecification" + (countInternalElement > 1 ? "_" + (internalElements.size() + 1) : "")) - .withID(getId(value, generator, context)) + .withID(generator.getId(value)) .withRefBaseSystemUnitPath(generator.getDocumentInfo().getDataSpecificationTemplatesSystemUnitClassLib() + "/" + getDataSpecificationContentType(element.getDataSpecificationContent().getClass()) + "Template/" + getDataSpecificationContentType(element.getDataSpecificationContent().getClass())); @@ -63,7 +67,15 @@ public void map(Collection value, AmlGenerator genera } } attributes.forEach(x -> generator.addAttribute(x)); - internalElements.forEach(x -> generator.addInternalElement(x)); + if (internalElements.size() > 1) { + InternalElementType wrapper = InternalElementType.builder() + .withName("EmbeddedDataSpecifications") + .addInternalElement(internalElements) + .build(); + generator.addInternalElement(wrapper); + } else { + internalElements.forEach(x -> generator.addInternalElement(x)); + } } private String getDataSpecificationContentType(Class type) { diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/FileMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/FileMapper.java similarity index 86% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/FileMapper.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/FileMapper.java index bf9de357..aa78ea67 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/FileMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/FileMapper.java @@ -13,10 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper; +package io.adminshell.aas.v3.dataformat.aml.aas2aml.custom; -import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.Aas2AmlMappingContext; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.DefaultMapper; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.AmlGenerator; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.MappingContext; import io.adminshell.aas.v3.dataformat.aml.model.caex.AttributeType; import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; import io.adminshell.aas.v3.dataformat.aml.model.caex.RoleClassType; @@ -35,12 +36,11 @@ public FileMapper() { } @Override - protected InternalElementType.Builder toInternalElement(File value, AmlGenerator generator, Aas2AmlMappingContext context) throws MappingException { + protected InternalElementType.Builder toInternalElement(File value, AmlGenerator generator, MappingContext context) throws MappingException { InternalElementType.Builder builder = super.toInternalElement(value, generator, context); if (builder != null) { builder.withExternalInterface(RoleClassType.ExternalInterface.builder() .withName(FILE_INTERFACE_NAME) - .withID(getId(value, generator, context)) .withRefBaseClassPath(generator.getDocumentInfo().getAssetAdministrationShellInterfaceClassLib() + "/" + FILE_INTERFACE_NAME) .addAttribute(AttributeType.builder() .withName(ATTRIBUTE_MIMETYPE_NAME) diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/LangStringCollectionMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/LangStringCollectionMapper.java similarity index 81% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/LangStringCollectionMapper.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/LangStringCollectionMapper.java index 2eabe2ec..9d0fe524 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/LangStringCollectionMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/LangStringCollectionMapper.java @@ -13,10 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper; +package io.adminshell.aas.v3.dataformat.aml.aas2aml.custom; -import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.Aas2AmlMappingContext; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.DefaultMapper; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.AmlGenerator; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.MappingContext; import io.adminshell.aas.v3.dataformat.aml.model.caex.AttributeType; import io.adminshell.aas.v3.model.LangString; import java.lang.reflect.ParameterizedType; @@ -25,8 +26,10 @@ public class LangStringCollectionMapper extends DefaultMapper> { + private static final String NAME_PREFIX = "aml-lang="; + @Override - public void map(Collection value, AmlGenerator generator, Aas2AmlMappingContext context) { + public void map(Collection value, AmlGenerator generator, MappingContext context) { if (context == null || context.getProperty() == null) { throw new IllegalArgumentException("context.property must be non-null"); } @@ -36,7 +39,6 @@ public void map(Collection value, AmlGenerator generator, Aas2AmlMap Object t = (Class) ((ParameterizedType) context.getProperty().getReadMethod().getGenericReturnType()).getActualTypeArguments()[0]; generator.addAttribute(AttributeType.builder() - // für collections funktioniert getName so nicht weil value.class == Collection + type erasure .withName(context.getAttributeNamingStrategy().getName( context.getProperty().getReadMethod().getDeclaringClass(), value, @@ -44,7 +46,7 @@ public void map(Collection value, AmlGenerator generator, Aas2AmlMap .withRefSemantic(generator.refSemantic(context.getProperty())) .addAttribute(value.stream() .map(x -> AttributeType.builder() - .withName("aml-lang=" + x.getLanguage()) + .withName(NAME_PREFIX + x.getLanguage()) .withValue(x.getValue()) .build()) .collect(Collectors.toList())) diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/OperationVariableCollectionMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/OperationVariableCollectionMapper.java similarity index 78% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/OperationVariableCollectionMapper.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/OperationVariableCollectionMapper.java index e360ab98..b7826fee 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/OperationVariableCollectionMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/OperationVariableCollectionMapper.java @@ -13,10 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper; +package io.adminshell.aas.v3.dataformat.aml.aas2aml.custom; -import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.Aas2AmlMappingContext; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.DefaultCollectionMapper; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.AmlGenerator; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.MappingContext; import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; import io.adminshell.aas.v3.dataformat.mapping.MappingException; import io.adminshell.aas.v3.model.OperationVariable; @@ -25,7 +26,7 @@ public class OperationVariableCollectionMapper extends DefaultCollectionMapper { @Override - public void map(Collection value, AmlGenerator generator, Aas2AmlMappingContext context) throws MappingException { + public void map(Collection value, AmlGenerator generator, MappingContext context) throws MappingException { if (value == null || value.isEmpty()) { return; } @@ -36,12 +37,10 @@ public void map(Collection value, AmlGenerator generator, Aas name = name.substring(0, 1).toUpperCase() + name.substring(1); InternalElementType.Builder builder = InternalElementType.builder() .withName(name) - .withID(getId(value, generator, context)) + .withID(generator.getId(value)) .withRoleRequirements(generator.roleRequirement("Operation" + name)); for (OperationVariable element : value) { - context - .withoutProperty() - .withoutIdCache() + context.withoutProperty() .map(element, generator.with(builder)); } generator.addInternalElement(builder.build()); diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/OperationVariableMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/OperationVariableMapper.java similarity index 76% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/OperationVariableMapper.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/OperationVariableMapper.java index 9d26be6c..7901b104 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/OperationVariableMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/OperationVariableMapper.java @@ -13,10 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper; +package io.adminshell.aas.v3.dataformat.aml.aas2aml.custom; -import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.Aas2AmlMappingContext; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.DefaultMapper; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.AmlGenerator; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.MappingContext; import io.adminshell.aas.v3.dataformat.mapping.MappingException; import io.adminshell.aas.v3.model.OperationVariable; @@ -26,7 +27,7 @@ public OperationVariableMapper() { } @Override - public void map(OperationVariable operationVariable, AmlGenerator generator, Aas2AmlMappingContext context) throws MappingException { + public void map(OperationVariable operationVariable, AmlGenerator generator, MappingContext context) throws MappingException { if (operationVariable != null && operationVariable.getValue() != null) { context.withoutProperty().map(operationVariable.getValue(), generator); } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/QualifierMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/QualifierMapper.java similarity index 69% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/QualifierMapper.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/QualifierMapper.java index ff130d91..5ddd2f7a 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/QualifierMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/QualifierMapper.java @@ -13,22 +13,23 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper; +package io.adminshell.aas.v3.dataformat.aml.aas2aml.custom; -import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.Aas2AmlMappingContext; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.DefaultMapper; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.AmlGenerator; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.MappingContext; import io.adminshell.aas.v3.dataformat.mapping.MappingException; import io.adminshell.aas.v3.model.Qualifier; public class QualifierMapper extends DefaultMapper { @Override - public void map(Qualifier value, AmlGenerator generator, Aas2AmlMappingContext context) throws MappingException { + public void map(Qualifier value, AmlGenerator generator, MappingContext context) throws MappingException { asAttribute(value, generator, context); } @Override - protected String getAttributeName(Qualifier value, Aas2AmlMappingContext context) { + protected String getAttributeName(Qualifier value, MappingContext context) { return context.getAttributeNamingStrategy().getName( Qualifier.class, value, diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/ReferenceCollectionMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/ReferenceCollectionMapper.java similarity index 71% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/ReferenceCollectionMapper.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/ReferenceCollectionMapper.java index db753003..6c3e66a3 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/ReferenceCollectionMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/ReferenceCollectionMapper.java @@ -13,18 +13,19 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper; +package io.adminshell.aas.v3.dataformat.aml.aas2aml.custom; -import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.Aas2AmlMappingContext; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.Mapper; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.AmlGenerator; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.MappingContext; import io.adminshell.aas.v3.dataformat.mapping.MappingException; import io.adminshell.aas.v3.model.Reference; import java.util.Collection; -public class ReferenceCollectionMapper implements Aas2AmlElementMapper> { +public class ReferenceCollectionMapper implements Mapper> { @Override - public void map(Collection value, AmlGenerator generator, Aas2AmlMappingContext context) throws MappingException { + public void map(Collection value, AmlGenerator generator, MappingContext context) throws MappingException { if (value == null || value.isEmpty()) { return; } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/ReferenceElementMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/ReferenceElementMapper.java new file mode 100644 index 00000000..f5662c86 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/ReferenceElementMapper.java @@ -0,0 +1,61 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.aas2aml.custom; + +import io.adminshell.aas.v3.dataformat.aml.aas2aml.DefaultMapper; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.AmlGenerator; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.MappingContext; +import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; +import io.adminshell.aas.v3.dataformat.core.ReflectionHelper; +import io.adminshell.aas.v3.dataformat.core.util.AasUtils; +import io.adminshell.aas.v3.dataformat.mapping.MappingException; +import io.adminshell.aas.v3.model.Referable; +import io.adminshell.aas.v3.model.ReferenceElement; + +public class ReferenceElementMapper extends DefaultMapper { + + private static final String PROPERTY_VALUE_NAME = "value"; + private static final String PROPERTY_VALUE_TYPE = "xs:string"; + + public ReferenceElementMapper() { + super(PROPERTY_VALUE_NAME); + } + + @Override + public void map(ReferenceElement element, AmlGenerator generator, MappingContext context) throws MappingException { + if (element == null) { + return; + } + InternalElementType.Builder builder = InternalElementType.builder() + .withName(context.getInternalElementNamingStrategy().getName( + element.getClass(), + element, + null)) + .withRoleRequirements(generator.roleRequirement(ReflectionHelper.getModelType(element.getClass()))); + AmlGenerator subGenerator = generator.with(builder); + mapProperties(element, subGenerator, context); + Referable resolvedReference = AasUtils.resolve(element.getValue(), context.getEnvironment()); + if (resolvedReference != null) { + subGenerator.addExternalInterfaceForReference(context); + subGenerator.addInternalLink(PROPERTY_VALUE_NAME, element, element.getValue()); + } else { + subGenerator.addExternalInterfaceForUnresolvableReference(element.getValue(), context); + } + subGenerator.appendReferenceTargetInterfaceIfRequired(element, context); + generator.addInternalElement(builder.build(), element); + } + +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/RelationshipElementMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/RelationshipElementMapper.java new file mode 100644 index 00000000..0ed07d56 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/RelationshipElementMapper.java @@ -0,0 +1,66 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.aas2aml.custom; + +import io.adminshell.aas.v3.dataformat.aml.aas2aml.DefaultMapper; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.AmlGenerator; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.MappingContext; +import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; +import io.adminshell.aas.v3.dataformat.core.ReflectionHelper; +import io.adminshell.aas.v3.dataformat.core.util.AasUtils; +import io.adminshell.aas.v3.dataformat.mapping.MappingException; +import io.adminshell.aas.v3.model.Referable; +import io.adminshell.aas.v3.model.Reference; +import io.adminshell.aas.v3.model.RelationshipElement; + +public class RelationshipElementMapper extends DefaultMapper { + + private static final String PROPERTY_FIRST_NAME = "first"; + private static final String PROPERTY_SECOND_NAME = "second"; + + public RelationshipElementMapper() { + super(PROPERTY_FIRST_NAME, PROPERTY_SECOND_NAME); + } + + @Override + public void map(RelationshipElement element, AmlGenerator generator, MappingContext context) throws MappingException { + if (element == null) { + return; + } + InternalElementType.Builder builder = InternalElementType.builder() + .withName(context.getInternalElementNamingStrategy().getName( + element.getClass(), + element, + null)) + .withRoleRequirements(generator.roleRequirement(ReflectionHelper.getModelType(element.getClass()))); + AmlGenerator subGenerator = generator.with(builder); + mapProperties(element, subGenerator, context); + mapProperty(element, element.getFirst(), PROPERTY_FIRST_NAME, subGenerator, context); + mapProperty(element, element.getSecond(), PROPERTY_SECOND_NAME, subGenerator, context); + generator.with(builder).appendReferenceTargetInterfaceIfRequired(element, context); + generator.addInternalElement(builder.build(), element); + } + + private void mapProperty(RelationshipElement element, Reference reference, String name, AmlGenerator generator, MappingContext context) { + Referable resolvedReference = AasUtils.resolve(reference, context.getEnvironment()); + if (resolvedReference != null) { + generator.addExternalInterfaceForReference(context); + generator.addInternalLink(name, element, reference); + } else { + generator.addExternalInterfaceForUnresolvableReference(reference, context); + } + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/SubmodelMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/SubmodelMapper.java similarity index 78% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/SubmodelMapper.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/SubmodelMapper.java index fadfeb4c..17d03748 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/SubmodelMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/SubmodelMapper.java @@ -13,10 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper; +package io.adminshell.aas.v3.dataformat.aml.aas2aml.custom; -import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.Aas2AmlMappingContext; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.DefaultMapper; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.AmlGenerator; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.MappingContext; import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; import io.adminshell.aas.v3.dataformat.mapping.MappingException; import io.adminshell.aas.v3.model.ModelingKind; @@ -28,7 +29,7 @@ public SubmodelMapper() { } @Override - protected InternalElementType.Builder toInternalElement(Submodel value, AmlGenerator generator, Aas2AmlMappingContext context) throws MappingException { + protected InternalElementType.Builder toInternalElement(Submodel value, AmlGenerator generator, MappingContext context) throws MappingException { InternalElementType.Builder builder = super.toInternalElement(value, generator, context); if (value.getKind() == ModelingKind.TEMPLATE) { builder = builder.withRefBaseSystemUnitPath(generator.refBaseSystemUnitPath(value, context)); diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/ViewMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/ViewMapper.java similarity index 66% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/ViewMapper.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/ViewMapper.java index 474b8f23..904f080f 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/ViewMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/ViewMapper.java @@ -13,32 +13,37 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper; +package io.adminshell.aas.v3.dataformat.aml.aas2aml.custom; -import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.Aas2AmlMappingContext; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.DefaultMapper; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.AmlGenerator; +import io.adminshell.aas.v3.dataformat.aml.aas2aml.MappingContext; import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; -import io.adminshell.aas.v3.dataformat.aml.util.AASUtils; import io.adminshell.aas.v3.dataformat.core.ReflectionHelper; +import io.adminshell.aas.v3.dataformat.core.util.AasUtils; import io.adminshell.aas.v3.dataformat.mapping.MappingException; import io.adminshell.aas.v3.model.Referable; import io.adminshell.aas.v3.model.Reference; import io.adminshell.aas.v3.model.View; -import java.beans.PropertyDescriptor; public class ViewMapper extends DefaultMapper { + private static final String PROPERTY_CONTAINED_ELEMENTS_NAME = "containedElements"; + + public ViewMapper() { + super(PROPERTY_CONTAINED_ELEMENTS_NAME); + } + @Override - public void map(View view, AmlGenerator generator, Aas2AmlMappingContext context) throws MappingException { + public void map(View view, AmlGenerator generator, MappingContext context) throws MappingException { if (view == null || view.getContainedElements() == null || view.getContainedElements().isEmpty()) { return; } InternalElementType.Builder builder = InternalElementType.builder(); - builder = builder.withID(getId(view, generator, context)) - .withName(context.getInternalElementNamingStrategy().getName( - view.getClass(), - view, - null)) + builder = builder.withName(context.getInternalElementNamingStrategy().getName( + view.getClass(), + view, + null)) // .withRefBaseSystemUnitPath(context.getIdentityProvider().getId( // AASUtils.resolve( // view.getContainedElements().get(0), @@ -46,21 +51,16 @@ public void map(View view, AmlGenerator generator, Aas2AmlMappingContext context .withRoleRequirements(generator.roleRequirement(ReflectionHelper.getModelType(view.getClass()))); generator.with(builder).appendReferenceTargetInterfaceIfRequired(view, context); for (Reference reference : view.getContainedElements()) { - Referable referable = AASUtils.resolve(reference, context.getEnvironment()); + Referable referable = AasUtils.resolve(reference, context.getEnvironment()); builder.addInternalElement(InternalElementType.builder() .withName(getInternalElementName(referable, context)) - .withID(context.newId()) - .withRefBaseSystemUnitPath(context.getId(reference)) + .withID(generator.newId()) + .withRefBaseSystemUnitPath(generator.getId(reference)) .build()); } - generator.addInternalElement(builder.build()); - } - - @Override - protected boolean skipProperty(PropertyDescriptor property) { - return property != null && property.getName().equals("containedElements"); + generator.addInternalElement(builder.build(), view); } // diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/ReferenceElementMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/ReferenceElementMapper.java deleted file mode 100644 index 04c37deb..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/ReferenceElementMapper.java +++ /dev/null @@ -1,86 +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 io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper; - -import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.Aas2AmlMappingContext; -import io.adminshell.aas.v3.dataformat.aml.model.caex.AttributeType; -import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; -import io.adminshell.aas.v3.dataformat.aml.model.caex.RoleClassType; -import io.adminshell.aas.v3.dataformat.aml.model.caex.SystemUnitClassType.InternalLink; -import io.adminshell.aas.v3.dataformat.aml.util.AASUtils; -import io.adminshell.aas.v3.dataformat.core.ReflectionHelper; -import io.adminshell.aas.v3.dataformat.mapping.MappingException; -import io.adminshell.aas.v3.model.Referable; -import io.adminshell.aas.v3.model.ReferenceElement; -import java.beans.PropertyDescriptor; - -public class ReferenceElementMapper extends DefaultMapper { - - public ReferenceElementMapper() { - } - - @Override - public void map(ReferenceElement element, AmlGenerator generator, Aas2AmlMappingContext context) throws MappingException { - if (element == null) { - return; - } - // regular mapping - InternalElementType.Builder builder = InternalElementType.builder() - .withID(getId(element, generator, context)) - .withName(context.getInternalElementNamingStrategy().getName( - element.getClass(), - element, - null)) - .withRoleRequirements(generator.roleRequirement(ReflectionHelper.getModelType(element.getClass()))); - mapProperties(element, generator.with(builder), context); - // add interface - RoleClassType.ExternalInterface.Builder interfaceBuilder = RoleClassType.ExternalInterface.builder() - .withID(context.getId(null)) - .withName("ReferableReference") - .withRefBaseClassPath("AssetAdministrationShellInterfaceClassLib/ReferableReference"); - Referable resolvedReference = AASUtils.resolve(element.getValue(), context.getEnvironment()); - if (resolvedReference != null) { - // TODO internalLink must be added on appropriate level which contains both elements - // check if it can also be added on higher levels as this would make things easier - // !!! neither CAEXFile nor InstanceHierarchy allow definition of internalLinks which - // !!! contradicts CAEX meta model as depicted on slide 13 https://www.plt.rwth-aachen.de/global/show_document.asp?id=aaaaaaaaaatmalk - builder = builder.withInternalLink(InternalLink.builder() - .withName("value") - .withID(getId(element, generator, context)) - .withRefPartnerSideA(getId(element, generator, context) + ":ReferableReference") - .withRefPartnerSideB(context.getId(element.getValue()) + ":ReferableReference") - .build()); - } else { - interfaceBuilder = interfaceBuilder - .addAttribute(AttributeType.builder() - .withName("value") - .withID(getId(element, generator, context)) - .withAttributeDataType("xs:string") - .withValue(AASUtils.asString(element.getValue())) - .build()); - } - builder.withExternalInterface(interfaceBuilder.build()); - generator.with(builder).appendReferenceTargetInterfaceIfRequired(element, context); - generator.addInternalElement(builder.build()); - } - - @Override - protected boolean skipProperty(PropertyDescriptor property) { - return property.getName().equals("value"); - } - -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/ReferenceMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/ReferenceMapper.java deleted file mode 100644 index 780154cd..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/ReferenceMapper.java +++ /dev/null @@ -1,48 +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 io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper; - -import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.Aas2AmlMappingContext; -import io.adminshell.aas.v3.dataformat.aml.util.AASUtils; -import io.adminshell.aas.v3.dataformat.mapping.MappingException; -import io.adminshell.aas.v3.model.KeyElements; -import io.adminshell.aas.v3.model.Reference; -import io.adminshell.aas.v3.model.Submodel; -import java.util.Optional; - -public class ReferenceMapper extends DefaultMapper { - - @Override - public void map(Reference reference, AmlGenerator generator, Aas2AmlMappingContext context) throws MappingException { - if (reference == null || reference.getKeys().isEmpty()) { - return; - } - KeyElements referencedType = reference.getKeys().get(reference.getKeys().size() - 1).getType(); - if (referencedType == KeyElements.SUBMODEL) { - Optional resolvedSubmodel = AASUtils.resolveSubmodelReference(reference, context.getEnvironment()); - if (resolvedSubmodel.isPresent()) { - context - // not having this causes duplicate IDs - // maybe this can be "fixed" by not shortening References - // .withoutIdCache() - .map(resolvedSubmodel.get(), generator); - return; - } - } - context.map(AASUtils.asString(reference), generator); - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/RelationshipElementMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/RelationshipElementMapper.java deleted file mode 100644 index c85610d0..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/RelationshipElementMapper.java +++ /dev/null @@ -1,89 +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 io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper; - -import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.Aas2AmlMappingContext; -import io.adminshell.aas.v3.dataformat.aml.model.caex.AttributeType; -import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; -import io.adminshell.aas.v3.dataformat.aml.model.caex.RoleClassType; -import io.adminshell.aas.v3.dataformat.aml.model.caex.SystemUnitClassType.InternalLink; -import io.adminshell.aas.v3.dataformat.aml.util.AASUtils; -import io.adminshell.aas.v3.dataformat.core.ReflectionHelper; -import io.adminshell.aas.v3.dataformat.mapping.MappingException; -import io.adminshell.aas.v3.model.Referable; -import io.adminshell.aas.v3.model.Reference; -import io.adminshell.aas.v3.model.RelationshipElement; -import java.beans.PropertyDescriptor; - -public class RelationshipElementMapper extends DefaultMapper { - - public RelationshipElementMapper() { - } - - @Override - public void map(RelationshipElement element, AmlGenerator generator, Aas2AmlMappingContext context) throws MappingException { - if (element == null) { - return; - } - // regular mapping - InternalElementType.Builder builder = InternalElementType.builder() - .withID(getId(element, generator, context)) - .withName(context.getInternalElementNamingStrategy().getName( - element.getClass(), - element, - null)) - .withRoleRequirements(generator.roleRequirement(ReflectionHelper.getModelType(element.getClass()))); - AmlGenerator subGenerator = generator.with(builder); - mapProperties(element, subGenerator, context); - // add special mapping for first, second - mapProperty(element, element.getFirst(), "first", subGenerator, context); - mapProperty(element, element.getSecond(), "second", subGenerator, context); - generator.with(builder).appendReferenceTargetInterfaceIfRequired(element, context); - generator.addInternalElement(builder.build()); - } - - private void mapProperty(RelationshipElement element, Reference reference, String name, AmlGenerator generator, Aas2AmlMappingContext context) { - RoleClassType.ExternalInterface.Builder builder = RoleClassType.ExternalInterface.builder() - .withName(name) - .withRefBaseClassPath("AssetAdministrationShellInterfaceClassLib/ReferableReference"); - Referable resolvedReference = AASUtils.resolve(reference, context.getEnvironment()); - if (resolvedReference != null) { - // TODO internalLink must be added on appropriate level which contains both elements - // check if it can also be added on higher levels as this would make things easier - // !!! neither CAEXFile nor InstanceHierarchy allow definition of internalLinks which - // !!! contradicts CAEX meta model as depicted on slide 13 https://www.plt.rwth-aachen.de/global/show_document.asp?id=aaaaaaaaaatmalk - generator.addInternalLink(InternalLink.builder() - .withName(name) - .withID(context.newId()) - .withRefPartnerSideA(getId(element, generator, context) + ":name") - .withRefPartnerSideB(context.getId(reference) + ":ReferableReference") - .build()); - } else { - builder = builder.addAttribute(AttributeType.builder() - .withName("value") - .withAttributeDataType("xs:string") - .withValue(AASUtils.asString(reference)) - .build()); - } - generator.addExternalInterface(builder.build()); - } - - @Override - protected boolean skipProperty(PropertyDescriptor property) { - return property.getName().equals("first") || property.getName().equals("second"); - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/ToAttributeMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/ToAttributeMapper.java deleted file mode 100644 index e7a55b03..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/mapper/ToAttributeMapper.java +++ /dev/null @@ -1,35 +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 io.adminshell.aas.v3.dataformat.aml.aas2aml.mapper; - -import io.adminshell.aas.v3.dataformat.aml.AmlGenerator; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.Aas2AmlMappingContext; -import io.adminshell.aas.v3.dataformat.aml.model.caex.AttributeType; - -public abstract class ToAttributeMapper implements Aas2AmlElementMapper { - - protected void mapAsAttribute(Object value, AmlGenerator generator, Aas2AmlMappingContext context) { - if (value != null && context.getProperty() != null) { - generator.addAttribute(AttributeType.builder() - .withName(context.getProperty().getName()) - .withValue(value) - .withRefSemantic(AttributeType.RefSemantic.builder() - .withCorrespondingAttributePath("AAS:" + context.getProperty().getReadMethod().getDeclaringClass().getSimpleName() + "/" + context.getProperty().getName()) - .build()) - .build()); - } - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/AasTypeFactory.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/AasTypeFactory.java index e86cf6e7..e4684bca 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/AasTypeFactory.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/AasTypeFactory.java @@ -1,3 +1,18 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.aml2aas; import io.adminshell.aas.v3.dataformat.core.ReflectionHelper; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/Aml2AasMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/Aml2AasMapper.java index 6ec67f55..b9ca36bd 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/Aml2AasMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/Aml2AasMapper.java @@ -15,7 +15,34 @@ */ package io.adminshell.aas.v3.dataformat.aml.aml2aas; -import io.adminshell.aas.v3.dataformat.mapping.TargetBasedMapper; +import io.adminshell.aas.v3.dataformat.aml.aml2aas.custom.AssetAdministrationShellEnvironmentMapper; +import io.adminshell.aas.v3.dataformat.aml.AmlDeserializationConfig; +import io.adminshell.aas.v3.dataformat.aml.model.caex.CAEXFile; +import io.adminshell.aas.v3.dataformat.core.ReflectionHelper; +import io.adminshell.aas.v3.dataformat.mapping.MappingException; +import io.adminshell.aas.v3.dataformat.mapping.MappingProvider; +import io.adminshell.aas.v3.model.AssetAdministrationShellEnvironment; +import java.util.List; -public interface Aml2AasMapper extends TargetBasedMapper { +public class Aml2AasMapper { + + private AmlDeserializationConfig config; + + public Aml2AasMapper(AmlDeserializationConfig config) { + this.config = config; + } + + public AssetAdministrationShellEnvironment map(CAEXFile aml) throws MappingException { + // unclear how to handle additional information + List additionalInformation = aml.getAdditionalInformation(); + // find AAS elements throughout all instance hierarchies + AmlParser parser = new AmlParser(aml); + MappingProvider mappingProvider = new MappingProvider(Mapper.class, new DefaultMapper(), new DefaultMapper()); + mappingProvider.register(new AssetAdministrationShellEnvironmentMapper()); + AasTypeFactory typeFactory = new AasTypeFactory(); + MappingContext context = new MappingContext(mappingProvider, typeFactory); + Object result = context.getMappingProvider().getMapper(AssetAdministrationShellEnvironment.class).map(parser, context); + String foo = ""; + return (AssetAdministrationShellEnvironment) result; + } } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/Aml2AasMappingContext.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/Aml2AasMappingContext.java deleted file mode 100644 index 53d917bc..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/Aml2AasMappingContext.java +++ /dev/null @@ -1,45 +0,0 @@ -package io.adminshell.aas.v3.dataformat.aml.aml2aas; - -import io.adminshell.aas.v3.dataformat.aml.AmlDocumentInfo; -import io.adminshell.aas.v3.dataformat.mapping.MappingProvider; -import io.adminshell.aas.v3.dataformat.mapping.TargetBasedMappingContext; - -public class Aml2AasMappingContext extends TargetBasedMappingContext { - - private AmlDocumentInfo documentInfo; - private AasTypeFactory typeFactory; - private Class type; - - public Aml2AasMappingContext(MappingProvider mappingProvider, AasTypeFactory typeFactory) { - super(mappingProvider); - this.typeFactory = typeFactory; - this.type = null; - } - - private Aml2AasMappingContext(MappingProvider mappingProvider, AasTypeFactory typeFactory, Class type) { - super(mappingProvider); - this.typeFactory = typeFactory; - this.type = type; - } - - public Aml2AasMappingContext with(Class type) { - return new Aml2AasMappingContext(mappingProvider, typeFactory, type); - } - - public AmlDocumentInfo getDocumentInfo() { - return documentInfo; - } - - public void setDocumentInfo(AmlDocumentInfo documentInfo) { - this.documentInfo = documentInfo; - } - - public Class getType() { - return type; - } - - public AasTypeFactory getTypeFactory() { - return typeFactory; - } - -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/Aml2AasObjectMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/Aml2AasObjectMapper.java deleted file mode 100644 index 6fb9117b..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/Aml2AasObjectMapper.java +++ /dev/null @@ -1,32 +0,0 @@ -package io.adminshell.aas.v3.dataformat.aml.aml2aas; - -import io.adminshell.aas.v3.dataformat.aml.Aml2AasConfig; -import io.adminshell.aas.v3.dataformat.aml.model.caex.CAEXFile; -import io.adminshell.aas.v3.dataformat.core.ReflectionHelper; -import io.adminshell.aas.v3.dataformat.mapping.MappingException; -import io.adminshell.aas.v3.dataformat.mapping.MappingProvider; -import io.adminshell.aas.v3.model.AssetAdministrationShellEnvironment; -import java.util.List; - -public class Aml2AasObjectMapper { - - private Aml2AasConfig config; - - public Aml2AasObjectMapper(Aml2AasConfig config) { - this.config = config; - } - - public AssetAdministrationShellEnvironment map(CAEXFile aml) throws MappingException { - // unclear how to handle additional information - List additionalInformation = aml.getAdditionalInformation(); - // find AAS elements throughout all instance hierarchies - AmlParser parser = new AmlParser(aml); - MappingProvider mappingProvider = new MappingProvider(Aml2AasMapper.class, new DefaultMapper(), new DefaultMapper()); - mappingProvider.register(new AssetAdministrationShellEnvironmentMapper()); - AasTypeFactory typeFactory = new AasTypeFactory(); - Aml2AasMappingContext context = new Aml2AasMappingContext(mappingProvider, typeFactory); - Object result = context.getMappingProvider().getMapper(AssetAdministrationShellEnvironment.class).map(parser, context); - String foo = ""; - return (AssetAdministrationShellEnvironment) result; - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/AmlParser.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/AmlParser.java index 872e1852..42f4b88b 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/AmlParser.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/AmlParser.java @@ -1,3 +1,18 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.aml2aas; import io.adminshell.aas.v3.dataformat.aml.model.caex.CAEXFile; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/DefaultMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/DefaultMapper.java index 6b2d752e..4feca809 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/DefaultMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/DefaultMapper.java @@ -1,3 +1,18 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.aml2aas; import com.google.common.reflect.TypeToken; @@ -18,10 +33,10 @@ import java.util.logging.Logger; import java.util.stream.Collectors; -public class DefaultMapper implements Aml2AasMapper { +public class DefaultMapper implements Mapper { @Override - public Object map(AmlParser parser, Aml2AasMappingContext context) throws MappingException { + public Object map(AmlParser parser, MappingContext context) throws MappingException { if (parser.getCurrent() == null) { return null; } @@ -33,7 +48,7 @@ public Object map(AmlParser parser, Aml2AasMappingContext context) throws Mappin throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } - protected Object handleInternalElement(AmlParser parser, Aml2AasMappingContext context) { + protected Object handleInternalElement(AmlParser parser, MappingContext context) { Object result = null; InternalElementType current = (InternalElementType) parser.getCurrent(); String role = current.getRoleRequirements().getRefBaseRoleClassPath(); @@ -158,7 +173,7 @@ protected Object handleInternalElement(AmlParser parser, Aml2AasMappingContext c return result; } - protected Object handleAttribute(AmlParser parser, Aml2AasMappingContext context) throws MappingException { + protected Object handleAttribute(AmlParser parser, MappingContext context) throws MappingException { AttributeType current = (AttributeType) parser.getCurrent(); if (context.getType() == null) { throw new MappingException(String.format("error processing Attribute '%s', missing type information in context", current.getName())); diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/Mapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/Mapper.java new file mode 100644 index 00000000..1c6c977e --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/Mapper.java @@ -0,0 +1,21 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.aml2aas; + +import io.adminshell.aas.v3.dataformat.mapping.TargetBasedMapper; + +public interface Mapper extends TargetBasedMapper { +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/MappingContext.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/MappingContext.java new file mode 100644 index 00000000..6e072d11 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/MappingContext.java @@ -0,0 +1,60 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.aml2aas; + +import io.adminshell.aas.v3.dataformat.aml.AmlDocumentInfo; +import io.adminshell.aas.v3.dataformat.mapping.MappingProvider; +import io.adminshell.aas.v3.dataformat.mapping.TargetBasedMappingContext; + +public class MappingContext extends TargetBasedMappingContext { + + private AmlDocumentInfo documentInfo; + private AasTypeFactory typeFactory; + private Class type; + + public MappingContext(MappingProvider mappingProvider, AasTypeFactory typeFactory) { + super(mappingProvider); + this.typeFactory = typeFactory; + this.type = null; + } + + private MappingContext(MappingProvider mappingProvider, AasTypeFactory typeFactory, Class type) { + super(mappingProvider); + this.typeFactory = typeFactory; + this.type = type; + } + + public MappingContext with(Class type) { + return new MappingContext(mappingProvider, typeFactory, type); + } + + public AmlDocumentInfo getDocumentInfo() { + return documentInfo; + } + + public void setDocumentInfo(AmlDocumentInfo documentInfo) { + this.documentInfo = documentInfo; + } + + public Class getType() { + return type; + } + + public AasTypeFactory getTypeFactory() { + return typeFactory; + } + +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/AssetAdministrationShellEnvironmentMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/custom/AssetAdministrationShellEnvironmentMapper.java similarity index 64% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/AssetAdministrationShellEnvironmentMapper.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/custom/AssetAdministrationShellEnvironmentMapper.java index 8150ae20..3d66f37f 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/AssetAdministrationShellEnvironmentMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/custom/AssetAdministrationShellEnvironmentMapper.java @@ -1,6 +1,24 @@ -package io.adminshell.aas.v3.dataformat.aml.aml2aas; +/* + * 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 io.adminshell.aas.v3.dataformat.aml.aml2aas.custom; import io.adminshell.aas.v3.dataformat.aml.AmlDocumentInfo; +import io.adminshell.aas.v3.dataformat.aml.aml2aas.AmlParser; +import io.adminshell.aas.v3.dataformat.aml.aml2aas.Mapper; +import io.adminshell.aas.v3.dataformat.aml.aml2aas.MappingContext; import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; import io.adminshell.aas.v3.dataformat.mapping.MappingException; import io.adminshell.aas.v3.model.AssetAdministrationShell; @@ -12,10 +30,10 @@ import java.util.logging.Logger; import java.util.stream.Collectors; -public class AssetAdministrationShellEnvironmentMapper implements Aml2AasMapper { +public class AssetAdministrationShellEnvironmentMapper implements Mapper { @Override - public AssetAdministrationShellEnvironment map(AmlParser parser, Aml2AasMappingContext context) throws MappingException { + public AssetAdministrationShellEnvironment map(AmlParser parser, MappingContext context) throws MappingException { AssetAdministrationShellEnvironment result = new DefaultAssetAdministrationShellEnvironment.Builder().build(); List shells = parser.getContent().getInstanceHierarchy().stream() .flatMap(x -> x.getInternalElement().stream().filter(filterByRole(AssetAdministrationShell.class))) diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/header/AutomationMLVersion.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/header/AutomationMLVersion.java index 0fc06f46..ddf3685d 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/header/AutomationMLVersion.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/header/AutomationMLVersion.java @@ -18,20 +18,17 @@ import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElementRef; import javax.xml.bind.annotation.XmlType; @XmlAccessorType(XmlAccessType.FIELD) @XmlType(namespace = "http://www.w3.org/2001/XMLSchema", name = "string") public class AutomationMLVersion { - public static final String DEFAULT_VERSION = "2.0"; - @XmlAttribute(name = "AutomationMLVersion") private final String value; public AutomationMLVersion() { - value = DEFAULT_VERSION; + this.value = ""; } public AutomationMLVersion(String value) { diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/header/WriterHeader.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/header/WriterInfo.java similarity index 88% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/header/WriterHeader.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/header/WriterInfo.java index 315dd5cb..329df855 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/header/WriterHeader.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/header/WriterInfo.java @@ -17,12 +17,10 @@ import java.text.SimpleDateFormat; import java.util.Date; -import javax.xml.bind.annotation.XmlAnyElement; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; -//@XmlType(name = EmployeeDesiredSkill.class) -public class WriterHeader { +public class WriterInfo { @XmlElement(name = "WriterName") private String name; @@ -43,7 +41,7 @@ public class WriterHeader { @XmlElement(name = "WriterProjectID") private String projectID; - public WriterHeader() { + public WriterInfo() { SimpleDateFormat formatter = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss"); writingDate = formatter.format(new Date()); } @@ -56,16 +54,16 @@ public String getName() { public static class Wrapper { @XmlElement(name = "WriterHeader") - private WriterHeader writerHeader; + private WriterInfo writerHeader; public Wrapper() { } - public WriterHeader getWriterHeader() { + public WriterInfo getWriterHeader() { return writerHeader; } - public void setWriterHeader(WriterHeader writerHeader) { + public void setWriterHeader(WriterInfo writerHeader) { this.writerHeader = writerHeader; } } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/id/IdGenerator.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/id/IdGenerator.java index c5ee76fe..369560d4 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/id/IdGenerator.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/id/IdGenerator.java @@ -17,5 +17,5 @@ public interface IdGenerator { - public String generateId(); + public String next(); } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/id/IntegerIdGenerator.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/id/IntegerIdGenerator.java index e27536da..8a162677 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/id/IntegerIdGenerator.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/id/IntegerIdGenerator.java @@ -20,7 +20,7 @@ public class IntegerIdGenerator implements IdGenerator { private int id = 1; @Override - public String generateId() { + public String next() { return Integer.toString(id++); } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/id/UuidGenerator.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/id/UuidGenerator.java index ea7b46e6..2d8d1006 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/id/UuidGenerator.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/id/UuidGenerator.java @@ -20,7 +20,7 @@ public class UuidGenerator implements IdGenerator { @Override - public String generateId() { + public String next() { return UUID.randomUUID().toString(); } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util/ReferencedByViewCollector.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util/ReferencedByViewCollector.java index 332edd99..b228fe0b 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util/ReferencedByViewCollector.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util/ReferencedByViewCollector.java @@ -15,11 +15,11 @@ */ package io.adminshell.aas.v3.dataformat.aml.util; +import io.adminshell.aas.v3.dataformat.core.util.AasUtils; +import io.adminshell.aas.v3.dataformat.core.visitor.AssetAdministrationShellElementWalkerVisitor; import io.adminshell.aas.v3.model.AssetAdministrationShellEnvironment; import io.adminshell.aas.v3.model.Referable; import io.adminshell.aas.v3.model.Reference; -import io.adminshell.aas.v3.model.ReferenceElement; -import io.adminshell.aas.v3.model.RelationshipElement; import io.adminshell.aas.v3.model.View; import java.util.HashSet; import java.util.Set; @@ -49,7 +49,7 @@ public void visit(View view) { } private void handleReference(Reference reference) { - Referable target = AASUtils.resolve(reference, env); + Referable target = AasUtils.resolve(reference, env); if (target != null) { referencedElements.add(target); } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util/ReferencedReferableCollector.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util/ReferencedReferableCollector.java index be34087f..277a3a5c 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util/ReferencedReferableCollector.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util/ReferencedReferableCollector.java @@ -15,6 +15,8 @@ */ package io.adminshell.aas.v3.dataformat.aml.util; +import io.adminshell.aas.v3.dataformat.core.util.AasUtils; +import io.adminshell.aas.v3.dataformat.core.visitor.AssetAdministrationShellElementWalkerVisitor; import io.adminshell.aas.v3.model.AssetAdministrationShellEnvironment; import io.adminshell.aas.v3.model.Referable; import io.adminshell.aas.v3.model.Reference; @@ -48,7 +50,7 @@ public void visit(ReferenceElement referenceElement) { } private void handleReference(Reference reference) { - Referable target = AASUtils.resolve(reference, env); + Referable target = AasUtils.resolve(reference, env); if (target != null) { referencedElements.add(reference); } diff --git a/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/fixtures/TestExample.java b/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/fixtures/TestExample.java index 1a493aa7..8d727109 100644 --- a/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/fixtures/TestExample.java +++ b/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/fixtures/TestExample.java @@ -137,8 +137,9 @@ private static final Reference asReference(Identifiable identifiable) { .build()) .inputVariable(new DefaultOperationVariable.Builder() .value(new DefaultProperty.Builder() - .idShort("ExampleProperty") + .idShort("ExampleProperty1") .category("Constant") + .kind(ModelingKind.TEMPLATE) .description(new LangString("Example Property object", "en-us")) .description(new LangString("Beispiel Property Element", "de")) .semanticId(new DefaultReference.Builder() @@ -161,7 +162,7 @@ private static final Reference asReference(Identifiable identifiable) { .build()) .outputVariable(new DefaultOperationVariable.Builder() .value(new DefaultProperty.Builder() - .idShort("ExampleProperty") + .idShort("ExampleProperty2") .category("Constant") .description(new LangString("Example Property object", "en-us")) .description(new LangString("Beispiel Property Element", "de")) @@ -185,7 +186,8 @@ private static final Reference asReference(Identifiable identifiable) { .build()) .inoutputVariable(new DefaultOperationVariable.Builder() .value(new DefaultProperty.Builder() - .idShort("ExampleProperty") + .idShort("ExampleProperty3") + .kind(ModelingKind.TEMPLATE) .category("Constant") .description(new LangString("Example Property object", "en-us")) .description(new LangString("Beispiel Property Element", "de")) diff --git a/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/serialize/AmlDeserializerTest.java b/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/serialize/AmlDeserializerTest.java index fdd0d1a9..a49cf8d4 100644 --- a/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/serialize/AmlDeserializerTest.java +++ b/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/serialize/AmlDeserializerTest.java @@ -21,6 +21,7 @@ import io.adminshell.aas.v3.model.AssetAdministrationShellEnvironment; import java.io.FileNotFoundException; import static org.junit.Assert.assertEquals; +import org.junit.Ignore; import org.junit.Test; public class AmlDeserializerTest { @@ -28,7 +29,7 @@ public class AmlDeserializerTest { private final AmlDeserializer deserializer = new AmlDeserializer(); @Test -// @Ignore + @Ignore public void testExample() throws FileNotFoundException, DeserializationException { AssetAdministrationShellEnvironment actual = deserializer.read(TestExample.FILE); assertEquals(TestExample.ENVIRONMENT, actual); diff --git a/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/serialize/AmlSerializerTest.java b/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/serialize/AmlSerializerTest.java index ca59937a..2bc0a9dc 100644 --- a/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/serialize/AmlSerializerTest.java +++ b/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/serialize/AmlSerializerTest.java @@ -17,11 +17,32 @@ import io.adminshell.aas.v3.dataformat.aml.fixtures.FullExample; import io.adminshell.aas.v3.dataformat.SerializationException; -import io.adminshell.aas.v3.dataformat.aml.Aas2AmlConfig; +import io.adminshell.aas.v3.dataformat.aml.AmlSerializationConfig; import io.adminshell.aas.v3.dataformat.aml.AmlSerializer; import io.adminshell.aas.v3.dataformat.aml.id.IntegerIdGenerator; import io.adminshell.aas.v3.dataformat.aml.fixtures.TestExample; +import io.adminshell.aas.v3.dataformat.core.util.AasUtils; import io.adminshell.aas.v3.model.AssetAdministrationShellEnvironment; +import io.adminshell.aas.v3.model.DataTypeIEC61360; +import io.adminshell.aas.v3.model.IdentifierType; +import io.adminshell.aas.v3.model.KeyElements; +import io.adminshell.aas.v3.model.KeyType; +import io.adminshell.aas.v3.model.LangString; +import io.adminshell.aas.v3.model.ModelingKind; +import io.adminshell.aas.v3.model.Submodel; +import io.adminshell.aas.v3.model.impl.DefaultAssetAdministrationShell; +import io.adminshell.aas.v3.model.impl.DefaultAssetAdministrationShellEnvironment; +import io.adminshell.aas.v3.model.impl.DefaultDataSpecificationIEC61360; +import io.adminshell.aas.v3.model.impl.DefaultEmbeddedDataSpecification; +import io.adminshell.aas.v3.model.impl.DefaultIdentifier; +import io.adminshell.aas.v3.model.impl.DefaultKey; +import io.adminshell.aas.v3.model.impl.DefaultOperation; +import io.adminshell.aas.v3.model.impl.DefaultOperationVariable; +import io.adminshell.aas.v3.model.impl.DefaultProperty; +import io.adminshell.aas.v3.model.impl.DefaultReference; +import io.adminshell.aas.v3.model.impl.DefaultReferenceElement; +import io.adminshell.aas.v3.model.impl.DefaultSubmodel; +import io.adminshell.aas.v3.model.impl.DefaultSubmodelElementCollection; import java.io.File; import java.io.IOException; import java.nio.file.Files; @@ -40,12 +61,140 @@ public class AmlSerializerTest { private final AmlSerializer serializer = new AmlSerializer(); @Test -// @Ignore + @Ignore public void testExample() throws SerializationException, SAXException, IOException { validateAmlSerializer(TestExample.FILE, TestExample.ENVIRONMENT); } + @Test +// @Ignore + public void testReferenceElement() throws SerializationException, SAXException, IOException { + Submodel submodel = new DefaultSubmodel.Builder() + .idShort("submodel1") + .identification(new DefaultIdentifier.Builder() + .idType(IdentifierType.IRI) + .identifier("iri:submodel1") + .build()) + .kind(ModelingKind.INSTANCE) + .submodelElement(new DefaultProperty.Builder() + .idShort("property1") + .build()) + .submodelElement(new DefaultOperation.Builder() + .idShort("operation1") + .inputVariable(new DefaultOperationVariable.Builder() + .value(new DefaultSubmodelElementCollection.Builder() + .idShort("submodelElementCollection1") + .value(new DefaultReferenceElement.Builder() + .idShort("refElement1") + .value(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .idType(KeyType.IRI) + .type(KeyElements.SUBMODEL) + .value("iri:submodel1") + .build()) + .key(new DefaultKey.Builder() + .idType(KeyType.ID_SHORT) + .type(KeyElements.PROPERTY) + .value("property1") + .build()) + .build()) + .build()) + .value(new DefaultReferenceElement.Builder() + .idShort("refElement2") + .value(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .idType(KeyType.IRI) + .type(KeyElements.SUBMODEL) + .value("iri:submodel1") + .build()) + .key(new DefaultKey.Builder() + .idType(KeyType.ID_SHORT) + .type(KeyElements.OPERATION) + .value("operation1") + .build()) + .key(new DefaultKey.Builder() + .idType(KeyType.ID_SHORT) + .type(KeyElements.SUBMODEL_ELEMENT_COLLECTION) + .value("submodelElementCollection1") + .build()) + .key(new DefaultKey.Builder() + .idType(KeyType.ID_SHORT) + .type(KeyElements.REFERENCE_ELEMENT) + .value("refElement1") + .build()) + .build()) + .build()) + .build()) + .build()) + .build()) + .build(); + AssetAdministrationShellEnvironment environment = new DefaultAssetAdministrationShellEnvironment.Builder() + .assetAdministrationShells(new DefaultAssetAdministrationShell.Builder() + .identification(new DefaultIdentifier.Builder() + .idType(IdentifierType.IRI) + .identifier("iri:AAS1") + .build()) + .idShort("AAS1") + .submodel(AasUtils.identifiableToReference(submodel)) + .build()) + .submodels(submodel) + .build(); + String actual = new AmlSerializer().write(environment, AmlSerializationConfig.builder() + .idGenerator(new IntegerIdGenerator()) + .build()); + System.out.println(actual); + + } + + @Test + public void testEmbeddedDataSpecification() throws SerializationException, SAXException, IOException { + Submodel submodel = new DefaultSubmodel.Builder() + .idShort("submodel1") + .identification(new DefaultIdentifier.Builder() + .idType(IdentifierType.IRI) + .identifier("iri:submodel1") + .build()) + .kind(ModelingKind.INSTANCE) + .embeddedDataSpecification(new DefaultEmbeddedDataSpecification.Builder() + .dataSpecificationContent(new DefaultDataSpecificationIEC61360.Builder() + .dataType(DataTypeIEC61360.INTEGER_COUNT) + .preferredName(new LangString("de", "preferredName1")) + .shortName(new LangString("de", "shortName1")) + .symbol("some symbol1") + .value("value1") + .unit("unit1") + .build()) + .build()) + .embeddedDataSpecification(new DefaultEmbeddedDataSpecification.Builder() + .dataSpecificationContent(new DefaultDataSpecificationIEC61360.Builder() + .dataType(DataTypeIEC61360.INTEGER_COUNT) + .preferredName(new LangString("de", "preferredName2")) + .shortName(new LangString("de", "shortName2")) + .symbol("some symbol2") + .value("value2") + .unit("unit2") + .build()) + .build()) + .build(); + AssetAdministrationShellEnvironment environment = new DefaultAssetAdministrationShellEnvironment.Builder() + .assetAdministrationShells(new DefaultAssetAdministrationShell.Builder() + .identification(new DefaultIdentifier.Builder() + .idType(IdentifierType.IRI) + .identifier("iri:AAS1") + .build()) + .idShort("AAS1") + .submodel(AasUtils.identifiableToReference(submodel)) + .build()) + .submodels(submodel) + .build(); + String actual = new AmlSerializer().write(environment, AmlSerializationConfig.builder() + .idGenerator(new IntegerIdGenerator()) + .build()); + System.out.println(actual); + + } + @Test @Ignore public void testSAPFullExample() throws SerializationException { @@ -55,7 +204,7 @@ public void testSAPFullExample() throws SerializationException { private void validateAmlSerializer(File expectedFile, AssetAdministrationShellEnvironment environment) throws SerializationException, SAXException, IOException { String expected = Files.readString(expectedFile.toPath()); - String actual = new AmlSerializer().write(environment, Aas2AmlConfig.builder() + String actual = new AmlSerializer().write(environment, AmlSerializationConfig.builder() .idGenerator(new IntegerIdGenerator()) .build()); System.out.println(actual); diff --git a/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/DataSpecificationInfo.java b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/DataSpecificationInfo.java new file mode 100644 index 00000000..d822f4c2 --- /dev/null +++ b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/DataSpecificationInfo.java @@ -0,0 +1,44 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.core; + +import io.adminshell.aas.v3.model.DataSpecificationContent; +import io.adminshell.aas.v3.model.Reference; + +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/main/java/io/adminshell/aas/v3/dataformat/core/DataSpecificationManager.java b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/DataSpecificationManager.java index be9bf22a..7e37e9ca 100644 --- a/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/DataSpecificationManager.java +++ b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/DataSpecificationManager.java @@ -15,8 +15,8 @@ */ package io.adminshell.aas.v3.dataformat.core; +import io.adminshell.aas.v3.dataformat.core.util.AasUtils; import java.util.Arrays; -import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -27,6 +27,9 @@ import io.adminshell.aas.v3.model.Reference; import io.adminshell.aas.v3.model.impl.DefaultKey; import io.adminshell.aas.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 @@ -38,32 +41,19 @@ public class DataSpecificationManager { public static final String PROP_DATA_SPECIFICATION = "dataSpecification"; public static final String PROP_DATA_SPECIFICATION_CONTENT = "dataSpecificationContent"; - private static final Map> KNOWN_IMPLEMENTATIONS = Map.of( - createGlobalIri("http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/2/0"), - DataSpecificationIEC61360.class); + private static final Set KNOWN_IMPLEMENTATIONS = new HashSet<>(Arrays.asList( + new DataSpecificationInfo(DataSpecificationIEC61360.class, + createGlobalIri("http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/2/0"), + "IEC"))); /** - * Allows to register an additional data specification template based on any - * kind of Reference. + * Allows to register an additional data specification template * - * @param reference The reference used to identify the data specification - * template - * @param implementation The Java class implementing that template + * @param dataSpecification Details of the data specification template to + * register */ - public static void register(Reference reference, Class implementation) { - KNOWN_IMPLEMENTATIONS.put(reference, implementation); - } - - /** - * Allows to register an additional data specification template based on a - * global IRI. - * - * @param iri The IRI of the global reference used to identify the data - * specification template - * @param implementation The Java class implementing that template - */ - public static void registerGlobalIri(String iri, Class implementation) { - KNOWN_IMPLEMENTATIONS.put(createGlobalIri(iri), implementation); + public static void register(DataSpecificationInfo dataSpecification) { + KNOWN_IMPLEMENTATIONS.add(dataSpecification); } private static Reference createGlobalIri(String iri) { @@ -73,62 +63,44 @@ private static Reference createGlobalIri(String iri) { } /** - * Returns a Reference describing the data specification template - * implemented by the given class. If the class is unknown, an - * IllegalArgumentException is thrown + * 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 reference describing the data specification template - * implemented by the given class - * @throws IllegalArgumentException when implementation class is not known + * @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 Reference getReference(Class implementation) { - Reference result = getReferenceSafe(implementation); + public static DataSpecificationInfo getDataSpecification(Class implementation) { + DataSpecificationInfo result = getDataSpecification(x -> Objects.equals(x.getType(), implementation)); if (result == null) { - throw new IllegalArgumentException( - String.format("unknown data specification implementation '%s'", implementation.getName())); + result = getDataSpecification(x -> x.getType().isAssignableFrom(implementation)); } return result; } /** - * Returns a Reference describing the data specification template - * implemented by the given class. If the class is unknown, null is + * 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 reference describing the data specification template - * implemented by the given class, or null if the implementation class is - * unknown + * @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 Reference getReferenceSafe(Class implementation) { - Optional exactMatch = KNOWN_IMPLEMENTATIONS.entrySet().stream() - .filter(x -> Objects.equals(x.getValue(), implementation)).map(x -> x.getKey()).findFirst(); + 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(); } - Optional inheritanceMatch = KNOWN_IMPLEMENTATIONS.entrySet().stream() - .filter(x -> x.getValue().isAssignableFrom(implementation)).map(x -> x.getKey()).findFirst(); - if (inheritanceMatch.isPresent()) { - return inheritanceMatch.get(); - } return null; } - - /** - * Returns the Java class implementing the data specification template - * identified by the given reference. If the reference is unkown - * - * @param reference A reference used to identify the used data specification - * template. - * @return Java class implementing the given data specification template - * @throws IllegalArgumentException if there is no known implementation for - * the given reference identifier - */ - public static Class getImplementation(Reference reference) { - if (KNOWN_IMPLEMENTATIONS.containsKey(reference)) { - return KNOWN_IMPLEMENTATIONS.get(reference); - } - throw new IllegalArgumentException(String.format("unknown data specification reference '%s'", reference)); - } } diff --git a/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/deserialization/EmbeddedDataSpecificationDeserializer.java b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/deserialization/EmbeddedDataSpecificationDeserializer.java index 8d3b4125..2c031437 100644 --- a/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/deserialization/EmbeddedDataSpecificationDeserializer.java +++ b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/deserialization/EmbeddedDataSpecificationDeserializer.java @@ -60,7 +60,7 @@ public EmbeddedDataSpecification deserialize(JsonParser parser, DeserializationC Reference reference = parserReference.readValueAs(Reference.class); JsonNode nodeContent = node.get(PROP_DATA_SPECIFICATION_CONTENT); if (nodeContent != null) { - Class targetClass = DataSpecificationManager.getImplementation(reference); + Class targetClass = DataSpecificationManager.getDataSpecification(reference).getType(); JsonParser parserContent = parser.getCodec().getFactory().getCodec().treeAsTokens(nodeContent); parserContent.nextToken(); DataSpecificationContent content = parserContent.readValueAs(targetClass); diff --git a/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/serialization/EmbeddedDataSpecificationSerializer.java b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/serialization/EmbeddedDataSpecificationSerializer.java index 0be44532..a7b8f2e2 100644 --- a/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/serialization/EmbeddedDataSpecificationSerializer.java +++ b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/serialization/EmbeddedDataSpecificationSerializer.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.JsonSerializer; import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.databind.jsontype.TypeSerializer; +import io.adminshell.aas.v3.dataformat.core.DataSpecificationInfo; import io.adminshell.aas.v3.dataformat.core.DataSpecificationManager; import io.adminshell.aas.v3.model.DataSpecificationContent; @@ -52,7 +53,8 @@ public void serialize(EmbeddedDataSpecification data, JsonGenerator generator, S Reference reference = null; DataSpecificationContent content = data.getDataSpecificationContent(); if (content != null) { - Reference implicitType = DataSpecificationManager.getReferenceSafe(content.getClass()); + DataSpecificationInfo implicitDataSpecification = DataSpecificationManager.getDataSpecification(content.getClass()); + Reference implicitType = implicitDataSpecification != null ? implicitDataSpecification.getReference() : null; Reference explicitType = data.getDataSpecification(); if (implicitType == null) { logger.warn( diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util/AASUtils.java b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/util/AasUtils.java similarity index 55% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util/AASUtils.java rename to dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/util/AasUtils.java index 5252bb48..357a1638 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util/AASUtils.java +++ b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/util/AasUtils.java @@ -13,12 +13,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.util; +package io.adminshell.aas.v3.dataformat.core.util; import com.google.common.base.Objects; +import com.google.common.reflect.TypeToken; import io.adminshell.aas.v3.dataformat.core.ReflectionHelper; import io.adminshell.aas.v3.dataformat.core.deserialization.EnumDeserializer; import io.adminshell.aas.v3.dataformat.core.serialization.EnumSerializer; +import io.adminshell.aas.v3.dataformat.core.visitor.IdentifiableCollector; +import io.adminshell.aas.v3.dataformat.mapping.util.TypeUtils; import io.adminshell.aas.v3.model.AssetAdministrationShell; import io.adminshell.aas.v3.model.AssetAdministrationShellEnvironment; import io.adminshell.aas.v3.model.Identifiable; @@ -26,23 +29,30 @@ import io.adminshell.aas.v3.model.KeyElements; import io.adminshell.aas.v3.model.KeyType; import io.adminshell.aas.v3.model.ModelingKind; +import io.adminshell.aas.v3.model.Operation; import io.adminshell.aas.v3.model.Referable; import io.adminshell.aas.v3.model.Reference; import io.adminshell.aas.v3.model.Submodel; +import io.adminshell.aas.v3.model.SubmodelElement; import io.adminshell.aas.v3.model.impl.DefaultKey; import io.adminshell.aas.v3.model.impl.DefaultReference; +import java.beans.PropertyDescriptor; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.ArrayList; +import java.util.Collection; import java.util.Iterator; import java.util.List; import java.util.Optional; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import java.util.stream.Collectors; import java.util.stream.Stream; -public class AASUtils { +public class AasUtils { - private AASUtils() { + private AasUtils() { } public static String asString(Reference reference) { @@ -122,12 +132,12 @@ public static Reference asReference(Reference parent, Referable element) { if (element == null) { return null; } else if (Identifiable.class.isAssignableFrom(element.getClass())) { - return AASUtils.identifiableToReference((Identifiable) element); + return AasUtils.identifiableToReference((Identifiable) element); } else { - Reference result = AASUtils.cloneReference(parent); + Reference result = AasUtils.cloneReference(parent); if (result != null) { result.getKeys().add(new DefaultKey.Builder() - .type(AASUtils.referableToKeyType(element)) + .type(AasUtils.referableToKeyType(element)) .idType(KeyType.ID_SHORT) .value(element.getIdShort()) .build()); @@ -136,7 +146,7 @@ public static Reference asReference(Reference parent, Referable element) { } } - public static boolean equals(Reference ref1, Reference ref2) { + public static boolean sameAs(Reference ref1, Reference ref2) { boolean ref1Empty = ref1 == null || ref1.getKeys() == null || ref1.getKeys().isEmpty(); boolean ref2Empty = ref2 == null || ref2.getKeys() == null || ref2.getKeys().isEmpty(); if (ref1Empty && ref2Empty) { @@ -191,59 +201,149 @@ public static Referable resolve(Reference reference, AssetAdministrationShellEnv if (reference == null || reference.getKeys() == null || reference.getKeys().isEmpty()) { return null; } - List keys = reference.getKeys(); - - //get reduced Key list from last identifiable key to end - List reducedKeyList = new ArrayList<>(); - reduceKeyList(keys, reducedKeyList); - - //resolve the reference - Referable searchedReferable = null; - for (int i = 0; i < reducedKeyList.size(); i++) { - - Key actualKey = reducedKeyList.get(i); - String className = EnumSerializer.translate(actualKey.getType().name()); - try { - - //get class from the key type and calculate the method name for getting a list of the elements - //e.g. "getSubmodelElements" - Class c = Class.forName(ReflectionHelper.MODEL_PACKAGE_NAME + "." + className); - - //TODO: visitor pattern? e.g. for Operation Variables - String methodName = "get" + className + "s"; - - Method method = null; - - if (i == 0) { - //first Key is identifiable - - //get list of elements due to the key type - method = env.getClass().getMethod(methodName); - List list = (List) method.invoke(env); - searchedReferable = getIdentifiable(actualKey, c, list); + Set identifiables = new IdentifiableCollector(env).collect(); + Object current = null; + int i = reference.getKeys().size() - 1; + for (; i >= 0; i--) { + Key key = reference.getKeys().get(i); + Optional referencedType = keyTypeToClass(key.getType()); + if (referencedType.isPresent()) { + List matchingIdentifiables = identifiables.stream() + .filter(x -> referencedType.get().isAssignableFrom(x.getClass())) + .filter(x -> key.getIdType().name().equals(x.getIdentification().getIdType().name())) + .filter(x -> x.getIdentification().getIdentifier().equals(key.getValue())) + .collect(Collectors.toList()); + if (matchingIdentifiables.size() > 1) { + throw new IllegalArgumentException("found multiple matching Identifiables for id '" + key.getValue() + "'"); + } + if (matchingIdentifiables.size() == 1) { + current = matchingIdentifiables.get(0); + break; + } + } + } + if (current == null) { + return null; + } + i++; + if (i == reference.getKeys().size()) { + return (Referable) current; + } + // follow idShort path until target + for (; i < reference.getKeys().size(); i++) { + Key key = reference.getKeys().get(i); + Optional keyType = keyTypeToClass(key.getType()); + if (keyType.isPresent()) { + 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 { - - //if searchedReferable is null then the first identifiable could not be found - if (searchedReferable == null) { - return null; + List matchingProperties = TypeUtils.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.get())) + .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.get().getSimpleName(), + current.getClass().getSimpleName())); } - - //get list of elements due to the key type - method = searchedReferable.getClass().getMethod(methodName); - List list = (List) method.invoke(searchedReferable); - searchedReferable = getReferable(actualKey, list); + 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 RuntimeException("error resolving reference", ex); + } + Optional next = collection.stream() + .filter(x -> ((Referable) x).getIdShort().equals(key.getValue())) + .findFirst(); + if (next.isEmpty()) { + throw new IllegalArgumentException("error resolving reference - could not find idShort " + key.getValue()); + } + current = next.get(); } - - } catch (ClassNotFoundException | NoSuchMethodException e) { - e.printStackTrace(); - return null; - } catch (InvocationTargetException | IllegalAccessException e) { - e.printStackTrace(); } } - - return searchedReferable; + return (Referable) current; + +// +// +// +// +// +// +// +// +// List keys = reference.getKeys(); +// +// //get reduced Key list from last identifiable key to end +// List reducedKeyList = new ArrayList<>(); +// reduceKeyList(keys, reducedKeyList); +// +// //resolve the reference +// Referable searchedReferable = null; +// for (int i = 0; i < reducedKeyList.size(); i++) { +// +// Key actualKey = reducedKeyList.get(i); +// String className = EnumSerializer.translate(actualKey.getType().name()); +// try { +// +// //get class from the key type and calculate the method name for getting a list of the elements +// //e.g. "getSubmodelElements" +// Class c = Class.forName(ReflectionHelper.MODEL_PACKAGE_NAME + "." + className); +// +// TypeUtils.getAASProperties(value.getClass()) +// //TODO: visitor pattern? e.g. for Operation Variables +// String methodName = "get" + className + "s"; +// +// Method method = null; +// +// if (i == 0) { +// //first Key is identifiable +// +// //get list of elements due to the key type +// method = env.getClass().getMethod(methodName); +// List list = (List) method.invoke(env); +// searchedReferable = getIdentifiable(actualKey, c, list); +// +// } else { +// +// //if searchedReferable is null then the first identifiable could not be found +// if (searchedReferable == null) { +// return null; +// } +// +// //get list of elements due to the key type +// method = searchedReferable.getClass().getMethod(methodName); +// List list = (List) method.invoke(searchedReferable); +// searchedReferable = getReferable(actualKey, list); +// } +// +// } catch (ClassNotFoundException | NoSuchMethodException e) { +// e.printStackTrace(); +// return null; +// } catch (InvocationTargetException | IllegalAccessException e) { +// e.printStackTrace(); +// } +// } +// +// return searchedReferable; } private static void reduceKeyList(List keys, List reducedKeyList) { diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util/AbstractReferableVisitor.java b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/visitor/AbstractReferableVisitor.java similarity index 94% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util/AbstractReferableVisitor.java rename to dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/visitor/AbstractReferableVisitor.java index 44d1038f..6e669cbf 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util/AbstractReferableVisitor.java +++ b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/visitor/AbstractReferableVisitor.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.util; +package io.adminshell.aas.v3.dataformat.core.visitor; import io.adminshell.aas.v3.model.Property; import io.adminshell.aas.v3.model.Submodel; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util/AbstractVisitor.java b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/visitor/AbstractVisitor.java similarity index 94% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util/AbstractVisitor.java rename to dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/visitor/AbstractVisitor.java index 5aae42d2..38b192c5 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util/AbstractVisitor.java +++ b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/visitor/AbstractVisitor.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.util; +package io.adminshell.aas.v3.dataformat.core.visitor; import java.lang.reflect.Method; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util/AssetAdministrationShellElementVisitor.java b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/visitor/AssetAdministrationShellElementVisitor.java similarity index 96% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util/AssetAdministrationShellElementVisitor.java rename to dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/visitor/AssetAdministrationShellElementVisitor.java index 4c921e97..deeafa2d 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util/AssetAdministrationShellElementVisitor.java +++ b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/visitor/AssetAdministrationShellElementVisitor.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.util; +package io.adminshell.aas.v3.dataformat.core.visitor; import io.adminshell.aas.v3.model.AccessControl; import io.adminshell.aas.v3.model.AccessControlPolicyPoints; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util/AssetAdministrationShellElementWalkerVisitor.java b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/visitor/AssetAdministrationShellElementWalkerVisitor.java similarity index 97% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util/AssetAdministrationShellElementWalkerVisitor.java rename to dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/visitor/AssetAdministrationShellElementWalkerVisitor.java index 8a367ea9..b98b9520 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/util/AssetAdministrationShellElementWalkerVisitor.java +++ b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/visitor/AssetAdministrationShellElementWalkerVisitor.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.util; +package io.adminshell.aas.v3.dataformat.core.visitor; import io.adminshell.aas.v3.model.AccessControl; import io.adminshell.aas.v3.model.AccessControlPolicyPoints; diff --git a/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/visitor/IdentifiableCollector.java b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/visitor/IdentifiableCollector.java new file mode 100644 index 00000000..62f2babd --- /dev/null +++ b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/visitor/IdentifiableCollector.java @@ -0,0 +1,69 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.core.visitor; + +import io.adminshell.aas.v3.model.Asset; +import io.adminshell.aas.v3.model.AssetAdministrationShell; +import io.adminshell.aas.v3.model.AssetAdministrationShellEnvironment; +import io.adminshell.aas.v3.model.ConceptDescription; +import io.adminshell.aas.v3.model.Identifiable; +import io.adminshell.aas.v3.model.Submodel; +import java.util.HashSet; +import java.util.Set; + +public class IdentifiableCollector { + + private AssetAdministrationShellEnvironment env; + + public IdentifiableCollector(AssetAdministrationShellEnvironment 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(Asset 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-xml/src/main/java/io/adminshell/aas/v3/dataformat/xml/deserialization/DataSpecificationDeserializer.java b/dataformat-xml/src/main/java/io/adminshell/aas/v3/dataformat/xml/deserialization/DataSpecificationDeserializer.java index 35ef059d..d9920274 100644 --- a/dataformat-xml/src/main/java/io/adminshell/aas/v3/dataformat/xml/deserialization/DataSpecificationDeserializer.java +++ b/dataformat-xml/src/main/java/io/adminshell/aas/v3/dataformat/xml/deserialization/DataSpecificationDeserializer.java @@ -51,7 +51,7 @@ public EmbeddedDataSpecification deserialize(JsonParser parser, DeserializationC JsonParser parserReference = parser.getCodec().getFactory().getCodec().treeAsTokens(nodeDataSpecification); parserReference.nextToken(); Reference reference = parserReference.readValueAs(Reference.class); - Class targetClass = DataSpecificationManager.getImplementation(reference); + Class targetClass = DataSpecificationManager.getDataSpecification(reference).getType(); JsonNode nodeContent = node.get(PROP_DATA_SPECIFICATION_CONTENT); if (nodeContent == null) { context.reportInputMismatch(targetClass, "property {} must not be empty", PROP_DATA_SPECIFICATION_CONTENT); diff --git a/dataformat-xml/src/main/java/io/adminshell/aas/v3/dataformat/xml/serialization/EmbeddedDataSpecificationSerializer.java b/dataformat-xml/src/main/java/io/adminshell/aas/v3/dataformat/xml/serialization/EmbeddedDataSpecificationSerializer.java index 1320f7f1..711cda56 100644 --- a/dataformat-xml/src/main/java/io/adminshell/aas/v3/dataformat/xml/serialization/EmbeddedDataSpecificationSerializer.java +++ b/dataformat-xml/src/main/java/io/adminshell/aas/v3/dataformat/xml/serialization/EmbeddedDataSpecificationSerializer.java @@ -26,6 +26,7 @@ import com.fasterxml.jackson.databind.JsonSerializer; import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.databind.jsontype.TypeSerializer; +import io.adminshell.aas.v3.dataformat.core.DataSpecificationInfo; import static io.adminshell.aas.v3.dataformat.core.DataSpecificationManager.PROP_DATA_SPECIFICATION; import static io.adminshell.aas.v3.dataformat.core.DataSpecificationManager.PROP_DATA_SPECIFICATION_CONTENT; @@ -52,7 +53,8 @@ public void serialize(EmbeddedDataSpecification data, JsonGenerator generator, S Reference reference = null; DataSpecificationContent content = data.getDataSpecificationContent(); if (content != null) { - Reference implicitType = DataSpecificationManager.getReferenceSafe(content.getClass()); + 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 ({}). " From 9a20e977e03658b2c540d1dd52b3cd3001b3a99a Mon Sep 17 00:00:00 2001 From: Jan-Wilhelm Blume Date: Thu, 12 Aug 2021 14:48:36 +0200 Subject: [PATCH 13/18] Changed unvalid References in ReferenceElements, (Annotated-)RelationshipElements and BasicEvents --- .../dataformat/aml/fixtures/FullExample.java | 178 +++++++++++++++++- 1 file changed, 174 insertions(+), 4 deletions(-) diff --git a/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/fixtures/FullExample.java b/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/fixtures/FullExample.java index 80ef152f..275c457e 100644 --- a/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/fixtures/FullExample.java +++ b/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/fixtures/FullExample.java @@ -397,6 +397,16 @@ public class FullExample { .build()) .build()) .first(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.Submodel) + .value("https://acplt.org/Test_Submodel") + .idType(KeyType.IRI) + .build()) + .key(new DefaultKey.Builder() + .type(KeyElements.SubmodelElementCollection) + .value("ExampleSubmodelCollectionOrdered") + .idType(KeyType.ID_SHORT) + .build()) .key(new DefaultKey.Builder() .type(KeyElements.PROPERTY) .value("ExampleProperty") @@ -404,6 +414,16 @@ public class FullExample { .build()) .build()) .second(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.Submodel) + .value("http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial") + .idType(KeyType.IRI) + .build()) + .key(new DefaultKey.Builder() + .type(KeyElements.Entity) + .value("ExampleEntity") + .idType(KeyType.ID_SHORT) + .build()) .key(new DefaultKey.Builder() .type(KeyElements.PROPERTY) .value("ExampleProperty2") @@ -424,6 +444,16 @@ public class FullExample { .build()) .build()) .first(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.Submodel) + .value("https://acplt.org/Test_Submodel") + .idType(KeyType.IRI) + .build()) + .key(new DefaultKey.Builder() + .type(KeyElements.SubmodelElementCollection) + .value("ExampleSubmodelCollectionOrdered") + .idType(KeyType.ID_SHORT) + .build()) .key(new DefaultKey.Builder() .type(KeyElements.PROPERTY) .value("ExampleProperty") @@ -431,6 +461,16 @@ public class FullExample { .build()) .build()) .second(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.Submodel) + .value("http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial") + .idType(KeyType.IRI) + .build()) + .key(new DefaultKey.Builder() + .type(KeyElements.Entity) + .value("ExampleEntity") + .idType(KeyType.ID_SHORT) + .build()) .key(new DefaultKey.Builder() .type(KeyElements.PROPERTY) .value("ExampleProperty2") @@ -556,6 +596,16 @@ public class FullExample { .build()) .build()) .observed(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.Submodel) + .value("https://acplt.org/Test_Submodel") + .idType(KeyType.IRI) + .build()) + .key(new DefaultKey.Builder() + .type(KeyElements.SubmodelElementCollection) + .value("ExampleSubmodelCollectionOrdered") + .idType(KeyType.ID_SHORT) + .build()) .key(new DefaultKey.Builder() .type(KeyElements.PROPERTY) .idType(KeyType.ID_SHORT) @@ -691,6 +741,16 @@ public class FullExample { .build()) .build()) .value(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.Submodel) + .value("https://acplt.org/Test_Submodel") + .idType(KeyType.IRI) + .build()) + .key(new DefaultKey.Builder() + .type(KeyElements.SubmodelElementCollection) + .value("ExampleSubmodelCollectionOrdered") + .idType(KeyType.ID_SHORT) + .build()) .key(new DefaultKey.Builder() .type(KeyElements.PROPERTY) .idType(KeyType.ID_SHORT) @@ -712,6 +772,16 @@ public class FullExample { .submodelElement(new DefaultRelationshipElement.Builder() .idShort("ExampleRelationshipElement") .first(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.Submodel) + .value("https://acplt.org/Test_Submodel_Mandatory") + .idType(KeyType.IRI) + .build()) + .key(new DefaultKey.Builder() + .type(KeyElements.SubmodelElementCollection) + .value("ExampleSubmodelCollectionOrdered") + .idType(KeyType.ID_SHORT) + .build()) .key(new DefaultKey.Builder() .type(KeyElements.PROPERTY) .value("ExampleProperty") @@ -719,9 +789,19 @@ public class FullExample { .build()) .build()) .second(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.Submodel) + .value("https://acplt.org/Test_Submodel_Mandatory") + .idType(KeyType.IRI) + .build()) + .key(new DefaultKey.Builder() + .type(KeyElements.SubmodelElementCollection) + .value("ExampleSubmodelCollectionOrdered") + .idType(KeyType.ID_SHORT) + .build()) .key(new DefaultKey.Builder() .type(KeyElements.PROPERTY) - .value("ExampleProperty") + .value("ExampleMultiLanguageProperty") .idType(KeyType.ID_SHORT) .build()) .build()) @@ -729,6 +809,16 @@ public class FullExample { .submodelElement(new DefaultAnnotatedRelationshipElement.Builder() .idShort("ExampleAnnotatedRelationshipElement") .first(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.Submodel) + .value("https://acplt.org/Test_Submodel_Mandatory") + .idType(KeyType.IRI) + .build()) + .key(new DefaultKey.Builder() + .type(KeyElements.SubmodelElementCollection) + .value("ExampleSubmodelCollectionOrdered") + .idType(KeyType.ID_SHORT) + .build()) .key(new DefaultKey.Builder() .type(KeyElements.PROPERTY) .value("ExampleProperty") @@ -736,9 +826,19 @@ public class FullExample { .build()) .build()) .second(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.Submodel) + .value("https://acplt.org/Test_Submodel_Mandatory") + .idType(KeyType.IRI) + .build()) + .key(new DefaultKey.Builder() + .type(KeyElements.SubmodelElementCollection) + .value("ExampleSubmodelCollectionOrdered") + .idType(KeyType.ID_SHORT) + .build()) .key(new DefaultKey.Builder() .type(KeyElements.PROPERTY) - .value("ExampleProperty") + .value("ExampleMultiLanguageProperty") .idType(KeyType.ID_SHORT) .build()) .build()) @@ -752,6 +852,16 @@ public class FullExample { .submodelElement(new DefaultBasicEvent.Builder() .idShort("ExampleBasicEvent") .observed(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.Submodel) + .value("https://acplt.org/Test_Submodel_Mandatory") + .idType(KeyType.IRI) + .build()) + .key(new DefaultKey.Builder() + .type(KeyElements.SubmodelElementCollection) + .value("ExampleSubmodelCollectionOrdered") + .idType(KeyType.ID_SHORT) + .build()) .key(new DefaultKey.Builder() .type(KeyElements.PROPERTY) .idType(KeyType.ID_SHORT) @@ -840,6 +950,16 @@ public class FullExample { .build()) .build()) .first(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.Submodel) + .value("https://acplt.org/Test_Submodel_Missing") + .idType(KeyType.IRI) + .build()) + .key(new DefaultKey.Builder() + .type(KeyElements.SubmodelElementCollection) + .value("ExampleSubmodelCollectionOrdered") + .idType(KeyType.ID_SHORT) + .build()) .key(new DefaultKey.Builder() .type(KeyElements.PROPERTY) .value("ExampleProperty") @@ -847,9 +967,19 @@ public class FullExample { .build()) .build()) .second(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.Submodel) + .value("https://acplt.org/Test_Submodel_Missing") + .idType(KeyType.IRI) + .build()) + .key(new DefaultKey.Builder() + .type(KeyElements.SubmodelElementCollection) + .value("ExampleSubmodelCollectionOrdered") + .idType(KeyType.ID_SHORT) + .build()) .key(new DefaultKey.Builder() .type(KeyElements.PROPERTY) - .value("ExampleProperty") + .value("ExampleMultiLanguageProperty") .idType(KeyType.ID_SHORT) .build()) .build()) @@ -867,6 +997,16 @@ public class FullExample { .build()) .build()) .first(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.Submodel) + .value("https://acplt.org/Test_Submodel_Missing") + .idType(KeyType.IRI) + .build()) + .key(new DefaultKey.Builder() + .type(KeyElements.SubmodelElementCollection) + .value("ExampleSubmodelCollectionOrdered") + .idType(KeyType.ID_SHORT) + .build()) .key(new DefaultKey.Builder() .type(KeyElements.PROPERTY) .value("ExampleProperty") @@ -874,9 +1014,19 @@ public class FullExample { .build()) .build()) .second(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.Submodel) + .value("https://acplt.org/Test_Submodel_Missing") + .idType(KeyType.IRI) + .build()) + .key(new DefaultKey.Builder() + .type(KeyElements.SubmodelElementCollection) + .value("ExampleSubmodelCollectionOrdered") + .idType(KeyType.ID_SHORT) + .build()) .key(new DefaultKey.Builder() .type(KeyElements.PROPERTY) - .value("ExampleProperty") + .value("ExampleMultiLanguageProperty") .idType(KeyType.ID_SHORT) .build()) .build()) @@ -990,6 +1140,16 @@ public class FullExample { .build()) .build()) .observed(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.Submodel) + .value("https://acplt.org/Test_Submodel_Missing") + .idType(KeyType.IRI) + .build()) + .key(new DefaultKey.Builder() + .type(KeyElements.SubmodelElementCollection) + .value("ExampleSubmodelCollectionOrdered") + .idType(KeyType.ID_SHORT) + .build()) .key(new DefaultKey.Builder() .type(KeyElements.PROPERTY) .idType(KeyType.ID_SHORT) @@ -1116,6 +1276,16 @@ public class FullExample { .build()) .build()) .value(new DefaultReference.Builder() + .key(new DefaultKey.Builder() + .type(KeyElements.Submodel) + .value("https://acplt.org/Test_Submodel_Missing") + .idType(KeyType.IRI) + .build()) + .key(new DefaultKey.Builder() + .type(KeyElements.SubmodelElementCollection) + .value("ExampleSubmodelCollectionOrdered") + .idType(KeyType.ID_SHORT) + .build()) .key(new DefaultKey.Builder() .type(KeyElements.PROPERTY) .idType(KeyType.ID_SHORT) From f4af62b55e4c39be7a3b8bfb213b5cbe78dfebc9 Mon Sep 17 00:00:00 2001 From: Jacoby Date: Thu, 12 Aug 2021 15:00:23 +0200 Subject: [PATCH 14/18] refactoring and javadoc --- .../aml/AmlDeserializationConfig.java | 28 + .../v3/dataformat/aml/AmlDeserializer.java | 7 +- .../v3/dataformat/aml/AmlDocumentInfo.java | 66 +- .../aml/AmlSerializationConfig.java | 49 +- .../aas/v3/dataformat/aml/AmlSerializer.java | 20 +- .../aml/aml2aas/AasTypeFactory.java | 44 - .../aml/deserialization/AasTypeFactory.java | 77 + .../Aml2AasMapper.java | 23 +- .../AmlParser.java | 24 +- .../DefaultMapper.java | 59 +- .../{aml2aas => deserialization}/Mapper.java | 7 +- .../MappingContext.java | 5 +- ...tAdministrationShellEnvironmentMapper.java | 8 +- .../aml/header/AutomationMLVersion.java | 3 + .../v3/dataformat/aml/header/WriterInfo.java | 3 + .../AasToAmlMapper.java | 69 +- .../AmlGenerator.java | 16 +- .../DefaultCollectionMapper.java | 2 +- .../DefaultMapper.java | 6 +- .../IdentityProvider.java | 4 +- .../{aas2aml => serialization}/Mapper.java | 2 +- .../MappingContext.java | 4 +- .../{ => serialization}/id/IdGenerator.java | 2 +- .../id/IntegerIdGenerator.java | 2 +- .../{ => serialization}/id/UuidGenerator.java | 2 +- ...tAdministrationShellEnvironmentMapper.java | 12 +- .../AssetAdministrationShellMapper.java | 14 +- .../mappers}/ConstraintCollectionMapper.java | 8 +- .../DataSpecificationContentMapper.java | 8 +- .../DataSpecificationIEC61360Mapper.java | 8 +- .../mappers}/DataSpecificationMapper.java | 8 +- ...ddedDataSpecificationCollectionMapper.java | 8 +- .../mappers}/FileMapper.java | 8 +- .../mappers}/LangStringCollectionMapper.java | 8 +- .../OperationVariableCollectionMapper.java | 8 +- .../mappers}/OperationVariableMapper.java | 8 +- .../mappers}/QualifierMapper.java | 8 +- .../mappers}/ReferenceCollectionMapper.java | 8 +- .../mappers}/ReferenceElementMapper.java | 10 +- .../mappers/ReferenceMapper.java | 39 + .../mappers}/RelationshipElementMapper.java | 10 +- .../mappers}/SubmodelMapper.java | 8 +- .../mappers}/ViewMapper.java | 8 +- .../naming/AbstractClassNamingStrategy.java | 6 +- .../naming/IdClassNamingStrategy.java | 2 +- .../naming/NamingStrategy.java | 2 +- .../naming/NumberingClassNamingStrategy.java | 2 +- .../naming/PropertyNamingStrategy.java | 6 +- .../dataformat/aml/fixtures/TestExample.java | 4 +- .../aml/serialize/AmlDeserializerTest.java | 1 - .../aml/serialize/AmlSerializerTest.java | 12 +- .../test/resources/test_demo_full_example.aml | 3724 +++++++++++++++++ .../aas/v3/dataformat/Deserializer.java | 13 +- .../core/DataSpecificationInfo.java | 3 + .../core/DataSpecificationManager.java | 10 +- .../deserialization/EnumDeserializer.java | 25 +- .../core/serialization/EnumSerializer.java | 25 +- .../aas/v3/dataformat/core/util/AasUtils.java | 394 +- .../aas/v3/dataformat/core/util/FooBar.java | 24 + .../IdentifiableCollector.java | 7 +- .../util/MostSpecificTypeTokenComparator.java | 36 + .../visitor/AbstractReferableVisitor.java | 70 - .../core/visitor/AbstractVisitor.java | 58 - .../aas/v3/dataformat/mapping/Mapper.java | 6 + .../v3/dataformat/mapping/MappingContext.java | 6 + .../dataformat/mapping/MappingException.java | 3 + .../dataformat/mapping/MappingProvider.java | 23 +- .../dataformat/mapping/SourceBasedMapper.java | 15 + .../dataformat/mapping/TargetBasedMapper.java | 16 + .../v3/dataformat/mapping/util/TypeUtils.java | 71 - ...mespaceIndependentReferenceSerializer.java | 5 +- pom.xml | 2 +- 72 files changed, 4618 insertions(+), 674 deletions(-) delete mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/AasTypeFactory.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/deserialization/AasTypeFactory.java rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/{aml2aas => deserialization}/Aml2AasMapper.java (70%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/{aml2aas => deserialization}/AmlParser.java (63%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/{aml2aas => deserialization}/DefaultMapper.java (79%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/{aml2aas => deserialization}/Mapper.java (81%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/{aml2aas => deserialization}/MappingContext.java (91%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/{aml2aas/custom => deserialization/mappers}/AssetAdministrationShellEnvironmentMapper.java (88%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/{aas2aml => serialization}/AasToAmlMapper.java (61%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/{aas2aml => serialization}/AmlGenerator.java (93%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/{aas2aml => serialization}/DefaultCollectionMapper.java (95%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/{aas2aml => serialization}/DefaultMapper.java (94%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/{aas2aml => serialization}/IdentityProvider.java (88%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/{aas2aml => serialization}/Mapper.java (90%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/{aas2aml => serialization}/MappingContext.java (94%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/{ => serialization}/id/IdGenerator.java (89%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/{ => serialization}/id/IntegerIdGenerator.java (90%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/{ => serialization}/id/UuidGenerator.java (90%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/{aas2aml/custom => serialization/mappers}/AssetAdministrationShellEnvironmentMapper.java (90%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/{aas2aml/custom => serialization/mappers}/AssetAdministrationShellMapper.java (80%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/{aas2aml/custom => serialization/mappers}/ConstraintCollectionMapper.java (79%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/{aas2aml/custom => serialization/mappers}/DataSpecificationContentMapper.java (82%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/{aas2aml/custom => serialization/mappers}/DataSpecificationIEC61360Mapper.java (85%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/{aas2aml/custom => serialization/mappers}/DataSpecificationMapper.java (86%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/{aas2aml/custom => serialization/mappers}/EmbeddedDataSpecificationCollectionMapper.java (93%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/{aas2aml/custom => serialization/mappers}/FileMapper.java (88%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/{aas2aml/custom => serialization/mappers}/LangStringCollectionMapper.java (86%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/{aas2aml/custom => serialization/mappers}/OperationVariableCollectionMapper.java (84%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/{aas2aml/custom => serialization/mappers}/OperationVariableMapper.java (79%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/{aas2aml/custom => serialization/mappers}/QualifierMapper.java (80%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/{aas2aml/custom => serialization/mappers}/ReferenceCollectionMapper.java (79%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/{aas2aml/custom => serialization/mappers}/ReferenceElementMapper.java (86%) create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/ReferenceMapper.java rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/{aas2aml/custom => serialization/mappers}/RelationshipElementMapper.java (88%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/{aas2aml/custom => serialization/mappers}/SubmodelMapper.java (81%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/{aas2aml/custom => serialization/mappers}/ViewMapper.java (89%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/{ => serialization}/naming/AbstractClassNamingStrategy.java (91%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/{ => serialization}/naming/IdClassNamingStrategy.java (91%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/{ => serialization}/naming/NamingStrategy.java (89%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/{ => serialization}/naming/NumberingClassNamingStrategy.java (92%) rename dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/{ => serialization}/naming/PropertyNamingStrategy.java (90%) create mode 100644 dataformat-aml/src/test/resources/test_demo_full_example.aml create mode 100644 dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/util/FooBar.java rename dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/{visitor => util}/IdentifiableCollector.java (87%) create mode 100644 dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/util/MostSpecificTypeTokenComparator.java delete mode 100644 dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/visitor/AbstractReferableVisitor.java delete mode 100644 dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/visitor/AbstractVisitor.java delete mode 100644 dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/util/TypeUtils.java diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlDeserializationConfig.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlDeserializationConfig.java index 6211703b..be07bad7 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlDeserializationConfig.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlDeserializationConfig.java @@ -15,6 +15,34 @@ */ package io.adminshell.aas.v3.dataformat.aml; +import io.adminshell.aas.v3.dataformat.aml.deserialization.AasTypeFactory; + public class AmlDeserializationConfig { + public static Builder builder() { + return new Builder(); + } + + private final AasTypeFactory typeFactory; + + private AmlDeserializationConfig(AasTypeFactory typeFactory) { + this.typeFactory = typeFactory; + } + public AasTypeFactory getTypeFactory() { + return typeFactory; + } + + public static class Builder { + + private AasTypeFactory typeFactory = new AasTypeFactory(); + + public AmlDeserializationConfig build() { + return new AmlDeserializationConfig(typeFactory); + } + + public Builder typeFactory(AasTypeFactory value) { + this.typeFactory = value; + return this; + } + } } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlDeserializer.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlDeserializer.java index 55e72177..84d88f6b 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlDeserializer.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlDeserializer.java @@ -17,7 +17,7 @@ import io.adminshell.aas.v3.dataformat.DeserializationException; import io.adminshell.aas.v3.dataformat.Deserializer; -import io.adminshell.aas.v3.dataformat.aml.aml2aas.Aml2AasMapper; +import io.adminshell.aas.v3.dataformat.aml.deserialization.Aml2AasMapper; import io.adminshell.aas.v3.dataformat.aml.model.caex.CAEXFile; import io.adminshell.aas.v3.dataformat.mapping.MappingException; import io.adminshell.aas.v3.model.AssetAdministrationShellEnvironment; @@ -28,6 +28,9 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +/** + * Class for deserializing/parsing AAS AML documents. + */ public class AmlDeserializer implements Deserializer { private static final Logger log = LoggerFactory.getLogger(AmlDeserializer.class); @@ -38,7 +41,7 @@ public AssetAdministrationShellEnvironment read(String value) throws Deserializa Unmarshaller unmarshaller = JAXBContextFactory.createContext(new Class[]{CAEXFile.class}, null).createUnmarshaller(); StringReader reader = new StringReader(value); CAEXFile aml = (CAEXFile) unmarshaller.unmarshal(reader); - Aml2AasMapper mapper = new Aml2AasMapper(new AmlDeserializationConfig()); + Aml2AasMapper mapper = new Aml2AasMapper(new AmlDeserializationConfig.Builder().build()); return mapper.map(aml); } catch (JAXBException ex) { throw new DeserializationException("error deserializing AssetAdministrationShellEnvironment", ex); diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlDocumentInfo.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlDocumentInfo.java index d91cf891..98cafbc3 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlDocumentInfo.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlDocumentInfo.java @@ -15,6 +15,12 @@ */ package io.adminshell.aas.v3.dataformat.aml; +import io.adminshell.aas.v3.dataformat.aml.model.caex.CAEXFile; +import io.adminshell.aas.v3.model.AssetAdministrationShell; +import io.adminshell.aas.v3.model.ConceptDescription; +import java.util.Set; +import java.util.stream.Collectors; + public class AmlDocumentInfo { public static final String DEFAULT_ASSET_ADMINISTRATION_SHELL_INSTANCE_HIERARCHY = "AssetAdministrationShellInstanceHierarchy"; @@ -44,9 +50,21 @@ public AmlDocumentInfo( String assetAdministrationShellInstanceHierarchy, String conceptDescriptionInstanceHierarchy, String assetAdministrationShellSystemUnitClassLib) { - this.assetAdministrationShellSystemUnitClassLib = assetAdministrationShellSystemUnitClassLib; - this.assetAdministrationShellInstanceHierarchy = assetAdministrationShellInstanceHierarchy; - this.conceptDescriptionInstanceHierarchy = conceptDescriptionInstanceHierarchy; + if (assetAdministrationShellInstanceHierarchy == null || assetAdministrationShellInstanceHierarchy.isBlank()) { + this.assetAdministrationShellInstanceHierarchy = DEFAULT_ASSET_ADMINISTRATION_SHELL_INSTANCE_HIERARCHY; + } else { + this.assetAdministrationShellInstanceHierarchy = assetAdministrationShellInstanceHierarchy; + } + if (assetAdministrationShellSystemUnitClassLib == null || assetAdministrationShellSystemUnitClassLib.isBlank()) { + this.assetAdministrationShellSystemUnitClassLib = DEFAULT_ASSET_ADMINISTRATION_SHELL_SYSTEM_UNIT_CLASS_LIB; + } else { + this.assetAdministrationShellSystemUnitClassLib = assetAdministrationShellSystemUnitClassLib; + } + if (conceptDescriptionInstanceHierarchy == null || conceptDescriptionInstanceHierarchy.isBlank()) { + this.conceptDescriptionInstanceHierarchy = DEFAULT_CONCEPT_DESCRIPTION_INSTANCE_HIERARCHY; + } else { + this.conceptDescriptionInstanceHierarchy = conceptDescriptionInstanceHierarchy; + } this.dataSpecificationTemplatesSystemUnitClassLib = DEFAULT_DATA_SPECIFICATION_TEMPLATES_UNIT_CLASS_LIB; this.assetAdministrationShellRoleClassLib = DEFAULT_ASSET_ADMINISTRATION_SHELL_ROLE_CLASS_LIB; this.assetAdministrationShellInterfaceClassLib = DEFAULT_ASSET_ADMINISTRATION_SHELL_INTERFACE_CLASS_LIB; @@ -75,4 +93,46 @@ public String getAssetAdministrationShellRoleClassLib() { public String getAssetAdministrationShellInterfaceClassLib() { return assetAdministrationShellInterfaceClassLib; } + + public static AmlDocumentInfo fromFile(CAEXFile file) { + String aasInstanceHierarchy = findInstanceHierarchy(file, AssetAdministrationShell.class); + String conceptDescriptionInstanceHierarchy = findInstanceHierarchy(file, ConceptDescription.class); + String aasSystemUnitClassLib = findSystemUnitClassLib(file, AssetAdministrationShell.class); + return new AmlDocumentInfo(aasInstanceHierarchy, conceptDescriptionInstanceHierarchy, aasSystemUnitClassLib); + } + + private static String findInstanceHierarchy(CAEXFile file, Class type) { + String typeName = type.getSimpleName(); + Set instanceHierarchies = file.getInstanceHierarchy().stream() + .filter(x -> x.getInternalElement().stream() + .anyMatch(y -> y.getRoleRequirements() + .equals(DEFAULT_ASSET_ADMINISTRATION_SHELL_ROLE_CLASS_LIB + "/" + typeName))) + .map(x -> x.getName()) + .collect(Collectors.toSet()); + if (instanceHierarchies.size() > 1) { + throw new IllegalArgumentException(String.format("found %d InstanceHierarchy containing %s definitions (%s), required exactly 1", + instanceHierarchies.size(), + typeName, + instanceHierarchies.stream().collect(Collectors.joining(",")))); + } + return instanceHierarchies.isEmpty() ? null : instanceHierarchies.iterator().next(); + } + + private static String findSystemUnitClassLib(CAEXFile file, Class type) { + String typeName = type.getSimpleName(); + Set systemUnitClassLibs = file.getSystemUnitClassLib().stream() + .filter(x -> x.getSystemUnitClass().stream() + .anyMatch(y -> y.getSupportedRoleClass() + .equals(DEFAULT_ASSET_ADMINISTRATION_SHELL_ROLE_CLASS_LIB + "/" + typeName))) + .map(x -> x.getName()) + .collect(Collectors.toSet()); + if (systemUnitClassLibs.size() > 1) { + throw new IllegalArgumentException(String.format("found %d SystemUnitClass containing %s definitions (%s), required exactly 1", + systemUnitClassLibs.size(), + typeName, + systemUnitClassLibs.stream().collect(Collectors.joining(",")))); + } + return systemUnitClassLibs.isEmpty() ? null : systemUnitClassLibs.iterator().next(); + } + } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlSerializationConfig.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlSerializationConfig.java index 5fcacbb3..a33c550e 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlSerializationConfig.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlSerializationConfig.java @@ -16,12 +16,15 @@ package io.adminshell.aas.v3.dataformat.aml; import io.adminshell.aas.v3.dataformat.aml.header.WriterInfo; -import io.adminshell.aas.v3.dataformat.aml.id.UuidGenerator; -import io.adminshell.aas.v3.dataformat.aml.id.IdGenerator; +import io.adminshell.aas.v3.dataformat.aml.serialization.id.UuidGenerator; +import io.adminshell.aas.v3.dataformat.aml.serialization.id.IdGenerator; import java.util.ArrayList; import java.util.Arrays; import java.util.List; +/** + * Configuration class for AML serialization. This class is immutable. + */ public class AmlSerializationConfig { public static final String DEFAULT_SCHEMA_VERSION = "2.15"; @@ -34,7 +37,7 @@ public static Builder builder() { } private final IdGenerator idGenerator; - private final String schemaVersion; + private final String caexSchemaVersion; private final String amlVersion; private final String filename; private final boolean includeLibraries; @@ -50,7 +53,7 @@ private AmlSerializationConfig( WriterInfo writerInfo, List additionalInformation) { this.idGenerator = idGenerator; - this.schemaVersion = schemaVersion; + this.caexSchemaVersion = schemaVersion; this.amlVersion = amlVersion; this.filename = filename; this.includeLibraries = includeLibraries; @@ -58,26 +61,58 @@ private AmlSerializationConfig( this.additionalInformation = additionalInformation; } + /** + * Indicates if the predefined AAS libraries should be included in the + * result or not + * + * @return true is they should be included, otherwise false + */ public boolean isIncludeLibraries() { return includeLibraries; } + /** + * The IdGenerator used for AML creation. Default are UUID-based IDs but + * custom IdGenerator can be used. + * + * @return the IdGenerator to use + */ public IdGenerator getIdGenerator() { return idGenerator; } + /** + * Gets additional information that should be included in the file header + * + * @return list of additional information objects + */ public List getAdditionalInformation() { return additionalInformation; } - public String getSchemaVersion() { - return schemaVersion; + /** + * Gets the CAEX schema version + * + * @return the CAEX schema version + */ + public String getCaexSchemaVersion() { + return caexSchemaVersion; } + /** + * Gets the AML version + * + * @return the AML version + */ public String getAmlVersion() { return amlVersion; } + /** + * Gets the WriterInfo header to include in AML + * + * @return the WriterInfo + */ public WriterInfo getWriterInfo() { return writerInfo; } @@ -90,7 +125,7 @@ public static class Builder { private String filename = DEFAULT_FILENAME; private boolean includeLibraries = true; private WriterInfo writerInfo = null; - private List additionalInformation = new ArrayList<>(); + private final List additionalInformation = new ArrayList<>(); public AmlSerializationConfig build() { return new AmlSerializationConfig( diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlSerializer.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlSerializer.java index 58cbf9cc..9e16fb18 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlSerializer.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlSerializer.java @@ -15,7 +15,7 @@ */ package io.adminshell.aas.v3.dataformat.aml; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.AasToAmlMapper; +import io.adminshell.aas.v3.dataformat.aml.serialization.AasToAmlMapper; import io.adminshell.aas.v3.dataformat.SerializationException; import io.adminshell.aas.v3.dataformat.Serializer; import io.adminshell.aas.v3.dataformat.aml.header.AutomationMLVersion; @@ -32,19 +32,30 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +/** + * Class for serializing an instance of AssetAdministrationShellEnvironment to + * AML. + */ public class AmlSerializer implements Serializer { private static final String AAS_LIB_SOURCE = "/AssetAdministrationShellLib.aml"; private static final Logger log = LoggerFactory.getLogger(AmlSerializer.class); - public AmlSerializer() { - } - @Override public String write(AssetAdministrationShellEnvironment aasEnvironment) throws SerializationException { return write(aasEnvironment, AmlSerializationConfig.DEFAULT); } + /** + * Serializes a given instance of AssetAdministrationShellEnvironment to + * string + * + * @param aasEnvironment the AssetAdministrationShellEnvironment to + * serialize + * @param config serialization configuration + * @return the string representation of the environment + * @throws SerializationException if serialization fails + */ public String write(AssetAdministrationShellEnvironment aasEnvironment, AmlSerializationConfig config) throws SerializationException { try { CAEXFile aml = new AasToAmlMapper().map(aasEnvironment, config); @@ -72,7 +83,6 @@ public String write(AssetAdministrationShellEnvironment aasEnvironment, AmlSeria } private CAEXFile addAASLibrary(CAEXFile file) throws JAXBException, IOException { - // potential issue: when dynamically adding custom DataSpecificationTemplates this won't work CAEXFile aasLib = loadAASLibrary(); return CAEXFile.copyOf(file) .addInterfaceClassLib(aasLib.getInterfaceClassLib()) diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/AasTypeFactory.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/AasTypeFactory.java deleted file mode 100644 index e4684bca..00000000 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/AasTypeFactory.java +++ /dev/null @@ -1,44 +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 io.adminshell.aas.v3.dataformat.aml.aml2aas; - -import io.adminshell.aas.v3.dataformat.core.ReflectionHelper; -import java.lang.reflect.Constructor; -import java.lang.reflect.InvocationTargetException; -import java.util.Map; - -public class AasTypeFactory { - - private Map, Class> typeMapping; - - public AasTypeFactory() { - ReflectionHelper.DEFAULT_IMPLEMENTATIONS.forEach(x -> typeMapping.put(x.getInterfaceType(), x.getImplementationType())); - } - - public void useImplementation(Class aasInterface, Class implementation) { - typeMapping.put(aasInterface, implementation); - } - - public T newInstance(Class aasInterface) throws NoSuchMethodException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Class classToInstantiate = aasInterface; - if (typeMapping.containsKey(aasInterface)) { - classToInstantiate = typeMapping.get(aasInterface); - } - Constructor constructor = classToInstantiate.getConstructor(); - constructor.setAccessible(true); - return (T) constructor.newInstance(); - } -} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/deserialization/AasTypeFactory.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/deserialization/AasTypeFactory.java new file mode 100644 index 00000000..4027863b --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/deserialization/AasTypeFactory.java @@ -0,0 +1,77 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.deserialization; + +import io.adminshell.aas.v3.dataformat.core.ReflectionHelper; +import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationTargetException; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * Supports in creating instances of AAS interfaces + */ +public class AasTypeFactory { + + private Map, Class> typeMapping; + + public AasTypeFactory() { + typeMapping = ReflectionHelper.DEFAULT_IMPLEMENTATIONS.stream().collect(Collectors.toMap(x -> x.getInterfaceType(), x -> x.getImplementationType())); + } + + /** + * Defines which implementation class to use when creating instances of + * aasInterface. 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 instantiation + */ + public void useImplementation(Class aasInterface, Class implementation) { + typeMapping.put(aasInterface, implementation); + } + + /** + * Creates a new instance for a given aasInterface. If the + * + * @param type to create + * @param aasInterface class to find instantiate + * @return an instance of aasInterface + * @throws NoSuchMethodException + * @throws InstantiationException + * @throws IllegalAccessException + * @throws IllegalArgumentException if aasInterface is null or no suitable + * concrete type to instantiate could be found + * @throws InvocationTargetException + */ + public T newInstance(Class aasInterface) throws NoSuchMethodException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + if (aasInterface == null) { + throw new IllegalArgumentException("aasInterface must be non-null"); + } + Class classToInstantiate = aasInterface; + if (typeMapping.containsKey(aasInterface)) { + classToInstantiate = typeMapping.get(aasInterface); + } + if (classToInstantiate.isInterface()) { + throw new IllegalArgumentException("could not resolve type for interface " + classToInstantiate.getName()); + } + Constructor constructor = classToInstantiate.getConstructor(); + constructor.setAccessible(true); + return (T) constructor.newInstance(); + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/Aml2AasMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/deserialization/Aml2AasMapper.java similarity index 70% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/Aml2AasMapper.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/deserialization/Aml2AasMapper.java index b9ca36bd..46c3921c 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/Aml2AasMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/deserialization/Aml2AasMapper.java @@ -13,36 +13,43 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.aml2aas; +package io.adminshell.aas.v3.dataformat.aml.deserialization; -import io.adminshell.aas.v3.dataformat.aml.aml2aas.custom.AssetAdministrationShellEnvironmentMapper; +import io.adminshell.aas.v3.dataformat.aml.deserialization.mappers.AssetAdministrationShellEnvironmentMapper; import io.adminshell.aas.v3.dataformat.aml.AmlDeserializationConfig; +import io.adminshell.aas.v3.dataformat.aml.AmlDocumentInfo; import io.adminshell.aas.v3.dataformat.aml.model.caex.CAEXFile; -import io.adminshell.aas.v3.dataformat.core.ReflectionHelper; import io.adminshell.aas.v3.dataformat.mapping.MappingException; import io.adminshell.aas.v3.dataformat.mapping.MappingProvider; import io.adminshell.aas.v3.model.AssetAdministrationShellEnvironment; import java.util.List; +/** + * Maps an AML file to an AssetAdministrationShellEnvironment + */ public class Aml2AasMapper { - private AmlDeserializationConfig config; + private final AmlDeserializationConfig config; public Aml2AasMapper(AmlDeserializationConfig config) { this.config = config; } + /** + * Maps an AML file (represented by a CAEXFile) to an AssetAdministrationShellEnvironment + * @param aml the AML source file to map + * @return AssetAdministrationShellEnvironment representation + * @throws MappingException if the mapping fails + */ public AssetAdministrationShellEnvironment map(CAEXFile aml) throws MappingException { // unclear how to handle additional information List additionalInformation = aml.getAdditionalInformation(); - // find AAS elements throughout all instance hierarchies AmlParser parser = new AmlParser(aml); MappingProvider mappingProvider = new MappingProvider(Mapper.class, new DefaultMapper(), new DefaultMapper()); mappingProvider.register(new AssetAdministrationShellEnvironmentMapper()); - AasTypeFactory typeFactory = new AasTypeFactory(); - MappingContext context = new MappingContext(mappingProvider, typeFactory); + MappingContext context = new MappingContext(mappingProvider, config.getTypeFactory()); + context.setDocumentInfo(AmlDocumentInfo.fromFile(aml)); Object result = context.getMappingProvider().getMapper(AssetAdministrationShellEnvironment.class).map(parser, context); - String foo = ""; return (AssetAdministrationShellEnvironment) result; } } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/AmlParser.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/deserialization/AmlParser.java similarity index 63% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/AmlParser.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/deserialization/AmlParser.java index 42f4b88b..7977d046 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/AmlParser.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/deserialization/AmlParser.java @@ -13,11 +13,17 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.aml2aas; +package io.adminshell.aas.v3.dataformat.aml.deserialization; import io.adminshell.aas.v3.dataformat.aml.model.caex.CAEXFile; import io.adminshell.aas.v3.dataformat.aml.model.caex.CAEXObject; +/** + * Wraps an AML file and provides a pointer to the current position within that + * file + * + * @author jab + */ public class AmlParser { private final CAEXFile content; @@ -27,14 +33,30 @@ public AmlParser(CAEXFile content) { this.content = content; } + /** + * Gets the AML file the parser represents + * + * @return the AML file the parser represents + */ public CAEXFile getContent() { return content; } + /** + * Gets the CAEXObject that currently is being processed, i.e. a point to + * the current position within the AML file + * + * @return the current object + */ public CAEXObject getCurrent() { return current; } + /** + * Sets the CAEXObject that currently is being processed. + * + * @param current the object currently being processed + */ public void setCurrent(CAEXObject current) { this.current = current; } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/DefaultMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/deserialization/DefaultMapper.java similarity index 79% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/DefaultMapper.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/deserialization/DefaultMapper.java index 4feca809..d12e5a1a 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/DefaultMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/deserialization/DefaultMapper.java @@ -13,19 +13,18 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.aml2aas; +package io.adminshell.aas.v3.dataformat.aml.deserialization; import com.google.common.reflect.TypeToken; import io.adminshell.aas.v3.dataformat.aml.model.caex.AttributeType; import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; import io.adminshell.aas.v3.dataformat.core.ReflectionHelper; +import io.adminshell.aas.v3.dataformat.core.util.AasUtils; import io.adminshell.aas.v3.dataformat.mapping.MappingException; -import io.adminshell.aas.v3.dataformat.mapping.util.TypeUtils; import java.beans.PropertyDescriptor; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; -import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Optional; @@ -33,6 +32,10 @@ import java.util.logging.Logger; import java.util.stream.Collectors; +/** + * Default mapper for mapping AML to AAS. This mapper will be used when there no + * more specific one is available. + */ public class DefaultMapper implements Mapper { @Override @@ -41,19 +44,26 @@ public Object map(AmlParser parser, MappingContext context) throws MappingExcept return null; } if (InternalElementType.class.isAssignableFrom(parser.getCurrent().getClass())) { - handleInternalElement(parser, context); + return handleInternalElement(parser, context); } else if (AttributeType.class.isAssignableFrom(parser.getCurrent().getClass())) { - handleAttribute(parser, context); + return handleAttribute(parser, context); } throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } + /** + * This method is called whenever an InternalElement is encountered. + * + * @param parser the AML parser + * @param context the mapping context + * @return an AAS object representing the current object of the parser + */ protected Object handleInternalElement(AmlParser parser, MappingContext context) { Object result = null; InternalElementType current = (InternalElementType) parser.getCurrent(); String role = current.getRoleRequirements().getRefBaseRoleClassPath(); if (role.startsWith(context.getDocumentInfo().getAssetAdministrationShellRoleClassLib())) { - String aasClassName = role.substring(context.getDocumentInfo().getAssetAdministrationShellRoleClassLib().length()); + String aasClassName = role.substring(context.getDocumentInfo().getAssetAdministrationShellRoleClassLib().length() + 1); Optional implementationInfo = ReflectionHelper.DEFAULT_IMPLEMENTATIONS.stream() .filter(x -> x.getInterfaceType().getSimpleName().equals(aasClassName)) .findFirst(); @@ -67,7 +77,7 @@ protected Object handleInternalElement(AmlParser parser, MappingContext context) if (aasClass != null) { try { result = context.getTypeFactory().newInstance(aasClass); - List properties = TypeUtils.getAASProperties(aasClass); + List properties = AasUtils.getAasProperties(aasClass); List propertiesGivenAsAttribute = new ArrayList<>(); for (AttributeType attribute : current.getAttribute()) { Optional property = properties.stream() @@ -98,7 +108,7 @@ protected Object handleInternalElement(AmlParser parser, MappingContext context) .filter(x -> Collection.class.isAssignableFrom(x.getReadMethod().getReturnType())) .map(x -> new Object() { PropertyDescriptor type = x; - String aasType = ReflectionHelper.getModelType(TypeToken.of(x.getReadMethod().getGenericReturnType()).resolveType(Collection.class).getRawType()); + String aasType = ReflectionHelper.getModelType(TypeToken.of(x.getReadMethod().getGenericReturnType()).resolveType(Collection.class.getTypeParameters()[0]).getRawType()); }) .filter(x -> x.aasType != null) .collect(Collectors.toMap( @@ -173,15 +183,42 @@ protected Object handleInternalElement(AmlParser parser, MappingContext context) return result; } + /** + * This method is called whenever an AttributeType is encountered. + * + * @param parser the AML parser + * @param context the mapping context + * @return an object representing the current object of the parser + */ protected Object handleAttribute(AmlParser parser, MappingContext context) throws MappingException { AttributeType current = (AttributeType) parser.getCurrent(); if (context.getType() == null) { throw new MappingException(String.format("error processing Attribute '%s', missing type information in context", current.getName())); } Object result = null; -// result = context.getTypeFactory().newInstance(context.getType()); - // distinguish between AASType and other - // AASType needs reflection + Class aasType = ReflectionHelper.getAasInterface(context.getType()); + if (aasType != null) { + try { + result = context.getTypeFactory().newInstance(aasType); + List properties = AasUtils.getAasProperties(aasType); + for (AttributeType attribute : current.getAttribute()) { + Optional property = properties.stream() + .filter(x -> x.getName().equals(attribute.getName())) + .findFirst(); + if (property.isPresent()) { + parser.setCurrent(attribute); + Object attributeValue = context.getMappingProvider() + .getMapper(property.get().getReadMethod().getReturnType()) + .map(parser, context.with(property.get().getReadMethod().getReturnType())); + property.get().getWriteMethod().invoke(result, attributeValue); + } + } + } catch (Exception ex) { + Logger.getLogger(DefaultMapper.class.getName()).log(Level.SEVERE, null, ex); + } + } else { + result = current.getValue(); + } return result; } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/Mapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/deserialization/Mapper.java similarity index 81% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/Mapper.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/deserialization/Mapper.java index 1c6c977e..4f026246 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/Mapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/deserialization/Mapper.java @@ -13,9 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.aml2aas; +package io.adminshell.aas.v3.dataformat.aml.deserialization; import io.adminshell.aas.v3.dataformat.mapping.TargetBasedMapper; - +/** + * Utility interface for all AML to AAS mappers + * @param type to be deserialized + */ public interface Mapper extends TargetBasedMapper { } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/MappingContext.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/deserialization/MappingContext.java similarity index 91% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/MappingContext.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/deserialization/MappingContext.java index 6e072d11..9312f4c6 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/MappingContext.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/deserialization/MappingContext.java @@ -13,12 +13,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.aml2aas; +package io.adminshell.aas.v3.dataformat.aml.deserialization; import io.adminshell.aas.v3.dataformat.aml.AmlDocumentInfo; import io.adminshell.aas.v3.dataformat.mapping.MappingProvider; import io.adminshell.aas.v3.dataformat.mapping.TargetBasedMappingContext; +/** + * Mapping Context for mapping AML to AAS + */ public class MappingContext extends TargetBasedMappingContext { private AmlDocumentInfo documentInfo; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/custom/AssetAdministrationShellEnvironmentMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/deserialization/mappers/AssetAdministrationShellEnvironmentMapper.java similarity index 88% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/custom/AssetAdministrationShellEnvironmentMapper.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/deserialization/mappers/AssetAdministrationShellEnvironmentMapper.java index 3d66f37f..a75da886 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aml2aas/custom/AssetAdministrationShellEnvironmentMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/deserialization/mappers/AssetAdministrationShellEnvironmentMapper.java @@ -13,12 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.aml2aas.custom; +package io.adminshell.aas.v3.dataformat.aml.deserialization.mappers; import io.adminshell.aas.v3.dataformat.aml.AmlDocumentInfo; -import io.adminshell.aas.v3.dataformat.aml.aml2aas.AmlParser; -import io.adminshell.aas.v3.dataformat.aml.aml2aas.Mapper; -import io.adminshell.aas.v3.dataformat.aml.aml2aas.MappingContext; +import io.adminshell.aas.v3.dataformat.aml.deserialization.AmlParser; +import io.adminshell.aas.v3.dataformat.aml.deserialization.Mapper; +import io.adminshell.aas.v3.dataformat.aml.deserialization.MappingContext; import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; import io.adminshell.aas.v3.dataformat.mapping.MappingException; import io.adminshell.aas.v3.model.AssetAdministrationShell; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/header/AutomationMLVersion.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/header/AutomationMLVersion.java index ddf3685d..fb8d44db 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/header/AutomationMLVersion.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/header/AutomationMLVersion.java @@ -22,6 +22,9 @@ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(namespace = "http://www.w3.org/2001/XMLSchema", name = "string") +/** + * Utility class to represent AutomationML version in an AML document + */ public class AutomationMLVersion { @XmlAttribute(name = "AutomationMLVersion") diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/header/WriterInfo.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/header/WriterInfo.java index 329df855..bb92069a 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/header/WriterInfo.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/header/WriterInfo.java @@ -20,6 +20,9 @@ import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; +/** + * Utility class to represent the WriterInfo section in an AML document + */ public class WriterInfo { @XmlElement(name = "WriterName") diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/AasToAmlMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/AasToAmlMapper.java similarity index 61% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/AasToAmlMapper.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/AasToAmlMapper.java index dfc72a56..dcc5982c 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/AasToAmlMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/AasToAmlMapper.java @@ -13,31 +13,31 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.aas2aml; +package io.adminshell.aas.v3.dataformat.aml.serialization; import io.adminshell.aas.v3.dataformat.aml.AmlSerializationConfig; -import io.adminshell.aas.v3.dataformat.aml.naming.PropertyNamingStrategy; -import io.adminshell.aas.v3.dataformat.aml.naming.AbstractClassNamingStrategy; -import io.adminshell.aas.v3.dataformat.aml.naming.NumberingClassNamingStrategy; +import io.adminshell.aas.v3.dataformat.aml.serialization.naming.PropertyNamingStrategy; +import io.adminshell.aas.v3.dataformat.aml.serialization.naming.AbstractClassNamingStrategy; +import io.adminshell.aas.v3.dataformat.aml.serialization.naming.NumberingClassNamingStrategy; import io.adminshell.aas.v3.dataformat.aml.header.AutomationMLVersion; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.custom.AssetAdministrationShellEnvironmentMapper; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.custom.AssetAdministrationShellMapper; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.custom.ConstraintCollectionMapper; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.custom.DataSpecificationContentMapper; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.custom.DataSpecificationIEC61360Mapper; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.custom.EmbeddedDataSpecificationCollectionMapper; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.custom.FileMapper; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.custom.LangStringCollectionMapper; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.custom.OperationVariableCollectionMapper; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.custom.OperationVariableMapper; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.custom.QualifierMapper; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.custom.ReferenceCollectionMapper; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.custom.ReferenceElementMapper; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.custom.RelationshipElementMapper; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.custom.SubmodelMapper; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.custom.ViewMapper; -import io.adminshell.aas.v3.dataformat.aml.id.IntegerIdGenerator; +import io.adminshell.aas.v3.dataformat.aml.serialization.mappers.AssetAdministrationShellEnvironmentMapper; +import io.adminshell.aas.v3.dataformat.aml.serialization.mappers.AssetAdministrationShellMapper; +import io.adminshell.aas.v3.dataformat.aml.serialization.mappers.ConstraintCollectionMapper; +import io.adminshell.aas.v3.dataformat.aml.serialization.mappers.DataSpecificationContentMapper; +import io.adminshell.aas.v3.dataformat.aml.serialization.mappers.DataSpecificationIEC61360Mapper; +import io.adminshell.aas.v3.dataformat.aml.serialization.mappers.EmbeddedDataSpecificationCollectionMapper; +import io.adminshell.aas.v3.dataformat.aml.serialization.mappers.FileMapper; +import io.adminshell.aas.v3.dataformat.aml.serialization.mappers.LangStringCollectionMapper; +import io.adminshell.aas.v3.dataformat.aml.serialization.mappers.OperationVariableCollectionMapper; +import io.adminshell.aas.v3.dataformat.aml.serialization.mappers.OperationVariableMapper; +import io.adminshell.aas.v3.dataformat.aml.serialization.mappers.QualifierMapper; +import io.adminshell.aas.v3.dataformat.aml.serialization.mappers.ReferenceCollectionMapper; +import io.adminshell.aas.v3.dataformat.aml.serialization.mappers.ReferenceElementMapper; +import io.adminshell.aas.v3.dataformat.aml.serialization.mappers.RelationshipElementMapper; +import io.adminshell.aas.v3.dataformat.aml.serialization.mappers.SubmodelMapper; +import io.adminshell.aas.v3.dataformat.aml.serialization.mappers.ViewMapper; import io.adminshell.aas.v3.dataformat.aml.model.caex.CAEXFile; +import io.adminshell.aas.v3.dataformat.aml.serialization.mappers.ReferenceMapper; import io.adminshell.aas.v3.dataformat.mapping.MappingException; import io.adminshell.aas.v3.dataformat.mapping.MappingProvider; import io.adminshell.aas.v3.model.AssetAdministrationShellEnvironment; @@ -48,12 +48,20 @@ import org.slf4j.LoggerFactory; import io.adminshell.aas.v3.dataformat.mapping.SourceBasedMapper; +/** + * Maps an AssetAdministrationShellEnvironment to an AML file + */ public class AasToAmlMapper { private static final org.slf4j.Logger log = LoggerFactory.getLogger(AasToAmlMapper.class); - private static final String DEFAULT_LANGUAGE = "EN"; - private CAEXFile result; + /** + * Maps an AssetAdministrationShellEnvironment to an AML file (represented by a CAEXFile) + * @param env the AssetAdministrationShellEnvironment to map + * @param config the serialization conig + * @return an AML representation of the AssetAdministrationShellEnvironment + * @throws MappingException if the mapping fails + */ public CAEXFile map(AssetAdministrationShellEnvironment env, AmlSerializationConfig config) throws MappingException { AbstractClassNamingStrategy classNamingStrategy = new NumberingClassNamingStrategy(); classNamingStrategy.registerCustomNaming(LangString.class, x -> "aml-lang=" + x.getLanguage()); @@ -68,7 +76,7 @@ public CAEXFile map(AssetAdministrationShellEnvironment env, AmlSerializationCon mappingProvider.register(new AssetAdministrationShellEnvironmentMapper()); mappingProvider.register(new LangStringCollectionMapper()); -// mappingProvider.register(new ReferenceMapper()); + mappingProvider.register(new ReferenceMapper()); mappingProvider.register(new AssetAdministrationShellMapper()); mappingProvider.register(new OperationVariableMapper()); mappingProvider.register(new OperationVariableCollectionMapper()); @@ -83,24 +91,13 @@ public CAEXFile map(AssetAdministrationShellEnvironment env, AmlSerializationCon mappingProvider.register(new RelationshipElementMapper()); mappingProvider.register(new DataSpecificationIEC61360Mapper()); mappingProvider.register(new ViewMapper()); - // FIX - // ReferenceElement and RelationshipElement reference other Referables. - // Each such reference is represented as an InternalLink in AML. - // InternalLinks require target to be an interface but AAS AML serialization - // does not define creation of such interfaces. Therefore, we do a preprocessing - // step to identify all Referable which are targeted by such a reference - // to later add a generic interface to them upon serialization - - // NOTE - // This has implications on ID generator and requires additional lookup table - // for Referable --> AML ID of ExternalInterface MappingContext context = new MappingContext( mappingProvider, classNamingStrategy, propertyNamingStrategy, env); CAEXFile.Builder builder = CAEXFile.builder() - .withSchemaVersion(config.getSchemaVersion()) + .withSchemaVersion(config.getCaexSchemaVersion()) .withFileName(config.getFilename()) .addAdditionalInformation(new AutomationMLVersion(config.getAmlVersion())); if (config.getWriterInfo() != null) { diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/AmlGenerator.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/AmlGenerator.java similarity index 93% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/AmlGenerator.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/AmlGenerator.java index e7a63bcf..0b8b7429 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/AmlGenerator.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/AmlGenerator.java @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.aas2aml; +package io.adminshell.aas.v3.dataformat.aml.serialization; import io.adminshell.aas.v3.dataformat.aml.AmlDocumentInfo; -import io.adminshell.aas.v3.dataformat.aml.id.IdGenerator; -import io.adminshell.aas.v3.dataformat.aml.id.UuidGenerator; +import io.adminshell.aas.v3.dataformat.aml.serialization.id.IdGenerator; +import io.adminshell.aas.v3.dataformat.aml.serialization.id.UuidGenerator; import io.adminshell.aas.v3.dataformat.aml.model.caex.AttributeType; import io.adminshell.aas.v3.dataformat.aml.model.caex.CAEXFile; import io.adminshell.aas.v3.dataformat.aml.model.caex.CAEXObject; @@ -84,7 +84,7 @@ public AmlGenerator with(Referable parent) { refSemanticPrefix, fileBuilder, current, - AasUtils.asReference(reference, parent)); + AasUtils.toReference(reference, parent)); } public AmlGenerator withRefSemanticPrefix(String value) { @@ -162,7 +162,7 @@ public String getId(Object obj) { if (Reference.class.isAssignableFrom(obj.getClass())) { key = (Reference) obj; } else if (Referable.class.isAssignableFrom(obj.getClass())) { - key = AasUtils.asReference(reference, (Referable) obj); + key = AasUtils.toReference(reference, (Referable) obj); } else { return idGenerator.next(); } @@ -243,10 +243,10 @@ public void addInternalLink(String name, Referable source, Reference target) { } } - public void addExternalInterfaceForUnresolvableReference(Reference reference, MappingContext context) { + public void addExternalInterfaceForUnresolvableReference(String name, Reference reference, MappingContext context) { addExternalInterface(RoleClassType.ExternalInterface.builder() .withID(idGenerator.next()) - .withName(REFERABLE_REFERENCE_INTERFACE_CLASS) + .withName(name) .withRefBaseClassPath(documentInfo.getAssetAdministrationShellInterfaceClassLib() + "/" + REFERABLE_REFERENCE_INTERFACE_CLASS) .addAttribute(AttributeType.builder() .withName("value") @@ -320,7 +320,7 @@ public RoleClassType.ExternalInterface getReferenceTargetInterface(Object obj, M RoleClassType.ExternalInterface result = null; if (obj != null && Referable.class.isAssignableFrom(obj.getClass())) { Referable referable = (Referable) obj; - Reference targetRef = AasUtils.asReference(reference, referable); + Reference targetRef = AasUtils.toReference(reference, referable); if (context.isTargetOfInternalLink(targetRef)) { result = RoleClassType.ExternalInterface.builder() .withID(newId()) diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/DefaultCollectionMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/DefaultCollectionMapper.java similarity index 95% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/DefaultCollectionMapper.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/DefaultCollectionMapper.java index 76f7144f..584b1974 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/DefaultCollectionMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/DefaultCollectionMapper.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.aas2aml; +package io.adminshell.aas.v3.dataformat.aml.serialization; import io.adminshell.aas.v3.dataformat.aml.model.caex.AttributeType; import io.adminshell.aas.v3.dataformat.core.ReflectionHelper; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/DefaultMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/DefaultMapper.java similarity index 94% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/DefaultMapper.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/DefaultMapper.java index bb8f7be7..c9446c57 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/DefaultMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/DefaultMapper.java @@ -13,13 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.aas2aml; +package io.adminshell.aas.v3.dataformat.aml.serialization; import io.adminshell.aas.v3.dataformat.aml.model.caex.AttributeType; import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; import io.adminshell.aas.v3.dataformat.core.ReflectionHelper; +import io.adminshell.aas.v3.dataformat.core.util.AasUtils; import io.adminshell.aas.v3.dataformat.mapping.MappingException; -import io.adminshell.aas.v3.dataformat.mapping.util.TypeUtils; import io.adminshell.aas.v3.model.Referable; import java.beans.PropertyDescriptor; import java.lang.reflect.InvocationTargetException; @@ -137,7 +137,7 @@ protected boolean skipProperty(PropertyDescriptor property) { } protected void mapProperties(T value, AmlGenerator generator, MappingContext context) throws MappingException { - for (PropertyDescriptor property : TypeUtils.getAASProperties(value.getClass())) { + for (PropertyDescriptor property : AasUtils.getAasProperties(value.getClass())) { if (!skipProperty(property)) { context.with(property) .map(property.getReadMethod().getGenericReturnType(), diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/IdentityProvider.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/IdentityProvider.java similarity index 88% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/IdentityProvider.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/IdentityProvider.java index 31bdecf1..cab9952a 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/IdentityProvider.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/IdentityProvider.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.aas2aml; +package io.adminshell.aas.v3.dataformat.aml.serialization; -import io.adminshell.aas.v3.dataformat.aml.id.IdGenerator; +import io.adminshell.aas.v3.dataformat.aml.serialization.id.IdGenerator; import java.util.HashMap; import java.util.Map; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/Mapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/Mapper.java similarity index 90% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/Mapper.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/Mapper.java index 9b64d5ff..abbfc4bb 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/Mapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/Mapper.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.aas2aml; +package io.adminshell.aas.v3.dataformat.aml.serialization; import io.adminshell.aas.v3.dataformat.mapping.SourceBasedMapper; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/MappingContext.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/MappingContext.java similarity index 94% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/MappingContext.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/MappingContext.java index 97405b31..a67652eb 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/MappingContext.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/MappingContext.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.aas2aml; +package io.adminshell.aas.v3.dataformat.aml.serialization; -import io.adminshell.aas.v3.dataformat.aml.naming.NamingStrategy; +import io.adminshell.aas.v3.dataformat.aml.serialization.naming.NamingStrategy; import io.adminshell.aas.v3.dataformat.aml.util.ReferencedReferableCollector; import io.adminshell.aas.v3.dataformat.core.util.AasUtils; import io.adminshell.aas.v3.dataformat.mapping.MappingException; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/id/IdGenerator.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/id/IdGenerator.java similarity index 89% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/id/IdGenerator.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/id/IdGenerator.java index 369560d4..a9074e14 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/id/IdGenerator.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/id/IdGenerator.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.id; +package io.adminshell.aas.v3.dataformat.aml.serialization.id; public interface IdGenerator { diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/id/IntegerIdGenerator.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/id/IntegerIdGenerator.java similarity index 90% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/id/IntegerIdGenerator.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/id/IntegerIdGenerator.java index 8a162677..05472323 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/id/IntegerIdGenerator.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/id/IntegerIdGenerator.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.id; +package io.adminshell.aas.v3.dataformat.aml.serialization.id; public class IntegerIdGenerator implements IdGenerator { diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/id/UuidGenerator.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/id/UuidGenerator.java similarity index 90% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/id/UuidGenerator.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/id/UuidGenerator.java index 2d8d1006..ef218427 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/id/UuidGenerator.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/id/UuidGenerator.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.id; +package io.adminshell.aas.v3.dataformat.aml.serialization.id; import java.util.UUID; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/AssetAdministrationShellEnvironmentMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/AssetAdministrationShellEnvironmentMapper.java similarity index 90% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/AssetAdministrationShellEnvironmentMapper.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/AssetAdministrationShellEnvironmentMapper.java index 04dd01fb..dad931b5 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/AssetAdministrationShellEnvironmentMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/AssetAdministrationShellEnvironmentMapper.java @@ -13,12 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.aas2aml.custom; +package io.adminshell.aas.v3.dataformat.aml.serialization.mappers; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.DefaultMapper; +import io.adminshell.aas.v3.dataformat.aml.serialization.DefaultMapper; import com.google.inject.util.Types; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.AmlGenerator; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.MappingContext; +import io.adminshell.aas.v3.dataformat.aml.serialization.AmlGenerator; +import io.adminshell.aas.v3.dataformat.aml.serialization.MappingContext; import io.adminshell.aas.v3.dataformat.aml.model.caex.CAEXFile; import io.adminshell.aas.v3.dataformat.aml.model.caex.CAEXFile.SystemUnitClassLib; import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; @@ -43,8 +43,8 @@ public void map(AssetAdministrationShellEnvironment value, AmlGenerator generato List assetAdministrationShells = value.getAssetAdministrationShells().stream() .filter(x -> x.getSubmodels().stream() .anyMatch(sm -> { - Optional submodel = AasUtils.resolveSubmodelReference(sm, value); - return submodel.isPresent() && submodel.get().getKind() == ModelingKind.INSTANCE; + Submodel submodel = AasUtils.resolve(sm, value, Submodel.class); + return submodel != null && submodel.getKind() != ModelingKind.TEMPLATE; })) .collect(Collectors.toList()); toHierarchy(generator.getDocumentInfo().getAssetAdministrationShellInstanceHierarchy(), diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/AssetAdministrationShellMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/AssetAdministrationShellMapper.java similarity index 80% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/AssetAdministrationShellMapper.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/AssetAdministrationShellMapper.java index 1a8621e1..3aefa759 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/AssetAdministrationShellMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/AssetAdministrationShellMapper.java @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.aas2aml.custom; +package io.adminshell.aas.v3.dataformat.aml.serialization.mappers; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.AmlGenerator; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.DefaultMapper; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.MappingContext; +import io.adminshell.aas.v3.dataformat.aml.serialization.AmlGenerator; +import io.adminshell.aas.v3.dataformat.aml.serialization.DefaultMapper; +import io.adminshell.aas.v3.dataformat.aml.serialization.MappingContext; import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; import io.adminshell.aas.v3.dataformat.core.util.AasUtils; import io.adminshell.aas.v3.dataformat.mapping.MappingException; @@ -45,9 +45,9 @@ public void map(AssetAdministrationShell aas, AmlGenerator generator, MappingCon } InternalElementType.Builder builder = toInternalElement(aas, generator, context); for (Reference reference : aas.getSubmodels()) { - Optional resolvedSubmodel = AasUtils.resolveSubmodelReference(reference, context.getEnvironment()); - if (resolvedSubmodel.isPresent()) { - context.map(resolvedSubmodel.get(), generator.with(builder)); + Submodel resolvedSubmodel = AasUtils.resolve(reference, context.getEnvironment(), Submodel.class); + if (resolvedSubmodel != null) { + context.map(resolvedSubmodel, generator.with(builder)); } else { log.warn("unresolvable submodel reference '{}' found in AssetAdministrationShell '{}'", AasUtils.asString(reference), diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/ConstraintCollectionMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/ConstraintCollectionMapper.java similarity index 79% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/ConstraintCollectionMapper.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/ConstraintCollectionMapper.java index 835ba875..97a8d183 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/ConstraintCollectionMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/ConstraintCollectionMapper.java @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.aas2aml.custom; +package io.adminshell.aas.v3.dataformat.aml.serialization.mappers; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.Mapper; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.AmlGenerator; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.MappingContext; +import io.adminshell.aas.v3.dataformat.aml.serialization.Mapper; +import io.adminshell.aas.v3.dataformat.aml.serialization.AmlGenerator; +import io.adminshell.aas.v3.dataformat.aml.serialization.MappingContext; import io.adminshell.aas.v3.dataformat.mapping.MappingException; import io.adminshell.aas.v3.model.Constraint; import java.util.Collection; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/DataSpecificationContentMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/DataSpecificationContentMapper.java similarity index 82% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/DataSpecificationContentMapper.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/DataSpecificationContentMapper.java index 2e189bfe..2ddbe430 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/DataSpecificationContentMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/DataSpecificationContentMapper.java @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.aas2aml.custom; +package io.adminshell.aas.v3.dataformat.aml.serialization.mappers; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.DefaultMapper; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.AmlGenerator; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.MappingContext; +import io.adminshell.aas.v3.dataformat.aml.serialization.DefaultMapper; +import io.adminshell.aas.v3.dataformat.aml.serialization.AmlGenerator; +import io.adminshell.aas.v3.dataformat.aml.serialization.MappingContext; import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; import io.adminshell.aas.v3.dataformat.mapping.MappingException; import io.adminshell.aas.v3.model.DataSpecificationContent; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/DataSpecificationIEC61360Mapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/DataSpecificationIEC61360Mapper.java similarity index 85% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/DataSpecificationIEC61360Mapper.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/DataSpecificationIEC61360Mapper.java index 5fa9a088..acacdbcc 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/DataSpecificationIEC61360Mapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/DataSpecificationIEC61360Mapper.java @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.aas2aml.custom; +package io.adminshell.aas.v3.dataformat.aml.serialization.mappers; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.DefaultMapper; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.AmlGenerator; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.MappingContext; +import io.adminshell.aas.v3.dataformat.aml.serialization.DefaultMapper; +import io.adminshell.aas.v3.dataformat.aml.serialization.AmlGenerator; +import io.adminshell.aas.v3.dataformat.aml.serialization.MappingContext; import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; import io.adminshell.aas.v3.dataformat.mapping.MappingException; import io.adminshell.aas.v3.model.DataSpecificationContent; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/DataSpecificationMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/DataSpecificationMapper.java similarity index 86% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/DataSpecificationMapper.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/DataSpecificationMapper.java index 54c68782..60a04f58 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/DataSpecificationMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/DataSpecificationMapper.java @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.aas2aml.custom; +package io.adminshell.aas.v3.dataformat.aml.serialization.mappers; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.DefaultMapper; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.AmlGenerator; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.MappingContext; +import io.adminshell.aas.v3.dataformat.aml.serialization.DefaultMapper; +import io.adminshell.aas.v3.dataformat.aml.serialization.AmlGenerator; +import io.adminshell.aas.v3.dataformat.aml.serialization.MappingContext; import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; import io.adminshell.aas.v3.dataformat.mapping.MappingException; import io.adminshell.aas.v3.model.DataSpecificationContent; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/EmbeddedDataSpecificationCollectionMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/EmbeddedDataSpecificationCollectionMapper.java similarity index 93% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/EmbeddedDataSpecificationCollectionMapper.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/EmbeddedDataSpecificationCollectionMapper.java index fe9e106a..30bd860e 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/EmbeddedDataSpecificationCollectionMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/EmbeddedDataSpecificationCollectionMapper.java @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.aas2aml.custom; +package io.adminshell.aas.v3.dataformat.aml.serialization.mappers; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.DefaultMapper; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.AmlGenerator; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.MappingContext; +import io.adminshell.aas.v3.dataformat.aml.serialization.DefaultMapper; +import io.adminshell.aas.v3.dataformat.aml.serialization.AmlGenerator; +import io.adminshell.aas.v3.dataformat.aml.serialization.MappingContext; import io.adminshell.aas.v3.dataformat.aml.model.caex.AttributeType; import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; import io.adminshell.aas.v3.dataformat.core.DataSpecificationInfo; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/FileMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/FileMapper.java similarity index 88% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/FileMapper.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/FileMapper.java index aa78ea67..d8b959d3 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/FileMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/FileMapper.java @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.aas2aml.custom; +package io.adminshell.aas.v3.dataformat.aml.serialization.mappers; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.DefaultMapper; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.AmlGenerator; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.MappingContext; +import io.adminshell.aas.v3.dataformat.aml.serialization.DefaultMapper; +import io.adminshell.aas.v3.dataformat.aml.serialization.AmlGenerator; +import io.adminshell.aas.v3.dataformat.aml.serialization.MappingContext; import io.adminshell.aas.v3.dataformat.aml.model.caex.AttributeType; import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; import io.adminshell.aas.v3.dataformat.aml.model.caex.RoleClassType; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/LangStringCollectionMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/LangStringCollectionMapper.java similarity index 86% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/LangStringCollectionMapper.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/LangStringCollectionMapper.java index 9d0fe524..b803c908 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/LangStringCollectionMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/LangStringCollectionMapper.java @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.aas2aml.custom; +package io.adminshell.aas.v3.dataformat.aml.serialization.mappers; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.DefaultMapper; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.AmlGenerator; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.MappingContext; +import io.adminshell.aas.v3.dataformat.aml.serialization.DefaultMapper; +import io.adminshell.aas.v3.dataformat.aml.serialization.AmlGenerator; +import io.adminshell.aas.v3.dataformat.aml.serialization.MappingContext; import io.adminshell.aas.v3.dataformat.aml.model.caex.AttributeType; import io.adminshell.aas.v3.model.LangString; import java.lang.reflect.ParameterizedType; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/OperationVariableCollectionMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/OperationVariableCollectionMapper.java similarity index 84% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/OperationVariableCollectionMapper.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/OperationVariableCollectionMapper.java index b7826fee..2954cce1 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/OperationVariableCollectionMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/OperationVariableCollectionMapper.java @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.aas2aml.custom; +package io.adminshell.aas.v3.dataformat.aml.serialization.mappers; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.DefaultCollectionMapper; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.AmlGenerator; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.MappingContext; +import io.adminshell.aas.v3.dataformat.aml.serialization.DefaultCollectionMapper; +import io.adminshell.aas.v3.dataformat.aml.serialization.AmlGenerator; +import io.adminshell.aas.v3.dataformat.aml.serialization.MappingContext; import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; import io.adminshell.aas.v3.dataformat.mapping.MappingException; import io.adminshell.aas.v3.model.OperationVariable; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/OperationVariableMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/OperationVariableMapper.java similarity index 79% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/OperationVariableMapper.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/OperationVariableMapper.java index 7901b104..50522e2a 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/OperationVariableMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/OperationVariableMapper.java @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.aas2aml.custom; +package io.adminshell.aas.v3.dataformat.aml.serialization.mappers; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.DefaultMapper; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.AmlGenerator; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.MappingContext; +import io.adminshell.aas.v3.dataformat.aml.serialization.DefaultMapper; +import io.adminshell.aas.v3.dataformat.aml.serialization.AmlGenerator; +import io.adminshell.aas.v3.dataformat.aml.serialization.MappingContext; import io.adminshell.aas.v3.dataformat.mapping.MappingException; import io.adminshell.aas.v3.model.OperationVariable; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/QualifierMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/QualifierMapper.java similarity index 80% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/QualifierMapper.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/QualifierMapper.java index 5ddd2f7a..2198a20c 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/QualifierMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/QualifierMapper.java @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.aas2aml.custom; +package io.adminshell.aas.v3.dataformat.aml.serialization.mappers; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.DefaultMapper; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.AmlGenerator; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.MappingContext; +import io.adminshell.aas.v3.dataformat.aml.serialization.DefaultMapper; +import io.adminshell.aas.v3.dataformat.aml.serialization.AmlGenerator; +import io.adminshell.aas.v3.dataformat.aml.serialization.MappingContext; import io.adminshell.aas.v3.dataformat.mapping.MappingException; import io.adminshell.aas.v3.model.Qualifier; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/ReferenceCollectionMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/ReferenceCollectionMapper.java similarity index 79% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/ReferenceCollectionMapper.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/ReferenceCollectionMapper.java index 6c3e66a3..81b8ca63 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/ReferenceCollectionMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/ReferenceCollectionMapper.java @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.aas2aml.custom; +package io.adminshell.aas.v3.dataformat.aml.serialization.mappers; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.Mapper; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.AmlGenerator; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.MappingContext; +import io.adminshell.aas.v3.dataformat.aml.serialization.Mapper; +import io.adminshell.aas.v3.dataformat.aml.serialization.AmlGenerator; +import io.adminshell.aas.v3.dataformat.aml.serialization.MappingContext; import io.adminshell.aas.v3.dataformat.mapping.MappingException; import io.adminshell.aas.v3.model.Reference; import java.util.Collection; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/ReferenceElementMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/ReferenceElementMapper.java similarity index 86% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/ReferenceElementMapper.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/ReferenceElementMapper.java index f5662c86..d2ca99d5 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/ReferenceElementMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/ReferenceElementMapper.java @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.aas2aml.custom; +package io.adminshell.aas.v3.dataformat.aml.serialization.mappers; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.DefaultMapper; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.AmlGenerator; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.MappingContext; +import io.adminshell.aas.v3.dataformat.aml.serialization.DefaultMapper; +import io.adminshell.aas.v3.dataformat.aml.serialization.AmlGenerator; +import io.adminshell.aas.v3.dataformat.aml.serialization.MappingContext; import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; import io.adminshell.aas.v3.dataformat.core.ReflectionHelper; import io.adminshell.aas.v3.dataformat.core.util.AasUtils; @@ -52,7 +52,7 @@ public void map(ReferenceElement element, AmlGenerator generator, MappingContext subGenerator.addExternalInterfaceForReference(context); subGenerator.addInternalLink(PROPERTY_VALUE_NAME, element, element.getValue()); } else { - subGenerator.addExternalInterfaceForUnresolvableReference(element.getValue(), context); + subGenerator.addExternalInterfaceForUnresolvableReference(PROPERTY_VALUE_NAME, element.getValue(), context); } subGenerator.appendReferenceTargetInterfaceIfRequired(element, context); generator.addInternalElement(builder.build(), element); diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/ReferenceMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/ReferenceMapper.java new file mode 100644 index 00000000..0bffea29 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/ReferenceMapper.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 io.adminshell.aas.v3.dataformat.aml.serialization.mappers; + +import io.adminshell.aas.v3.dataformat.aml.model.caex.AttributeType; +import io.adminshell.aas.v3.dataformat.aml.serialization.AmlGenerator; +import io.adminshell.aas.v3.dataformat.aml.serialization.DefaultMapper; +import io.adminshell.aas.v3.dataformat.aml.serialization.MappingContext; +import io.adminshell.aas.v3.dataformat.core.util.AasUtils; +import io.adminshell.aas.v3.dataformat.mapping.MappingException; +import io.adminshell.aas.v3.model.Reference; + +public class ReferenceMapper extends DefaultMapper { + + @Override + protected AttributeType.Builder toAttribute(Reference value, AmlGenerator generator, MappingContext context) throws MappingException { + AttributeType.Builder builder = AttributeType.builder() + .withValue(AasUtils.asString(value)); + if (context.getProperty() != null) { + builder = builder + .withName(getAttributeName(value, context)) + .withRefSemantic(getRefSemantic(value, generator, context)); + } + return builder; + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/RelationshipElementMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/RelationshipElementMapper.java similarity index 88% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/RelationshipElementMapper.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/RelationshipElementMapper.java index 0ed07d56..46ca23c8 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/RelationshipElementMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/RelationshipElementMapper.java @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.aas2aml.custom; +package io.adminshell.aas.v3.dataformat.aml.serialization.mappers; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.DefaultMapper; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.AmlGenerator; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.MappingContext; +import io.adminshell.aas.v3.dataformat.aml.serialization.DefaultMapper; +import io.adminshell.aas.v3.dataformat.aml.serialization.AmlGenerator; +import io.adminshell.aas.v3.dataformat.aml.serialization.MappingContext; import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; import io.adminshell.aas.v3.dataformat.core.ReflectionHelper; import io.adminshell.aas.v3.dataformat.core.util.AasUtils; @@ -60,7 +60,7 @@ private void mapProperty(RelationshipElement element, Reference reference, Strin generator.addExternalInterfaceForReference(context); generator.addInternalLink(name, element, reference); } else { - generator.addExternalInterfaceForUnresolvableReference(reference, context); + generator.addExternalInterfaceForUnresolvableReference(name, reference, context); } } } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/SubmodelMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/SubmodelMapper.java similarity index 81% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/SubmodelMapper.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/SubmodelMapper.java index 17d03748..cfa078e9 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/SubmodelMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/SubmodelMapper.java @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.aas2aml.custom; +package io.adminshell.aas.v3.dataformat.aml.serialization.mappers; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.DefaultMapper; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.AmlGenerator; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.MappingContext; +import io.adminshell.aas.v3.dataformat.aml.serialization.DefaultMapper; +import io.adminshell.aas.v3.dataformat.aml.serialization.AmlGenerator; +import io.adminshell.aas.v3.dataformat.aml.serialization.MappingContext; import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; import io.adminshell.aas.v3.dataformat.mapping.MappingException; import io.adminshell.aas.v3.model.ModelingKind; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/ViewMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/ViewMapper.java similarity index 89% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/ViewMapper.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/ViewMapper.java index 904f080f..828abc34 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/aas2aml/custom/ViewMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/ViewMapper.java @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.aas2aml.custom; +package io.adminshell.aas.v3.dataformat.aml.serialization.mappers; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.DefaultMapper; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.AmlGenerator; -import io.adminshell.aas.v3.dataformat.aml.aas2aml.MappingContext; +import io.adminshell.aas.v3.dataformat.aml.serialization.DefaultMapper; +import io.adminshell.aas.v3.dataformat.aml.serialization.AmlGenerator; +import io.adminshell.aas.v3.dataformat.aml.serialization.MappingContext; import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; import io.adminshell.aas.v3.dataformat.core.ReflectionHelper; import io.adminshell.aas.v3.dataformat.core.util.AasUtils; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/naming/AbstractClassNamingStrategy.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/naming/AbstractClassNamingStrategy.java similarity index 91% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/naming/AbstractClassNamingStrategy.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/naming/AbstractClassNamingStrategy.java index 0fd4ad33..7d2cf7e5 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/naming/AbstractClassNamingStrategy.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/naming/AbstractClassNamingStrategy.java @@ -13,10 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.naming; +package io.adminshell.aas.v3.dataformat.aml.serialization.naming; import com.google.common.reflect.TypeToken; -import io.adminshell.aas.v3.dataformat.mapping.util.TypeUtils; +import io.adminshell.aas.v3.dataformat.core.util.MostSpecificTypeTokenComparator; import io.adminshell.aas.v3.model.Referable; import java.lang.reflect.Type; import java.util.ArrayList; @@ -55,7 +55,7 @@ public void registerCustomNaming(Class type, BiFunction getCustomNaming(Type type) { return customNamings.stream() .filter(x -> x.inputType.isSupertypeOf(type)) - .sorted((x, y) -> Objects.compare(x.inputType, y.inputType, new TypeUtils.TypeTokenComparator())) + .sorted((x, y) -> Objects.compare(x.inputType, y.inputType, new MostSpecificTypeTokenComparator())) .findFirst(); } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/naming/IdClassNamingStrategy.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/naming/IdClassNamingStrategy.java similarity index 91% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/naming/IdClassNamingStrategy.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/naming/IdClassNamingStrategy.java index c4982800..4b4a2894 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/naming/IdClassNamingStrategy.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/naming/IdClassNamingStrategy.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.naming; +package io.adminshell.aas.v3.dataformat.aml.serialization.naming; import java.util.UUID; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/naming/NamingStrategy.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/naming/NamingStrategy.java similarity index 89% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/naming/NamingStrategy.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/naming/NamingStrategy.java index a3531b97..3cd74554 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/naming/NamingStrategy.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/naming/NamingStrategy.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.naming; +package io.adminshell.aas.v3.dataformat.aml.serialization.naming; import java.lang.reflect.Type; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/naming/NumberingClassNamingStrategy.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/naming/NumberingClassNamingStrategy.java similarity index 92% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/naming/NumberingClassNamingStrategy.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/naming/NumberingClassNamingStrategy.java index 7ff69764..88c36cb0 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/naming/NumberingClassNamingStrategy.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/naming/NumberingClassNamingStrategy.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.naming; +package io.adminshell.aas.v3.dataformat.aml.serialization.naming; import java.util.HashMap; import java.util.Map; diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/naming/PropertyNamingStrategy.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/naming/PropertyNamingStrategy.java similarity index 90% rename from dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/naming/PropertyNamingStrategy.java rename to dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/naming/PropertyNamingStrategy.java index 67702c5d..b8409bc4 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/naming/PropertyNamingStrategy.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/naming/PropertyNamingStrategy.java @@ -13,10 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.aml.naming; +package io.adminshell.aas.v3.dataformat.aml.serialization.naming; import com.google.common.reflect.TypeToken; -import io.adminshell.aas.v3.dataformat.mapping.util.TypeUtils; +import io.adminshell.aas.v3.dataformat.core.util.MostSpecificTypeTokenComparator; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.List; @@ -54,7 +54,7 @@ public void registerCustomNaming(Class type, Function provider private List getCustomNaming(Type type, String property) { return customNamings.stream() .filter(x -> x.inputType.isSupertypeOf(type)) - .sorted((x, y) -> Objects.compare(x.inputType, y.inputType, new TypeUtils.TypeTokenComparator())) + .sorted((x, y) -> Objects.compare(x.inputType, y.inputType, new MostSpecificTypeTokenComparator())) .collect(Collectors.toList()); } diff --git a/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/fixtures/TestExample.java b/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/fixtures/TestExample.java index 8d727109..e91edab1 100644 --- a/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/fixtures/TestExample.java +++ b/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/fixtures/TestExample.java @@ -16,7 +16,7 @@ package io.adminshell.aas.v3.dataformat.aml.fixtures; import io.adminshell.aas.v3.dataformat.core.ReflectionHelper; -import io.adminshell.aas.v3.dataformat.core.deserialization.EnumDeserializer; +import io.adminshell.aas.v3.dataformat.core.util.AasUtils; import io.adminshell.aas.v3.model.*; import io.adminshell.aas.v3.model.impl.*; @@ -27,7 +27,7 @@ public class TestExample { public static final java.io.File FILE = new java.io.File("src/test/resources/amlfile/example_test.aml"); private static KeyElements resolveKeyElement(Class type) { - String potentialEnumName = EnumDeserializer.translate(ReflectionHelper.getAasInterface(type).getSimpleName()); + String potentialEnumName = AasUtils.deserializeEnumName(ReflectionHelper.getAasInterface(type).getSimpleName()); return KeyElements.valueOf(potentialEnumName); } diff --git a/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/serialize/AmlDeserializerTest.java b/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/serialize/AmlDeserializerTest.java index a49cf8d4..e09fe40d 100644 --- a/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/serialize/AmlDeserializerTest.java +++ b/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/serialize/AmlDeserializerTest.java @@ -29,7 +29,6 @@ public class AmlDeserializerTest { private final AmlDeserializer deserializer = new AmlDeserializer(); @Test - @Ignore public void testExample() throws FileNotFoundException, DeserializationException { AssetAdministrationShellEnvironment actual = deserializer.read(TestExample.FILE); assertEquals(TestExample.ENVIRONMENT, actual); diff --git a/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/serialize/AmlSerializerTest.java b/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/serialize/AmlSerializerTest.java index 2bc0a9dc..d15ef036 100644 --- a/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/serialize/AmlSerializerTest.java +++ b/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/serialize/AmlSerializerTest.java @@ -19,7 +19,7 @@ import io.adminshell.aas.v3.dataformat.SerializationException; import io.adminshell.aas.v3.dataformat.aml.AmlSerializationConfig; import io.adminshell.aas.v3.dataformat.aml.AmlSerializer; -import io.adminshell.aas.v3.dataformat.aml.id.IntegerIdGenerator; +import io.adminshell.aas.v3.dataformat.aml.serialization.id.IntegerIdGenerator; import io.adminshell.aas.v3.dataformat.aml.fixtures.TestExample; import io.adminshell.aas.v3.dataformat.core.util.AasUtils; import io.adminshell.aas.v3.model.AssetAdministrationShellEnvironment; @@ -136,7 +136,7 @@ public void testReferenceElement() throws SerializationException, SAXException, .identifier("iri:AAS1") .build()) .idShort("AAS1") - .submodel(AasUtils.identifiableToReference(submodel)) + .submodel(AasUtils.toReference(submodel)) .build()) .submodels(submodel) .build(); @@ -184,7 +184,7 @@ public void testEmbeddedDataSpecification() throws SerializationException, SAXEx .identifier("iri:AAS1") .build()) .idShort("AAS1") - .submodel(AasUtils.identifiableToReference(submodel)) + .submodel(AasUtils.toReference(submodel)) .build()) .submodels(submodel) .build(); @@ -196,9 +196,9 @@ public void testEmbeddedDataSpecification() throws SerializationException, SAXEx } @Test - @Ignore - public void testSAPFullExample() throws SerializationException { - String actual = serializer.write(FullExample.ENVIRONMENT); +// @Ignore + public void testSAPFullExample() throws SerializationException, SAXException, IOException { + validateAmlSerializer(FullExample.FILE, FullExample.ENVIRONMENT); } private void validateAmlSerializer(File expectedFile, AssetAdministrationShellEnvironment environment) diff --git a/dataformat-aml/src/test/resources/test_demo_full_example.aml b/dataformat-aml/src/test/resources/test_demo_full_example.aml new file mode 100644 index 00000000..2fa0d7ba --- /dev/null +++ b/dataformat-aml/src/test/resources/test_demo_full_example.aml @@ -0,0 +1,3724 @@ + + + + + foo + bar + 05-08-2021 15:14:40 + + + + + AutomationML Editor + 916578CA-FE0D-474E-A4FC-9E1719892369 + AutomationML e.V. + www.AutomationML.org + 5.3.3.0 + 5.3.3.0 + 2021-08-12T13:27:15.422413 + unspecified + unspecified + + + + + + + + 0 + + + + 0.9 + + + + + + + INSTANCE + + + + (ASSET)[IRI]https://acplt.org/Test_Asset + + + + + (ASSET_ADMINISTRATION_SHELL)[IRI]https://acplt.org/TestAssetAdministrationShell2 + + + + + + An Example Asset Administration Shell for the test application + + + Ein Beispiel-Verwaltungsschale für eine Test-Anwendung + + + + TestAssetAdministrationShell + + + + + + IRI + + + + https://acplt.org/Test_AssetAdministrationShell + + + + + + + + 0 + + + + 0.9 + + + + + + + An example submodel for the test application + + + Ein Beispiel-Teilmodell für eine Test-Anwendung + + + + TestSubmodel + + + + + + IRI + + + + https://acplt.org/Test_Submodel + + + + + INSTANCE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelTemplates/ExampleSubmodel + + + + + Parameter + + + + + + Example RelationshipElement object + + + Beispiel RelationshipElement Element + + + + ExampleRelationshipElement + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleRelationshipElement + + + + + + + + + Parameter + + + + + + Example AnnotatedRelationshipElement object + + + Beispiel AnnotatedRelationshipElement Element + + + + ExampleAnnotatedRelationshipElement + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement + + + + + + + Parameter + + + + ExampleProperty3 + + + + INSTANCE + + + + some example annotation + + + + string + + + + + + + + + Parameter + + + + + + Example Operation object + + + Beispiel Operation Element + + + + ExampleOperation + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Operations/ExampleOperation + + + + + + Constant + + + + + + Example Property object + + + Beispiel Property Element + + + + ExampleProperty + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty + + + + exampleValue + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + string + + + + + + + + + + Constant + + + + + + Example Property object + + + Beispiel Property Element + + + + ExampleProperty + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty + + + + exampleValue + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + string + + + + + + + + + + Constant + + + + + + Example Property object + + + Beispiel Property Element + + + + ExampleProperty + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty + + + + exampleValue + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + string + + + + + + + + + + + Parameter + + + + + + Example Capability object + + + Beispiel Capability Element + + + + ExampleCapability + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Capabilities/ExampleCapability + + + + + + + Parameter + + + + + + Example BasicEvent object + + + Beispiel BasicEvent Element + + + + ExampleBasicEvent + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Events/ExampleBasicEvent + + + + + + + false + + + + Parameter + + + + + + Example SubmodelElementCollectionOrdered object + + + Beispiel SubmodelElementCollectionOrdered Element + + + + ExampleSubmodelCollectionOrdered + + + + true + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered + + + + + Constant + + + + + + Example Property object + + + Beispiel Property Element + + + + ExampleProperty + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty + + + + exampleValue + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + string + + + + + + + + Constant + + + + + + Example MultiLanguageProperty object + + + Beispiel MulitLanguageProperty Element + + + + ExampleMultiLanguageProperty + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleMultiLanguageValueId + + + + + + Example value of a MultiLanguageProperty element + + + Beispielswert für ein MulitLanguageProperty-Element + + + + + + + Parameter + + + + + + Example Range object + + + Beispiel Range Element + + + + ExampleRange + + + + 100 + + + + 0 + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Ranges/ExampleRange + + + + int + + + + + + + + + false + + + + Parameter + + + + + + Example SubmodelElementCollectionUnordered object + + + Beispiel SubmodelElementCollectionUnordered Element + + + + ExampleSubmodelCollectionUnordered + + + + false + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered + + + + + Parameter + + + + + + Example Blob object + + + Beispiel Blob Element + + + + ExampleBlob + + + + application/pdf + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Blobs/ExampleBlob + + + + AQIDBAU= + + + + + + + Parameter + + + + + + Example File object + + + Beispiel File Element + + + + ExampleFile + + + + application/pdf + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Files/ExampleFile + + + + /TestFile.pdf + + + + + application/pdf + + + /TestFile.pdf + + + + + + + Parameter + + + + + + Example Reference Element object + + + Beispiel Reference Element Element + + + + ExampleReferenceElement + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ReferenceElements/ExampleReferenceElement + + + + + + + + + + + + + + + + + 0.9 + + + + + + + An example bill of material submodel for the test application + + + Ein Beispiel-BillofMaterial-Submodel für eine Test-Anwendung + + + + BillOfMaterial + + + + + + IRI + + + + http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial + + + + + INSTANCE + + + + (SUBMODEL)[IRI]http://acplt.org/SubmodelTemplates/BillOfMaterial + + + + + + + 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. + + + 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 + + + + CO_MANAGED_ENTITY + + + + ExampleEntity + + + + (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber + + + + + Constant + + + + + + Example Property object + + + Beispiel Property Element + + + + ExampleProperty2 + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty + + + + exampleValue2 + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + string + + + + + + + + Constant + + + + + + Example Property object + + + Beispiel Property Element + + + + ExampleProperty + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty + + + + exampleValue + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + string + + + + + + + + + + + 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. + + + 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 + + + + SELF_MANAGED_ENTITY + + + + (ASSET)[IRI]https://acplt.org/Test_Asset2 + + + + ExampleEntity2 + + + + (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber + + + + + + + + + + + 0 + + + + 0.9 + + + + + + + An example asset identification submodel for the test application + + + Ein Beispiel-Identifikations-Submodel für eine Test-Anwendung + + + + Identification + + + + + + IRI + + + + http://acplt.org/Submodels/Assets/TestAsset/Identification + + + + + INSTANCE + + + + (SUBMODEL)[IRI]http://acplt.org/SubmodelTemplates/AssetIdentification + + + + + + + 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. + + + 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 + + + + ManufacturerName + + + + + + http://acplt.org/Qualifier/ExampleQualifier + + + + 100 + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + int + + + + + + + http://acplt.org/Qualifier/ExampleQualifier2 + + + + 50 + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + int + + + + + (GLOBAL_REFERENCE)[IRI]0173-1#02-AAO677#002 + + + + ACPLT + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + string + + + + + + + + + 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. + + + 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 + + + + InstanceId + + + + (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber + + + + 978-8234-234-342 + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + string + + + + + + + + + + + + + + + INSTANCE + + + + (ASSET)[IRI]https://acplt.org/Test_Asset_Mandatory + + + + + + + + + + + IRI + + + + https://acplt.org/Test_AssetAdministrationShell_Mandatory + + + + + + + + + + + + IRI + + + + https://acplt.org/Test_Submodel_Mandatory + + + + + TEMPLATE + + + + + ExampleRelationshipElement + + + + + + + + + ExampleAnnotatedRelationshipElement + + + + + + + + + ExampleOperation + + + + + + + ExampleCapability + + + + + + + ExampleBasicEvent + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + + + false + + + + ExampleSubmodelCollectionOrdered + + + + true + + + + + ExampleProperty + + + + string + + + + + + + + ExampleMultiLanguageProperty + + + + + + + + ExampleRange + + + + int + + + + + + + + + false + + + + ExampleSubmodelCollectionUnordered + + + + false + + + + + ExampleBlob + + + + application/pdf + + + + + + + ExampleFile + + + + application/pdf + + + + + application/pdf + + + + + + + + ExampleReferenceElement + + + + + + + + + + false + + + + ExampleSubmodelCollectionUnordered2 + + + + false + + + + + + + + + + + + + + + + + + + + IRI + + + + https://acplt.org/Test_Submodel2_Mandatory + + + + + INSTANCE + + + + + + + + + + + 0 + + + + 0.9 + + + + + + + INSTANCE + + + + (ASSET)[IRI]https://acplt.org/Test_Asset_Missing + + + + + + + An Example Asset Administration Shell for the test application + + + Ein Beispiel-Verwaltungsschale für eine Test-Anwendung + + + + TestAssetAdministrationShell + + + + + + IRI + + + + https://acplt.org/Test_AssetAdministrationShell_Missing + + + + + + + + 0 + + + + 0.9 + + + + + + + An example submodel for the test application + + + Ein Beispiel-Teilmodell für eine Test-Anwendung + + + + TestSubmodel + + + + + + IRI + + + + https://acplt.org/Test_Submodel_Missing + + + + + INSTANCE + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelTemplates/ExampleSubmodel + + + + + Parameter + + + + + + Example RelationshipElement object + + + Beispiel RelationshipElement Element + + + + ExampleRelationshipElement + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleRelationshipElement + + + + + + + + + Parameter + + + + + + Example AnnotatedRelationshipElement object + + + Beispiel AnnotatedRelationshipElement Element + + + + ExampleAnnotatedRelationshipElement + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement + + + + + + + Parameter + + + + ExampleProperty + + + + INSTANCE + + + + some example annotation + + + + string + + + + + + + + + Parameter + + + + + + Example Operation object + + + Beispiel Operation Element + + + + ExampleOperation + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Operations/ExampleOperation + + + + + + Constant + + + + + + Example Property object + + + Beispiel Property Element + + + + ExampleProperty + + + + + + http://acplt.org/Qualifier/ExampleQualifier + + + + string + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty + + + + exampleValue + + + + string + + + + + + + + + + Constant + + + + + + Example Property object + + + Beispiel Property Element + + + + ExampleProperty + + + + + + http://acplt.org/Qualifier/ExampleQualifier + + + + string + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty + + + + exampleValue + + + + string + + + + + + + + + + Constant + + + + + + Example Property object + + + Beispiel Property Element + + + + ExampleProperty + + + + + + http://acplt.org/Qualifier/ExampleQualifier + + + + string + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty + + + + exampleValue + + + + string + + + + + + + + + + + Parameter + + + + + + Example Capability object + + + Beispiel Capability Element + + + + ExampleCapability + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Capabilities/ExampleCapability + + + + + + + Parameter + + + + + + Example BasicEvent object + + + Beispiel BasicEvent Element + + + + ExampleBasicEvent + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Events/ExampleBasicEvent + + + + + + + false + + + + Parameter + + + + + + Example SubmodelElementCollectionOrdered object + + + Beispiel SubmodelElementCollectionOrdered Element + + + + ExampleSubmodelCollectionOrdered + + + + true + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered + + + + + Constant + + + + + + Example Property object + + + Beispiel Property Element + + + + ExampleProperty + + + + + + http://acplt.org/Qualifier/ExampleQualifier + + + + string + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty + + + + exampleValue + + + + string + + + + + + + + Constant + + + + + + Example MultiLanguageProperty object + + + Beispiel MulitLanguageProperty Element + + + + ExampleMultiLanguageProperty + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty + + + + + + Example value of a MultiLanguageProperty element + + + Beispielswert für ein MulitLanguageProperty-Element + + + + + + + + Parameter + + + + + + Example Range object + + + Beispiel Range Element + + + + ExampleRange + + + + 100 + + + + 0 + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Ranges/ExampleRange + + + + int + + + + + + + + + false + + + + Parameter + + + + + + Example SubmodelElementCollectionUnordered object + + + Beispiel SubmodelElementCollectionUnordered Element + + + + ExampleSubmodelCollectionUnordered + + + + false + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered + + + + + Parameter + + + + + + Example Blob object + + + Beispiel Blob Element + + + + ExampleBlob + + + + application/pdf + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Blobs/ExampleBlob + + + + AQIDBAU= + + + + + + + Parameter + + + + + + Example File object + + + Beispiel File Element + + + + ExampleFile + + + + application/pdf + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Files/ExampleFile + + + + /TestFile.pdf + + + + + application/pdf + + + /TestFile.pdf + + + + + + + Parameter + + + + + + Example Reference Element object + + + Beispiel Reference Element Element + + + + ExampleReferenceElement + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ReferenceElements/ExampleReferenceElement + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + 0.9 + + + + + + + An example concept description for the test application + + + Ein Beispiel-ConceptDescription für eine Test-Anwendung + + + + TestConceptDescription + + + + + + IRI + + + + https://acplt.org/Test_ConceptDescription + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/DataSpecifications/ConceptDescriptions/TestConceptDescription + + + + + + + + + + + + + IRI + + + + https://acplt.org/Test_ConceptDescription_Mandatory + + + + + + + + + + 0 + + + + 0.9 + + + + + + + An example concept description for the test application + + + Ein Beispiel-ConceptDescription für eine Test-Anwendung + + + + TestConceptDescription + + + + + + IRI + + + + https://acplt.org/Test_ConceptDescription_Missing + + + + + + + + + + 0 + + + + 0.9 + + + + + TestSpec_01 + + + + + + IRI + + + + http://acplt.org/DataSpecifciations/Example/Identification + + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/ReferenceElements/ConceptDescriptionX + + + + + REAL_MEASURE + + + + + + Dies ist eine Data Specification für Testzwecke + + + This is a DataSpecification for testing purposes + + + + + + Test Specification + + + TestSpecification + + + + + + Test Spec + + + TestSpec + + + + http://acplt.org/DataSpec/ExampleDef + + + + SU + + + + SpaceUnit + + + + (GLOBAL_REFERENCE)[IRI]http://acplt.org/Units/SpaceUnit + + + + TEST + + + + string + + + + + + + + + Interface Class Library according to Details of the Asset Administration Shell V2.0. + 1.0.0 + + A FileDataReference represents the address to a File. FileDataReference is derived from the AutomationML Interface Class ExternalDataReference that is defined in AutomationML BPR_005E_ExternalDataReference_v1.0.0_2:The interface class “ExternalDataReference” shall be used in order to reference external documents out of the scope of AutomationML. + + + Reference to any other referable element of the same of any other AAS or a reference to an external object or entity. For local references inside the same Asset Administration Shell an InternalLink between two objects with this interface "ReferableReference" shall be set. In this case the attribute value has to be empty. For references between different Asset Administration Shells or external objects or entities the attribute value shall be used and no InternalLink shall be set. + + Reference to any other referable element of any other AAS or a reference to an external object or entity. Note: For references to any other referable element of the same AAS InternalLinks are used and this attribute value shall be empty. + + + + + + Standard Automation Markup Language Interface Class Library - Part 1 Content extended with Part 3 and Part 4 Content + 2.2.2 + + + + + + + + + + The attribute refURI is an IRI that can represent an absolute or relative path to an L document. An added fragment (with #) references inside the document + + + + + + + + + + + + + + + + + true + + + + + + + + + + + + + 1.0.0 + + + Mime type of the content of the File. + + + + + Role Class Library according to Details of the Asset Administration Shell V2.0. + 1.0.0 + + An Asset Administration Shell. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + + + + + + Abstract attribute class for identification. Has the subattributes id and idType. + + + Identifier of the element. Its type is defined in idType. Id is a subproperty of identification. + + + + + Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the enumeration “IdentifierType”. IdType is a subproperty of identification. + + + + + + Abstract attribute for administration. Has the subattributes revision and version. + + + Revision of the element. Constraint AASd-005: A revision requires a version. This means, if there is no version there is no revision neither. Revision is a subproperty of administration. + + + + + Version of the element. Version is a subproperty of administration. + + + + + + Global reference to the data specification template used by the element. + + + + + The derivedFrom attribute is used to establish a relationship between two Asset Administration Shells that are derived from each other. + + + + + + An Asset describes meta data of an asset that is represented by an AAS. The asset may either represent an asset type or an asset instance. The asset has a globally unique identifier plus – if needed – additional domain specific (proprietary) identifiers. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + Abstract attribute class for identification. Has the subattributes id and idType. + + + Identifier of the element. Its type is defined in idType. + + + + + Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the enumeration “IdentifierType”. IdType is a subproperty of identification. + + + + + + Abstract attribute for administration. Has the subattributes revision and version. + + + Revision of the element. Constraint AASd-005: A revision requires a version. This means, if there is no version there is no revision neither. Revision is a subproperty of administration. + + + + + Version of the element. Version is a subproperty of administration. + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the asset: either type or instance. + Instance + Instance + + + + Instance + Type + + + + + + A Submodel defines a specific aspect of the asset represented by the AAS. A submodel is used to structure the virtual representation and technical functionality of an Administration Shell into distinguishable parts. Each submodel refers to a well-defined domain or subject matter. Submodels can become standardized and thus become submodels types. Submodels can have different life-cycles. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + Abstract attribute class for identification. Has the subattributes id and idType. + + + Identifier of the element. Its type is defined in idType. Id is a subproperty of identification. + + + + + Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the enumeration “IdentifierType”. IdType is a subproperty of identification. + + + + + + Abstract attribute for administration. Has the subattributes revision and version. + + + Revision of the element. Constraint AASd-005: A revision requires a version. This means, if there is no version there is no revision neither. Revision is a subproperty of administration. + + + + + Version of the element. Version of the element. Version is a subproperty of administration. + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. + + + + + Reference to the global unqiue id of a coded value. + + + + + + + A submodel element collection is a set or list of submodel elements. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. + + + + + Reference to the global unqiue id of a coded value. + + + + + + If allowDuplicates=true, then it is allowed that the collection contains the same element several times. + false + + + + If ordered=false, then the elements in the property collection are not ordered. If ordered=true then the elements in the collection are ordered. Default = false. Note: An ordered submodel element collection is typically implemented as an indexed array. + false + + + + Submodel element contained in the collection. + + + + + A BLOB is a data element that represents a file that is contained with its source code in the value attribute. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. + + + + + Reference to the global unqiue id of a coded value. + + + + + + Mime type of the content of the BLOB. The mime type states which file extension the file has. Valid values are e.g. “application/json”, “application/xls”, ”image/jpg”. The allowed values are defined as in RFC2046. + + + + + The value of the BLOB instance of a blob data element. Note: In contrast to the file property the file content is stored directly as value in the Blob data element. + + + + + + A capability is the implementation-independent description of the potential of an asset to achieve a certain effect in the physical or virtual world. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. + + + + + Reference to the global unqiue id of a coded value. + + + + + + + A role class for a File that a data element that represents an address to a file. It is derived from the AutomationML role class ExternalData that is an role type for a document type and the base class for all document type roles. It describes different document types. ExternalData is defined in AutomationML BPR_005E_ExternalDataReference_v1.0.0_2. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. + + + + + Reference to the global unqiue id of a coded value. + + + + + + + The attribute refURI is an IRI that can represent an absolute or relative path to an L document. An added fragment (with #) references inside the document + + + Mime type of the content of the File. + + + + + A property is a data element that has a single value. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. + + + + + Reference to the global unqiue id of a coded value. + + + + + + The value of the property instance. + + + + Reference to the global unique id if a coded value. + + + + + A reference element is a data element that defines a logical reference to another element within the same or another AAS or a reference to an external object or entity. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. + + + + + Reference to the global unqiue id of a coded value. + + + + + + + Reference to any other referable element of any other AAS or a reference to an external object or entity. Note: For references to any other referable elment of the same AAS InternalLinks are used and this attribute value shall be empty. + + + + + + A relationship element is used to define a relationship between two referable elements. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. + + + + + Reference to the global unqiue id of a coded value. + + + + + + + Reference to any other referable element of any other AAS or a reference to an external object or entity. Note: For references to any other referable elment of the same AAS InternalLinks are used and this attribute value shall be empty. + + + + + Reference to any other referable element of any other AAS or a reference to an external object or entity. Note: For references to any other referable elment of the same AAS InternalLinks are used and this attribute value shall be empty. + + + + + An annotated relationship element is an relationship element that can be annotated with additional data elements. + + Annotations that hold for the relationships between the two elements. + + + + + An operation is a submodel element with input and output variables. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. + + + + + Reference to the global unqiue id of a coded value. + + + + + + + The list of AAS OperationVariableIn entities. In AML, the corresponding InternalElement with this role is a child of the InternalElement with the Operation role. + + + The list of AAS OperationVariableOut entities. In AML, the corresponding InternalElement with this role is a child of the InternalElement with the Operation role. + + + The list of AAS OperationVariableOut entities. In AML, the corresponding InternalElement with this role is a child of the InternalElement with the Operation role. + + + A view is a collection of referable elements w.r.t. to a specific viewpoint of one or more stakeholders. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + Global reference to the data specification template used by the element. + + + + + Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. + + + + + + A dictionary contains elements that can be reused. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + + + + + + + Explanation: The semantics of a property or other elements that may have a semantic description is defined by a concept description. The description of the concept should follow a standardized schema (realized as data specification template). + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + Abstract attribute class for identification. Has the subattributes id and idType. + + + Identifier of the element. Its type is defined in idType. Id is a subproperty of identification. + + + + + Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the enumeration “IdentifierType”. IdType is a subproperty of identification. + + + + + + Abstract attribute for administration. Has the subattributes revision and version. + + + Revision of the element. Constraint AASd-005: A revision requires a version. This means, if there is no version there is no revision neither. Revision is a subproperty of administration. + + + + + Version of the element. Version is a subproperty of administration. + + + + + + Global reference to the data specification template used by the element. + + + + Global reference to an external definition the concept is compatible to or was derived from. + + + + + + Description Role class of an element that has a data specification template. A template defines the additional attributes an element may or shall have. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + + + + + + Abstract attribute class for identification. Has the subattributes id and idType. + + + Identifier of the element. Its type is defined in idType. Id is a subproperty of identification. + + + + + Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the enumeration “IdentifierType”. IdType is a subproperty of identification. + + + + + + Abstract attribute for administration. Has the subattributes revision and version. + + + Revision of the element. Constraint AASd-005: A revision requires a version. This means, if there is no version there is no revision neither. Revision is a subproperty of administration. + + + + + Version of the element. Version is a subproperty of administration. + + + + + + + Content of the data specification template. + + + An entity is a submodel element that is used to model entities. Constraint AASd-056: If the semanticId of a Entity submodel element references a ConceptDescription then the ConceptDescription/category shall be one of following values: ENTITY. The ConceptDescription describes the elements assigned to the entity via Entity/statement. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. + + + + + Reference to the global unqiue id of a coded value. + + + + + + Describes statements applicable to the entity by a set of submodel elements, typically with a qualified value. + + + + Describes whether the entity is a co-managed entity or a self-managed entity. + SelfManagedEntity + SelfManagedEntity + + + + CoManagedEntity + SelfManagedEntity + + + + + Reference to an identifier key value pair representing a specific identifier of the asset represented by the asset administration shell. See Constraint AASd-014 + + + + Reference to the asset the entity is representing. Constraint AASd-014: Either the attribute globalAssetId or specificAssetId of an Entity must be set if Entity/entityType is set to "SelfManagedEntity". They are not existing otherwise. + + + + + + Automation Markup Language Base Role Class Library - Part 1 Content extended with Part 3 and Part 4 Content + 2.2.2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1.0.0 + + + + + + + + INSTANCE + + + + (ASSET)[IRI]https://acplt.org/Test_Asset_Mandatory + + + + + + + + + + + IRI + + + + https://acplt.org/Test_AssetAdministrationShell_Mandatory + + + + + + + + + + + + IRI + + + + https://acplt.org/Test_Submodel_Mandatory + + + + + TEMPLATE + + + + + ExampleRelationshipElement + + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + + + ExampleAnnotatedRelationshipElement + + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + + + ExampleOperation + + + + + + + ExampleCapability + + + + + + + ExampleBasicEvent + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + + + false + + + + ExampleSubmodelCollectionOrdered + + + + true + + + + + ExampleProperty + + + + string + + + + + + + ExampleMultiLanguageProperty + + + + + + + ExampleRange + + + + int + + + + + + + + + false + + + + ExampleSubmodelCollectionUnordered + + + + false + + + + + ExampleBlob + + + + application/pdf + + + + + + + ExampleFile + + + + application/pdf + + + + + application/pdf + + + + + + + + ExampleReferenceElement + + + + + + + + + + + + false + + + + ExampleSubmodelCollectionUnordered2 + + + + false + + + + + + + + + + + + + + + IRI + + + + https://acplt.org/Test_Submodel2_Mandatory + + + + + INSTANCE + + + + + + + + + + + + + + + IRI + + + + https://acplt.org/Test_Submodel_Mandatory + + + + + TEMPLATE + + + + + ExampleRelationshipElement + + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + + + ExampleAnnotatedRelationshipElement + + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + + + ExampleOperation + + + + + + + ExampleCapability + + + + + + + ExampleBasicEvent + + + + (PROPERTY)[ID_SHORT]ExampleProperty + + + + + + + false + + + + ExampleSubmodelCollectionOrdered + + + + true + + + + + ExampleProperty + + + + string + + + + + + + ExampleMultiLanguageProperty + + + + + + + ExampleRange + + + + int + + + + + + + + + false + + + + ExampleSubmodelCollectionUnordered + + + + false + + + + + ExampleBlob + + + + application/pdf + + + + + + + ExampleFile + + + + application/pdf + + + + + application/pdf + + + + + + + + ExampleReferenceElement + + + + + + + + + + + + false + + + + ExampleSubmodelCollectionUnordered2 + + + + false + + + + + + + + + 0 + + An AAS Data Specification template for IEC61369. A template consists of the DataSpecificationContent containing the additional attributes to be added to the element instance that references the data specification template and meta information about the template itself (this is why DataSpecification inherits from Identifiable). In UML these are two separated classes. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + + + + + + Abstract attribute class for identification. Has the subattributes id and idType. + + + Identifier of the element. Its type is defined in idType. Id is a subproperty of identification. + http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360 + + + + Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the enumeration “IdentifierType”. IdType is a subproperty of identification. + IRI + + + + + Abstract attribute for administration. Has the subattributes revision and version. + + + Revision of the element. Constraint AASd-005: A revision requires a version. This means, if there is no version there is no revision neither. Revision is a subproperty of administration. + + + + + Version of the element. Version is a subproperty of administration. + + + + + + + The content of an AAS Data Specification template for IEC61360. + + Identifies the attribute hierarchy for preferredName in above attribute hierachy. Subordinate attributes are designated by the country code information (see aml-lang literal). + + + + Identifies the attribute for shortName in above attribute hierarchy. + + + + Identifies the attribute for unit in above attribute hierarchy. + + + + Identifies the attribute for unitId in above attribute hierarchy in its string serialization. + + + + Identifies the attribute for sourceOfDefinition in above attribute hierachy. Subordinate attributes are designated by the country code information (see aml-lang literal). + + + + Identifies the attribute for symbol in above attribute hierarchy. + + + + Identifies the attribute for dataType in above attribute hierarchy. + + + + Identifies the attribute for definition in above attribute hierachy. Subordinate attributes are designated by the country code information (see aml-lang literal). + + + + Identifies the attribute for valueFormat in above attribute hierarchy. + + + + Identifies the attribute for valueList in above attribute hierarchy. + + + + The attribute value. + + + + The id for the value. + + + + + + + \ No newline at end of file diff --git a/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/Deserializer.java b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/Deserializer.java index 62a955ba..a79c4ab5 100644 --- a/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/Deserializer.java +++ b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/Deserializer.java @@ -27,18 +27,17 @@ import io.adminshell.aas.v3.model.*; /** - * * Generic deserializer interface to deserialize a given string, Outputstream - * or java.io.File into an instance of AssetAdministrationShellEnvironment + * 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 + * 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 * @@ -50,7 +49,6 @@ public interface Deserializer { AssetAdministrationShellEnvironment read(String value) throws DeserializationException; /** - * * * Deserializes a given InputStream into an instance of * AssetAdministrationShellEnvironment using DEFAULT_CHARSET * @@ -64,7 +62,6 @@ default AssetAdministrationShellEnvironment read(InputStream src) throws Deseria } /** - * * * Deserializes a given InputStream into an instance of * AssetAdministrationShellEnvironment using a given charset * @@ -81,9 +78,7 @@ default AssetAdministrationShellEnvironment read(InputStream src, Charset charse .collect(Collectors.joining(System.lineSeparator()))); } - // Note that the AAS also defines a file class /** - * * * Deserializes a given File into an instance of * AssetAdministrationShellEnvironment using DEFAULT_CHARSET * @@ -100,7 +95,6 @@ default AssetAdministrationShellEnvironment read(java.io.File file, Charset char } /** - * * * Deserializes a given File into an instance of * AssetAdministrationShellEnvironment using a given charset * @@ -115,7 +109,6 @@ default AssetAdministrationShellEnvironment read(java.io.File file) throws FileN } /** - * * * 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 diff --git a/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/DataSpecificationInfo.java b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/DataSpecificationInfo.java index d822f4c2..a8731eb1 100644 --- a/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/DataSpecificationInfo.java +++ b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/DataSpecificationInfo.java @@ -18,6 +18,9 @@ import io.adminshell.aas.v3.model.DataSpecificationContent; import io.adminshell.aas.v3.model.Reference; +/** + * Class representing all information required for a (custom) data specification + */ public class DataSpecificationInfo { private final Class type; diff --git a/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/DataSpecificationManager.java b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/DataSpecificationManager.java index 7e37e9ca..73feb594 100644 --- a/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/DataSpecificationManager.java +++ b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/DataSpecificationManager.java @@ -33,18 +33,20 @@ /** * This class is used to manage supported data specification templates. Each - * template is identified through a reference and provides a corresponding Java - * class. + * 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("http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/2/0"), - "IEC"))); + createGlobalIri(DATA_SPECIFICATION_IEC61360_IRI), + DATA_SPECIFICATION_IEC61360_PREFIX))); /** * Allows to register an additional data specification template diff --git a/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/deserialization/EnumDeserializer.java b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/deserialization/EnumDeserializer.java index 104247d0..ec1ed975 100644 --- a/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/deserialization/EnumDeserializer.java +++ b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/deserialization/EnumDeserializer.java @@ -21,6 +21,7 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.DeserializationContext; import com.fasterxml.jackson.databind.JsonDeserializer; +import io.adminshell.aas.v3.dataformat.core.util.AasUtils; /** * Deserializes enum values converting element names from UpperCamelCase to @@ -30,7 +31,6 @@ */ public class EnumDeserializer extends JsonDeserializer { - protected static final char UNDERSCORE = '_'; protected final Class type; public EnumDeserializer(Class type) { @@ -39,28 +39,7 @@ public EnumDeserializer(Class type) { @Override public T deserialize(JsonParser parser, DeserializationContext context) throws IOException, JsonProcessingException { - return (T) Enum.valueOf(type, translate(parser.getText())); + return (T) Enum.valueOf(type, AasUtils.deserializeEnumName(parser.getText())); } - /** - * 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 translate(String input) { - String result = ""; - if (input == null || input.isEmpty()) { - return result; - } - result += input.charAt(0); - for (int i = 1; i < input.length(); i++) { - char currentChar = input.charAt(i); - if (Character.isUpperCase(currentChar)) { - result += UNDERSCORE; - } - result += Character.toUpperCase(currentChar); - } - return result; - } } diff --git a/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/serialization/EnumSerializer.java b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/serialization/EnumSerializer.java index e9e6004d..cea7e38f 100644 --- a/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/serialization/EnumSerializer.java +++ b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/serialization/EnumSerializer.java @@ -21,6 +21,7 @@ import com.fasterxml.jackson.databind.JsonSerializer; import com.fasterxml.jackson.databind.SerializerProvider; import io.adminshell.aas.v3.dataformat.core.ReflectionHelper; +import io.adminshell.aas.v3.dataformat.core.util.AasUtils; /** * Serializes enum values. If enum is part of the AAS Java model, the name will @@ -34,32 +35,10 @@ public class EnumSerializer extends JsonSerializer { @Override public void serialize(Enum value, JsonGenerator gen, SerializerProvider provider) throws IOException { if (ReflectionHelper.ENUMS.contains(value.getClass())) { - gen.writeString(translate(value.name())); + gen.writeString(AasUtils.serializeEnumName(value.name())); } else { provider.findValueSerializer(Enum.class).serialize(value, gen, provider); } } - /** - * 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 translate(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; - } } diff --git a/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/util/AasUtils.java b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/util/AasUtils.java index 357a1638..ee3c53cb 100644 --- a/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/util/AasUtils.java +++ b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/util/AasUtils.java @@ -18,10 +18,6 @@ import com.google.common.base.Objects; import com.google.common.reflect.TypeToken; import io.adminshell.aas.v3.dataformat.core.ReflectionHelper; -import io.adminshell.aas.v3.dataformat.core.deserialization.EnumDeserializer; -import io.adminshell.aas.v3.dataformat.core.serialization.EnumSerializer; -import io.adminshell.aas.v3.dataformat.core.visitor.IdentifiableCollector; -import io.adminshell.aas.v3.dataformat.mapping.util.TypeUtils; import io.adminshell.aas.v3.model.AssetAdministrationShell; import io.adminshell.aas.v3.model.AssetAdministrationShellEnvironment; import io.adminshell.aas.v3.model.Identifiable; @@ -33,28 +29,41 @@ import io.adminshell.aas.v3.model.Referable; import io.adminshell.aas.v3.model.Reference; import io.adminshell.aas.v3.model.Submodel; -import io.adminshell.aas.v3.model.SubmodelElement; import io.adminshell.aas.v3.model.impl.DefaultKey; import io.adminshell.aas.v3.model.impl.DefaultReference; +import java.beans.IntrospectionException; +import java.beans.Introspector; import java.beans.PropertyDescriptor; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.ArrayList; import java.util.Collection; -import java.util.Iterator; +import java.util.Comparator; +import java.util.HashSet; import java.util.List; import java.util.Optional; import java.util.Set; -import java.util.logging.Level; -import java.util.logging.Logger; import java.util.stream.Collectors; import java.util.stream.Stream; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +/** + * Provides utility functions related to AAS + */ public class AasUtils { + private static final Logger log = LoggerFactory.getLogger(AasUtils.class); + + private static final char UNDERSCORE = '_'; + 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; @@ -64,23 +73,30 @@ public static String asString(Reference reference) { .collect(Collectors.joining(",")); } - public static Optional resolveSubmodelReference(Reference reference, AssetAdministrationShellEnvironment environment) { - return environment.getSubmodels().stream() - .filter(sm -> Objects.equal(sm.getIdentification().getIdentifier(), reference.getKeys().get(0).getValue())) - .findAny(); - } - + /** + * 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, AssetAdministrationShellEnvironment environment) { - // could/should additionally try resolving it return !reference.getKeys().stream().anyMatch(x -> x.getType() == KeyElements.GLOBAL_REFERENCE); } public static List getSubmodelTemplates(AssetAdministrationShell aas, AssetAdministrationShellEnvironment environment) { return aas.getSubmodels().stream() - .map(ref -> resolveSubmodelReference(ref, environment)) - .filter(sm -> sm.isPresent()) - .map(sm -> sm.get()) - .filter(sm -> sm.getKind() == ModelingKind.TEMPLATE) + .map(ref -> resolve(ref, environment, Submodel.class)) + .filter(sm -> sm != null) + .filter(sm -> sm.getKind() != ModelingKind.INSTANCE) .collect(Collectors.toList()); } @@ -88,7 +104,13 @@ public static boolean hasTemplate(AssetAdministrationShell aas, AssetAdministrat return !getSubmodelTemplates(aas, environment).isEmpty(); } - public static Reference identifiableToReference(Identifiable identifiable) { + /** + * Creates a reference for an Identifiable instance + * + * @param identifiable the identifiable to create the reference for + * @return a reference representing the identifiable + */ + public static Reference toReference(Identifiable identifiable) { return new DefaultReference.Builder() .key(new DefaultKey.Builder() .type(referableToKeyType(identifiable)) @@ -98,43 +120,100 @@ public static Reference identifiableToReference(Identifiable identifiable) { .build(); } + /** + * 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 + */ public static KeyElements referableToKeyType(Referable referable) { Class aasInterface = ReflectionHelper.getAasInterface(referable.getClass()); if (aasInterface != null) { - return KeyElements.valueOf(EnumDeserializer.translate(aasInterface.getSimpleName())); + return KeyElements.valueOf(deserializeEnumName(aasInterface.getSimpleName())); } return null; } - public static Optional keyTypeToClass(KeyElements key) { - return Stream.concat(ReflectionHelper.INTERFACES.stream(), ReflectionHelper.INTERFACES_WITHOUT_DEFAULT_IMPLEMENTATION.stream()) - .filter(x -> x.getSimpleName().equals(EnumSerializer.translate(key.name()))) - .findAny(); + /** + * 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; } - public static Reference asReference(Reference parent, Referable element) { -// if (element == null) { -// return null; -// } -// Reference result = AASUtils.cloneReference(parent); -// if (result == null && Identifiable.class.isAssignableFrom(element.getClass())) { -// return AASUtils.identifiableToReference((Identifiable) element); -// } -// if (result != null) { -// result.getKeys().add(new DefaultKey.Builder() -// .type(AASUtils.referableToKeyType(element)) -// .idType(KeyType.ID_SHORT) -// .value(element.getIdShort()) -// .build()); -// } -// 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 += input.charAt(0); + for (int i = 1; i < input.length(); i++) { + char currentChar = input.charAt(i); + if (Character.isUpperCase(currentChar)) { + 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 + */ + public static Class keyTypeToClass(KeyElements key) { + return Stream.concat(ReflectionHelper.INTERFACES.stream(), ReflectionHelper.INTERFACES_WITHOUT_DEFAULT_IMPLEMENTATION.stream()) + .filter(x -> x.getSimpleName().equals(serializeEnumName(key.name()))) + .findAny() + .orElse(null); + } + + /** + * Creates a reference for an element given a potential parent + * + * @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 + * @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) { if (element == null) { return null; } else if (Identifiable.class.isAssignableFrom(element.getClass())) { - return AasUtils.identifiableToReference((Identifiable) element); + return toReference((Identifiable) element); } else { - Reference result = AasUtils.cloneReference(parent); + Reference result = clone(parent); if (result != null) { result.getKeys().add(new DefaultKey.Builder() .type(AasUtils.referableToKeyType(element)) @@ -146,6 +225,14 @@ public static Reference asReference(Reference parent, Referable element) { } } + /** + * Checks if two references are refering to the same element + * + * @param ref1 reference 1 + * @param ref2 reference 2 + * @return returns true if both references are refering to the same element, + * otherwise false + */ public static boolean sameAs(Reference ref1, Reference ref2) { boolean ref1Empty = ref1 == null || ref1.getKeys() == null || ref1.getKeys().isEmpty(); boolean ref2Empty = ref2 == null || ref2.getKeys() == null || ref2.getKeys().isEmpty(); @@ -159,14 +246,14 @@ public static boolean sameAs(Reference ref1, Reference ref2) { for (int i = 0; i < keyLength; i++) { Key ref1Key = ref1.getKeys().get(ref1.getKeys().size() - (i + 1)); Key ref2Key = ref2.getKeys().get(ref2.getKeys().size() - (i + 1)); - Optional ref1Type = keyTypeToClass(ref1Key.getType()); - Optional ref2Type = keyTypeToClass(ref2Key.getType()); - if (ref1Type.isPresent() != ref2Type.isPresent()) { + Class ref1Type = keyTypeToClass(ref1Key.getType()); + Class ref2Type = keyTypeToClass(ref2Key.getType()); + if (ref1Type != ref2Type) { return false; } - if (ref1Type.isPresent()) { - if (!(ref1Type.get().isAssignableFrom(ref2Type.get()) - || ref2Type.get().isAssignableFrom(ref1Type.get()))) { + if (ref1Type != null) { + if (!(ref1Type.isAssignableFrom(ref2Type) + || ref2Type.isAssignableFrom(ref1Type))) { return false; } } @@ -183,7 +270,13 @@ public static boolean sameAs(Reference ref1, Reference ref2) { return true; } - public static Reference cloneReference(Reference reference) { + /** + * Creates a deep-copy clone of a reference + * + * @param reference the reference to clone + * @return the cloned reference + */ + public static Reference clone(Reference reference) { if (reference == null || reference.getKeys() == null || reference.getKeys().isEmpty()) { return null; } @@ -197,19 +290,58 @@ public static Reference cloneReference(Reference reference) { .build(); } + /** + * 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 + * @throws IllegalArgumentException if something goes wrong while resolving + */ public static Referable resolve(Reference reference, AssetAdministrationShellEnvironment env) { + return resolve(reference, env, Referable.class); + } + + /** + * 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 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 + * @throws IllegalArgumentException if something goes wrong while resolving + */ + public static T resolve(Reference reference, AssetAdministrationShellEnvironment env, Class type) { if (reference == null || reference.getKeys() == null || reference.getKeys().isEmpty()) { return null; } Set identifiables = new IdentifiableCollector(env).collect(); Object current = null; int i = reference.getKeys().size() - 1; + if (type != null) { + Class actualType = keyTypeToClass(reference.getKeys().get(i).getType()); + if (!type.isAssignableFrom(actualType)) { + log.warn("reference {} could not be resolved as target type is not assignable from actual type (target: {}, actual: {})", + asString(reference), type.getName(), actualType.getName()); + return null; + } + } for (; i >= 0; i--) { Key key = reference.getKeys().get(i); - Optional referencedType = keyTypeToClass(key.getType()); - if (referencedType.isPresent()) { + Class referencedType = keyTypeToClass(key.getType()); + if (referencedType != null) { List matchingIdentifiables = identifiables.stream() - .filter(x -> referencedType.get().isAssignableFrom(x.getClass())) + .filter(x -> referencedType.isAssignableFrom(x.getClass())) .filter(x -> key.getIdType().name().equals(x.getIdentification().getIdType().name())) .filter(x -> x.getIdentification().getIdentifier().equals(key.getValue())) .collect(Collectors.toList()); @@ -227,14 +359,13 @@ public static Referable resolve(Reference reference, AssetAdministrationShellEnv } i++; if (i == reference.getKeys().size()) { - return (Referable) current; + return (T) current; } - // follow idShort path until target for (; i < reference.getKeys().size(); i++) { Key key = reference.getKeys().get(i); - Optional keyType = keyTypeToClass(key.getType()); - if (keyType.isPresent()) { + Class keyType = keyTypeToClass(key.getType()); + if (keyType != null) { Collection collection; // operation needs special handling because of nested values if (Operation.class.isAssignableFrom(current.getClass())) { @@ -246,15 +377,15 @@ public static Referable resolve(Reference reference, AssetAdministrationShellEnv .flatMap(x -> x.map(y -> y.getValue())) .collect(Collectors.toSet()); } else { - List matchingProperties = TypeUtils.getAASProperties(current.getClass()).stream() + 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.get())) + .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.get().getSimpleName(), + keyType.getSimpleName(), current.getClass().getSimpleName())); } if (matchingProperties.size() > 1) { @@ -268,7 +399,7 @@ public static Referable resolve(Reference reference, AssetAdministrationShellEnv try { collection = (Collection) matchingProperties.get(0).getReadMethod().invoke(current); } catch (Exception ex) { - throw new RuntimeException("error resolving reference", ex); + throw new IllegalArgumentException("error resolving reference", ex); } Optional next = collection.stream() .filter(x -> ((Referable) x).getIdShort().equals(key.getValue())) @@ -280,117 +411,36 @@ public static Referable resolve(Reference reference, AssetAdministrationShellEnv } } } - return (Referable) current; - -// -// -// -// -// -// -// -// -// List keys = reference.getKeys(); -// -// //get reduced Key list from last identifiable key to end -// List reducedKeyList = new ArrayList<>(); -// reduceKeyList(keys, reducedKeyList); -// -// //resolve the reference -// Referable searchedReferable = null; -// for (int i = 0; i < reducedKeyList.size(); i++) { -// -// Key actualKey = reducedKeyList.get(i); -// String className = EnumSerializer.translate(actualKey.getType().name()); -// try { -// -// //get class from the key type and calculate the method name for getting a list of the elements -// //e.g. "getSubmodelElements" -// Class c = Class.forName(ReflectionHelper.MODEL_PACKAGE_NAME + "." + className); -// -// TypeUtils.getAASProperties(value.getClass()) -// //TODO: visitor pattern? e.g. for Operation Variables -// String methodName = "get" + className + "s"; -// -// Method method = null; -// -// if (i == 0) { -// //first Key is identifiable -// -// //get list of elements due to the key type -// method = env.getClass().getMethod(methodName); -// List list = (List) method.invoke(env); -// searchedReferable = getIdentifiable(actualKey, c, list); -// -// } else { -// -// //if searchedReferable is null then the first identifiable could not be found -// if (searchedReferable == null) { -// return null; -// } -// -// //get list of elements due to the key type -// method = searchedReferable.getClass().getMethod(methodName); -// List list = (List) method.invoke(searchedReferable); -// searchedReferable = getReferable(actualKey, list); -// } -// -// } catch (ClassNotFoundException | NoSuchMethodException e) { -// e.printStackTrace(); -// return null; -// } catch (InvocationTargetException | IllegalAccessException e) { -// e.printStackTrace(); -// } -// } -// -// return searchedReferable; - } - - private static void reduceKeyList(List keys, List reducedKeyList) { - for (int i = keys.size() - 1; i >= 0; i--) { - Key k = keys.get(i); - reducedKeyList.add(0, k); - String className = EnumSerializer.translate(k.getType().name()); - Class c = null; - try { - c = Class.forName(ReflectionHelper.MODEL_PACKAGE_NAME + "." + className); - } catch (ClassNotFoundException e) { - e.printStackTrace(); - } - if (Identifiable.class.isAssignableFrom(c)) { - break; - } - } + return (T) current; } - private static Referable getReferable(Key actualKey, List list) { - Referable searchedReferable = null; - for (Object e : list) { - Referable element = (Referable) e; - if (actualKey.getIdType() == KeyType.ID_SHORT) { - if (element.getIdShort().equals(actualKey.getValue())) { - searchedReferable = element; - } - } + /** + * 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. + */ + public static List getAasProperties(Class type) { + Class aasType = ReflectionHelper.getAasInterface(type); + Set> types = new HashSet<>(); + if (aasType != null) { + types.add(aasType); + types.addAll(ReflectionHelper.getSuperTypes(aasType, true)); } - return searchedReferable; - } - - private static Identifiable getIdentifiable(Key lastKey, Class c, List list) { - if (Identifiable.class.isAssignableFrom(c)) { - for (Object e : list) { - Identifiable element = (Identifiable) e; - if (lastKey.getIdType() == KeyType.ID_SHORT) { - if (element.getIdShort().equals(lastKey.getValue())) { - return element; - } - } else if (lastKey.getIdType() == KeyType.IRI || lastKey.getIdType() == KeyType.IRDI || lastKey.getIdType() == KeyType.CUSTOM) { - if (element.getIdentification().getIdentifier().equals(lastKey.getValue())) { - return element; + return types.stream() + .flatMap(x -> { + try { + return Stream.of(Introspector.getBeanInfo(x).getPropertyDescriptors()); + } catch (IntrospectionException ex) { + log.warn("error finding properties of class '{}'", type, ex); } - } - } - } - return null; + return Stream.empty(); + }) + .sorted(Comparator.comparing(x -> x.getName())) + .collect(Collectors.toList()); } } diff --git a/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/util/FooBar.java b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/util/FooBar.java new file mode 100644 index 00000000..e82f19d9 --- /dev/null +++ b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/util/FooBar.java @@ -0,0 +1,24 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.core.util; + +/** + * + * @author jab + */ +public class FooBar { + +} diff --git a/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/visitor/IdentifiableCollector.java b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/util/IdentifiableCollector.java similarity index 87% rename from dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/visitor/IdentifiableCollector.java rename to dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/util/IdentifiableCollector.java index 62f2babd..c66b680e 100644 --- a/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/visitor/IdentifiableCollector.java +++ b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/util/IdentifiableCollector.java @@ -13,8 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.adminshell.aas.v3.dataformat.core.visitor; +package io.adminshell.aas.v3.dataformat.core.util; +import io.adminshell.aas.v3.dataformat.core.visitor.AssetAdministrationShellElementWalkerVisitor; import io.adminshell.aas.v3.model.Asset; import io.adminshell.aas.v3.model.AssetAdministrationShell; import io.adminshell.aas.v3.model.AssetAdministrationShellEnvironment; @@ -24,6 +25,10 @@ import java.util.HashSet; import java.util.Set; +/** + * Collects all Identifiable elements within an + * AssetAdministrationShellEnvironment + */ public class IdentifiableCollector { private AssetAdministrationShellEnvironment env; diff --git a/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/util/MostSpecificTypeTokenComparator.java b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/util/MostSpecificTypeTokenComparator.java new file mode 100644 index 00000000..6257c6e3 --- /dev/null +++ b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/util/MostSpecificTypeTokenComparator.java @@ -0,0 +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 io.adminshell.aas.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/io/adminshell/aas/v3/dataformat/core/visitor/AbstractReferableVisitor.java b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/visitor/AbstractReferableVisitor.java deleted file mode 100644 index 6e669cbf..00000000 --- a/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/visitor/AbstractReferableVisitor.java +++ /dev/null @@ -1,70 +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 io.adminshell.aas.v3.dataformat.core.visitor; - -import io.adminshell.aas.v3.model.Property; -import io.adminshell.aas.v3.model.Submodel; -import io.adminshell.aas.v3.model.SubmodelElement; -import io.adminshell.aas.v3.model.SubmodelElementCollection; -import java.lang.reflect.Method; - -public abstract class AbstractReferableVisitor { - - private static final String METHOD_NAME = "visit"; - - public void visit(Object o) { - Method visitMethod = getMethod(o.getClass()); - if (visitMethod == null) { - defaultVisit(o); - } else { - try { - visitMethod.invoke(this, new Object[]{o}); - } catch (Exception ex) { - throw new RuntimeException(ex); - } - } - } - - public abstract void visit(Submodel submodel); - - public abstract void visit(SubmodelElement submodelElement); - - public abstract void visit(SubmodelElementCollection submodelElementCollection); - - public abstract void visit(Property property); - - public void defaultVisit(Object o) { - - } - - protected Method getMethod(Class source) { - Class clazz = source; - while (!clazz.equals(Object.class)) { - try { - return getClass().getMethod(METHOD_NAME, clazz); - } catch (NoSuchMethodException ex) { - clazz = clazz.getSuperclass(); - } - } - for (Class clsInterface : source.getInterfaces()) { - try { - return getClass().getMethod(METHOD_NAME, clsInterface); - } catch (NoSuchMethodException ex) { - } - } - return null; - } -} diff --git a/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/visitor/AbstractVisitor.java b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/visitor/AbstractVisitor.java deleted file mode 100644 index 38b192c5..00000000 --- a/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/visitor/AbstractVisitor.java +++ /dev/null @@ -1,58 +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 io.adminshell.aas.v3.dataformat.core.visitor; - -import java.lang.reflect.Method; - -public abstract class AbstractVisitor { - - private static final String METHOD_NAME = "visit"; - - public void visit(Object o) { - Method visitMethod = getMethod(o.getClass()); - if (visitMethod == null) { - defaultVisit(o); - } else { - try { - visitMethod.invoke(this, new Object[]{o}); - } catch (Exception ex) { - throw new RuntimeException(ex); - } - } - } - - public void defaultVisit(Object o) { - - } - - protected Method getMethod(Class source) { - Class clazz = source; - while (!clazz.equals(Object.class)) { - try { - return getClass().getMethod(METHOD_NAME, clazz); - } catch (NoSuchMethodException ex) { - clazz = clazz.getSuperclass(); - } - } - for (Class clsInterface : source.getInterfaces()) { - try { - return getClass().getMethod(METHOD_NAME, clsInterface); - } catch (NoSuchMethodException ex) { - } - } - return null; - } -} diff --git a/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/Mapper.java b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/Mapper.java index 140b5f8d..1cf80c00 100644 --- a/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/Mapper.java +++ b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/Mapper.java @@ -15,6 +15,12 @@ */ package io.adminshell.aas.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/io/adminshell/aas/v3/dataformat/mapping/MappingContext.java b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/MappingContext.java index 66053bae..259b76b3 100644 --- a/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/MappingContext.java +++ b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/MappingContext.java @@ -18,6 +18,12 @@ 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); diff --git a/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/MappingException.java b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/MappingException.java index 1b4c0f4a..507b7295 100644 --- a/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/MappingException.java +++ b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/MappingException.java @@ -15,6 +15,9 @@ */ package io.adminshell.aas.v3.dataformat.mapping; +/** + * Exception throw upon any error on mapping + */ public class MappingException extends Exception { public MappingException(String msg) { diff --git a/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/MappingProvider.java b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/MappingProvider.java index 43c2c7bc..d96ac465 100644 --- a/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/MappingProvider.java +++ b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/MappingProvider.java @@ -16,7 +16,7 @@ package io.adminshell.aas.v3.dataformat.mapping; import com.google.common.reflect.TypeToken; -import io.adminshell.aas.v3.dataformat.mapping.util.TypeUtils; +import io.adminshell.aas.v3.dataformat.core.util.MostSpecificTypeTokenComparator; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.Collection; @@ -28,6 +28,12 @@ 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); @@ -75,6 +81,13 @@ private TypeToken getMappedType(Class type) { .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); @@ -85,10 +98,16 @@ public T getMapper(Object 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 TypeUtils.TypeTokenComparator())) + .sorted((x, y) -> Objects.compare(x.getKey(), y.getKey(), new MostSpecificTypeTokenComparator())) .map(x -> x.getValue()) .findFirst(); if (!customMapper.isPresent() || customMapper.get().isEmpty()) { diff --git a/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/SourceBasedMapper.java b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/SourceBasedMapper.java index 29bc9ed2..c206e8b0 100644 --- a/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/SourceBasedMapper.java +++ b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/SourceBasedMapper.java @@ -15,7 +15,22 @@ */ package io.adminshell.aas.v3.dataformat.mapping; +/** + * A mapper that when mapping from A -> 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/io/adminshell/aas/v3/dataformat/mapping/TargetBasedMapper.java b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/TargetBasedMapper.java index 7b57d3fc..f10b5ddf 100644 --- a/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/TargetBasedMapper.java +++ b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/TargetBasedMapper.java @@ -15,7 +15,23 @@ */ package io.adminshell.aas.v3.dataformat.mapping; +/** + * A mapper that when mapping from A -> 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/main/java/io/adminshell/aas/v3/dataformat/mapping/util/TypeUtils.java b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/util/TypeUtils.java deleted file mode 100644 index d6f352da..00000000 --- a/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/util/TypeUtils.java +++ /dev/null @@ -1,71 +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 io.adminshell.aas.v3.dataformat.mapping.util; - -import com.google.common.reflect.TypeToken; -import io.adminshell.aas.v3.dataformat.core.ReflectionHelper; -import java.beans.IntrospectionException; -import java.beans.Introspector; -import java.beans.PropertyDescriptor; -import java.util.Comparator; -import java.util.HashSet; -import java.util.List; -import java.util.Set; -import java.util.stream.Collectors; -import java.util.stream.Stream; -import org.slf4j.LoggerFactory; - -public class TypeUtils { - - private static final org.slf4j.Logger log = LoggerFactory.getLogger(TypeUtils.class); - - private TypeUtils() { - } - - public static List getAASProperties(Class type) { - Class aasType = ReflectionHelper.getAasInterface(type); - Set> types = new HashSet<>(); - if (aasType != null) { - types.add(aasType); - types.addAll(ReflectionHelper.getSuperTypes(aasType, true)); - } - return types.stream() - .flatMap(x -> { - try { - return Stream.of(Introspector.getBeanInfo(x).getPropertyDescriptors()); - } catch (IntrospectionException ex) { - log.warn("error finding properties of class '{}'", type, ex); - } - return Stream.empty(); - }) - .sorted(Comparator.comparing(x -> x.getName())) - .collect(Collectors.toList()); - } - - public static class TypeTokenComparator 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-xml/src/main/java/io/adminshell/aas/v3/dataformat/xml/serialization/NamespaceIndependentReferenceSerializer.java b/dataformat-xml/src/main/java/io/adminshell/aas/v3/dataformat/xml/serialization/NamespaceIndependentReferenceSerializer.java index 66983254..7be246d1 100644 --- a/dataformat-xml/src/main/java/io/adminshell/aas/v3/dataformat/xml/serialization/NamespaceIndependentReferenceSerializer.java +++ b/dataformat-xml/src/main/java/io/adminshell/aas/v3/dataformat/xml/serialization/NamespaceIndependentReferenceSerializer.java @@ -24,6 +24,7 @@ import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator; import io.adminshell.aas.v3.dataformat.core.serialization.EnumSerializer; +import io.adminshell.aas.v3.dataformat.core.util.AasUtils; import io.adminshell.aas.v3.model.Key; import io.adminshell.aas.v3.model.Reference; @@ -38,9 +39,9 @@ public void serialize(Reference value, JsonGenerator gen, SerializerProvider ser for (Key key : value.getKeys()) { xgen.writeObjectFieldStart("key"); try { - String idTypeValue = EnumSerializer.translate(key.getIdType().toString()); + String idTypeValue = AasUtils.serializeEnumName(key.getIdType().toString()); xgen.getStaxWriter().writeAttribute("idType", idTypeValue); - String keyTypeValue = EnumSerializer.translate(key.getType().toString()); + String keyTypeValue = AasUtils.serializeEnumName(key.getType().toString()); xgen.getStaxWriter().writeAttribute("type", keyTypeValue); } catch (XMLStreamException e) { e.printStackTrace(); diff --git a/pom.xml b/pom.xml index 136b52a7..a5f3926f 100644 --- a/pom.xml +++ b/pom.xml @@ -16,7 +16,7 @@ - 1.0.0 + 1.0.3 1.8 1.8 UTF-8 From 4b6fbbacaa4620b83c7c6450ce9e0a3036f189b7 Mon Sep 17 00:00:00 2001 From: Jacoby Date: Fri, 13 Aug 2021 12:52:03 +0200 Subject: [PATCH 15/18] -refactoring - added unit test to AML serializer --- .../aml/AmlDeserializationConfig.java | 2 + .../aml/deserialization/Aml2AasMapper.java | 4 +- .../aml/deserialization/AmlParser.java | 2 +- .../aml/deserialization/Mapper.java | 2 + .../aml/serialization/AasToAmlMapper.java | 4 +- .../aml/serialization/AmlGenerator.java | 200 +- .../aml/serialization/DefaultMapper.java | 4 + .../AssetAdministrationShellMapper.java | 10 +- .../aml/serialization/mappers/FileMapper.java | 1 + .../mappers/ReferenceElementMapper.java | 6 +- .../mappers/RelationshipElementMapper.java | 4 +- .../serialization/mappers/SubmodelMapper.java | 3 +- .../aml/serialization/mappers/ViewMapper.java | 9 +- .../naming/NumberingClassNamingStrategy.java | 13 +- .../resources/AssetAdministrationShellLib.aml | 4 +- .../dataformat/aml/fixtures/FullExample.java | 92 +- .../dataformat/aml/fixtures/TestExample.java | 571 -- .../aml/serialize/AmlDeserializerTest.java | 7 +- .../aml/serialize/AmlSerializerTest.java | 181 +- .../test/resources/amlfile/example-motor.xml | 2890 ------ .../test/resources/amlfile/example_test.aml | 2608 ----- .../test/resources/amlfile/full-example.xml | 8921 ----------------- .../test/resources/test_demo_full_example.aml | 7414 +++++++------- .../v3/dataformat/core/ReflectionHelper.java | 10 +- .../aas/v3/dataformat/core/util/AasUtils.java | 7 +- .../aas/v3/dataformat/core/util/FooBar.java | 24 - .../dataformat/mapping/SourceBasedMapper.java | 3 +- 27 files changed, 3953 insertions(+), 19043 deletions(-) delete mode 100644 dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/fixtures/TestExample.java delete mode 100644 dataformat-aml/src/test/resources/amlfile/example-motor.xml delete mode 100644 dataformat-aml/src/test/resources/amlfile/example_test.aml delete mode 100644 dataformat-aml/src/test/resources/amlfile/full-example.xml delete mode 100644 dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/util/FooBar.java diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlDeserializationConfig.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlDeserializationConfig.java index be07bad7..a9d4ba0e 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlDeserializationConfig.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/AmlDeserializationConfig.java @@ -18,6 +18,7 @@ import io.adminshell.aas.v3.dataformat.aml.deserialization.AasTypeFactory; public class AmlDeserializationConfig { + public static Builder builder() { return new Builder(); } @@ -27,6 +28,7 @@ public static Builder builder() { private AmlDeserializationConfig(AasTypeFactory typeFactory) { this.typeFactory = typeFactory; } + public AasTypeFactory getTypeFactory() { return typeFactory; } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/deserialization/Aml2AasMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/deserialization/Aml2AasMapper.java index 46c3921c..ec730609 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/deserialization/Aml2AasMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/deserialization/Aml2AasMapper.java @@ -36,7 +36,9 @@ public Aml2AasMapper(AmlDeserializationConfig config) { } /** - * Maps an AML file (represented by a CAEXFile) to an AssetAdministrationShellEnvironment + * Maps an AML file (represented by a CAEXFile) to an + * AssetAdministrationShellEnvironment + * * @param aml the AML source file to map * @return AssetAdministrationShellEnvironment representation * @throws MappingException if the mapping fails diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/deserialization/AmlParser.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/deserialization/AmlParser.java index 7977d046..709d34b6 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/deserialization/AmlParser.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/deserialization/AmlParser.java @@ -53,7 +53,7 @@ public CAEXObject getCurrent() { } /** - * Sets the CAEXObject that currently is being processed. + * Sets the CAEXObject that currently is being processed. * * @param current the object currently being processed */ diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/deserialization/Mapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/deserialization/Mapper.java index 4f026246..3b8f964f 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/deserialization/Mapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/deserialization/Mapper.java @@ -16,8 +16,10 @@ package io.adminshell.aas.v3.dataformat.aml.deserialization; import io.adminshell.aas.v3.dataformat.mapping.TargetBasedMapper; + /** * Utility interface for all AML to AAS mappers + * * @param type to be deserialized */ public interface Mapper extends TargetBasedMapper { diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/AasToAmlMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/AasToAmlMapper.java index dcc5982c..c10052d9 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/AasToAmlMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/AasToAmlMapper.java @@ -56,7 +56,9 @@ public class AasToAmlMapper { private static final org.slf4j.Logger log = LoggerFactory.getLogger(AasToAmlMapper.class); /** - * Maps an AssetAdministrationShellEnvironment to an AML file (represented by a CAEXFile) + * Maps an AssetAdministrationShellEnvironment to an AML file (represented + * by a CAEXFile) + * * @param env the AssetAdministrationShellEnvironment to map * @param config the serialization conig * @return an AML representation of the AssetAdministrationShellEnvironment diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/AmlGenerator.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/AmlGenerator.java index 0b8b7429..97d28d51 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/AmlGenerator.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/AmlGenerator.java @@ -36,11 +36,20 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +/** + * Immutable class supporting creation of AML file by encalsulating different + * common tasks and functionality, e.g. id generation and caching. To create new + * instances with modified properties use provided with...(...) functions. + */ public class AmlGenerator { private static final Logger log = LoggerFactory.getLogger(AmlGenerator.class); public static final String REFERABLE_REFERENCE_INTERFACE_CLASS = "ReferableReference"; private static final String DEFAULT_REF_SEMANTIC_PREFIX = "AAS"; + + public static Builder builder() { + return new Builder(); + } private final String refSemanticPrefix; private final CAEXObject.Builder current; private final AmlDocumentInfo documentInfo; @@ -66,6 +75,12 @@ private AmlGenerator( this.reference = reference; } + /** + * Creates a new instance with new current CAEXObject.Builder + * + * @param current new current CAEXObject.Builder + * @return new immutable instance with CAEXObject.Builder + */ public AmlGenerator with(CAEXObject.Builder current) { return new AmlGenerator(documentInfo, idGenerator, @@ -76,6 +91,12 @@ public AmlGenerator with(CAEXObject.Builder current) { reference); } + /** + * Creates a new instance with reference to new parent object in AAS + * + * @param parent reference to new parent element + * @return new immutable instance with new parent + */ public AmlGenerator with(Referable parent) { return new AmlGenerator( documentInfo, @@ -87,6 +108,12 @@ public AmlGenerator with(Referable parent) { AasUtils.toReference(reference, parent)); } + /** + * Creates a new instance with given prefix for refSemantic tags + * + * @param value new prefix for refSemantic tags + * @return new immutable instance given refSemantic prefix + */ public AmlGenerator withRefSemanticPrefix(String value) { return new AmlGenerator( documentInfo, @@ -98,62 +125,36 @@ public AmlGenerator withRefSemanticPrefix(String value) { reference); } + /** + * Adds additional information to the AML file + * + * @param additionalInformation additional information to add + */ public void addAdditionalInformation(List additionalInformation) { fileBuilder.addAdditionalInformation(additionalInformation); } - public static Builder builder() { - return new Builder(); - } - - public static class Builder { - - private String refSemanticPrefix = DEFAULT_REF_SEMANTIC_PREFIX; - private CAEXObject.Builder current; - private CAEXFile.Builder fileBuilder = CAEXFile.builder(); - private AmlDocumentInfo documentInfo = new AmlDocumentInfo(); - private IdGenerator idGenerator = new UuidGenerator(); - - public AmlGenerator build() { - return new AmlGenerator(documentInfo, - idGenerator, - new HashMap<>(), - refSemanticPrefix, - fileBuilder, - current, - new DefaultReference.Builder().build()); - } - - public Builder refSemanticPrefix(String value) { - this.refSemanticPrefix = value; - return this; - } - - public Builder current(CAEXObject.Builder value) { - this.current = value; - return this; - } - - public Builder idGenerator(IdGenerator value) { - this.idGenerator = value; - return this; - } - - public Builder file(CAEXFile.Builder value) { - this.fileBuilder = value; - return this; - } - - public Builder documentInfo(AmlDocumentInfo value) { - this.documentInfo = value; - return this; - } - } - + /** + * Generates a new ID without caching it. + * + * @return a new ID + */ public String newId() { return idGenerator.next(); } + /** + * Gets the ID for given object. If obj is an instance of Referable it is + * first converted to reference pointing to that element. In that case, or + * if the obj is already an instance of Reference, an already existing ID + * will be returned if available, otherwise a new one is created and cached. + * If obj is neither an instance of Reference nor Referable, a new ID is + * generated and not cached. + * + * @param obj object to generate an ID for + * @return an ID that might or might not be cached (depending of type of + * obj) + */ public String getId(Object obj) { if (obj == null) { return idGenerator.next(); @@ -177,6 +178,11 @@ public String getId(Object obj) { return result; } + /** + * Adds an object to the current element of the AML document + * + * @param caexObject the object to add + */ public void add(CAEXObject caexObject) { if (caexObject == null) { return; @@ -190,6 +196,11 @@ public void add(CAEXObject caexObject) { } } + /** + * Adds an attribute to the current element of the AML document + * + * @param attribute the attribute to add + */ public void addAttribute(AttributeType attribute) { if (attribute == null) { return; @@ -221,7 +232,11 @@ private void addExternalInterface(RoleClassType.ExternalInterface externalInterf } } - public void addExternalInterfaceForReference(MappingContext context) { + /** + * Adds an external interface with name and roleCall ReferableReference to + * the current element of the AML document + */ + public void addExternalInterfaceForReference() { addExternalInterface(RoleClassType.ExternalInterface.builder() .withID(newId()) .withName(REFERABLE_REFERENCE_INTERFACE_CLASS) @@ -229,6 +244,14 @@ public void addExternalInterfaceForReference(MappingContext context) { .build(), false); } + /** + * Adds an internal link with given namen pointing from source to target to + * the current element of the AML document + * + * @param name name if the link + * @param source source element of the link + * @param target reference pointing to the target element + */ public void addInternalLink(String name, Referable source, Reference target) { if (InternalElementType.Builder.class.isAssignableFrom(current.getClass())) { InternalElementType.Builder builder = (InternalElementType.Builder) current; @@ -243,7 +266,15 @@ public void addInternalLink(String name, Referable source, Reference target) { } } - public void addExternalInterfaceForUnresolvableReference(String name, Reference reference, MappingContext context) { + /** + * Adds an external interface of type ReferableReference with given name + * with unresolvabled reference as value to the current element of the AML + * document + * + * @param name name of the interface + * @param reference unresolvable target reference + */ + public void addExternalInterfaceForUnresolvableReference(String name, Reference reference) { addExternalInterface(RoleClassType.ExternalInterface.builder() .withID(idGenerator.next()) .withName(name) @@ -258,6 +289,12 @@ public void addExternalInterfaceForUnresolvableReference(String name, Reference false); } + /** + * Clears the ID cache. This should be used with caution as it may cause + * reference resolution mechanism to fail. Typically it will only be called + * after processing the InstanceHierarchy elements and before creating + * custom SystemUnitClasses + */ public void clearIdCache() { idCache.clear(); } @@ -344,23 +381,66 @@ public AttributeType.RefSemantic refSemantic(Class type, String propertyName) .build(); } + /** + * Creates a refSemantic object for a given property + * + * @param property the property + * @return the generated refSemantic object + */ public AttributeType.RefSemantic refSemantic(PropertyDescriptor property) { return refSemantic(property.getReadMethod().getDeclaringClass(), property.getName()); } - public String refBaseSystemUnitPath(Object value, MappingContext context) { - return documentInfo.getAssetAdministrationShellSystemUnitClassLib() - + "/" + context.getInternalElementNamingStrategy().getName( - value.getClass(), - value, - null); - } - + /** + * Gets to AML document info + * + * @return the AML document info + */ public AmlDocumentInfo getDocumentInfo() { return documentInfo; } - public Reference getReference() { - return reference; + public static class Builder { + + private String refSemanticPrefix = DEFAULT_REF_SEMANTIC_PREFIX; + private CAEXObject.Builder current; + private CAEXFile.Builder fileBuilder = CAEXFile.builder(); + private AmlDocumentInfo documentInfo = new AmlDocumentInfo(); + private IdGenerator idGenerator = new UuidGenerator(); + + public AmlGenerator build() { + return new AmlGenerator(documentInfo, + idGenerator, + new HashMap<>(), + refSemanticPrefix, + fileBuilder, + current, + new DefaultReference.Builder().build()); + } + + public Builder refSemanticPrefix(String value) { + this.refSemanticPrefix = value; + return this; + } + + public Builder current(CAEXObject.Builder value) { + this.current = value; + return this; + } + + public Builder idGenerator(IdGenerator value) { + this.idGenerator = value; + return this; + } + + public Builder file(CAEXFile.Builder value) { + this.fileBuilder = value; + return this; + } + + public Builder documentInfo(AmlDocumentInfo value) { + this.documentInfo = value; + return this; + } } } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/DefaultMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/DefaultMapper.java index c9446c57..31e6e3bf 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/DefaultMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/DefaultMapper.java @@ -20,12 +20,15 @@ import io.adminshell.aas.v3.dataformat.core.ReflectionHelper; import io.adminshell.aas.v3.dataformat.core.util.AasUtils; import io.adminshell.aas.v3.dataformat.mapping.MappingException; +import io.adminshell.aas.v3.model.MultiLanguageProperty; import io.adminshell.aas.v3.model.Referable; import java.beans.PropertyDescriptor; import java.lang.reflect.InvocationTargetException; import java.util.Arrays; import java.util.HashSet; +import java.util.List; import java.util.Set; +import java.util.stream.Collectors; public class DefaultMapper implements Mapper { @@ -137,6 +140,7 @@ protected boolean skipProperty(PropertyDescriptor property) { } protected void mapProperties(T value, AmlGenerator generator, MappingContext context) throws MappingException { + List collect = AasUtils.getAasProperties(value.getClass()).stream().map(x -> x.getName()).collect(Collectors.toList()); for (PropertyDescriptor property : AasUtils.getAasProperties(value.getClass())) { if (!skipProperty(property)) { context.with(property) diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/AssetAdministrationShellMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/AssetAdministrationShellMapper.java index 3aefa759..a824feee 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/AssetAdministrationShellMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/AssetAdministrationShellMapper.java @@ -22,10 +22,10 @@ import io.adminshell.aas.v3.dataformat.core.util.AasUtils; import io.adminshell.aas.v3.dataformat.mapping.MappingException; import io.adminshell.aas.v3.model.AssetAdministrationShell; +import io.adminshell.aas.v3.model.ModelingKind; import io.adminshell.aas.v3.model.Reference; import io.adminshell.aas.v3.model.Submodel; import java.beans.PropertyDescriptor; -import java.util.Optional; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -44,10 +44,14 @@ public void map(AssetAdministrationShell aas, AmlGenerator generator, MappingCon return; } InternalElementType.Builder builder = toInternalElement(aas, generator, context); + boolean hasTemplateSubmodel = false; for (Reference reference : aas.getSubmodels()) { Submodel resolvedSubmodel = AasUtils.resolve(reference, context.getEnvironment(), Submodel.class); if (resolvedSubmodel != null) { context.map(resolvedSubmodel, generator.with(builder)); + if (resolvedSubmodel.getKind() == ModelingKind.TEMPLATE) { + hasTemplateSubmodel = true; + } } else { log.warn("unresolvable submodel reference '{}' found in AssetAdministrationShell '{}'", AasUtils.asString(reference), @@ -55,6 +59,10 @@ public void map(AssetAdministrationShell aas, AmlGenerator generator, MappingCon context.map(AasUtils.asString(reference), generator); } } + if (hasTemplateSubmodel) { + builder = builder.withRefBaseSystemUnitPath(generator.getDocumentInfo().getAssetAdministrationShellSystemUnitClassLib() + + "/" + context.getInternalElementNamingStrategy().getName(aas.getClass(), aas, null)); + } generator.with(builder).appendReferenceTargetInterfaceIfRequired(aas, context); generator.add(builder.build()); } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/FileMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/FileMapper.java index d8b959d3..afa6bded 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/FileMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/FileMapper.java @@ -40,6 +40,7 @@ protected InternalElementType.Builder toInternalElement(File value, AmlGenerator InternalElementType.Builder builder = super.toInternalElement(value, generator, context); if (builder != null) { builder.withExternalInterface(RoleClassType.ExternalInterface.builder() + .withID(generator.newId()) .withName(FILE_INTERFACE_NAME) .withRefBaseClassPath(generator.getDocumentInfo().getAssetAdministrationShellInterfaceClassLib() + "/" + FILE_INTERFACE_NAME) .addAttribute(AttributeType.builder() diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/ReferenceElementMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/ReferenceElementMapper.java index d2ca99d5..c9db554e 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/ReferenceElementMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/ReferenceElementMapper.java @@ -49,10 +49,12 @@ public void map(ReferenceElement element, AmlGenerator generator, MappingContext mapProperties(element, subGenerator, context); Referable resolvedReference = AasUtils.resolve(element.getValue(), context.getEnvironment()); if (resolvedReference != null) { - subGenerator.addExternalInterfaceForReference(context); + subGenerator.addExternalInterfaceForReference(); subGenerator.addInternalLink(PROPERTY_VALUE_NAME, element, element.getValue()); } else { - subGenerator.addExternalInterfaceForUnresolvableReference(PROPERTY_VALUE_NAME, element.getValue(), context); + if (element.getValue() != null) { + subGenerator.addExternalInterfaceForUnresolvableReference(PROPERTY_VALUE_NAME, element.getValue()); + } } subGenerator.appendReferenceTargetInterfaceIfRequired(element, context); generator.addInternalElement(builder.build(), element); diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/RelationshipElementMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/RelationshipElementMapper.java index 46ca23c8..ded6b30b 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/RelationshipElementMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/RelationshipElementMapper.java @@ -57,10 +57,10 @@ public void map(RelationshipElement element, AmlGenerator generator, MappingCont private void mapProperty(RelationshipElement element, Reference reference, String name, AmlGenerator generator, MappingContext context) { Referable resolvedReference = AasUtils.resolve(reference, context.getEnvironment()); if (resolvedReference != null) { - generator.addExternalInterfaceForReference(context); + generator.addExternalInterfaceForReference(); generator.addInternalLink(name, element, reference); } else { - generator.addExternalInterfaceForUnresolvableReference(name, reference, context); + generator.addExternalInterfaceForUnresolvableReference(name, reference); } } } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/SubmodelMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/SubmodelMapper.java index cfa078e9..cbd16296 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/SubmodelMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/SubmodelMapper.java @@ -32,7 +32,8 @@ public SubmodelMapper() { protected InternalElementType.Builder toInternalElement(Submodel value, AmlGenerator generator, MappingContext context) throws MappingException { InternalElementType.Builder builder = super.toInternalElement(value, generator, context); if (value.getKind() == ModelingKind.TEMPLATE) { - builder = builder.withRefBaseSystemUnitPath(generator.refBaseSystemUnitPath(value, context)); + builder = builder.withRefBaseSystemUnitPath(generator.getDocumentInfo().getAssetAdministrationShellSystemUnitClassLib() + + "/" + context.getInternalElementNamingStrategy().getName(value.getClass(), value, null)); } return builder; } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/ViewMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/ViewMapper.java index 828abc34..87e474d9 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/ViewMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/ViewMapper.java @@ -36,7 +36,7 @@ public ViewMapper() { @Override public void map(View view, AmlGenerator generator, MappingContext context) throws MappingException { - if (view == null || view.getContainedElements() == null || view.getContainedElements().isEmpty()) { + if (view == null) { return; } InternalElementType.Builder builder = InternalElementType.builder(); @@ -44,10 +44,6 @@ public void map(View view, AmlGenerator generator, MappingContext context) throw view.getClass(), view, null)) - // .withRefBaseSystemUnitPath(context.getIdentityProvider().getId( - // AASUtils.resolve( - // view.getContainedElements().get(0), - // context.getEnvironment()))) .withRoleRequirements(generator.roleRequirement(ReflectionHelper.getModelType(view.getClass()))); generator.with(builder).appendReferenceTargetInterfaceIfRequired(view, context); for (Reference reference : view.getContainedElements()) { @@ -59,9 +55,6 @@ public void map(View view, AmlGenerator generator, MappingContext context) throw .build()); } - generator.addInternalElement(builder.build(), view); } - - // } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/naming/NumberingClassNamingStrategy.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/naming/NumberingClassNamingStrategy.java index 88c36cb0..b7909658 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/naming/NumberingClassNamingStrategy.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/naming/NumberingClassNamingStrategy.java @@ -15,6 +15,7 @@ */ package io.adminshell.aas.v3.dataformat.aml.serialization.naming; +import io.adminshell.aas.v3.dataformat.core.ReflectionHelper; import java.util.HashMap; import java.util.Map; @@ -32,11 +33,15 @@ public NumberingClassNamingStrategy(boolean preferIdShort) { @Override protected String generateName(Object obj) { - if (!counter.containsKey(obj.getClass())) { - counter.put(obj.getClass(), 0); + if (obj == null) { + return null; } - counter.put(obj.getClass(), counter.get(obj.getClass()) + 1); - return obj.getClass().getSimpleName() + "_" + counter.get(obj.getClass()); + Class type = ReflectionHelper.getAasInterface(obj.getClass()); + if (!counter.containsKey(type)) { + counter.put(type, 0); + } + counter.put(type, counter.get(type) + 1); + return type.getSimpleName() + "_" + counter.get(type); } } diff --git a/dataformat-aml/src/main/resources/AssetAdministrationShellLib.aml b/dataformat-aml/src/main/resources/AssetAdministrationShellLib.aml index 6d37a571..46ab3419 100644 --- a/dataformat-aml/src/main/resources/AssetAdministrationShellLib.aml +++ b/dataformat-aml/src/main/resources/AssetAdministrationShellLib.aml @@ -1,5 +1,5 @@ - - + + diff --git a/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/fixtures/FullExample.java b/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/fixtures/FullExample.java index 275c457e..b36b551e 100644 --- a/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/fixtures/FullExample.java +++ b/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/fixtures/FullExample.java @@ -23,7 +23,7 @@ public class FullExample { - public static final java.io.File FILE = new java.io.File("src/test/resources/test_demo_full_example.json"); + public static final java.io.File FILE = new java.io.File("src/test/resources/test_demo_full_example.aml"); public static final AssetAdministrationShell AAS_1 = new DefaultAssetAdministrationShell.Builder() .idShort("TestAssetAdministrationShell") @@ -398,12 +398,12 @@ public class FullExample { .build()) .first(new DefaultReference.Builder() .key(new DefaultKey.Builder() - .type(KeyElements.Submodel) + .type(KeyElements.SUBMODEL) .value("https://acplt.org/Test_Submodel") .idType(KeyType.IRI) .build()) .key(new DefaultKey.Builder() - .type(KeyElements.SubmodelElementCollection) + .type(KeyElements.SUBMODEL_ELEMENT_COLLECTION) .value("ExampleSubmodelCollectionOrdered") .idType(KeyType.ID_SHORT) .build()) @@ -415,12 +415,12 @@ public class FullExample { .build()) .second(new DefaultReference.Builder() .key(new DefaultKey.Builder() - .type(KeyElements.Submodel) + .type(KeyElements.SUBMODEL) .value("http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial") .idType(KeyType.IRI) .build()) .key(new DefaultKey.Builder() - .type(KeyElements.Entity) + .type(KeyElements.ENTITY) .value("ExampleEntity") .idType(KeyType.ID_SHORT) .build()) @@ -445,12 +445,12 @@ public class FullExample { .build()) .first(new DefaultReference.Builder() .key(new DefaultKey.Builder() - .type(KeyElements.Submodel) + .type(KeyElements.SUBMODEL) .value("https://acplt.org/Test_Submodel") .idType(KeyType.IRI) .build()) .key(new DefaultKey.Builder() - .type(KeyElements.SubmodelElementCollection) + .type(KeyElements.SUBMODEL_ELEMENT_COLLECTION) .value("ExampleSubmodelCollectionOrdered") .idType(KeyType.ID_SHORT) .build()) @@ -462,12 +462,12 @@ public class FullExample { .build()) .second(new DefaultReference.Builder() .key(new DefaultKey.Builder() - .type(KeyElements.Submodel) + .type(KeyElements.SUBMODEL) .value("http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial") .idType(KeyType.IRI) .build()) .key(new DefaultKey.Builder() - .type(KeyElements.Entity) + .type(KeyElements.ENTITY) .value("ExampleEntity") .idType(KeyType.ID_SHORT) .build()) @@ -499,7 +499,7 @@ public class FullExample { .build()) .inputVariable(new DefaultOperationVariable.Builder() .value(new DefaultProperty.Builder() - .idShort("ExampleProperty") + .idShort("ExampleProperty1") .category("Constant") .description(new LangString("Example Property object", "en-us")) .description(new LangString("Beispiel Property Element", "de")) @@ -523,7 +523,7 @@ public class FullExample { .build()) .outputVariable(new DefaultOperationVariable.Builder() .value(new DefaultProperty.Builder() - .idShort("ExampleProperty") + .idShort("ExampleProperty2") .category("Constant") .description(new LangString("Example Property object", "en-us")) .description(new LangString("Beispiel Property Element", "de")) @@ -547,7 +547,7 @@ public class FullExample { .build()) .inoutputVariable(new DefaultOperationVariable.Builder() .value(new DefaultProperty.Builder() - .idShort("ExampleProperty") + .idShort("ExampleProperty3") .category("Constant") .description(new LangString("Example Property object", "en-us")) .description(new LangString("Beispiel Property Element", "de")) @@ -597,12 +597,12 @@ public class FullExample { .build()) .observed(new DefaultReference.Builder() .key(new DefaultKey.Builder() - .type(KeyElements.Submodel) + .type(KeyElements.SUBMODEL) .value("https://acplt.org/Test_Submodel") .idType(KeyType.IRI) .build()) .key(new DefaultKey.Builder() - .type(KeyElements.SubmodelElementCollection) + .type(KeyElements.SUBMODEL_ELEMENT_COLLECTION) .value("ExampleSubmodelCollectionOrdered") .idType(KeyType.ID_SHORT) .build()) @@ -742,12 +742,12 @@ public class FullExample { .build()) .value(new DefaultReference.Builder() .key(new DefaultKey.Builder() - .type(KeyElements.Submodel) + .type(KeyElements.SUBMODEL) .value("https://acplt.org/Test_Submodel") .idType(KeyType.IRI) .build()) .key(new DefaultKey.Builder() - .type(KeyElements.SubmodelElementCollection) + .type(KeyElements.SUBMODEL_ELEMENT_COLLECTION) .value("ExampleSubmodelCollectionOrdered") .idType(KeyType.ID_SHORT) .build()) @@ -773,12 +773,12 @@ public class FullExample { .idShort("ExampleRelationshipElement") .first(new DefaultReference.Builder() .key(new DefaultKey.Builder() - .type(KeyElements.Submodel) + .type(KeyElements.SUBMODEL) .value("https://acplt.org/Test_Submodel_Mandatory") .idType(KeyType.IRI) .build()) .key(new DefaultKey.Builder() - .type(KeyElements.SubmodelElementCollection) + .type(KeyElements.SUBMODEL_ELEMENT_COLLECTION) .value("ExampleSubmodelCollectionOrdered") .idType(KeyType.ID_SHORT) .build()) @@ -790,17 +790,17 @@ public class FullExample { .build()) .second(new DefaultReference.Builder() .key(new DefaultKey.Builder() - .type(KeyElements.Submodel) + .type(KeyElements.SUBMODEL) .value("https://acplt.org/Test_Submodel_Mandatory") .idType(KeyType.IRI) .build()) .key(new DefaultKey.Builder() - .type(KeyElements.SubmodelElementCollection) + .type(KeyElements.SUBMODEL_ELEMENT_COLLECTION) .value("ExampleSubmodelCollectionOrdered") .idType(KeyType.ID_SHORT) .build()) .key(new DefaultKey.Builder() - .type(KeyElements.PROPERTY) + .type(KeyElements.MULTI_LANGUAGE_PROPERTY) .value("ExampleMultiLanguageProperty") .idType(KeyType.ID_SHORT) .build()) @@ -810,12 +810,12 @@ public class FullExample { .idShort("ExampleAnnotatedRelationshipElement") .first(new DefaultReference.Builder() .key(new DefaultKey.Builder() - .type(KeyElements.Submodel) + .type(KeyElements.SUBMODEL) .value("https://acplt.org/Test_Submodel_Mandatory") .idType(KeyType.IRI) .build()) .key(new DefaultKey.Builder() - .type(KeyElements.SubmodelElementCollection) + .type(KeyElements.SUBMODEL_ELEMENT_COLLECTION) .value("ExampleSubmodelCollectionOrdered") .idType(KeyType.ID_SHORT) .build()) @@ -827,17 +827,17 @@ public class FullExample { .build()) .second(new DefaultReference.Builder() .key(new DefaultKey.Builder() - .type(KeyElements.Submodel) + .type(KeyElements.SUBMODEL) .value("https://acplt.org/Test_Submodel_Mandatory") .idType(KeyType.IRI) .build()) .key(new DefaultKey.Builder() - .type(KeyElements.SubmodelElementCollection) + .type(KeyElements.SUBMODEL_ELEMENT_COLLECTION) .value("ExampleSubmodelCollectionOrdered") .idType(KeyType.ID_SHORT) .build()) .key(new DefaultKey.Builder() - .type(KeyElements.PROPERTY) + .type(KeyElements.MULTI_LANGUAGE_PROPERTY) .value("ExampleMultiLanguageProperty") .idType(KeyType.ID_SHORT) .build()) @@ -853,12 +853,12 @@ public class FullExample { .idShort("ExampleBasicEvent") .observed(new DefaultReference.Builder() .key(new DefaultKey.Builder() - .type(KeyElements.Submodel) + .type(KeyElements.SUBMODEL) .value("https://acplt.org/Test_Submodel_Mandatory") .idType(KeyType.IRI) .build()) .key(new DefaultKey.Builder() - .type(KeyElements.SubmodelElementCollection) + .type(KeyElements.SUBMODEL_ELEMENT_COLLECTION) .value("ExampleSubmodelCollectionOrdered") .idType(KeyType.ID_SHORT) .build()) @@ -951,12 +951,12 @@ public class FullExample { .build()) .first(new DefaultReference.Builder() .key(new DefaultKey.Builder() - .type(KeyElements.Submodel) + .type(KeyElements.SUBMODEL) .value("https://acplt.org/Test_Submodel_Missing") .idType(KeyType.IRI) .build()) .key(new DefaultKey.Builder() - .type(KeyElements.SubmodelElementCollection) + .type(KeyElements.SUBMODEL_ELEMENT_COLLECTION) .value("ExampleSubmodelCollectionOrdered") .idType(KeyType.ID_SHORT) .build()) @@ -968,17 +968,17 @@ public class FullExample { .build()) .second(new DefaultReference.Builder() .key(new DefaultKey.Builder() - .type(KeyElements.Submodel) + .type(KeyElements.SUBMODEL) .value("https://acplt.org/Test_Submodel_Missing") .idType(KeyType.IRI) .build()) .key(new DefaultKey.Builder() - .type(KeyElements.SubmodelElementCollection) + .type(KeyElements.SUBMODEL_ELEMENT_COLLECTION) .value("ExampleSubmodelCollectionOrdered") .idType(KeyType.ID_SHORT) .build()) .key(new DefaultKey.Builder() - .type(KeyElements.PROPERTY) + .type(KeyElements.MULTI_LANGUAGE_PROPERTY) .value("ExampleMultiLanguageProperty") .idType(KeyType.ID_SHORT) .build()) @@ -998,12 +998,12 @@ public class FullExample { .build()) .first(new DefaultReference.Builder() .key(new DefaultKey.Builder() - .type(KeyElements.Submodel) + .type(KeyElements.SUBMODEL) .value("https://acplt.org/Test_Submodel_Missing") .idType(KeyType.IRI) .build()) .key(new DefaultKey.Builder() - .type(KeyElements.SubmodelElementCollection) + .type(KeyElements.SUBMODEL_ELEMENT_COLLECTION) .value("ExampleSubmodelCollectionOrdered") .idType(KeyType.ID_SHORT) .build()) @@ -1015,17 +1015,17 @@ public class FullExample { .build()) .second(new DefaultReference.Builder() .key(new DefaultKey.Builder() - .type(KeyElements.Submodel) + .type(KeyElements.SUBMODEL) .value("https://acplt.org/Test_Submodel_Missing") .idType(KeyType.IRI) .build()) .key(new DefaultKey.Builder() - .type(KeyElements.SubmodelElementCollection) + .type(KeyElements.SUBMODEL_ELEMENT_COLLECTION) .value("ExampleSubmodelCollectionOrdered") .idType(KeyType.ID_SHORT) .build()) .key(new DefaultKey.Builder() - .type(KeyElements.PROPERTY) + .type(KeyElements.MULTI_LANGUAGE_PROPERTY) .value("ExampleMultiLanguageProperty") .idType(KeyType.ID_SHORT) .build()) @@ -1052,7 +1052,7 @@ public class FullExample { .build()) .inputVariable(new DefaultOperationVariable.Builder() .value(new DefaultProperty.Builder() - .idShort("ExampleProperty") + .idShort("ExampleProperty1") .category("Constant") .description(new LangString("Example Property object", "en-us")) .description(new LangString("Beispiel Property Element", "de")) @@ -1073,7 +1073,7 @@ public class FullExample { .build()) .outputVariable(new DefaultOperationVariable.Builder() .value(new DefaultProperty.Builder() - .idShort("ExampleProperty") + .idShort("ExampleProperty2") .category("Constant") .description(new LangString("Example Property object", "en-us")) .description(new LangString("Beispiel Property Element", "de")) @@ -1094,7 +1094,7 @@ public class FullExample { .build()) .inoutputVariable(new DefaultOperationVariable.Builder() .value(new DefaultProperty.Builder() - .idShort("ExampleProperty") + .idShort("ExampleProperty3") .category("Constant") .description(new LangString("Example Property object", "en-us")) .description(new LangString("Beispiel Property Element", "de")) @@ -1141,12 +1141,12 @@ public class FullExample { .build()) .observed(new DefaultReference.Builder() .key(new DefaultKey.Builder() - .type(KeyElements.Submodel) + .type(KeyElements.SUBMODEL) .value("https://acplt.org/Test_Submodel_Missing") .idType(KeyType.IRI) .build()) .key(new DefaultKey.Builder() - .type(KeyElements.SubmodelElementCollection) + .type(KeyElements.SUBMODEL_ELEMENT_COLLECTION) .value("ExampleSubmodelCollectionOrdered") .idType(KeyType.ID_SHORT) .build()) @@ -1277,12 +1277,12 @@ public class FullExample { .build()) .value(new DefaultReference.Builder() .key(new DefaultKey.Builder() - .type(KeyElements.Submodel) + .type(KeyElements.SUBMODEL) .value("https://acplt.org/Test_Submodel_Missing") .idType(KeyType.IRI) .build()) .key(new DefaultKey.Builder() - .type(KeyElements.SubmodelElementCollection) + .type(KeyElements.SUBMODEL_ELEMENT_COLLECTION) .value("ExampleSubmodelCollectionOrdered") .idType(KeyType.ID_SHORT) .build()) @@ -1662,7 +1662,7 @@ public class FullExample { .build(); public final static ConceptDescription CONCEPT_DESCRIPTION_3 = new DefaultConceptDescription.Builder() - .idShort("TestConceptDescription") + .idShort("TestConceptDescription1") .description(new LangString("An example concept description for the test application", "en-us")) .description(new LangString("Ein Beispiel-ConceptDescription für eine Test-Anwendung", "de")) .identification(new DefaultIdentifier.Builder() diff --git a/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/fixtures/TestExample.java b/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/fixtures/TestExample.java deleted file mode 100644 index e91edab1..00000000 --- a/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/fixtures/TestExample.java +++ /dev/null @@ -1,571 +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 io.adminshell.aas.v3.dataformat.aml.fixtures; - -import io.adminshell.aas.v3.dataformat.core.ReflectionHelper; -import io.adminshell.aas.v3.dataformat.core.util.AasUtils; -import io.adminshell.aas.v3.model.*; -import io.adminshell.aas.v3.model.impl.*; - -import java.util.Arrays; - -public class TestExample { - - public static final java.io.File FILE = new java.io.File("src/test/resources/amlfile/example_test.aml"); - - private static KeyElements resolveKeyElement(Class type) { - String potentialEnumName = AasUtils.deserializeEnumName(ReflectionHelper.getAasInterface(type).getSimpleName()); - return KeyElements.valueOf(potentialEnumName); - } - - private static final Reference asReference(Identifiable identifiable) { - return new DefaultReference.Builder() - .key(new DefaultKey.Builder() - .idType(KeyType.IRI) - .type(resolveKeyElement(identifiable.getClass())) - .value(identifiable.getIdentification().getIdentifier()) - .build()) - .build(); - } - - public static final Submodel SUBMODEL_1 = new DefaultSubmodel.Builder() - .idShort("Identification") - .description(new LangString("An example asset identification submodel for the test application", "en-us")) - .description(new LangString("Ein Beispiel-Identifikations-Submodel für eine Test-Anwendung", "de")) - .identification(new DefaultIdentifier.Builder() - .idType(IdentifierType.IRI) - .identifier("http://acplt.org/Submodels/Assets/TestAsset/Identification") - .build()) - .administration(new DefaultAdministrativeInformation.Builder() - .version("0.9") - .revision("0") - .build()) - .kind(ModelingKind.INSTANCE) - .semanticId(new DefaultReference.Builder() - .key(new DefaultKey.Builder() - .type(KeyElements.SUBMODEL) - .idType(KeyType.IRI) - .value("http://acplt.org/SubmodelTemplates/AssetIdentification") - .build()) - .build()) - .submodelElement(new DefaultReferenceElement.Builder() - .idShort("ExampleReferenceElement") - .category("Parameter") - .description(new LangString("Example Reference Element object", "en-us")) - .description(new LangString("Beispiel Reference Element Element", "de")) - .semanticId(new DefaultReference.Builder() - .key(new DefaultKey.Builder() - .type(KeyElements.GLOBAL_REFERENCE).value( - "http://acplt.org/ReferenceElements/ExampleReferenceElement") - .idType(KeyType.IRI) - .build()) - .build()) - .value(new DefaultReference.Builder() - .key(new DefaultKey.Builder() - .idType(KeyType.IRI) - .type(KeyElements.SUBMODEL) - .value("http://acplt.org/Submodels/Assets/TestAsset/Identification") - .build()) - .key(new DefaultKey.Builder() - .type(KeyElements.SUBMODEL_ELEMENT) - .idType(KeyType.ID_SHORT) - .value("ExampleOperation") - .build()) - .build()) - .build()) - // .submodelElement(new DefaultRelationshipElement.Builder() - // .idShort("ExampleRelationshipElement") - // .first(new DefaultReference.Builder() - // .key(new DefaultKey.Builder() - // .idType(KeyType.IRI) - // .type(KeyElements.SUBMODEL) - // .value("http://acplt.org/Submodels/Assets/TestAsset/Identification") - // .build()) - // .key(new DefaultKey.Builder() - // .type(KeyElements.SUBMODEL_ELEMENT) - // .idType(KeyType.ID_SHORT) - // .value("ExampleOperation") - // .build()) - // .build()) - // .second(new DefaultReference.Builder() - // .key(new DefaultKey.Builder() - // .idType(KeyType.IRI) - // .type(KeyElements.SUBMODEL) - // .value("http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial") - // .build()) - // .build()) - // .build()) - // .submodelElement(new DefaultFile.Builder() - // .idShort("ExampleFile") - // .category("Parameter") - // .description(new LangString("Example File object", "en-us")) - // .description(new LangString("Beispiel File Element", "de")) - // .semanticId(new DefaultReference.Builder() - // .key(new DefaultKey.Builder() - // .type(KeyElements.GLOBAL_REFERENCE) - // .value("http://acplt.org/Files/ExampleFile") - // .idType(KeyType.IRI) - // .build()) - // .build()) - // .value("/TestFile.pdf") - // .mimeType("application/pdf") - // .build()) - .submodelElement(new DefaultOperation.Builder() - .idShort("ExampleOperation") - .category("Parameter") - .description(new LangString("Example Operation object", "en-us")) - .description(new LangString("Beispiel Operation Element", "de")) - .semanticId(new DefaultReference.Builder() - .key(new DefaultKey.Builder() - .type(KeyElements.GLOBAL_REFERENCE) - .value("http://acplt.org/Operations/ExampleOperation") - .idType(KeyType.IRI) - .build()) - .build()) - .inputVariable(new DefaultOperationVariable.Builder() - .value(new DefaultProperty.Builder() - .idShort("ExampleProperty1") - .category("Constant") - .kind(ModelingKind.TEMPLATE) - .description(new LangString("Example Property object", "en-us")) - .description(new LangString("Beispiel Property Element", "de")) - .semanticId(new DefaultReference.Builder() - .key(new DefaultKey.Builder() - .type(KeyElements.GLOBAL_REFERENCE) - .value("http://acplt.org/Properties/ExampleProperty") - .idType(KeyType.IRI) - .build()) - .build()) - .value("exampleValue") - .valueId(new DefaultReference.Builder() - .key(new DefaultKey.Builder() - .type(KeyElements.GLOBAL_REFERENCE) - .idType(KeyType.IRI) - .value("http://acplt.org/ValueId/ExampleValueId") - .build()) - .build()) - .valueType("string") - .build()) - .build()) - .outputVariable(new DefaultOperationVariable.Builder() - .value(new DefaultProperty.Builder() - .idShort("ExampleProperty2") - .category("Constant") - .description(new LangString("Example Property object", "en-us")) - .description(new LangString("Beispiel Property Element", "de")) - .semanticId(new DefaultReference.Builder() - .key(new DefaultKey.Builder() - .type(KeyElements.GLOBAL_REFERENCE) - .value("http://acplt.org/Properties/ExampleProperty") - .idType(KeyType.IRI) - .build()) - .build()) - .value("exampleValue") - .valueId(new DefaultReference.Builder() - .key(new DefaultKey.Builder() - .type(KeyElements.GLOBAL_REFERENCE) - .idType(KeyType.IRI) - .value("http://acplt.org/ValueId/ExampleValueId") - .build()) - .build()) - .valueType("string") - .build()) - .build()) - .inoutputVariable(new DefaultOperationVariable.Builder() - .value(new DefaultProperty.Builder() - .idShort("ExampleProperty3") - .kind(ModelingKind.TEMPLATE) - .category("Constant") - .description(new LangString("Example Property object", "en-us")) - .description(new LangString("Beispiel Property Element", "de")) - .semanticId(new DefaultReference.Builder() - .key(new DefaultKey.Builder() - .type(KeyElements.GLOBAL_REFERENCE) - .value("http://acplt.org/Properties/ExampleProperty") - .idType(KeyType.IRI) - .build()) - .build()) - .value("exampleValue") - .valueId(new DefaultReference.Builder() - .key(new DefaultKey.Builder() - .type(KeyElements.GLOBAL_REFERENCE) - .idType(KeyType.IRI) - .value("http://acplt.org/ValueId/ExampleValueId") - .build()) - .build()) - .valueType("string") - .build()) - .build()) - .build()) - // .submodelElement( - // new DefaultProperty.Builder() - // .idShort("ManufacturerName") - // .description(new LangString("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.", "en-us")) - // .description(new LangString("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", "de")) - // .semanticId(new DefaultReference.Builder() - // .key(new DefaultKey.Builder() - // .type(KeyElements.GLOBAL_REFERENCE) - // .value("0173-1#02-AAO677#002") - // .idType(KeyType.IRI) - // .build()) - // .build()) - // .qualifier(new DefaultQualifier.Builder() - // .value("100") - // .valueId(new DefaultReference.Builder() - // .key(new DefaultKey.Builder() - // .type(KeyElements.GLOBAL_REFERENCE) - // .idType(KeyType.IRI) - // .value("http://acplt.org/ValueId/ExampleValueId") - // .build()) - // .build()) - // .valueType("int") - // .type("http://acplt.org/Qualifier/ExampleQualifier") - // .build()) - // .qualifier(new DefaultQualifier.Builder() - // .value("50") - // .valueId(new DefaultReference.Builder() - // .key(new DefaultKey.Builder() - // .type(KeyElements.GLOBAL_REFERENCE) - // .idType(KeyType.IRI) - // .value("http://acplt.org/ValueId/ExampleValueId") - // .build()) - // .build()) - // .valueType("int") - // .type("http://acplt.org/Qualifier/ExampleQualifier2") - // .build()) - // .value("ACPLT") - // .valueId(new DefaultReference.Builder() - // .key(new DefaultKey.Builder() - // .type(KeyElements.GLOBAL_REFERENCE) - // .idType(KeyType.IRI) - // .value("http://acplt.org/ValueId/ExampleValueId") - // .build()) - // .build()) - // .valueType("string") - // .build()) - - // .submodelElement(new DefaultProperty.Builder() - // .idShort("InstanceId") - // .description(new LangString("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.", "en-us")) - // .description(new LangString("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", "de")) - // .semanticId(new DefaultReference.Builder() - // .key(new DefaultKey.Builder() - // .type(KeyElements.GLOBAL_REFERENCE) - // .value("http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber") - // .idType(KeyType.IRI) - // .build()) - // .build()) - // .value("978-8234-234-342") - // .valueId(new DefaultReference.Builder() - // .key(new DefaultKey.Builder() - // .type(KeyElements.GLOBAL_REFERENCE) - // .idType(KeyType.IRI) - // .value("http://acplt.org/ValueId/ExampleValueId") - // .build()) - // .build()) - // .valueType("string") - // .build()) - .build(); - - public static final Submodel SUBMODEL_2 = new DefaultSubmodel.Builder() - .idShort("BillOfMaterial") - .description(new LangString("An example bill of material submodel for the test application", "en-us")) - .description(new LangString("Ein Beispiel-BillofMaterial-Submodel für eine Test-Anwendung", "de")) - .identification(new DefaultIdentifier.Builder() - .idType(IdentifierType.IRI) - .identifier("http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial") - .build()) - .administration(new DefaultAdministrativeInformation.Builder() - .version("0.9") - .build()) - .kind(ModelingKind.TEMPLATE) - .semanticId(new DefaultReference.Builder() - .key(new DefaultKey.Builder() - .type(KeyElements.SUBMODEL) - .idType(KeyType.IRI) - .value("http://acplt.org/SubmodelTemplates/BillOfMaterial") - .build()) - .build()) - .submodelElement(new DefaultEntity.Builder() - .idShort("ExampleEntity") - .description(new LangString("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.", "en-us")) - .description(new LangString("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", "de")) - .semanticId(new DefaultReference.Builder() - .key(new DefaultKey.Builder() - .type(KeyElements.GLOBAL_REFERENCE) - .value("http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber") - .idType(KeyType.IRI) - .build()) - .build()) - .statement(new DefaultProperty.Builder() - .idShort("ExampleProperty2") - .category("Constant") - .description(new LangString("Example Property object", "en-us")) - .description(new LangString("Beispiel Property Element", "de")) - .semanticId(new DefaultReference.Builder() - .key(new DefaultKey.Builder() - .type(KeyElements.GLOBAL_REFERENCE) - .value("http://acplt.org/Properties/ExampleProperty") - .idType(KeyType.IRI) - .build()) - .build()) - .value("exampleValue2") - .valueId(new DefaultReference.Builder() - .key(new DefaultKey.Builder() - .type(KeyElements.GLOBAL_REFERENCE) - .idType(KeyType.IRI) - .value("http://acplt.org/ValueId/ExampleValueId") - .build()) - .build()) - .valueType("string") - .build()) - .statement(new DefaultProperty.Builder() - .idShort("ExampleProperty") - .category("Constant") - .description(new LangString("Example Property object", "en-us")) - .description(new LangString("Beispiel Property Element", "de")) - .semanticId(new DefaultReference.Builder() - .key(new DefaultKey.Builder() - .type(KeyElements.GLOBAL_REFERENCE) - .value("http://acplt.org/Properties/ExampleProperty") - .idType(KeyType.IRI) - .build()) - .build()) - .value("exampleValue") - .valueId(new DefaultReference.Builder() - .key(new DefaultKey.Builder() - .type(KeyElements.GLOBAL_REFERENCE) - .idType(KeyType.IRI) - .value("http://acplt.org/ValueId/ExampleValueId") - .build()) - .build()) - .valueType("string") - .build()) - .entityType(EntityType.CO_MANAGED_ENTITY) - .build()) - .submodelElement(new DefaultEntity.Builder() - .idShort("ExampleEntity2") - .description(new LangString("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.", "en-us")) - .description(new LangString("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", "de")) - .semanticId(new DefaultReference.Builder() - .key(new DefaultKey.Builder() - .type(KeyElements.GLOBAL_REFERENCE) - .value("http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber") - .idType(KeyType.IRI) - .build()) - .build()) - .entityType(EntityType.SELF_MANAGED_ENTITY) - .globalAssetId(new DefaultReference.Builder() - .key(new DefaultKey.Builder() - .type(KeyElements.ASSET) - .idType(KeyType.IRI) - .value("https://acplt.org/Test_Asset2") - .build()) - .build()) - .build()) - .qualifier(new DefaultQualifier.Builder() - .value("100") - .valueId(new DefaultReference.Builder() - .key(new DefaultKey.Builder() - .type(KeyElements.GLOBAL_REFERENCE) - .idType(KeyType.IRI) - .value("http://acplt.org/ValueId/ExampleValueId") - .build()) - .build()) - .valueType("int") - .type("http://acplt.org/Qualifier/ExampleQualifier") - .build()) - .qualifier(new DefaultQualifier.Builder() - .value("50") - .valueId(new DefaultReference.Builder() - .key(new DefaultKey.Builder() - .type(KeyElements.GLOBAL_REFERENCE) - .idType(KeyType.IRI) - .value("http://acplt.org/ValueId/ExampleValueId") - .build()) - .build()) - .valueType("int") - .type("http://acplt.org/Qualifier/ExampleQualifier2") - .build()) - .build(); - - public final static ConceptDescription CONCEPT_DESCRIPTION_1 = new DefaultConceptDescription.Builder() - .idShort("TestConceptDescription") - .description(new LangString("An example concept description for the test application", "en-us")) - .description(new LangString("Ein Beispiel-ConceptDescription für eine Test-Anwendung", "de")) - .identification(new DefaultIdentifier.Builder() - .idType(IdentifierType.IRI) - .identifier("https://acplt.org/Test_ConceptDescription") - .build()) - .administration(new DefaultAdministrativeInformation.Builder() - .version("0.9") - .revision("0") - .build()) - .isCaseOf(new DefaultReference.Builder() - .key(new DefaultKey.Builder() - .type(KeyElements.GLOBAL_REFERENCE) - .idType(KeyType.IRI) - .value("http://acplt.org/DataSpecifications/ConceptDescriptions/TestConceptDescription") - .build()) - .build()) - .embeddedDataSpecification(new DefaultEmbeddedDataSpecification.Builder() - .dataSpecificationContent(new DefaultDataSpecificationIEC61360.Builder() - .preferredName(new LangString("Test Specification", "de")) - .preferredName(new LangString("TestSpecification", "en-us")) - .dataType(DataTypeIEC61360.REAL_MEASURE) - .definition(new LangString("Dies ist eine Data Specification für Testzwecke", "de")) - .definition(new LangString("This is a DataSpecification for testing purposes", "en-us")) - .shortName(new LangString("Test Spec", "de")) - .shortName(new LangString("TestSpec", "en-us")) - .unit("SpaceUnit") - .unitId(new DefaultReference.Builder() - .key(new DefaultKey.Builder() - .type(KeyElements.GLOBAL_REFERENCE) - .idType(KeyType.IRI) - .value("http://acplt.org/Units/SpaceUnit") - .build()) - .build()) - .sourceOfDefinition("http://acplt.org/DataSpec/ExampleDef") - .symbol("SU") - .valueFormat("string") - .value("TEST") - .levelType(LevelType.MIN) - .levelType(LevelType.MAX) - .valueList(new DefaultValueList.Builder() - .valueReferencePairTypes(new DefaultValueReferencePair.Builder() - .value("exampleValue") - .valueId(new DefaultReference.Builder() - .key(new DefaultKey.Builder() - .type(KeyElements.GLOBAL_REFERENCE) - .idType(KeyType.IRI) - .value("http://acplt.org/ValueId/ExampleValueId") - .build()) - .build()) - // TODO valueType - .build()) - .valueReferencePairTypes(new DefaultValueReferencePair.Builder() - .value("exampleValue2") - .valueId(new DefaultReference.Builder() - .key(new DefaultKey.Builder() - .type(KeyElements.GLOBAL_REFERENCE) - .idType(KeyType.IRI) - .value("http://acplt.org/ValueId/ExampleValueId2") - .build()) - .build()) - // TODO valueType - .build()) - .build()) - .build()) - .build()) - .embeddedDataSpecification(new DefaultEmbeddedDataSpecification.Builder() - .dataSpecificationContent(new DefaultDataSpecificationIEC61360.Builder() - .preferredName(new LangString("Test Specification2", "de")) - .preferredName(new LangString("TestSpecification2", "en-us")) - .dataType(DataTypeIEC61360.REAL_MEASURE) - .definition(new LangString("Dies ist eine Data Specification für Testzwecke2", "de")) - .definition(new LangString("This is a DataSpecification for testing purposes2", "en-us")) - .shortName(new LangString("Test Spec2", "de")) - .shortName(new LangString("TestSpec2", "en-us")) - .unit("SpaceUnit") - .unitId(new DefaultReference.Builder() - .key(new DefaultKey.Builder() - .type(KeyElements.GLOBAL_REFERENCE) - .idType(KeyType.IRI) - .value("http://acplt.org/Units/SpaceUnit") - .build()) - .build()) - .sourceOfDefinition("http://acplt.org/DataSpec/ExampleDef") - .symbol("SU") - .valueFormat("string") - .value("TEST2") - .levelType(LevelType.MIN) - .levelType(LevelType.MAX) - .valueList(new DefaultValueList.Builder() - .valueReferencePairTypes(new DefaultValueReferencePair.Builder() - .value("exampleValue21") - .valueId(new DefaultReference.Builder() - .key(new DefaultKey.Builder() - .type(KeyElements.GLOBAL_REFERENCE) - .idType(KeyType.IRI) - .value("http://acplt.org/ValueId/ExampleValueId") - .build()) - .build()) - // TODO valueType - .build()) - .valueReferencePairTypes(new DefaultValueReferencePair.Builder() - .value("exampleValue22") - .valueId(new DefaultReference.Builder() - .key(new DefaultKey.Builder() - .type(KeyElements.GLOBAL_REFERENCE) - .idType(KeyType.IRI) - .value("http://acplt.org/ValueId/ExampleValueId2") - .build()) - .build()) - // TODO valueType - .build()) - .build()) - .build()) - .build()) - .build(); - - public static final AssetAdministrationShell AAS_1 = new DefaultAssetAdministrationShell.Builder() - .idShort("TestAssetAdministrationShell") - .description(new LangString("An Example Asset Administration Shell for the test application", "en-us")) - .description(new LangString("Ein Beispiel-Verwaltungsschale für eine Test-Anwendung", "de")) - .identification(new DefaultIdentifier.Builder() - .idType(IdentifierType.IRI) - .identifier("https://acplt.org/Test_AssetAdministrationShell") - .build()) - .administration(new DefaultAdministrativeInformation.Builder() - .version("0.9") - .revision("0") - .build()) - .derivedFrom(new DefaultReference.Builder() - .key(new DefaultKey.Builder() - .type(KeyElements.ASSET_ADMINISTRATION_SHELL) - .idType(KeyType.IRI) - .value("https://acplt.org/TestAssetAdministrationShell2") - .build()) - .build()) - .assetInformation(new DefaultAssetInformation.Builder() - .assetKind(AssetKind.INSTANCE) - .globalAssetId(new DefaultReference.Builder() - .key(new DefaultKey.Builder() - .type(KeyElements.ASSET) - .idType(KeyType.IRI) - .value("https://acplt.org/Test_Asset") - .build()) - .build()) - // .billOfMaterial(asReference(SUBMODEL_2)) - .build()) - .submodel(asReference(SUBMODEL_1)) - .submodel(asReference(SUBMODEL_2)) - .view(new DefaultView.Builder() - .idShort("ExampleView") - .containedElement(asReference(SUBMODEL_1)) - .build()) - .build(); - - public static final AssetAdministrationShellEnvironment ENVIRONMENT = new DefaultAssetAdministrationShellEnvironment.Builder() - .assetAdministrationShells(Arrays.asList( - AAS_1)) - .submodels(Arrays.asList( - SUBMODEL_1, - SUBMODEL_2)) - .conceptDescriptions(Arrays.asList( - CONCEPT_DESCRIPTION_1)) - .build(); -} diff --git a/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/serialize/AmlDeserializerTest.java b/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/serialize/AmlDeserializerTest.java index e09fe40d..0693c93a 100644 --- a/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/serialize/AmlDeserializerTest.java +++ b/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/serialize/AmlDeserializerTest.java @@ -17,7 +17,7 @@ import io.adminshell.aas.v3.dataformat.DeserializationException; import io.adminshell.aas.v3.dataformat.aml.AmlDeserializer; -import io.adminshell.aas.v3.dataformat.aml.fixtures.TestExample; +import io.adminshell.aas.v3.dataformat.aml.fixtures.FullExample; import io.adminshell.aas.v3.model.AssetAdministrationShellEnvironment; import java.io.FileNotFoundException; import static org.junit.Assert.assertEquals; @@ -29,8 +29,9 @@ public class AmlDeserializerTest { private final AmlDeserializer deserializer = new AmlDeserializer(); @Test + @Ignore public void testExample() throws FileNotFoundException, DeserializationException { - AssetAdministrationShellEnvironment actual = deserializer.read(TestExample.FILE); - assertEquals(TestExample.ENVIRONMENT, actual); + AssetAdministrationShellEnvironment actual = deserializer.read(FullExample.FILE); + assertEquals(FullExample.ENVIRONMENT, actual); } } diff --git a/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/serialize/AmlSerializerTest.java b/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/serialize/AmlSerializerTest.java index d15ef036..ad286ac7 100644 --- a/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/serialize/AmlSerializerTest.java +++ b/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/serialize/AmlSerializerTest.java @@ -20,34 +20,11 @@ import io.adminshell.aas.v3.dataformat.aml.AmlSerializationConfig; import io.adminshell.aas.v3.dataformat.aml.AmlSerializer; import io.adminshell.aas.v3.dataformat.aml.serialization.id.IntegerIdGenerator; -import io.adminshell.aas.v3.dataformat.aml.fixtures.TestExample; -import io.adminshell.aas.v3.dataformat.core.util.AasUtils; import io.adminshell.aas.v3.model.AssetAdministrationShellEnvironment; -import io.adminshell.aas.v3.model.DataTypeIEC61360; -import io.adminshell.aas.v3.model.IdentifierType; -import io.adminshell.aas.v3.model.KeyElements; -import io.adminshell.aas.v3.model.KeyType; -import io.adminshell.aas.v3.model.LangString; -import io.adminshell.aas.v3.model.ModelingKind; -import io.adminshell.aas.v3.model.Submodel; -import io.adminshell.aas.v3.model.impl.DefaultAssetAdministrationShell; -import io.adminshell.aas.v3.model.impl.DefaultAssetAdministrationShellEnvironment; -import io.adminshell.aas.v3.model.impl.DefaultDataSpecificationIEC61360; -import io.adminshell.aas.v3.model.impl.DefaultEmbeddedDataSpecification; -import io.adminshell.aas.v3.model.impl.DefaultIdentifier; -import io.adminshell.aas.v3.model.impl.DefaultKey; -import io.adminshell.aas.v3.model.impl.DefaultOperation; -import io.adminshell.aas.v3.model.impl.DefaultOperationVariable; -import io.adminshell.aas.v3.model.impl.DefaultProperty; -import io.adminshell.aas.v3.model.impl.DefaultReference; -import io.adminshell.aas.v3.model.impl.DefaultReferenceElement; -import io.adminshell.aas.v3.model.impl.DefaultSubmodel; -import io.adminshell.aas.v3.model.impl.DefaultSubmodelElementCollection; import java.io.File; import java.io.IOException; import java.nio.file.Files; import java.util.Iterator; -import org.junit.Ignore; import org.junit.Test; import org.xml.sax.SAXException; import org.xmlunit.builder.DiffBuilder; @@ -58,145 +35,7 @@ public class AmlSerializerTest { - private final AmlSerializer serializer = new AmlSerializer(); - - @Test - @Ignore - public void testExample() throws SerializationException, SAXException, IOException { - validateAmlSerializer(TestExample.FILE, TestExample.ENVIRONMENT); - - } - - @Test -// @Ignore - public void testReferenceElement() throws SerializationException, SAXException, IOException { - Submodel submodel = new DefaultSubmodel.Builder() - .idShort("submodel1") - .identification(new DefaultIdentifier.Builder() - .idType(IdentifierType.IRI) - .identifier("iri:submodel1") - .build()) - .kind(ModelingKind.INSTANCE) - .submodelElement(new DefaultProperty.Builder() - .idShort("property1") - .build()) - .submodelElement(new DefaultOperation.Builder() - .idShort("operation1") - .inputVariable(new DefaultOperationVariable.Builder() - .value(new DefaultSubmodelElementCollection.Builder() - .idShort("submodelElementCollection1") - .value(new DefaultReferenceElement.Builder() - .idShort("refElement1") - .value(new DefaultReference.Builder() - .key(new DefaultKey.Builder() - .idType(KeyType.IRI) - .type(KeyElements.SUBMODEL) - .value("iri:submodel1") - .build()) - .key(new DefaultKey.Builder() - .idType(KeyType.ID_SHORT) - .type(KeyElements.PROPERTY) - .value("property1") - .build()) - .build()) - .build()) - .value(new DefaultReferenceElement.Builder() - .idShort("refElement2") - .value(new DefaultReference.Builder() - .key(new DefaultKey.Builder() - .idType(KeyType.IRI) - .type(KeyElements.SUBMODEL) - .value("iri:submodel1") - .build()) - .key(new DefaultKey.Builder() - .idType(KeyType.ID_SHORT) - .type(KeyElements.OPERATION) - .value("operation1") - .build()) - .key(new DefaultKey.Builder() - .idType(KeyType.ID_SHORT) - .type(KeyElements.SUBMODEL_ELEMENT_COLLECTION) - .value("submodelElementCollection1") - .build()) - .key(new DefaultKey.Builder() - .idType(KeyType.ID_SHORT) - .type(KeyElements.REFERENCE_ELEMENT) - .value("refElement1") - .build()) - .build()) - .build()) - .build()) - .build()) - .build()) - .build(); - AssetAdministrationShellEnvironment environment = new DefaultAssetAdministrationShellEnvironment.Builder() - .assetAdministrationShells(new DefaultAssetAdministrationShell.Builder() - .identification(new DefaultIdentifier.Builder() - .idType(IdentifierType.IRI) - .identifier("iri:AAS1") - .build()) - .idShort("AAS1") - .submodel(AasUtils.toReference(submodel)) - .build()) - .submodels(submodel) - .build(); - String actual = new AmlSerializer().write(environment, AmlSerializationConfig.builder() - .idGenerator(new IntegerIdGenerator()) - .build()); - System.out.println(actual); - - } - - @Test - public void testEmbeddedDataSpecification() throws SerializationException, SAXException, IOException { - Submodel submodel = new DefaultSubmodel.Builder() - .idShort("submodel1") - .identification(new DefaultIdentifier.Builder() - .idType(IdentifierType.IRI) - .identifier("iri:submodel1") - .build()) - .kind(ModelingKind.INSTANCE) - .embeddedDataSpecification(new DefaultEmbeddedDataSpecification.Builder() - .dataSpecificationContent(new DefaultDataSpecificationIEC61360.Builder() - .dataType(DataTypeIEC61360.INTEGER_COUNT) - .preferredName(new LangString("de", "preferredName1")) - .shortName(new LangString("de", "shortName1")) - .symbol("some symbol1") - .value("value1") - .unit("unit1") - .build()) - .build()) - .embeddedDataSpecification(new DefaultEmbeddedDataSpecification.Builder() - .dataSpecificationContent(new DefaultDataSpecificationIEC61360.Builder() - .dataType(DataTypeIEC61360.INTEGER_COUNT) - .preferredName(new LangString("de", "preferredName2")) - .shortName(new LangString("de", "shortName2")) - .symbol("some symbol2") - .value("value2") - .unit("unit2") - .build()) - .build()) - .build(); - AssetAdministrationShellEnvironment environment = new DefaultAssetAdministrationShellEnvironment.Builder() - .assetAdministrationShells(new DefaultAssetAdministrationShell.Builder() - .identification(new DefaultIdentifier.Builder() - .idType(IdentifierType.IRI) - .identifier("iri:AAS1") - .build()) - .idShort("AAS1") - .submodel(AasUtils.toReference(submodel)) - .build()) - .submodels(submodel) - .build(); - String actual = new AmlSerializer().write(environment, AmlSerializationConfig.builder() - .idGenerator(new IntegerIdGenerator()) - .build()); - System.out.println(actual); - - } - @Test -// @Ignore public void testSAPFullExample() throws SerializationException, SAXException, IOException { validateAmlSerializer(FullExample.FILE, FullExample.ENVIRONMENT); } @@ -209,15 +48,22 @@ private void validateAmlSerializer(File expectedFile, AssetAdministrationShellEn .build()); System.out.println(actual); Diff diff = DiffBuilder - .compare(actual) - .withTest(expected) - // .checkForSimilar() - // .checkForIdentical() + .compare(expected) + .withTest(actual) .normalizeWhitespace() - .withNodeMatcher(new DefaultNodeMatcher(ElementSelectors.byNameAndText)) + .withNodeMatcher(new DefaultNodeMatcher( + ElementSelectors.conditionalBuilder() + .whenElementIsNamed("Attribute") + .thenUse(ElementSelectors.byNameAndAttributes("Name")) + .whenElementIsNamed("InternalElement") + .thenUse(ElementSelectors.byNameAndAttributes("Name", "ID")) + .whenElementIsNamed("ExternalInterface") + .thenUse(ElementSelectors.byNameAndAttributes("Name")) + .elseUse(ElementSelectors.byNameAndText) + .build())) .ignoreComments() .ignoreWhitespace() - .withNodeFilter(node -> !node.getNodeName().equals("LastWritingDateTime")) + .withNodeFilter(node -> !node.getNodeName().equals("AdditionalInformation")) .build(); Iterator iter = diff.getDifferences().iterator(); int size = 0; @@ -225,6 +71,7 @@ private void validateAmlSerializer(File expectedFile, AssetAdministrationShellEn System.out.println(iter.next()); size++; } + System.err.println(String.format("found %d validation error(s)", size)); assert (size == 0); } diff --git a/dataformat-aml/src/test/resources/amlfile/example-motor.xml b/dataformat-aml/src/test/resources/amlfile/example-motor.xml deleted file mode 100644 index 0b56535d..00000000 --- a/dataformat-aml/src/test/resources/amlfile/example-motor.xml +++ /dev/null @@ -1,2890 +0,0 @@ - - - - 0 - - - - - - - - Instance - - - - (Submodel)(local)[IRI]i40.customer.com/type/1/1/F13E8576F6488342 - - - - - - IRI - - - - http://customer.com/assets/KHBVZJSQKIY - - - - - ServoDCMotor - - - - - - - - - - - Instance - - - - (GlobalReference)(no-local)[IRDI]0173-1#02-AAO677#002 - - - - Manufacturer - - - - CONSTANT - - - - CUSTOMER GmbH - - - - - - - - Instance - - - - (GlobalReference)(no-local)[IRDI]0173-1#02-AAY812#001 - - - - GLN - - - - CONSTANT - - - - 10101010 - - - - - - - - Instance - - - - (GlobalReference)(no-local)[IRDI]0173-1#02-AAW338#001 - - - - ProductDesignation - - - - CONSTANT - - - - I40 Capable Servo Motor (EN) - - - - - - - - Instance - - - - (GlobalReference)(no-local)[IRDI]0173-1#02-AAM556#002 - - - - SerialNumber - - - - CONSTANT - - - - P12345678I40 - - - - - Instance - - - - (GlobalReference)(no-local)[IRDI]0173-1#01-ADN198#009 - - - - - - IRI - - - - http://i40.customer.com/type/1/1/F13E8576F6488342 - - - - - Identification - - - - CONSTANT - - - - - - Identification from Manufacturer - - - Hersteller-Identifikation - - - - - - - - - - - Instance - - - - (ConceptDescription)(local)[IRI]http://customer.com/cd/1/1/18EBD56F6B43D89 - - - - RotationSpeed - - - - VARIABLE - - - - - - open circuit, external cooling - - - - 4370 - - - - - - - - Instance - - - - (ConceptDescription)(local)[IRI]http://customer.com/cd/1/1/18EBD56F6B43D896 - - - - Torque - - - - VARIABLE - - - - - - open circuit, external cooling - - - - 117.4 - - - - - Instance - - - - (GlobalReference)(no-local)[IRDI]0173-1#01-AFZ615#016 - - - - - - IRI - - - - http://i40.customer.com/instance/1/1/AC69B1CB44F07935 - - - - - OperationalData - - - - VARIABLE - - - - - - - - - - - - - - Instance - - - - (ConceptDescription)(local)[IRI]www.vdi2770.com/blatt1/Entwurf/Okt18/cd/DocumentId/Val - - - - DocumentId - - - - CONSTANT - - - - 3 608 870 A47 - - - - - - - - Instance - - - - (ConceptDescription)(local)[IRI]www.vdi2770.com/blatt1/Entwurf/Okt18/cd/DocumentClassification/ClassId - - - - DocumentClassId - - - - 03-02 - - - - - - - - Instance - - - - (ConceptDescription)(local)[IRI]www.vdi2770.com/blatt1/Entwurf/Okt18/cd/DocumentClassification/ClassName - - - - DocumentClassName - - - - Operation (EN) Bedienung (DE) - - - - - - - - Instance - - - - (ConceptDescription)(local)[IRI]www.vdi2770.com/blatt1/Entwurf/Okt18/cd/DocumentClassification/ClassificationSystem - - - - DocumentClassificationSystem - - - - VDI2770:2018 - - - - - - - - Instance - - - - (ConceptDescription)(local)[IRI]www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Organization/OrganizationName - - - - OrganizationName - - - - CUSTOMER - - - - - - - - Instance - - - - (ConceptDescription)(local)[IRI]www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Organization/OrganizationOfficialName - - - - OrganizationOfficialName - - - - CUSTOMER GmbH - - - - - - - - Instance - - - - (ConceptDescription)(local)[IRI]www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Description/Title - - - - Title - - - - Operating Manual - - - - - - - - Instance - - - - (ConceptDescription)(local)[IRI]www.vdi2770.com/blatt1/Entwurf/Okt18/cd/DocumentVersion/Language - - - - Language - - - - en-US - - - - - - - - Instance - - - - (ConceptDescription)(local)[IRI]www.vdi2770.com/blatt1/Entwurf/Okt18/cd/StoredDocumentRepresentation/DigitalFile - - - - DigitalFile_PDF - - - - PARAMETER - - - - - application/pdf - - - - /aasx/OperatingManual.pdf - - - - - - false - - - - false - - - - Instance - - - - (ConceptDescription)(local)[IRI]www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Document - - - - OperatingManual - - - - - Instance - - - - - - IRI - - - - http://i40.customer.com/type/1/1/1A7B62B529F1915 - - - - - Documentation - - - - CONSTANT - - - - - - - - - - - Instance - - - - (ConceptDescription)(local)[IRDI]0173-1#02-BAA120#008 - - - - MaxRotationSpeed - - - - PARAMETER - - - - 5000 - - - - - - - - Instance - - - - (ConceptDescription)(local)[IRDI]0173-1#02-BAE098#004 - - - - MaxTorque - - - - PARAMETER - - - - 200 - - - - - - - - (ConceptDescription)(local)[IRDI]0173-1#07-BAB657#003 - - - - Instance - - - - (ConceptDescription)(local)[IRDI]0173-1#02-BAE122#006 - - - - CoolingType - - - - PARAMETER - - - - - - open circuit, external cooling - - - - BAB657 - - - - - Instance - - - - (GlobalReference)(no-local)[IRDI]0173-1#01-AFZ615#016 - - - - - - IRI - - - - http.//i40.customer.com/type/1/1/7A7104BDAB57E184 - - - - - TechnicalData - - - - CONSTANT - - - - - - - IRI - - - - http://customer.com/aas/9175_7013_7091_9168 - - - - - ExampleMotor - - - - CONSTANT - - - - - - Interface Class Library according to Details of the Asset Administration Shell V2.0. - 1.0.0 - - A FileDataReference represents the address to a File. FileDataReference is derived from the - AutomationML Interface Class ExternalDataReference that is defined in AutomationML - BPR_005E_ExternalDataReference_v1.0.0_2:The interface class “ExternalDataReference�? shall be used in order - to reference external documents out of the scope of AutomationML. - - - - Reference to any other referable element of the same of any other AAS or a reference to an external - object or entity. For local references inside the same Asset Administration Shell an InternalLink between - two objects with this interface "ReferableReference" shall be set. In this case the attribute value has to - be empty. For references between different Asset Administration Shells or external objects or entities the - attribute value shall be used and no InternalLink shall be set. - - - Reference to any other referable element of any other AAS or a reference to an external object - or entity. Note: For references to any other referable element of the same AAS InternalLinks are used - and this attribute value shall be empty. - - - - - - - 1.0.0 - - - Mime type of the content of the File. - - - - - Standard Automation Markup Language Interface Class Library - Part 1 Content extended with Part 3 and Part - 4 Content - - 2.2.2 - - - - - - - - - - The attribute refURI is an IRI that can represent an absolute or relative path to an L - document. An added fragment (with #) references inside the document - - - - - - - - - - - - - - - - - - true - - - - - - - - - - - - - Role Class Library according to Details of the Asset Administration Shell V2.0. - 1.0.0 - - An Asset Administration Shell. - - Identifying string of the element within its name space. Constraint AASd-001: In case of a - referable element not being an identifiable element this id is mandatory and used for referring to the - element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore - ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. - Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used - for unique reference in its name space and thus allows better usability and a more performant - implementation. In this case it is similar to the “BrowserPath�? in OPC UA. - - - - - 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. - - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - - - - - - Abstract attribute class for identification. Has the subattributes id and idType. - - - Identifier of the element. Its type is defined in idType. Id is a subproperty of - identification. - - - - - - Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the - enumeration “IdentifierType�?. IdType is a subproperty of identification. - - - - - - - Abstract attribute for administration. Has the subattributes revision and version. - - - Revision of the element. Constraint AASd-005: A revision requires a version. This means, if - there is no version there is no revision neither. Revision is a subproperty of administration. - - - - - - Version of the element. Version is a subproperty of administration. - - - - - - Global reference to the data specification template used by the element. - - - - - The derivedFrom attribute is used to establish a relationship between two Asset Administration - Shells that are derived from each other. - - - - - - - An Asset describes meta data of an asset that is represented by an AAS. The asset may either represent - an asset type or an asset instance. The asset has a globally unique identifier plus – if needed – additional - domain specific (proprietary) identifiers. - - - Identifying string of the element within its name space. Constraint AASd-001: In case of a - referable element not being an identifiable element this id is mandatory and used for referring to the - element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore - ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. - Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used - for unique reference in its name space and thus allows better usability and a more performant - implementation. In this case it is similar to the “BrowserPath�? in OPC UA. - - - - - 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. - - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - Abstract attribute class for identification. Has the subattributes id and idType. - - - Identifier of the element. Its type is defined in idType. - - - - - Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the - enumeration “IdentifierType�?. IdType is a subproperty of identification. - - - - - - - Abstract attribute for administration. Has the subattributes revision and version. - - - Revision of the element. Constraint AASd-005: A revision requires a version. This means, if - there is no version there is no revision neither. Revision is a subproperty of administration. - - - - - - Version of the element. Version is a subproperty of administration. - - - - - - Global reference to the data specification template used by the element. - - - - - Kind of the element: either type or instance. - Instance - Instance - - - - Instance - Type - - - - - - A Submodel defines a specific aspect of the asset represented by the AAS. A submodel is used to - structure the virtual representation and technical functionality of an Administration Shell into distinguishable - parts. Each submodel refers to a well-defined domain or subject matter. Submodels can become standardized and - thus become submodels types. Submodels can have different life-cycles. - - - Identifying string of the element within its name space. Constraint AASd-001: In case of a - referable element not being an identifiable element this id is mandatory and used for referring to the - element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore - ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. - Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used - for unique reference in its name space and thus allows better usability and a more performant - implementation. In this case it is similar to the “BrowserPath�? in OPC UA. - - - - - 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. - - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - Abstract attribute class for identification. Has the subattributes id and idType. - - - Identifier of the element. Its type is defined in idType. Id is a subproperty of - identification. - - - - - - Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the - enumeration “IdentifierType�?. IdType is a subproperty of identification. - - - - - - - Abstract attribute for administration. Has the subattributes revision and version. - - - Revision of the element. Constraint AASd-005: A revision requires a version. This means, if - there is no version there is no revision neither. Revision is a subproperty of administration. - - - - - - Version of the element. Version of the element. Version is a subproperty of administration. - - - - - - - Global reference to the data specification template used by the element. - - - - - Kind of the element: either template or instance. - Instance - Instance - - - - Instance - Type - - - - - Description or comments on the element. The description can be provided in several languages. This - attribute has the name of the label and has a value with the label written in the default language. The - individual languages are modelled as child attributes. The names of the child attributes are the prefix - “aml-lang=�? with the expression of the language in compliance with RFC5646. At it, the values of the child - attributes are the labels within the respective language. - - - - - - A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. - [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. - - - - The type describes the type of the qualifier that is applied to the element. - - - - - The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and - the valueId are present then the value needs to be identical to the value of the referenced coded value - in valueId. - - - - - - Reference to the global unqiue id of a coded value. - - - - - - - A submodel element collection is a set or list of submodel elements. - - Identifying string of the element within its name space. Constraint AASd-001: In case of a - referable element not being an identifiable element this id is mandatory and used for referring to the - element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore - ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. - Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used - for unique reference in its name space and thus allows better usability and a more performant - implementation. In this case it is similar to the “BrowserPath�? in OPC UA. - - - - - 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. - - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - Global reference to the data specification template used by the element. - - - - - Kind of the element: either template or instance. - Instance - Instance - - - - Instance - Type - - - - - Description or comments on the element. The description can be provided in several languages. This - attribute has the name of the label and has a value with the label written in the default language. The - individual languages are modelled as child attributes. The names of the child attributes are the prefix - “aml-lang=�? with the expression of the language in compliance with RFC5646. At it, the values of the child - attributes are the labels within the respective language. - - - - - - A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. - [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. - - - - The type describes the type of the qualifier that is applied to the element. - - - - - The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and - the valueId are present then the value needs to be identical to the value of the referenced coded value - in valueId. - - - - - - Reference to the global unqiue id of a coded value. - - - - - - If allowDuplicates=true, then it is allowed that the collection contains the same element several - times. - - false - - - - If ordered=false, then the elements in the property collection are not ordered. If ordered=true - then the elements in the collection are ordered. Default = false. Note: An ordered submodel element - collection is typically implemented as an indexed array. - - false - - - - Submodel element contained in the collection. - - - - - A BLOB is a data element that represents a file that is contained with its source code in the value - attribute. - - - Identifying string of the element within its name space. Constraint AASd-001: In case of a - referable element not being an identifiable element this id is mandatory and used for referring to the - element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore - ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. - Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used - for unique reference in its name space and thus allows better usability and a more performant - implementation. In this case it is similar to the “BrowserPath�? in OPC UA. - - - - - 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. - - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - Global reference to the data specification template used by the element. - - - - - Kind of the element: either template or instance. - Instance - Instance - - - - Instance - Type - - - - - Description or comments on the element. The description can be provided in several languages. This - attribute has the name of the label and has a value with the label written in the default language. The - individual languages are modelled as child attributes. The names of the child attributes are the prefix - “aml-lang=�? with the expression of the language in compliance with RFC5646. At it, the values of the child - attributes are the labels within the respective language. - - - - - - A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. - [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. - - - - The type describes the type of the qualifier that is applied to the element. - - - - - The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and - the valueId are present then the value needs to be identical to the value of the referenced coded value - in valueId. - - - - - - Reference to the global unqiue id of a coded value. - - - - - - Mime type of the content of the BLOB. The mime type states which file extension the file has. Valid - values are e.g. “application/json�?, “application/xls�?, �?image/jpg�?. The allowed values are defined as in - RFC2046. - - - - - - The value of the BLOB instance of a blob data element. Note: In contrast to the file property the - file content is stored directly as value in the Blob data element. - - - - - - - A capability is the implementation-independent description of the potential of an asset to achieve a - certain effect in the physical or virtual world. - - - Identifying string of the element within its name space. Constraint AASd-001: In case of a - referable element not being an identifiable element this id is mandatory and used for referring to the - element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore - ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. - Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used - for unique reference in its name space and thus allows better usability and a more performant - implementation. In this case it is similar to the “BrowserPath�? in OPC UA. - - - - - 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. - - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - Global reference to the data specification template used by the element. - - - - - Kind of the element: either template or instance. - Instance - Instance - - - - Instance - Type - - - - - Description or comments on the element. The description can be provided in several languages. This - attribute has the name of the label and has a value with the label written in the default language. The - individual languages are modelled as child attributes. The names of the child attributes are the prefix - “aml-lang=�? with the expression of the language in compliance with RFC5646. At it, the values of the child - attributes are the labels within the respective language. - - - - - - A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. - [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. - - - - The type describes the type of the qualifier that is applied to the element. - - - - - The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and - the valueId are present then the value needs to be identical to the value of the referenced coded value - in valueId. - - - - - - Reference to the global unqiue id of a coded value. - - - - - - - A role class for a File that a data element that represents an address to a file. It is derived from - the AutomationML role class ExternalData that is an role type for a document type and the base class for all - document type roles. It describes different document types. ExternalData is defined in AutomationML - BPR_005E_ExternalDataReference_v1.0.0_2. - - - Identifying string of the element within its name space. Constraint AASd-001: In case of a - referable element not being an identifiable element this id is mandatory and used for referring to the - element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore - ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. - Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used - for unique reference in its name space and thus allows better usability and a more performant - implementation. In this case it is similar to the “BrowserPath�? in OPC UA. - - - - - 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. - - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - Global reference to the data specification template used by the element. - - - - - Kind of the element: either template or instance. - Instance - Instance - - - - Instance - Type - - - - - Description or comments on the element. The description can be provided in several languages. This - attribute has the name of the label and has a value with the label written in the default language. The - individual languages are modelled as child attributes. The names of the child attributes are the prefix - “aml-lang=�? with the expression of the language in compliance with RFC5646. At it, the values of the child - attributes are the labels within the respective language. - - - - - - A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. - [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. - - - - The type describes the type of the qualifier that is applied to the element. - - - - - The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and - the valueId are present then the value needs to be identical to the value of the referenced coded value - in valueId. - - - - - - Reference to the global unqiue id of a coded value. - - - - - - - The attribute refURI is an IRI that can represent an absolute or relative path to an L - document. An added fragment (with #) references inside the document - - - - Mime type of the content of the File. - - - - - A property is a data element that has a single value. - - Identifying string of the element within its name space. Constraint AASd-001: In case of a - referable element not being an identifiable element this id is mandatory and used for referring to the - element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore - ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. - Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used - for unique reference in its name space and thus allows better usability and a more performant - implementation. In this case it is similar to the “BrowserPath�? in OPC UA. - - - - - 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. - - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - Global reference to the data specification template used by the element. - - - - - Kind of the element: either template or instance. - Instance - Instance - - - - Instance - Type - - - - - Description or comments on the element. The description can be provided in several languages. This - attribute has the name of the label and has a value with the label written in the default language. The - individual languages are modelled as child attributes. The names of the child attributes are the prefix - “aml-lang=�? with the expression of the language in compliance with RFC5646. At it, the values of the child - attributes are the labels within the respective language. - - - - - - A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. - [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. - - - - The type describes the type of the qualifier that is applied to the element. - - - - - The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and - the valueId are present then the value needs to be identical to the value of the referenced coded value - in valueId. - - - - - - Reference to the global unqiue id of a coded value. - - - - - - The value of the property instance. - - - - Reference to the global unique id if a coded value. - - - - - A reference element is a data element that defines a logical reference to another element within the - same or another AAS or a reference to an external object or entity. - - - Identifying string of the element within its name space. Constraint AASd-001: In case of a - referable element not being an identifiable element this id is mandatory and used for referring to the - element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore - ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. - Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used - for unique reference in its name space and thus allows better usability and a more performant - implementation. In this case it is similar to the “BrowserPath�? in OPC UA. - - - - - 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. - - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - Global reference to the data specification template used by the element. - - - - - Kind of the element: either template or instance. - Instance - Instance - - - - Instance - Type - - - - - Description or comments on the element. The description can be provided in several languages. This - attribute has the name of the label and has a value with the label written in the default language. The - individual languages are modelled as child attributes. The names of the child attributes are the prefix - “aml-lang=�? with the expression of the language in compliance with RFC5646. At it, the values of the child - attributes are the labels within the respective language. - - - - - - A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. - [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. - - - - The type describes the type of the qualifier that is applied to the element. - - - - - The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and - the valueId are present then the value needs to be identical to the value of the referenced coded value - in valueId. - - - - - - Reference to the global unqiue id of a coded value. - - - - - - - Reference to any other referable element of any other AAS or a reference to an external object - or entity. Note: For references to any other referable elment of the same AAS InternalLinks are used and - this attribute value shall be empty. - - - - - - - A relationship element is used to define a relationship between two referable elements. - - Identifying string of the element within its name space. Constraint AASd-001: In case of a - referable element not being an identifiable element this id is mandatory and used for referring to the - element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore - ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. - Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used - for unique reference in its name space and thus allows better usability and a more performant - implementation. In this case it is similar to the “BrowserPath�? in OPC UA. - - - - - 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. - - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - Global reference to the data specification template used by the element. - - - - - Kind of the element: either template or instance. - Instance - Instance - - - - Instance - Type - - - - - Description or comments on the element. The description can be provided in several languages. This - attribute has the name of the label and has a value with the label written in the default language. The - individual languages are modelled as child attributes. The names of the child attributes are the prefix - “aml-lang=�? with the expression of the language in compliance with RFC5646. At it, the values of the child - attributes are the labels within the respective language. - - - - - - A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. - [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. - - - - The type describes the type of the qualifier that is applied to the element. - - - - - The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and - the valueId are present then the value needs to be identical to the value of the referenced coded value - in valueId. - - - - - - Reference to the global unqiue id of a coded value. - - - - - - - Reference to any other referable element of any other AAS or a reference to an external object - or entity. Note: For references to any other referable elment of the same AAS InternalLinks are used and - this attribute value shall be empty. - - - - - - Reference to any other referable element of any other AAS or a reference to an external object - or entity. Note: For references to any other referable elment of the same AAS InternalLinks are used and - this attribute value shall be empty. - - - - - - An annotated relationship element is an relationship element that can be annotated with additional data - elements. - - - Annotations that hold for the relationships between the two elements. - - - - - An operation is a submodel element with input and output variables. - - Identifying string of the element within its name space. Constraint AASd-001: In case of a - referable element not being an identifiable element this id is mandatory and used for referring to the - element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore - ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. - Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used - for unique reference in its name space and thus allows better usability and a more performant - implementation. In this case it is similar to the “BrowserPath�? in OPC UA. - - - - - 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. - - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - Global reference to the data specification template used by the element. - - - - - Kind of the element: either template or instance. - Instance - Instance - - - - Instance - Type - - - - - Description or comments on the element. The description can be provided in several languages. This - attribute has the name of the label and has a value with the label written in the default language. The - individual languages are modelled as child attributes. The names of the child attributes are the prefix - “aml-lang=�? with the expression of the language in compliance with RFC5646. At it, the values of the child - attributes are the labels within the respective language. - - - - - - A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. - [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. - - - - The type describes the type of the qualifier that is applied to the element. - - - - - The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and - the valueId are present then the value needs to be identical to the value of the referenced coded value - in valueId. - - - - - - Reference to the global unqiue id of a coded value. - - - - - - - The list of AAS OperationVariableIn entities. In AML, the corresponding InternalElement with this role - is a child of the InternalElement with the Operation role. - - - - The list of AAS OperationVariableOut entities. In AML, the corresponding InternalElement with this role - is a child of the InternalElement with the Operation role. - - - - The list of AAS OperationVariableOut entities. In AML, the corresponding InternalElement with this role - is a child of the InternalElement with the Operation role. - - - - A view is a collection of referable elements w.r.t. to a specific viewpoint of one or more - stakeholders. - - - Identifying string of the element within its name space. Constraint AASd-001: In case of a - referable element not being an identifiable element this id is mandatory and used for referring to the - element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore - ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. - Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used - for unique reference in its name space and thus allows better usability and a more performant - implementation. In this case it is similar to the “BrowserPath�? in OPC UA. - - - - - 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. - - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - Global reference to the data specification template used by the element. - - - - - Description or comments on the element. The description can be provided in several languages. This - attribute has the name of the label and has a value with the label written in the default language. The - individual languages are modelled as child attributes. The names of the child attributes are the prefix - “aml-lang=�? with the expression of the language in compliance with RFC5646. At it, the values of the child - attributes are the labels within the respective language. - - - - - - - A dictionary contains elements that can be reused. - - Identifying string of the element within its name space. Constraint AASd-001: In case of a - referable element not being an identifiable element this id is mandatory and used for referring to the - element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore - ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. - Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used - for unique reference in its name space and thus allows better usability and a more performant - implementation. In this case it is similar to the “BrowserPath�? in OPC UA. - - - - - 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. - - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - - - - - - - Explanation: The semantics of a property or other elements that may have a semantic description is - defined by a concept description. The description of the concept should follow a standardized schema (realized - as data specification template). - - - Identifying string of the element within its name space. Constraint AASd-001: In case of a - referable element not being an identifiable element this id is mandatory and used for referring to the - element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore - ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. - Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used - for unique reference in its name space and thus allows better usability and a more performant - implementation. In this case it is similar to the “BrowserPath�? in OPC UA. - - - - - 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. - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - Abstract attribute class for identification. Has the subattributes id and idType. - - - Identifier of the element. Its type is defined in idType. Id is a subproperty of - identification. - - - - - - Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the - enumeration “IdentifierType�?. IdType is a subproperty of identification. - - - - - - - Abstract attribute for administration. Has the subattributes revision and version. - - - Revision of the element. Constraint AASd-005: A revision requires a version. This means, if - there is no version there is no revision neither. Revision is a subproperty of administration. - - - - - - Version of the element. Version is a subproperty of administration. - - - - - - Global reference to the data specification template used by the element. - - - - Global reference to an external definition the concept is compatible to or was derived from. - - - - - - - Description Role class of an element that has a data specification template. A template defines the - additional attributes an element may or shall have. - - - Identifying string of the element within its name space. Constraint AASd-001: In case of a - referable element not being an identifiable element this id is mandatory and used for referring to the - element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore - ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. - Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used - for unique reference in its name space and thus allows better usability and a more performant - implementation. In this case it is similar to the “BrowserPath�? in OPC UA. - - - - - 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. - - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - - - - - - Abstract attribute class for identification. Has the subattributes id and idType. - - - Identifier of the element. Its type is defined in idType. Id is a subproperty of - identification. - - - - - - Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the - enumeration “IdentifierType�?. IdType is a subproperty of identification. - - - - - - - Abstract attribute for administration. Has the subattributes revision and version. - - - Revision of the element. Constraint AASd-005: A revision requires a version. This means, if - there is no version there is no revision neither. Revision is a subproperty of administration. - - - - - - Version of the element. Version is a subproperty of administration. - - - - - - - Content of the data specification template. - - - - 1.0.0 - - - - Automation Markup Language Base Role Class Library - Part 1 Content extended with Part 3 and Part 4 - Content - - 2.2.2 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - - An AAS Data Specification template for IEC61369. A template consists of the DataSpecificationContent - containing the additional attributes to be added to the element instance that references the data specification - template and meta information about the template itself (this is why DataSpecification inherits from - Identifiable). In UML these are two separated classes. - - - Identifying string of the element within its name space. Constraint AASd-001: In case of a - referable element not being an identifiable element this id is mandatory and used for referring to the - element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore - ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. - Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used - for unique reference in its name space and thus allows better usability and a more performant - implementation. In this case it is similar to the “BrowserPath�? in OPC UA. - - - - - 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. - - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - - - - - - Abstract attribute class for identification. Has the subattributes id and idType. - - - Identifier of the element. Its type is defined in idType. Id is a subproperty of - identification. - - http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360 - - - - Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the - enumeration “IdentifierType�?. IdType is a subproperty of identification. - - IRI - - - - - Abstract attribute for administration. Has the subattributes revision and version. - - - Revision of the element. Constraint AASd-005: A revision requires a version. This means, if - there is no version there is no revision neither. Revision is a subproperty of administration. - - - - - - Version of the element. Version is a subproperty of administration. - - - - - - - The content of an AAS Data Specification template for IEC61360. - - Identifies the attribute hierarchy for preferredName in above attribute hierachy. Subordinate - attributes are designated by the country code information (see aml-lang literal). - - - - - Identifies the attribute for shortName in above attribute hierarchy. - - - - Identifies the attribute for unit in above attribute hierarchy. - - - - Identifies the attribute for unitId in above attribute hierarchy in its string serialization. - - - - - Identifies the attribute for sourceOfDefinition in above attribute hierachy. Subordinate - attributes are designated by the country code information (see aml-lang literal). - - - - - Identifies the attribute for symbol in above attribute hierarchy. - - - - Identifies the attribute for dataType in above attribute hierarchy. - - - - Identifies the attribute for definition in above attribute hierachy. Subordinate attributes are - designated by the country code information (see aml-lang literal). - - - - - Identifies the attribute for valueFormat in above attribute hierarchy. - - - - Identifies the attribute for valueList in above attribute hierarchy. - - - - The attribute value. - - - - The id for the value. - - - - - - - - 0 - - \ No newline at end of file diff --git a/dataformat-aml/src/test/resources/amlfile/example_test.aml b/dataformat-aml/src/test/resources/amlfile/example_test.aml deleted file mode 100644 index e0dca540..00000000 --- a/dataformat-aml/src/test/resources/amlfile/example_test.aml +++ /dev/null @@ -1,2608 +0,0 @@ - - - - - - foo - bar - 03-08-2021 15:40:37 - - - - - - - - 0 - - - - 0.9 - - - - - - - INSTANCE - - - - (ASSET)[IRI]https://acplt.org/Test_Asset - - - - - (ASSET_ADMINISTRATION_SHELL)[IRI]https://acplt.org/TestAssetAdministrationShell2 - - - - - - An Example Asset Administration Shell for the test application - - - Ein Beispiel-Verwaltungsschale für eine Test-Anwendung - - - - TestAssetAdministrationShell - - - - - - IRI - - - - https://acplt.org/Test_AssetAdministrationShell - - - - - - - - 0 - - - - 0.9 - - - - - - - An example asset identification submodel for the test application - - - Ein Beispiel-Identifikations-Submodel für eine Test-Anwendung - - - - Identification - - - - - - IRI - - - - http://acplt.org/Submodels/Assets/TestAsset/Identification - - - - - INSTANCE - - - - (SUBMODEL)[IRI]http://acplt.org/SubmodelTemplates/AssetIdentification - - - - - Parameter - - - - - - Example Reference Element object - - - Beispiel Reference Element Element - - - - ExampleReferenceElement - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ReferenceElements/ExampleReferenceElement - - - - - - - - - Parameter - - - - - - Example File object - - - Beispiel File Element - - - - ExampleFile - - - - application/pdf - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Files/ExampleFile - - - - /TestFile.pdf - - - - - application/pdf - - - /TestFile.pdf - - - - - - - Parameter - - - - - - Example Operation object - - - Beispiel Operation Element - - - - ExampleOperation - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Operations/ExampleOperation - - - - - - - Constant - - - - - - Example Property object - - - Beispiel Property Element - - - - ExampleProperty - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty - - - - exampleValue - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId - - - - string - - - - - - - - - - Constant - - - - - - Example Property object - - - Beispiel Property Element - - - - ExampleProperty - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty - - - - exampleValue - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId - - - - string - - - - - - - - - - Constant - - - - - - Example Property object - - - Beispiel Property Element - - - - ExampleProperty - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty - - - - exampleValue - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId - - - - string - - - - - - - - - - - - - - - 0.9 - - - - - - - An example bill of material submodel for the test application - - - Ein Beispiel-BillofMaterial-Submodel für eine Test-Anwendung - - - - BillOfMaterial - - - - - - IRI - - - - http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial - - - - - TEMPLATE - - - - - - http://acplt.org/Qualifier/ExampleQualifier - - - - 100 - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId - - - - int - - - - - - - http://acplt.org/Qualifier/ExampleQualifier2 - - - - 50 - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId - - - - int - - - - - (SUBMODEL)[IRI]http://acplt.org/SubmodelTemplates/BillOfMaterial - - - - - - - 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. - - - 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 - - - - CO_MANAGED_ENTITY - - - - ExampleEntity - - - - (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber - - - - - Constant - - - - - - Example Property object - - - Beispiel Property Element - - - - ExampleProperty2 - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty - - - - exampleValue2 - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId - - - - string - - - - - - - Constant - - - - - - Example Property object - - - Beispiel Property Element - - - - ExampleProperty - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty - - - - exampleValue - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId - - - - string - - - - - - - - - - - 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. - - - 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 - - - - SELF_MANAGED_ENTITY - - - - (ASSET)[IRI]https://acplt.org/Test_Asset2 - - - - ExampleEntity2 - - - - (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber - - - - - - - - - - - - - - - 0 - - - - 0.9 - - - - - - - An example concept description for the test application - - - Ein Beispiel-ConceptDescription für eine Test-Anwendung - - - - TestConceptDescription - - - - - - IRI - - - - https://acplt.org/Test_ConceptDescription - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/DataSpecifications/ConceptDescriptions/TestConceptDescription - - - - - REAL_MEASURE - - - - - - Dies ist eine Data Specification für Testzwecke - - - This is a DataSpecification for testing purposes - - - - - - Test Specification - - - TestSpecification - - - - - - Test Spec - - - TestSpec - - - - http://acplt.org/DataSpec/ExampleDef - - - - SU - - - - SpaceUnit - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Units/SpaceUnit - - - - TEST - - - - string - - - - - - - REAL_MEASURE - - - - - - Dies ist eine Data Specification für Testzwecke2 - - - This is a DataSpecification for testing purposes2 - - - - - - Test Specification2 - - - TestSpecification2 - - - - - - Test Spec2 - - - TestSpec2 - - - - http://acplt.org/DataSpec/ExampleDef - - - - SU - - - - SpaceUnit - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Units/SpaceUnit - - - - TEST2 - - - - string - - - - - - - - - Interface Class Library according to Details of the Asset Administration Shell V2.0. - 1.0.0 - - A FileDataReference represents the address to a File. FileDataReference is derived from the AutomationML Interface Class ExternalDataReference that is defined in AutomationML BPR_005E_ExternalDataReference_v1.0.0_2:The interface class “ExternalDataReference” shall be used in order to reference external documents out of the scope of AutomationML. - - - Reference to any other referable element of the same of any other AAS or a reference to an external object or entity. For local references inside the same Asset Administration Shell an InternalLink between two objects with this interface "ReferableReference" shall be set. In this case the attribute value has to be empty. For references between different Asset Administration Shells or external objects or entities the attribute value shall be used and no InternalLink shall be set. - - Reference to any other referable element of any other AAS or a reference to an external object or entity. Note: For references to any other referable element of the same AAS InternalLinks are used and this attribute value shall be empty. - - - - - - Standard Automation Markup Language Interface Class Library - Part 1 Content extended with Part 3 and Part 4 Content - 2.2.2 - - - - - - - - - - The attribute refURI is an IRI that can represent an absolute or relative path to an L document. An added fragment (with #) references inside the document - - - - - - - - - - - - - - - - - true - - - - - - - - - - - - - 1.0.0 - - - Mime type of the content of the File. - - - - - Role Class Library according to Details of the Asset Administration Shell V2.0. - 1.0.0 - - An Asset Administration Shell. - - Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - 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. - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - - - - - Abstract attribute class for identification. Has the subattributes id and idType. - - - Identifier of the element. Its type is defined in idType. Id is a subproperty of identification. - - - - - Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the enumeration “IdentifierType”. IdType is a subproperty of identification. - - - - - - Abstract attribute for administration. Has the subattributes revision and version. - - - Revision of the element. Constraint AASd-005: A revision requires a version. This means, if there is no version there is no revision neither. Revision is a subproperty of administration. - - - - - Version of the element. Version is a subproperty of administration. - - - - - - Global reference to the data specification template used by the element. - - - - - The derivedFrom attribute is used to establish a relationship between two Asset Administration Shells that are derived from each other. - - - - - - An Asset describes meta data of an asset that is represented by an AAS. The asset may either represent an asset type or an asset instance. The asset has a globally unique identifier plus – if needed – additional domain specific (proprietary) identifiers. - - Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - 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. - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - Abstract attribute class for identification. Has the subattributes id and idType. - - - Identifier of the element. Its type is defined in idType. - - - - - Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the enumeration “IdentifierType”. IdType is a subproperty of identification. - - - - - - Abstract attribute for administration. Has the subattributes revision and version. - - - Revision of the element. Constraint AASd-005: A revision requires a version. This means, if there is no version there is no revision neither. Revision is a subproperty of administration. - - - - - Version of the element. Version is a subproperty of administration. - - - - - - Global reference to the data specification template used by the element. - - - - - Kind of the asset: either type or instance. - Instance - Instance - - - - Instance - Type - - - - - - A Submodel defines a specific aspect of the asset represented by the AAS. A submodel is used to structure the virtual representation and technical functionality of an Administration Shell into distinguishable parts. Each submodel refers to a well-defined domain or subject matter. Submodels can become standardized and thus become submodels types. Submodels can have different life-cycles. - - Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - 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. - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - Abstract attribute class for identification. Has the subattributes id and idType. - - - Identifier of the element. Its type is defined in idType. Id is a subproperty of identification. - - - - - Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the enumeration “IdentifierType”. IdType is a subproperty of identification. - - - - - - Abstract attribute for administration. Has the subattributes revision and version. - - - Revision of the element. Constraint AASd-005: A revision requires a version. This means, if there is no version there is no revision neither. Revision is a subproperty of administration. - - - - - Version of the element. Version of the element. Version is a subproperty of administration. - - - - - - Global reference to the data specification template used by the element. - - - - - Kind of the element: either template or instance. - Instance - Instance - - - - Instance - Type - - - - - Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. - - - - - A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. - - - The type describes the type of the qualifier that is applied to the element. - - - - - The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. - - - - - Reference to the global unqiue id of a coded value. - - - - - - - A submodel element collection is a set or list of submodel elements. - - Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - 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. - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - Global reference to the data specification template used by the element. - - - - - Kind of the element: either template or instance. - Instance - Instance - - - - Instance - Type - - - - - Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. - - - - - A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. - - - The type describes the type of the qualifier that is applied to the element. - - - - - The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. - - - - - Reference to the global unqiue id of a coded value. - - - - - - If allowDuplicates=true, then it is allowed that the collection contains the same element several times. - false - - - - If ordered=false, then the elements in the property collection are not ordered. If ordered=true then the elements in the collection are ordered. Default = false. Note: An ordered submodel element collection is typically implemented as an indexed array. - false - - - - Submodel element contained in the collection. - - - - - A BLOB is a data element that represents a file that is contained with its source code in the value attribute. - - Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - 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. - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - Global reference to the data specification template used by the element. - - - - - Kind of the element: either template or instance. - Instance - Instance - - - - Instance - Type - - - - - Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. - - - - - A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. - - - The type describes the type of the qualifier that is applied to the element. - - - - - The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. - - - - - Reference to the global unqiue id of a coded value. - - - - - - Mime type of the content of the BLOB. The mime type states which file extension the file has. Valid values are e.g. “application/json”, “application/xls”, ”image/jpg”. The allowed values are defined as in RFC2046. - - - - - The value of the BLOB instance of a blob data element. Note: In contrast to the file property the file content is stored directly as value in the Blob data element. - - - - - - A capability is the implementation-independent description of the potential of an asset to achieve a certain effect in the physical or virtual world. - - Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - 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. - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - Global reference to the data specification template used by the element. - - - - - Kind of the element: either template or instance. - Instance - Instance - - - - Instance - Type - - - - - Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. - - - - - A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. - - - The type describes the type of the qualifier that is applied to the element. - - - - - The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. - - - - - Reference to the global unqiue id of a coded value. - - - - - - - A role class for a File that a data element that represents an address to a file. It is derived from the AutomationML role class ExternalData that is an role type for a document type and the base class for all document type roles. It describes different document types. ExternalData is defined in AutomationML BPR_005E_ExternalDataReference_v1.0.0_2. - - Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - 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. - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - Global reference to the data specification template used by the element. - - - - - Kind of the element: either template or instance. - Instance - Instance - - - - Instance - Type - - - - - Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. - - - - - A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. - - - The type describes the type of the qualifier that is applied to the element. - - - - - The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. - - - - - Reference to the global unqiue id of a coded value. - - - - - - - The attribute refURI is an IRI that can represent an absolute or relative path to an L document. An added fragment (with #) references inside the document - - - Mime type of the content of the File. - - - - - A property is a data element that has a single value. - - Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - 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. - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - Global reference to the data specification template used by the element. - - - - - Kind of the element: either template or instance. - Instance - Instance - - - - Instance - Type - - - - - Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. - - - - - A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. - - - The type describes the type of the qualifier that is applied to the element. - - - - - The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. - - - - - Reference to the global unqiue id of a coded value. - - - - - - The value of the property instance. - - - - Reference to the global unique id if a coded value. - - - - - A reference element is a data element that defines a logical reference to another element within the same or another AAS or a reference to an external object or entity. - - Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - 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. - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - Global reference to the data specification template used by the element. - - - - - Kind of the element: either template or instance. - Instance - Instance - - - - Instance - Type - - - - - Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. - - - - - A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. - - - The type describes the type of the qualifier that is applied to the element. - - - - - The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. - - - - - Reference to the global unqiue id of a coded value. - - - - - - - Reference to any other referable element of any other AAS or a reference to an external object or entity. Note: For references to any other referable elment of the same AAS InternalLinks are used and this attribute value shall be empty. - - - - - - A relationship element is used to define a relationship between two referable elements. - - Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - 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. - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - Global reference to the data specification template used by the element. - - - - - Kind of the element: either template or instance. - Instance - Instance - - - - Instance - Type - - - - - Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. - - - - - A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. - - - The type describes the type of the qualifier that is applied to the element. - - - - - The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. - - - - - Reference to the global unqiue id of a coded value. - - - - - - - Reference to any other referable element of any other AAS or a reference to an external object or entity. Note: For references to any other referable elment of the same AAS InternalLinks are used and this attribute value shall be empty. - - - - - Reference to any other referable element of any other AAS or a reference to an external object or entity. Note: For references to any other referable elment of the same AAS InternalLinks are used and this attribute value shall be empty. - - - - - An annotated relationship element is an relationship element that can be annotated with additional data elements. - - Annotations that hold for the relationships between the two elements. - - - - - An operation is a submodel element with input and output variables. - - Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - 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. - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - Global reference to the data specification template used by the element. - - - - - Kind of the element: either template or instance. - Instance - Instance - - - - Instance - Type - - - - - Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. - - - - - A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. - - - The type describes the type of the qualifier that is applied to the element. - - - - - The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. - - - - - Reference to the global unqiue id of a coded value. - - - - - - - The list of AAS OperationVariableIn entities. In AML, the corresponding InternalElement with this role is a child of the InternalElement with the Operation role. - - - The list of AAS OperationVariableOut entities. In AML, the corresponding InternalElement with this role is a child of the InternalElement with the Operation role. - - - The list of AAS OperationVariableOut entities. In AML, the corresponding InternalElement with this role is a child of the InternalElement with the Operation role. - - - A view is a collection of referable elements w.r.t. to a specific viewpoint of one or more stakeholders. - - Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - 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. - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - Global reference to the data specification template used by the element. - - - - - Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. - - - - - - A dictionary contains elements that can be reused. - - Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - 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. - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - - - - - - Explanation: The semantics of a property or other elements that may have a semantic description is defined by a concept description. The description of the concept should follow a standardized schema (realized as data specification template). - - Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - 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. - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - Abstract attribute class for identification. Has the subattributes id and idType. - - - Identifier of the element. Its type is defined in idType. Id is a subproperty of identification. - - - - - Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the enumeration “IdentifierType”. IdType is a subproperty of identification. - - - - - - Abstract attribute for administration. Has the subattributes revision and version. - - - Revision of the element. Constraint AASd-005: A revision requires a version. This means, if there is no version there is no revision neither. Revision is a subproperty of administration. - - - - - Version of the element. Version is a subproperty of administration. - - - - - - Global reference to the data specification template used by the element. - - - - Global reference to an external definition the concept is compatible to or was derived from. - - - - - - Description Role class of an element that has a data specification template. A template defines the additional attributes an element may or shall have. - - Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - 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. - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - - - - - Abstract attribute class for identification. Has the subattributes id and idType. - - - Identifier of the element. Its type is defined in idType. Id is a subproperty of identification. - - - - - Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the enumeration “IdentifierType”. IdType is a subproperty of identification. - - - - - - Abstract attribute for administration. Has the subattributes revision and version. - - - Revision of the element. Constraint AASd-005: A revision requires a version. This means, if there is no version there is no revision neither. Revision is a subproperty of administration. - - - - - Version of the element. Version is a subproperty of administration. - - - - - - - Content of the data specification template. - - - An entity is a submodel element that is used to model entities. Constraint AASd-056: If the semanticId of a Entity submodel element references a ConceptDescription then the ConceptDescription/category shall be one of following values: ENTITY. The ConceptDescription describes the elements assigned to the entity via Entity/statement. - - Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - 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. - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - Global reference to the data specification template used by the element. - - - - - Kind of the element: either template or instance. - Instance - Instance - - - - Instance - Type - - - - - Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. - - - - - A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. - - - The type describes the type of the qualifier that is applied to the element. - - - - - The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. - - - - - Reference to the global unqiue id of a coded value. - - - - - - Describes statements applicable to the entity by a set of submodel elements, typically with a qualified value. - - - - Describes whether the entity is a co-managed entity or a self-managed entity. - SelfManagedEntity - SelfManagedEntity - - - - CoManagedEntity - SelfManagedEntity - - - - - Reference to an identifier key value pair representing a specific identifier of the asset represented by the asset administration shell. See Constraint AASd-014 - - - - Reference to the asset the entity is representing. Constraint AASd-014: Either the attribute globalAssetId or specificAssetId of an Entity must be set if Entity/entityType is set to "SelfManagedEntity". They are not existing otherwise. - - - - - - Automation Markup Language Base Role Class Library - Part 1 Content extended with Part 3 and Part 4 Content - 2.2.2 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1.0.0 - - - - - - - - 0 - - - - 0.9 - - - - - - - INSTANCE - - - - (ASSET)[IRI]https://acplt.org/Test_Asset - - - - - (ASSET_ADMINISTRATION_SHELL)[IRI]https://acplt.org/TestAssetAdministrationShell2 - - - - - - An Example Asset Administration Shell for the test application - - - Ein Beispiel-Verwaltungsschale für eine Test-Anwendung - - - - TestAssetAdministrationShell - - - - - - IRI - - - - https://acplt.org/Test_AssetAdministrationShell - - - - - - - - 0 - - - - 0.9 - - - - - - - An example asset identification submodel for the test application - - - Ein Beispiel-Identifikations-Submodel für eine Test-Anwendung - - - - Identification - - - - - - IRI - - - - http://acplt.org/Submodels/Assets/TestAsset/Identification - - - - - INSTANCE - - - - (SUBMODEL)[IRI]http://acplt.org/SubmodelTemplates/AssetIdentification - - - - - Parameter - - - - - - Example Reference Element object - - - Beispiel Reference Element Element - - - - ExampleReferenceElement - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ReferenceElements/ExampleReferenceElement - - - - - - - - - Parameter - - - - - - Example File object - - - Beispiel File Element - - - - ExampleFile - - - - application/pdf - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Files/ExampleFile - - - - /TestFile.pdf - - - - - application/pdf - - - /TestFile.pdf - - - - - - - Parameter - - - - - - Example Operation object - - - Beispiel Operation Element - - - - ExampleOperation - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Operations/ExampleOperation - - - - - - - Constant - - - - - - Example Property object - - - Beispiel Property Element - - - - ExampleProperty - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty - - - - exampleValue - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId - - - - string - - - - - - - - - - Constant - - - - - - Example Property object - - - Beispiel Property Element - - - - ExampleProperty - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty - - - - exampleValue - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId - - - - string - - - - - - - - - - Constant - - - - - - Example Property object - - - Beispiel Property Element - - - - ExampleProperty - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty - - - - exampleValue - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId - - - - string - - - - - - - - - - - - - - - 0.9 - - - - - - - An example bill of material submodel for the test application - - - Ein Beispiel-BillofMaterial-Submodel für eine Test-Anwendung - - - - BillOfMaterial - - - - - - IRI - - - - http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial - - - - - TEMPLATE - - - - - - http://acplt.org/Qualifier/ExampleQualifier - - - - 100 - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId - - - - int - - - - - - - http://acplt.org/Qualifier/ExampleQualifier2 - - - - 50 - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId - - - - int - - - - - (SUBMODEL)[IRI]http://acplt.org/SubmodelTemplates/BillOfMaterial - - - - - - - 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. - - - 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 - - - - CO_MANAGED_ENTITY - - - - ExampleEntity - - - - (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber - - - - - Constant - - - - - - Example Property object - - - Beispiel Property Element - - - - ExampleProperty2 - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty - - - - exampleValue2 - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId - - - - string - - - - - - - Constant - - - - - - Example Property object - - - Beispiel Property Element - - - - ExampleProperty - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty - - - - exampleValue - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId - - - - string - - - - - - - - - - - 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. - - - 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 - - - - SELF_MANAGED_ENTITY - - - - (ASSET)[IRI]https://acplt.org/Test_Asset2 - - - - ExampleEntity2 - - - - (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber - - - - - - - - - - - - - 0.9 - - - - - - - An example bill of material submodel for the test application - - - Ein Beispiel-BillofMaterial-Submodel für eine Test-Anwendung - - - - BillOfMaterial - - - - - - IRI - - - - http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial - - - - - TEMPLATE - - - - - - http://acplt.org/Qualifier/ExampleQualifier - - - - 100 - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId - - - - int - - - - - - - http://acplt.org/Qualifier/ExampleQualifier2 - - - - 50 - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId - - - - int - - - - - (SUBMODEL)[IRI]http://acplt.org/SubmodelTemplates/BillOfMaterial - - - - - - - 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. - - - 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 - - - - CO_MANAGED_ENTITY - - - - ExampleEntity - - - - (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber - - - - - Constant - - - - - - Example Property object - - - Beispiel Property Element - - - - ExampleProperty2 - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty - - - - exampleValue2 - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId - - - - string - - - - - - - Constant - - - - - - Example Property object - - - Beispiel Property Element - - - - ExampleProperty - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty - - - - exampleValue - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId - - - - string - - - - - - - - - - - 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. - - - 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 - - - - SELF_MANAGED_ENTITY - - - - (ASSET)[IRI]https://acplt.org/Test_Asset2 - - - - ExampleEntity2 - - - - (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber - - - - - - - - - 0 - - An AAS Data Specification template for IEC61369. A template consists of the DataSpecificationContent containing the additional attributes to be added to the element instance that references the data specification template and meta information about the template itself (this is why DataSpecification inherits from Identifiable). In UML these are two separated classes. - - Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - 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. - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - - - - - Abstract attribute class for identification. Has the subattributes id and idType. - - - Identifier of the element. Its type is defined in idType. Id is a subproperty of identification. - http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360 - - - - Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the enumeration “IdentifierType”. IdType is a subproperty of identification. - IRI - - - - - Abstract attribute for administration. Has the subattributes revision and version. - - - Revision of the element. Constraint AASd-005: A revision requires a version. This means, if there is no version there is no revision neither. Revision is a subproperty of administration. - - - - - Version of the element. Version is a subproperty of administration. - - - - - - - The content of an AAS Data Specification template for IEC61360. - - Identifies the attribute hierarchy for preferredName in above attribute hierachy. Subordinate attributes are designated by the country code information (see aml-lang literal). - - - - Identifies the attribute for shortName in above attribute hierarchy. - - - - Identifies the attribute for unit in above attribute hierarchy. - - - - Identifies the attribute for unitId in above attribute hierarchy in its string serialization. - - - - Identifies the attribute for sourceOfDefinition in above attribute hierachy. Subordinate attributes are designated by the country code information (see aml-lang literal). - - - - Identifies the attribute for symbol in above attribute hierarchy. - - - - Identifies the attribute for dataType in above attribute hierarchy. - - - - Identifies the attribute for definition in above attribute hierachy. Subordinate attributes are designated by the country code information (see aml-lang literal). - - - - Identifies the attribute for valueFormat in above attribute hierarchy. - - - - Identifies the attribute for valueList in above attribute hierarchy. - - - - The attribute value. - - - - The id for the value. - - - - - - - \ No newline at end of file diff --git a/dataformat-aml/src/test/resources/amlfile/full-example.xml b/dataformat-aml/src/test/resources/amlfile/full-example.xml deleted file mode 100644 index eea866a2..00000000 --- a/dataformat-aml/src/test/resources/amlfile/full-example.xml +++ /dev/null @@ -1,8921 +0,0 @@ - - - - 0 - - - - - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId - - - - - (GLOBAL_REFERENCE)[IRI]0173-1#02-AAO677#002 - - - - ManufacturerName - - - - - - - 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. - - - 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 - - - - - - xs:int - - - - 100 - - - - - - - - - - xs:int - - - - 50 - - - - - - - - ACPLT - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId - - - - - (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber - - - - InstanceId - - - - - - - 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. - - - 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 - - - - 978-8234-234-342 - - - - - - (SUBMODEL)[IRI]http://acplt.org/SubmodelTemplates/AssetIdentification - - - - - - IRI - - - - http://acplt.org/Submodels/Assets/TestAsset/Identification - - - - - - - 0.9 - - - - 0 - - - - - Identification - - - - - - - An example asset identification submodel for the test application - - - Ein Beispiel-Identifikations-Submodel für eine Test-Anwendung - - - - - - - - - - - - - - - CO_MANAGED_ENTITY - - - - - (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber - - - - ExampleEntity - - - - - - - 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. - - - 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 - - - - - - - - - SELF_MANAGED_ENTITY - - - - - (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber - - - - ExampleEntity2 - - - - - - - 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. - - - 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 - - - - - - (SUBMODEL)[IRI]http://acplt.org/SubmodelTemplates/BillOfMaterial - - - - - - IRI - - - - http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial - - - - - - - 0.9 - - - - - - - - BillOfMaterial - - - - - - - An example bill of material submodel for the test application - - - Ein Beispiel-BillofMaterial-Submodel für eine Test-Anwendung - - - - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleRelationshipElement - - - - ExampleRelationshipElement - - - - Parameter - - - - - - Example RelationshipElement object - - - Beispiel RelationshipElement Element - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - (PROPERTY)[ID_SHORT]ExampleProperty2 - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement - - - - ExampleAnnotatedRelationshipElement - - - - Parameter - - - - - - Example AnnotatedRelationshipElement object - - - Beispiel AnnotatedRelationshipElement Element - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - (PROPERTY)[ID_SHORT]ExampleProperty2 - - - - - - - - - - - - - - - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Operations/ExampleOperation - - - - ExampleOperation - - - - Parameter - - - - - - Example Operation object - - - Beispiel Operation Element - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Capabilities/ExampleCapability - - - - ExampleCapability - - - - Parameter - - - - - - Example Capability object - - - Beispiel Capability Element - - - - - - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Events/ExampleBasicEvent - - - - ExampleBasicEvent - - - - Parameter - - - - - - Example BasicEvent object - - - Beispiel BasicEvent Element - - - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty - - - - ExampleProperty - - - - Constant - - - - - - Example Property object - - - Beispiel Property Element - - - - exampleValue - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty - - - - ExampleMultiLanguageProperty - - - - Constant - - - - - - Example MultiLanguageProperty object - - - Beispiel MulitLanguageProperty Element - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleMultiLanguageValueId - - - - - - Example value of a MultiLanguageProperty element - - - Beispielswert für ein MulitLanguageProperty-Element - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Ranges/ExampleRange - - - - ExampleRange - - - - Parameter - - - - - - Example Range object - - - Beispiel Range Element - - - - 100 - - - - 0 - - - - - true - - - - false - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered - - - - ExampleSubmodelCollectionOrdered - - - - Parameter - - - - - - Example SubmodelElementCollectionOrdered object - - - Beispiel SubmodelElementCollectionOrdered Element - - - - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Blobs/ExampleBlob - - - - ExampleBlob - - - - Parameter - - - - - - Example Blob object - - - Beispiel Blob Element - - - - - application/pdf - - - - [1, 2, 3, 4, 5] - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Files/ExampleFile - - - - ExampleFile - - - - Parameter - - - - - - Example File object - - - Beispiel File Element - - - - - application/pdf - - - - /TestFile.pdf - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ReferenceElements/ExampleReferenceElement - - - - ExampleReferenceElement - - - - Parameter - - - - - - Example Reference Element object - - - Beispiel Reference Element Element - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - false - - - - false - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered - - - - ExampleSubmodelCollectionUnordered - - - - Parameter - - - - - - Example SubmodelElementCollectionUnordered object - - - Beispiel SubmodelElementCollectionUnordered Element - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelTemplates/ExampleSubmodel - - - - - - IRI - - - - https://acplt.org/Test_Submodel - - - - - - - 0.9 - - - - 0 - - - - - TestSubmodel - - - - - - - An example submodel for the test application - - - Ein Beispiel-Teilmodell für eine Test-Anwendung - - - - - - - - - - - - - - - ExampleRelationshipElement - - - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - - - - - - - ExampleAnnotatedRelationshipElement - - - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - - - - - - - - - - - - - - - - - - - - - - ExampleOperation - - - - - - - - - - - - - ExampleCapability - - - - - - - - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - - ExampleBasicEvent - - - - - - - - - - - - - - - - - - ExampleProperty - - - - - - - - - - - - - - - - ExampleMultiLanguageProperty - - - - - - - - - - - - - - - - - - - ExampleRange - - - - - - - - - - - - - true - - - - false - - - - - - ExampleSubmodelCollectionOrdered - - - - - - - - - - - - - - - - - ExampleBlob - - - - - - - application/pdf - - - - null - - - - - - - - - - - - ExampleFile - - - - - - - application/pdf - - - - - - - - - - - - - - - ExampleReferenceElement - - - - - - - - - - false - - - - false - - - - - - ExampleSubmodelCollectionUnordered - - - - - - - - - - - false - - - - false - - - - - - ExampleSubmodelCollectionUnordered2 - - - - - - - - - - - IRI - - - - https://acplt.org/Test_Submodel_Mandatory - - - - - - - - - - - - - - - - - - - - - IRI - - - - https://acplt.org/Test_Submodel2_Mandatory - - - - - - - - - - - - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleRelationshipElement - - - - ExampleRelationshipElement - - - - Parameter - - - - - - Example RelationshipElement object - - - Beispiel RelationshipElement Element - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement - - - - ExampleAnnotatedRelationshipElement - - - - Parameter - - - - - - Example AnnotatedRelationshipElement object - - - Beispiel AnnotatedRelationshipElement Element - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - - - - - - - - - - - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Operations/ExampleOperation - - - - ExampleOperation - - - - Parameter - - - - - - Example Operation object - - - Beispiel Operation Element - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Capabilities/ExampleCapability - - - - ExampleCapability - - - - Parameter - - - - - - Example Capability object - - - Beispiel Capability Element - - - - - - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Events/ExampleBasicEvent - - - - ExampleBasicEvent - - - - Parameter - - - - - - Example BasicEvent object - - - Beispiel BasicEvent Element - - - - - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty - - - - ExampleProperty - - - - Constant - - - - - - Example Property object - - - Beispiel Property Element - - - - - - xs:string - - - - - - - - - - - exampleValue - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty - - - - ExampleMultiLanguageProperty - - - - Constant - - - - - - Example MultiLanguageProperty object - - - Beispiel MulitLanguageProperty Element - - - - - - - - - Example value of a MultiLanguageProperty element - - - Beispielswert für ein MulitLanguageProperty-Element - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Ranges/ExampleRange - - - - ExampleRange - - - - Parameter - - - - - - Example Range object - - - Beispiel Range Element - - - - 100 - - - - 0 - - - - - true - - - - false - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered - - - - ExampleSubmodelCollectionOrdered - - - - Parameter - - - - - - Example SubmodelElementCollectionOrdered object - - - Beispiel SubmodelElementCollectionOrdered Element - - - - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Blobs/ExampleBlob - - - - ExampleBlob - - - - Parameter - - - - - - Example Blob object - - - Beispiel Blob Element - - - - - application/pdf - - - - [1, 2, 3, 4, 5] - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Files/ExampleFile - - - - ExampleFile - - - - Parameter - - - - - - Example File object - - - Beispiel File Element - - - - - application/pdf - - - - /TestFile.pdf - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ReferenceElements/ExampleReferenceElement - - - - ExampleReferenceElement - - - - Parameter - - - - - - Example Reference Element object - - - Beispiel Reference Element Element - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - false - - - - false - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered - - - - ExampleSubmodelCollectionUnordered - - - - Parameter - - - - - - Example SubmodelElementCollectionUnordered object - - - Beispiel SubmodelElementCollectionUnordered Element - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelTemplates/ExampleSubmodel - - - - - - IRI - - - - https://acplt.org/Test_Submodel_Missing - - - - - - - 0.9 - - - - 0 - - - - - TestSubmodel - - - - - - - An example submodel for the test application - - - Ein Beispiel-Teilmodell für eine Test-Anwendung - - - - - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleRelationshipElement - - - - ExampleRelationshipElement - - - - Parameter - - - - - - Example RelationshipElement object - - - Beispiel RelationshipElement Element - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement - - - - ExampleAnnotatedRelationshipElement - - - - Parameter - - - - - - Example AnnotatedRelationshipElement object - - - Beispiel AnnotatedRelationshipElement Element - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - - - - - - - - - - - - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Operations/ExampleOperation - - - - ExampleOperation - - - - Parameter - - - - - - Example Operation object - - - Beispiel Operation Element - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Capabilities/ExampleCapability - - - - ExampleCapability - - - - Parameter - - - - - - Example Capability object - - - Beispiel Capability Element - - - - - - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Events/ExampleBasicEvent - - - - ExampleBasicEvent - - - - Parameter - - - - - - Example BasicEvent object - - - Beispiel BasicEvent Element - - - - - - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty - - - - ExampleProperty - - - - Constant - - - - - - Example Property object - - - Beispiel Property Element - - - - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty - - - - ExampleMultiLanguageProperty - - - - Constant - - - - - - Example MultiLanguageProperty object - - - Beispiel MulitLanguageProperty Element - - - - - - - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Ranges/ExampleRange - - - - ExampleRange - - - - Parameter - - - - - - Example Range object - - - Beispiel Range Element - - - - 100 - - - - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Ranges/ExampleRange - - - - ExampleRange2 - - - - Parameter - - - - - - Example Range object - - - Beispiel Range Element - - - - - - - 0 - - - - - true - - - - false - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered - - - - ExampleSubmodelCollectionOrdered - - - - Parameter - - - - - - Example SubmodelElementCollectionOrdered object - - - Beispiel SubmodelElementCollectionOrdered Element - - - - - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Blobs/ExampleBlob - - - - ExampleBlob - - - - Parameter - - - - - - Example Blob object - - - Beispiel Blob Element - - - - - application/pdf - - - - null - - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Files/ExampleFile - - - - ExampleFile - - - - Parameter - - - - - - Example File object - - - Beispiel File Element - - - - - application/pdf - - - - - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ReferenceElements/ExampleReferenceElement - - - - ExampleReferenceElement - - - - Parameter - - - - - - Example Reference Element object - - - Beispiel Reference Element Element - - - - - - - - false - - - - false - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered - - - - ExampleSubmodelCollectionUnordered - - - - Parameter - - - - - - Example SubmodelElementCollectionUnordered object - - - Beispiel SubmodelElementCollectionUnordered Element - - - - - - - - - false - - - - false - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered - - - - ExampleSubmodelCollectionUnordered2 - - - - Parameter - - - - - - Example SubmodelElementCollectionUnordered object - - - Beispiel SubmodelElementCollectionUnordered Element - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelTemplates/ExampleSubmodel - - - - - - IRI - - - - https://acplt.org/Test_Submodel_Template - - - - - - - 0.9 - - - - 0 - - - - - TestSubmodel - - - - - - - An example submodel for the test application - - - Ein Beispiel-Teilmodell für eine Test-Anwendung - - - - - (ASSET_ADMINISTRATION_SHELL)[IRI]https://acplt.org/TestAssetAdministrationShell2 - - - - - - IRI - - - - https://acplt.org/Test_AssetAdministrationShell - - - - - - - 0.9 - - - - 0 - - - - - TestAssetAdministrationShell - - - - - - - An Example Asset Administration Shell for the test application - - - Ein Beispiel-Verwaltungsschale für eine Test-Anwendung - - - - - - (SUBMODEL)[IRI]https://acplt.org/Test_Submodel - - - - (SUBMODEL)[IRI]http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial - - - - (SUBMODEL)[IRI]http://acplt.org/Submodels/Assets/TestAsset/Identification - - - - - - - - - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId - - - - - (GLOBAL_REFERENCE)[IRI]0173-1#02-AAO677#002 - - - - ManufacturerName - - - - - - - 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. - - - 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 - - - - - - xs:int - - - - 100 - - - - - - - - - - xs:int - - - - 50 - - - - - - - - ACPLT - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId - - - - - (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber - - - - InstanceId - - - - - - - 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. - - - 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 - - - - 978-8234-234-342 - - - - - - (SUBMODEL)[IRI]http://acplt.org/SubmodelTemplates/AssetIdentification - - - - - - IRI - - - - http://acplt.org/Submodels/Assets/TestAsset/Identification - - - - - - - 0.9 - - - - 0 - - - - - Identification - - - - - - - An example asset identification submodel for the test application - - - Ein Beispiel-Identifikations-Submodel für eine Test-Anwendung - - - - - - - - - - - - - - - CO_MANAGED_ENTITY - - - - - (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber - - - - ExampleEntity - - - - - - - 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. - - - 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 - - - - - - - - - SELF_MANAGED_ENTITY - - - - - (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber - - - - ExampleEntity2 - - - - - - - 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. - - - 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 - - - - - - (SUBMODEL)[IRI]http://acplt.org/SubmodelTemplates/BillOfMaterial - - - - - - IRI - - - - http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial - - - - - - - 0.9 - - - - - - - - BillOfMaterial - - - - - - - An example bill of material submodel for the test application - - - Ein Beispiel-BillofMaterial-Submodel für eine Test-Anwendung - - - - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleRelationshipElement - - - - ExampleRelationshipElement - - - - Parameter - - - - - - Example RelationshipElement object - - - Beispiel RelationshipElement Element - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - (PROPERTY)[ID_SHORT]ExampleProperty2 - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement - - - - ExampleAnnotatedRelationshipElement - - - - Parameter - - - - - - Example AnnotatedRelationshipElement object - - - Beispiel AnnotatedRelationshipElement Element - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - (PROPERTY)[ID_SHORT]ExampleProperty2 - - - - - - - - - - - - - - - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Operations/ExampleOperation - - - - ExampleOperation - - - - Parameter - - - - - - Example Operation object - - - Beispiel Operation Element - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Capabilities/ExampleCapability - - - - ExampleCapability - - - - Parameter - - - - - - Example Capability object - - - Beispiel Capability Element - - - - - - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Events/ExampleBasicEvent - - - - ExampleBasicEvent - - - - Parameter - - - - - - Example BasicEvent object - - - Beispiel BasicEvent Element - - - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty - - - - ExampleProperty - - - - Constant - - - - - - Example Property object - - - Beispiel Property Element - - - - exampleValue - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty - - - - ExampleMultiLanguageProperty - - - - Constant - - - - - - Example MultiLanguageProperty object - - - Beispiel MulitLanguageProperty Element - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleMultiLanguageValueId - - - - - - Example value of a MultiLanguageProperty element - - - Beispielswert für ein MulitLanguageProperty-Element - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Ranges/ExampleRange - - - - ExampleRange - - - - Parameter - - - - - - Example Range object - - - Beispiel Range Element - - - - 100 - - - - 0 - - - - - true - - - - false - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered - - - - ExampleSubmodelCollectionOrdered - - - - Parameter - - - - - - Example SubmodelElementCollectionOrdered object - - - Beispiel SubmodelElementCollectionOrdered Element - - - - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Blobs/ExampleBlob - - - - ExampleBlob - - - - Parameter - - - - - - Example Blob object - - - Beispiel Blob Element - - - - - application/pdf - - - - [1, 2, 3, 4, 5] - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Files/ExampleFile - - - - ExampleFile - - - - Parameter - - - - - - Example File object - - - Beispiel File Element - - - - - application/pdf - - - - /TestFile.pdf - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ReferenceElements/ExampleReferenceElement - - - - ExampleReferenceElement - - - - Parameter - - - - - - Example Reference Element object - - - Beispiel Reference Element Element - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - false - - - - false - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered - - - - ExampleSubmodelCollectionUnordered - - - - Parameter - - - - - - Example SubmodelElementCollectionUnordered object - - - Beispiel SubmodelElementCollectionUnordered Element - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelTemplates/ExampleSubmodel - - - - - - IRI - - - - https://acplt.org/Test_Submodel - - - - - - - 0.9 - - - - 0 - - - - - TestSubmodel - - - - - - - An example submodel for the test application - - - Ein Beispiel-Teilmodell für eine Test-Anwendung - - - - - - - - - - - - - - - ExampleRelationshipElement - - - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - - - - - - - ExampleAnnotatedRelationshipElement - - - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - - - - - - - - - - - - - - - - - - - - - - ExampleOperation - - - - - - - - - - - - - ExampleCapability - - - - - - - - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - - ExampleBasicEvent - - - - - - - - - - - - - - - - - - ExampleProperty - - - - - - - - - - - - - - - - ExampleMultiLanguageProperty - - - - - - - - - - - - - - - - - - - ExampleRange - - - - - - - - - - - - - true - - - - false - - - - - - ExampleSubmodelCollectionOrdered - - - - - - - - - - - - - - - - - ExampleBlob - - - - - - - application/pdf - - - - null - - - - - - - - - - - - ExampleFile - - - - - - - application/pdf - - - - - - - - - - - - - - - ExampleReferenceElement - - - - - - - - - - false - - - - false - - - - - - ExampleSubmodelCollectionUnordered - - - - - - - - - - - false - - - - false - - - - - - ExampleSubmodelCollectionUnordered2 - - - - - - - - - - - IRI - - - - https://acplt.org/Test_Submodel_Mandatory - - - - - - - - - - - - - - - - - - - - - IRI - - - - https://acplt.org/Test_Submodel2_Mandatory - - - - - - - - - - - - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleRelationshipElement - - - - ExampleRelationshipElement - - - - Parameter - - - - - - Example RelationshipElement object - - - Beispiel RelationshipElement Element - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement - - - - ExampleAnnotatedRelationshipElement - - - - Parameter - - - - - - Example AnnotatedRelationshipElement object - - - Beispiel AnnotatedRelationshipElement Element - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - - - - - - - - - - - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Operations/ExampleOperation - - - - ExampleOperation - - - - Parameter - - - - - - Example Operation object - - - Beispiel Operation Element - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Capabilities/ExampleCapability - - - - ExampleCapability - - - - Parameter - - - - - - Example Capability object - - - Beispiel Capability Element - - - - - - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Events/ExampleBasicEvent - - - - ExampleBasicEvent - - - - Parameter - - - - - - Example BasicEvent object - - - Beispiel BasicEvent Element - - - - - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty - - - - ExampleProperty - - - - Constant - - - - - - Example Property object - - - Beispiel Property Element - - - - - - xs:string - - - - - - - - - - - exampleValue - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty - - - - ExampleMultiLanguageProperty - - - - Constant - - - - - - Example MultiLanguageProperty object - - - Beispiel MulitLanguageProperty Element - - - - - - - - - Example value of a MultiLanguageProperty element - - - Beispielswert für ein MulitLanguageProperty-Element - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Ranges/ExampleRange - - - - ExampleRange - - - - Parameter - - - - - - Example Range object - - - Beispiel Range Element - - - - 100 - - - - 0 - - - - - true - - - - false - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered - - - - ExampleSubmodelCollectionOrdered - - - - Parameter - - - - - - Example SubmodelElementCollectionOrdered object - - - Beispiel SubmodelElementCollectionOrdered Element - - - - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Blobs/ExampleBlob - - - - ExampleBlob - - - - Parameter - - - - - - Example Blob object - - - Beispiel Blob Element - - - - - application/pdf - - - - [1, 2, 3, 4, 5] - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Files/ExampleFile - - - - ExampleFile - - - - Parameter - - - - - - Example File object - - - Beispiel File Element - - - - - application/pdf - - - - /TestFile.pdf - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ReferenceElements/ExampleReferenceElement - - - - ExampleReferenceElement - - - - Parameter - - - - - - Example Reference Element object - - - Beispiel Reference Element Element - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - false - - - - false - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered - - - - ExampleSubmodelCollectionUnordered - - - - Parameter - - - - - - Example SubmodelElementCollectionUnordered object - - - Beispiel SubmodelElementCollectionUnordered Element - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelTemplates/ExampleSubmodel - - - - - - IRI - - - - https://acplt.org/Test_Submodel_Missing - - - - - - - 0.9 - - - - 0 - - - - - TestSubmodel - - - - - - - An example submodel for the test application - - - Ein Beispiel-Teilmodell für eine Test-Anwendung - - - - - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleRelationshipElement - - - - ExampleRelationshipElement - - - - Parameter - - - - - - Example RelationshipElement object - - - Beispiel RelationshipElement Element - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement - - - - ExampleAnnotatedRelationshipElement - - - - Parameter - - - - - - Example AnnotatedRelationshipElement object - - - Beispiel AnnotatedRelationshipElement Element - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - - - - - - - - - - - - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Operations/ExampleOperation - - - - ExampleOperation - - - - Parameter - - - - - - Example Operation object - - - Beispiel Operation Element - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Capabilities/ExampleCapability - - - - ExampleCapability - - - - Parameter - - - - - - Example Capability object - - - Beispiel Capability Element - - - - - - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Events/ExampleBasicEvent - - - - ExampleBasicEvent - - - - Parameter - - - - - - Example BasicEvent object - - - Beispiel BasicEvent Element - - - - - - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty - - - - ExampleProperty - - - - Constant - - - - - - Example Property object - - - Beispiel Property Element - - - - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty - - - - ExampleMultiLanguageProperty - - - - Constant - - - - - - Example MultiLanguageProperty object - - - Beispiel MulitLanguageProperty Element - - - - - - - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Ranges/ExampleRange - - - - ExampleRange - - - - Parameter - - - - - - Example Range object - - - Beispiel Range Element - - - - 100 - - - - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Ranges/ExampleRange - - - - ExampleRange2 - - - - Parameter - - - - - - Example Range object - - - Beispiel Range Element - - - - - - - 0 - - - - - true - - - - false - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered - - - - ExampleSubmodelCollectionOrdered - - - - Parameter - - - - - - Example SubmodelElementCollectionOrdered object - - - Beispiel SubmodelElementCollectionOrdered Element - - - - - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Blobs/ExampleBlob - - - - ExampleBlob - - - - Parameter - - - - - - Example Blob object - - - Beispiel Blob Element - - - - - application/pdf - - - - null - - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Files/ExampleFile - - - - ExampleFile - - - - Parameter - - - - - - Example File object - - - Beispiel File Element - - - - - application/pdf - - - - - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ReferenceElements/ExampleReferenceElement - - - - ExampleReferenceElement - - - - Parameter - - - - - - Example Reference Element object - - - Beispiel Reference Element Element - - - - - - - - false - - - - false - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered - - - - ExampleSubmodelCollectionUnordered - - - - Parameter - - - - - - Example SubmodelElementCollectionUnordered object - - - Beispiel SubmodelElementCollectionUnordered Element - - - - - - - - - false - - - - false - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered - - - - ExampleSubmodelCollectionUnordered2 - - - - Parameter - - - - - - Example SubmodelElementCollectionUnordered object - - - Beispiel SubmodelElementCollectionUnordered Element - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelTemplates/ExampleSubmodel - - - - - - IRI - - - - https://acplt.org/Test_Submodel_Template - - - - - - - 0.9 - - - - 0 - - - - - TestSubmodel - - - - - - - An example submodel for the test application - - - Ein Beispiel-Teilmodell für eine Test-Anwendung - - - - - - - - IRI - - - - https://acplt.org/Test_AssetAdministrationShell_Mandatory - - - - - - - - - - - - - - (SUBMODEL)[IRI]https://acplt.org/Test_Submodel_Mandatory - - - - (SUBMODEL)[IRI]https://acplt.org/Test_Submodel2_Mandatory - - - - - - - - - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId - - - - - (GLOBAL_REFERENCE)[IRI]0173-1#02-AAO677#002 - - - - ManufacturerName - - - - - - - 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. - - - 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 - - - - - - xs:int - - - - 100 - - - - - - - - - - xs:int - - - - 50 - - - - - - - - ACPLT - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId - - - - - (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber - - - - InstanceId - - - - - - - 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. - - - 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 - - - - 978-8234-234-342 - - - - - - (SUBMODEL)[IRI]http://acplt.org/SubmodelTemplates/AssetIdentification - - - - - - IRI - - - - http://acplt.org/Submodels/Assets/TestAsset/Identification - - - - - - - 0.9 - - - - 0 - - - - - Identification - - - - - - - An example asset identification submodel for the test application - - - Ein Beispiel-Identifikations-Submodel für eine Test-Anwendung - - - - - - - - - - - - - - - CO_MANAGED_ENTITY - - - - - (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber - - - - ExampleEntity - - - - - - - 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. - - - 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 - - - - - - - - - SELF_MANAGED_ENTITY - - - - - (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber - - - - ExampleEntity2 - - - - - - - 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. - - - 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 - - - - - - (SUBMODEL)[IRI]http://acplt.org/SubmodelTemplates/BillOfMaterial - - - - - - IRI - - - - http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial - - - - - - - 0.9 - - - - - - - - BillOfMaterial - - - - - - - An example bill of material submodel for the test application - - - Ein Beispiel-BillofMaterial-Submodel für eine Test-Anwendung - - - - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleRelationshipElement - - - - ExampleRelationshipElement - - - - Parameter - - - - - - Example RelationshipElement object - - - Beispiel RelationshipElement Element - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - (PROPERTY)[ID_SHORT]ExampleProperty2 - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement - - - - ExampleAnnotatedRelationshipElement - - - - Parameter - - - - - - Example AnnotatedRelationshipElement object - - - Beispiel AnnotatedRelationshipElement Element - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - (PROPERTY)[ID_SHORT]ExampleProperty2 - - - - - - - - - - - - - - - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Operations/ExampleOperation - - - - ExampleOperation - - - - Parameter - - - - - - Example Operation object - - - Beispiel Operation Element - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Capabilities/ExampleCapability - - - - ExampleCapability - - - - Parameter - - - - - - Example Capability object - - - Beispiel Capability Element - - - - - - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Events/ExampleBasicEvent - - - - ExampleBasicEvent - - - - Parameter - - - - - - Example BasicEvent object - - - Beispiel BasicEvent Element - - - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty - - - - ExampleProperty - - - - Constant - - - - - - Example Property object - - - Beispiel Property Element - - - - exampleValue - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty - - - - ExampleMultiLanguageProperty - - - - Constant - - - - - - Example MultiLanguageProperty object - - - Beispiel MulitLanguageProperty Element - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleMultiLanguageValueId - - - - - - Example value of a MultiLanguageProperty element - - - Beispielswert für ein MulitLanguageProperty-Element - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Ranges/ExampleRange - - - - ExampleRange - - - - Parameter - - - - - - Example Range object - - - Beispiel Range Element - - - - 100 - - - - 0 - - - - - true - - - - false - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered - - - - ExampleSubmodelCollectionOrdered - - - - Parameter - - - - - - Example SubmodelElementCollectionOrdered object - - - Beispiel SubmodelElementCollectionOrdered Element - - - - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Blobs/ExampleBlob - - - - ExampleBlob - - - - Parameter - - - - - - Example Blob object - - - Beispiel Blob Element - - - - - application/pdf - - - - [1, 2, 3, 4, 5] - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Files/ExampleFile - - - - ExampleFile - - - - Parameter - - - - - - Example File object - - - Beispiel File Element - - - - - application/pdf - - - - /TestFile.pdf - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ReferenceElements/ExampleReferenceElement - - - - ExampleReferenceElement - - - - Parameter - - - - - - Example Reference Element object - - - Beispiel Reference Element Element - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - false - - - - false - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered - - - - ExampleSubmodelCollectionUnordered - - - - Parameter - - - - - - Example SubmodelElementCollectionUnordered object - - - Beispiel SubmodelElementCollectionUnordered Element - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelTemplates/ExampleSubmodel - - - - - - IRI - - - - https://acplt.org/Test_Submodel - - - - - - - 0.9 - - - - 0 - - - - - TestSubmodel - - - - - - - An example submodel for the test application - - - Ein Beispiel-Teilmodell für eine Test-Anwendung - - - - - - - - - - - - - - - ExampleRelationshipElement - - - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - - - - - - - ExampleAnnotatedRelationshipElement - - - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - - - - - - - - - - - - - - - - - - - - - - ExampleOperation - - - - - - - - - - - - - ExampleCapability - - - - - - - - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - - ExampleBasicEvent - - - - - - - - - - - - - - - - - - ExampleProperty - - - - - - - - - - - - - - - - ExampleMultiLanguageProperty - - - - - - - - - - - - - - - - - - - ExampleRange - - - - - - - - - - - - - true - - - - false - - - - - - ExampleSubmodelCollectionOrdered - - - - - - - - - - - - - - - - - ExampleBlob - - - - - - - application/pdf - - - - null - - - - - - - - - - - - ExampleFile - - - - - - - application/pdf - - - - - - - - - - - - - - - ExampleReferenceElement - - - - - - - - - - false - - - - false - - - - - - ExampleSubmodelCollectionUnordered - - - - - - - - - - - false - - - - false - - - - - - ExampleSubmodelCollectionUnordered2 - - - - - - - - - - - IRI - - - - https://acplt.org/Test_Submodel_Mandatory - - - - - - - - - - - - - - - - - - - - - IRI - - - - https://acplt.org/Test_Submodel2_Mandatory - - - - - - - - - - - - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleRelationshipElement - - - - ExampleRelationshipElement - - - - Parameter - - - - - - Example RelationshipElement object - - - Beispiel RelationshipElement Element - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement - - - - ExampleAnnotatedRelationshipElement - - - - Parameter - - - - - - Example AnnotatedRelationshipElement object - - - Beispiel AnnotatedRelationshipElement Element - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - - - - - - - - - - - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Operations/ExampleOperation - - - - ExampleOperation - - - - Parameter - - - - - - Example Operation object - - - Beispiel Operation Element - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Capabilities/ExampleCapability - - - - ExampleCapability - - - - Parameter - - - - - - Example Capability object - - - Beispiel Capability Element - - - - - - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Events/ExampleBasicEvent - - - - ExampleBasicEvent - - - - Parameter - - - - - - Example BasicEvent object - - - Beispiel BasicEvent Element - - - - - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty - - - - ExampleProperty - - - - Constant - - - - - - Example Property object - - - Beispiel Property Element - - - - - - xs:string - - - - - - - - - - - exampleValue - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty - - - - ExampleMultiLanguageProperty - - - - Constant - - - - - - Example MultiLanguageProperty object - - - Beispiel MulitLanguageProperty Element - - - - - - - - - Example value of a MultiLanguageProperty element - - - Beispielswert für ein MulitLanguageProperty-Element - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Ranges/ExampleRange - - - - ExampleRange - - - - Parameter - - - - - - Example Range object - - - Beispiel Range Element - - - - 100 - - - - 0 - - - - - true - - - - false - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered - - - - ExampleSubmodelCollectionOrdered - - - - Parameter - - - - - - Example SubmodelElementCollectionOrdered object - - - Beispiel SubmodelElementCollectionOrdered Element - - - - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Blobs/ExampleBlob - - - - ExampleBlob - - - - Parameter - - - - - - Example Blob object - - - Beispiel Blob Element - - - - - application/pdf - - - - [1, 2, 3, 4, 5] - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Files/ExampleFile - - - - ExampleFile - - - - Parameter - - - - - - Example File object - - - Beispiel File Element - - - - - application/pdf - - - - /TestFile.pdf - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ReferenceElements/ExampleReferenceElement - - - - ExampleReferenceElement - - - - Parameter - - - - - - Example Reference Element object - - - Beispiel Reference Element Element - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - false - - - - false - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered - - - - ExampleSubmodelCollectionUnordered - - - - Parameter - - - - - - Example SubmodelElementCollectionUnordered object - - - Beispiel SubmodelElementCollectionUnordered Element - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelTemplates/ExampleSubmodel - - - - - - IRI - - - - https://acplt.org/Test_Submodel_Missing - - - - - - - 0.9 - - - - 0 - - - - - TestSubmodel - - - - - - - An example submodel for the test application - - - Ein Beispiel-Teilmodell für eine Test-Anwendung - - - - - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleRelationshipElement - - - - ExampleRelationshipElement - - - - Parameter - - - - - - Example RelationshipElement object - - - Beispiel RelationshipElement Element - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement - - - - ExampleAnnotatedRelationshipElement - - - - Parameter - - - - - - Example AnnotatedRelationshipElement object - - - Beispiel AnnotatedRelationshipElement Element - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - - - - - - - - - - - - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Operations/ExampleOperation - - - - ExampleOperation - - - - Parameter - - - - - - Example Operation object - - - Beispiel Operation Element - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Capabilities/ExampleCapability - - - - ExampleCapability - - - - Parameter - - - - - - Example Capability object - - - Beispiel Capability Element - - - - - - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Events/ExampleBasicEvent - - - - ExampleBasicEvent - - - - Parameter - - - - - - Example BasicEvent object - - - Beispiel BasicEvent Element - - - - - - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty - - - - ExampleProperty - - - - Constant - - - - - - Example Property object - - - Beispiel Property Element - - - - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty - - - - ExampleMultiLanguageProperty - - - - Constant - - - - - - Example MultiLanguageProperty object - - - Beispiel MulitLanguageProperty Element - - - - - - - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Ranges/ExampleRange - - - - ExampleRange - - - - Parameter - - - - - - Example Range object - - - Beispiel Range Element - - - - 100 - - - - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Ranges/ExampleRange - - - - ExampleRange2 - - - - Parameter - - - - - - Example Range object - - - Beispiel Range Element - - - - - - - 0 - - - - - true - - - - false - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered - - - - ExampleSubmodelCollectionOrdered - - - - Parameter - - - - - - Example SubmodelElementCollectionOrdered object - - - Beispiel SubmodelElementCollectionOrdered Element - - - - - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Blobs/ExampleBlob - - - - ExampleBlob - - - - Parameter - - - - - - Example Blob object - - - Beispiel Blob Element - - - - - application/pdf - - - - null - - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Files/ExampleFile - - - - ExampleFile - - - - Parameter - - - - - - Example File object - - - Beispiel File Element - - - - - application/pdf - - - - - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ReferenceElements/ExampleReferenceElement - - - - ExampleReferenceElement - - - - Parameter - - - - - - Example Reference Element object - - - Beispiel Reference Element Element - - - - - - - - false - - - - false - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered - - - - ExampleSubmodelCollectionUnordered - - - - Parameter - - - - - - Example SubmodelElementCollectionUnordered object - - - Beispiel SubmodelElementCollectionUnordered Element - - - - - - - - - false - - - - false - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered - - - - ExampleSubmodelCollectionUnordered2 - - - - Parameter - - - - - - Example SubmodelElementCollectionUnordered object - - - Beispiel SubmodelElementCollectionUnordered Element - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelTemplates/ExampleSubmodel - - - - - - IRI - - - - https://acplt.org/Test_Submodel_Template - - - - - - - 0.9 - - - - 0 - - - - - TestSubmodel - - - - - - - An example submodel for the test application - - - Ein Beispiel-Teilmodell für eine Test-Anwendung - - - - - - - - IRI - - - - https://acplt.org/Test_AssetAdministrationShell2_Mandatory - - - - - - - - - - - - - - - - - - - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId - - - - - (GLOBAL_REFERENCE)[IRI]0173-1#02-AAO677#002 - - - - ManufacturerName - - - - - - - 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. - - - 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 - - - - - - xs:int - - - - 100 - - - - - - - - - - xs:int - - - - 50 - - - - - - - - ACPLT - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId - - - - - (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber - - - - InstanceId - - - - - - - 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. - - - 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 - - - - 978-8234-234-342 - - - - - - (SUBMODEL)[IRI]http://acplt.org/SubmodelTemplates/AssetIdentification - - - - - - IRI - - - - http://acplt.org/Submodels/Assets/TestAsset/Identification - - - - - - - 0.9 - - - - 0 - - - - - Identification - - - - - - - An example asset identification submodel for the test application - - - Ein Beispiel-Identifikations-Submodel für eine Test-Anwendung - - - - - - - - - - - - - - - CO_MANAGED_ENTITY - - - - - (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber - - - - ExampleEntity - - - - - - - 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. - - - 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 - - - - - - - - - SELF_MANAGED_ENTITY - - - - - (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber - - - - ExampleEntity2 - - - - - - - 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. - - - 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 - - - - - - (SUBMODEL)[IRI]http://acplt.org/SubmodelTemplates/BillOfMaterial - - - - - - IRI - - - - http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial - - - - - - - 0.9 - - - - - - - - BillOfMaterial - - - - - - - An example bill of material submodel for the test application - - - Ein Beispiel-BillofMaterial-Submodel für eine Test-Anwendung - - - - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleRelationshipElement - - - - ExampleRelationshipElement - - - - Parameter - - - - - - Example RelationshipElement object - - - Beispiel RelationshipElement Element - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - (PROPERTY)[ID_SHORT]ExampleProperty2 - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement - - - - ExampleAnnotatedRelationshipElement - - - - Parameter - - - - - - Example AnnotatedRelationshipElement object - - - Beispiel AnnotatedRelationshipElement Element - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - (PROPERTY)[ID_SHORT]ExampleProperty2 - - - - - - - - - - - - - - - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Operations/ExampleOperation - - - - ExampleOperation - - - - Parameter - - - - - - Example Operation object - - - Beispiel Operation Element - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Capabilities/ExampleCapability - - - - ExampleCapability - - - - Parameter - - - - - - Example Capability object - - - Beispiel Capability Element - - - - - - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Events/ExampleBasicEvent - - - - ExampleBasicEvent - - - - Parameter - - - - - - Example BasicEvent object - - - Beispiel BasicEvent Element - - - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty - - - - ExampleProperty - - - - Constant - - - - - - Example Property object - - - Beispiel Property Element - - - - exampleValue - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty - - - - ExampleMultiLanguageProperty - - - - Constant - - - - - - Example MultiLanguageProperty object - - - Beispiel MulitLanguageProperty Element - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleMultiLanguageValueId - - - - - - Example value of a MultiLanguageProperty element - - - Beispielswert für ein MulitLanguageProperty-Element - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Ranges/ExampleRange - - - - ExampleRange - - - - Parameter - - - - - - Example Range object - - - Beispiel Range Element - - - - 100 - - - - 0 - - - - - true - - - - false - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered - - - - ExampleSubmodelCollectionOrdered - - - - Parameter - - - - - - Example SubmodelElementCollectionOrdered object - - - Beispiel SubmodelElementCollectionOrdered Element - - - - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Blobs/ExampleBlob - - - - ExampleBlob - - - - Parameter - - - - - - Example Blob object - - - Beispiel Blob Element - - - - - application/pdf - - - - [1, 2, 3, 4, 5] - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Files/ExampleFile - - - - ExampleFile - - - - Parameter - - - - - - Example File object - - - Beispiel File Element - - - - - application/pdf - - - - /TestFile.pdf - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ReferenceElements/ExampleReferenceElement - - - - ExampleReferenceElement - - - - Parameter - - - - - - Example Reference Element object - - - Beispiel Reference Element Element - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - false - - - - false - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered - - - - ExampleSubmodelCollectionUnordered - - - - Parameter - - - - - - Example SubmodelElementCollectionUnordered object - - - Beispiel SubmodelElementCollectionUnordered Element - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelTemplates/ExampleSubmodel - - - - - - IRI - - - - https://acplt.org/Test_Submodel - - - - - - - 0.9 - - - - 0 - - - - - TestSubmodel - - - - - - - An example submodel for the test application - - - Ein Beispiel-Teilmodell für eine Test-Anwendung - - - - - - - - - - - - - - - ExampleRelationshipElement - - - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - - - - - - - ExampleAnnotatedRelationshipElement - - - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - - - - - - - - - - - - - - - - - - - - - - ExampleOperation - - - - - - - - - - - - - ExampleCapability - - - - - - - - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - - ExampleBasicEvent - - - - - - - - - - - - - - - - - - ExampleProperty - - - - - - - - - - - - - - - - ExampleMultiLanguageProperty - - - - - - - - - - - - - - - - - - - ExampleRange - - - - - - - - - - - - - true - - - - false - - - - - - ExampleSubmodelCollectionOrdered - - - - - - - - - - - - - - - - - ExampleBlob - - - - - - - application/pdf - - - - null - - - - - - - - - - - - ExampleFile - - - - - - - application/pdf - - - - - - - - - - - - - - - ExampleReferenceElement - - - - - - - - - - false - - - - false - - - - - - ExampleSubmodelCollectionUnordered - - - - - - - - - - - false - - - - false - - - - - - ExampleSubmodelCollectionUnordered2 - - - - - - - - - - - IRI - - - - https://acplt.org/Test_Submodel_Mandatory - - - - - - - - - - - - - - - - - - - - - IRI - - - - https://acplt.org/Test_Submodel2_Mandatory - - - - - - - - - - - - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleRelationshipElement - - - - ExampleRelationshipElement - - - - Parameter - - - - - - Example RelationshipElement object - - - Beispiel RelationshipElement Element - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement - - - - ExampleAnnotatedRelationshipElement - - - - Parameter - - - - - - Example AnnotatedRelationshipElement object - - - Beispiel AnnotatedRelationshipElement Element - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - - - - - - - - - - - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Operations/ExampleOperation - - - - ExampleOperation - - - - Parameter - - - - - - Example Operation object - - - Beispiel Operation Element - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Capabilities/ExampleCapability - - - - ExampleCapability - - - - Parameter - - - - - - Example Capability object - - - Beispiel Capability Element - - - - - - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Events/ExampleBasicEvent - - - - ExampleBasicEvent - - - - Parameter - - - - - - Example BasicEvent object - - - Beispiel BasicEvent Element - - - - - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty - - - - ExampleProperty - - - - Constant - - - - - - Example Property object - - - Beispiel Property Element - - - - - - xs:string - - - - - - - - - - - exampleValue - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty - - - - ExampleMultiLanguageProperty - - - - Constant - - - - - - Example MultiLanguageProperty object - - - Beispiel MulitLanguageProperty Element - - - - - - - - - Example value of a MultiLanguageProperty element - - - Beispielswert für ein MulitLanguageProperty-Element - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Ranges/ExampleRange - - - - ExampleRange - - - - Parameter - - - - - - Example Range object - - - Beispiel Range Element - - - - 100 - - - - 0 - - - - - true - - - - false - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered - - - - ExampleSubmodelCollectionOrdered - - - - Parameter - - - - - - Example SubmodelElementCollectionOrdered object - - - Beispiel SubmodelElementCollectionOrdered Element - - - - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Blobs/ExampleBlob - - - - ExampleBlob - - - - Parameter - - - - - - Example Blob object - - - Beispiel Blob Element - - - - - application/pdf - - - - [1, 2, 3, 4, 5] - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Files/ExampleFile - - - - ExampleFile - - - - Parameter - - - - - - Example File object - - - Beispiel File Element - - - - - application/pdf - - - - /TestFile.pdf - - - - - - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ReferenceElements/ExampleReferenceElement - - - - ExampleReferenceElement - - - - Parameter - - - - - - Example Reference Element object - - - Beispiel Reference Element Element - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - false - - - - false - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered - - - - ExampleSubmodelCollectionUnordered - - - - Parameter - - - - - - Example SubmodelElementCollectionUnordered object - - - Beispiel SubmodelElementCollectionUnordered Element - - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelTemplates/ExampleSubmodel - - - - - - IRI - - - - https://acplt.org/Test_Submodel_Missing - - - - - - - 0.9 - - - - 0 - - - - - TestSubmodel - - - - - - - An example submodel for the test application - - - Ein Beispiel-Teilmodell für eine Test-Anwendung - - - - - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleRelationshipElement - - - - ExampleRelationshipElement - - - - Parameter - - - - - - Example RelationshipElement object - - - Beispiel RelationshipElement Element - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement - - - - ExampleAnnotatedRelationshipElement - - - - Parameter - - - - - - Example AnnotatedRelationshipElement object - - - Beispiel AnnotatedRelationshipElement Element - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - - - - - - - - - - - - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Operations/ExampleOperation - - - - ExampleOperation - - - - Parameter - - - - - - Example Operation object - - - Beispiel Operation Element - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Capabilities/ExampleCapability - - - - ExampleCapability - - - - Parameter - - - - - - Example Capability object - - - Beispiel Capability Element - - - - - - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Events/ExampleBasicEvent - - - - ExampleBasicEvent - - - - Parameter - - - - - - Example BasicEvent object - - - Beispiel BasicEvent Element - - - - - - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty - - - - ExampleProperty - - - - Constant - - - - - - Example Property object - - - Beispiel Property Element - - - - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty - - - - ExampleMultiLanguageProperty - - - - Constant - - - - - - Example MultiLanguageProperty object - - - Beispiel MulitLanguageProperty Element - - - - - - - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Ranges/ExampleRange - - - - ExampleRange - - - - Parameter - - - - - - Example Range object - - - Beispiel Range Element - - - - 100 - - - - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Ranges/ExampleRange - - - - ExampleRange2 - - - - Parameter - - - - - - Example Range object - - - Beispiel Range Element - - - - - - - 0 - - - - - true - - - - false - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered - - - - ExampleSubmodelCollectionOrdered - - - - Parameter - - - - - - Example SubmodelElementCollectionOrdered object - - - Beispiel SubmodelElementCollectionOrdered Element - - - - - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Blobs/ExampleBlob - - - - ExampleBlob - - - - Parameter - - - - - - Example Blob object - - - Beispiel Blob Element - - - - - application/pdf - - - - null - - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Files/ExampleFile - - - - ExampleFile - - - - Parameter - - - - - - Example File object - - - Beispiel File Element - - - - - application/pdf - - - - - - - - - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ReferenceElements/ExampleReferenceElement - - - - ExampleReferenceElement - - - - Parameter - - - - - - Example Reference Element object - - - Beispiel Reference Element Element - - - - - - - - false - - - - false - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered - - - - ExampleSubmodelCollectionUnordered - - - - Parameter - - - - - - Example SubmodelElementCollectionUnordered object - - - Beispiel SubmodelElementCollectionUnordered Element - - - - - - - - - false - - - - false - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered - - - - ExampleSubmodelCollectionUnordered2 - - - - Parameter - - - - - - Example SubmodelElementCollectionUnordered object - - - Beispiel SubmodelElementCollectionUnordered Element - - - - - TEMPLATE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelTemplates/ExampleSubmodel - - - - - - IRI - - - - https://acplt.org/Test_Submodel_Template - - - - - - - 0.9 - - - - 0 - - - - - TestSubmodel - - - - - - - An example submodel for the test application - - - Ein Beispiel-Teilmodell für eine Test-Anwendung - - - - - - - - IRI - - - - https://acplt.org/Test_AssetAdministrationShell_Missing - - - - - - - 0.9 - - - - 0 - - - - - TestAssetAdministrationShell - - - - - - - An Example Asset Administration Shell for the test application - - - Ein Beispiel-Verwaltungsschale für eine Test-Anwendung - - - - - - (SUBMODEL)[IRI]https://acplt.org/Test_Submodel_Missing - - - - - - diff --git a/dataformat-aml/src/test/resources/test_demo_full_example.aml b/dataformat-aml/src/test/resources/test_demo_full_example.aml index 2fa0d7ba..75b2392b 100644 --- a/dataformat-aml/src/test/resources/test_demo_full_example.aml +++ b/dataformat-aml/src/test/resources/test_demo_full_example.aml @@ -1,3724 +1,3690 @@ - - - - - foo - bar - 05-08-2021 15:14:40 - - - - - AutomationML Editor - 916578CA-FE0D-474E-A4FC-9E1719892369 - AutomationML e.V. - www.AutomationML.org - 5.3.3.0 - 5.3.3.0 - 2021-08-12T13:27:15.422413 - unspecified - unspecified - - - - - - - - 0 - - - - 0.9 - - - - - - - INSTANCE - - - - (ASSET)[IRI]https://acplt.org/Test_Asset - - - - - (ASSET_ADMINISTRATION_SHELL)[IRI]https://acplt.org/TestAssetAdministrationShell2 - - - - - - An Example Asset Administration Shell for the test application - - - Ein Beispiel-Verwaltungsschale für eine Test-Anwendung - - - - TestAssetAdministrationShell - - - - - - IRI - - - - https://acplt.org/Test_AssetAdministrationShell - - - - - - - - 0 - - - - 0.9 - - - - - - - An example submodel for the test application - - - Ein Beispiel-Teilmodell für eine Test-Anwendung - - - - TestSubmodel - - - - - - IRI - - - - https://acplt.org/Test_Submodel - - - - - INSTANCE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelTemplates/ExampleSubmodel - - - - - Parameter - - - - - - Example RelationshipElement object - - - Beispiel RelationshipElement Element - - - - ExampleRelationshipElement - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleRelationshipElement - - - - - - - - - Parameter - - - - - - Example AnnotatedRelationshipElement object - - - Beispiel AnnotatedRelationshipElement Element - - - - ExampleAnnotatedRelationshipElement - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement - - - - - - - Parameter - - - - ExampleProperty3 - - - - INSTANCE - - - - some example annotation - - - - string - - - - - - - - - Parameter - - - - - - Example Operation object - - - Beispiel Operation Element - - - - ExampleOperation - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Operations/ExampleOperation - - - - - - Constant - - - - - - Example Property object - - - Beispiel Property Element - - - - ExampleProperty - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty - - - - exampleValue - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId - - - - string - - - - - - - - - - Constant - - - - - - Example Property object - - - Beispiel Property Element - - - - ExampleProperty - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty - - - - exampleValue - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId - - - - string - - - - - - - - - - Constant - - - - - - Example Property object - - - Beispiel Property Element - - - - ExampleProperty - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty - - - - exampleValue - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId - - - - string - - - - - - - - - - - Parameter - - - - - - Example Capability object - - - Beispiel Capability Element - - - - ExampleCapability - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Capabilities/ExampleCapability - - - - - - - Parameter - - - - - - Example BasicEvent object - - - Beispiel BasicEvent Element - - - - ExampleBasicEvent - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Events/ExampleBasicEvent - - - - - - - false - - - - Parameter - - - - - - Example SubmodelElementCollectionOrdered object - - - Beispiel SubmodelElementCollectionOrdered Element - - - - ExampleSubmodelCollectionOrdered - - - - true - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered - - - - - Constant - - - - - - Example Property object - - - Beispiel Property Element - - - - ExampleProperty - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty - - - - exampleValue - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId - - - - string - - - - - - - - Constant - - - - - - Example MultiLanguageProperty object - - - Beispiel MulitLanguageProperty Element - - - - ExampleMultiLanguageProperty - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleMultiLanguageValueId - - - - - - Example value of a MultiLanguageProperty element - - - Beispielswert für ein MulitLanguageProperty-Element - - - - - - - Parameter - - - - - - Example Range object - - - Beispiel Range Element - - - - ExampleRange - - - - 100 - - - - 0 - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Ranges/ExampleRange - - - - int - - - - - - - - - false - - - - Parameter - - - - - - Example SubmodelElementCollectionUnordered object - - - Beispiel SubmodelElementCollectionUnordered Element - - - - ExampleSubmodelCollectionUnordered - - - - false - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered - - - - - Parameter - - - - - - Example Blob object - - - Beispiel Blob Element - - - - ExampleBlob - - - - application/pdf - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Blobs/ExampleBlob - - - - AQIDBAU= - - - - - - - Parameter - - - - - - Example File object - - - Beispiel File Element - - - - ExampleFile - - - - application/pdf - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Files/ExampleFile - - - - /TestFile.pdf - - - - - application/pdf - - - /TestFile.pdf - - - - - - - Parameter - - - - - - Example Reference Element object - - - Beispiel Reference Element Element - - - - ExampleReferenceElement - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ReferenceElements/ExampleReferenceElement - - - - - - - - - - - - - - - - - 0.9 - - - - - - - An example bill of material submodel for the test application - - - Ein Beispiel-BillofMaterial-Submodel für eine Test-Anwendung - - - - BillOfMaterial - - - - - - IRI - - - - http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial - - - - - INSTANCE - - - - (SUBMODEL)[IRI]http://acplt.org/SubmodelTemplates/BillOfMaterial - - - - - - - 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. - - - 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 - - - - CO_MANAGED_ENTITY - - - - ExampleEntity - - - - (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber - - - - - Constant - - - - - - Example Property object - - - Beispiel Property Element - - - - ExampleProperty2 - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty - - - - exampleValue2 - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId - - - - string - - - - - - - - Constant - - - - - - Example Property object - - - Beispiel Property Element - - - - ExampleProperty - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty - - - - exampleValue - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId - - - - string - - - - - - - - - - - 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. - - - 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 - - - - SELF_MANAGED_ENTITY - - - - (ASSET)[IRI]https://acplt.org/Test_Asset2 - - - - ExampleEntity2 - - - - (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber - - - - - - - - - - - 0 - - - - 0.9 - - - - - - - An example asset identification submodel for the test application - - - Ein Beispiel-Identifikations-Submodel für eine Test-Anwendung - - - - Identification - - - - - - IRI - - - - http://acplt.org/Submodels/Assets/TestAsset/Identification - - - - - INSTANCE - - - - (SUBMODEL)[IRI]http://acplt.org/SubmodelTemplates/AssetIdentification - - - - - - - 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. - - - 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 - - - - ManufacturerName - - - - - - http://acplt.org/Qualifier/ExampleQualifier - - - - 100 - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId - - - - int - - - - - - - http://acplt.org/Qualifier/ExampleQualifier2 - - - - 50 - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId - - - - int - - - - - (GLOBAL_REFERENCE)[IRI]0173-1#02-AAO677#002 - - - - ACPLT - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId - - - - string - - - - - - - - - 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. - - - 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 - - - - InstanceId - - - - (GLOBAL_REFERENCE)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber - - - - 978-8234-234-342 - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ValueId/ExampleValueId - - - - string - - - - - - - - - - - - - - - INSTANCE - - - - (ASSET)[IRI]https://acplt.org/Test_Asset_Mandatory - - - - - - - - - - - IRI - - - - https://acplt.org/Test_AssetAdministrationShell_Mandatory - - - - - - - - - - - - IRI - - - - https://acplt.org/Test_Submodel_Mandatory - - - - - TEMPLATE - - - - - ExampleRelationshipElement - - - - - - - - - ExampleAnnotatedRelationshipElement - - - - - - - - - ExampleOperation - - - - - - - ExampleCapability - - - - - - - ExampleBasicEvent - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - - - false - - - - ExampleSubmodelCollectionOrdered - - - - true - - - - - ExampleProperty - - - - string - - - - - - - - ExampleMultiLanguageProperty - - - - - - - - ExampleRange - - - - int - - - - - - - - - false - - - - ExampleSubmodelCollectionUnordered - - - - false - - - - - ExampleBlob - - - - application/pdf - - - - - - - ExampleFile - - - - application/pdf - - - - - application/pdf - - - - - - - - ExampleReferenceElement - - - - - - - - - - false - - - - ExampleSubmodelCollectionUnordered2 - - - - false - - - - - - - - - - - - - - - - - - - - IRI - - - - https://acplt.org/Test_Submodel2_Mandatory - - - - - INSTANCE - - - - - - - - - - - 0 - - - - 0.9 - - - - - - - INSTANCE - - - - (ASSET)[IRI]https://acplt.org/Test_Asset_Missing - - - - - - - An Example Asset Administration Shell for the test application - - - Ein Beispiel-Verwaltungsschale für eine Test-Anwendung - - - - TestAssetAdministrationShell - - - - - - IRI - - - - https://acplt.org/Test_AssetAdministrationShell_Missing - - - - - - - - 0 - - - - 0.9 - - - - - - - An example submodel for the test application - - - Ein Beispiel-Teilmodell für eine Test-Anwendung - - - - TestSubmodel - - - - - - IRI - - - - https://acplt.org/Test_Submodel_Missing - - - - - INSTANCE - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelTemplates/ExampleSubmodel - - - - - Parameter - - - - - - Example RelationshipElement object - - - Beispiel RelationshipElement Element - - - - ExampleRelationshipElement - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleRelationshipElement - - - - - - - - - Parameter - - - - - - Example AnnotatedRelationshipElement object - - - Beispiel AnnotatedRelationshipElement Element - - - - ExampleAnnotatedRelationshipElement - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement - - - - - - - Parameter - - - - ExampleProperty - - - - INSTANCE - - - - some example annotation - - - - string - - - - - - - - - Parameter - - - - - - Example Operation object - - - Beispiel Operation Element - - - - ExampleOperation - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Operations/ExampleOperation - - - - - - Constant - - - - - - Example Property object - - - Beispiel Property Element - - - - ExampleProperty - - - - - - http://acplt.org/Qualifier/ExampleQualifier - - - - string - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty - - - - exampleValue - - - - string - - - - - - - - - - Constant - - - - - - Example Property object - - - Beispiel Property Element - - - - ExampleProperty - - - - - - http://acplt.org/Qualifier/ExampleQualifier - - - - string - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty - - - - exampleValue - - - - string - - - - - - - - - - Constant - - - - - - Example Property object - - - Beispiel Property Element - - - - ExampleProperty - - - - - - http://acplt.org/Qualifier/ExampleQualifier - - - - string - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty - - - - exampleValue - - - - string - - - - - - - - - - - Parameter - - - - - - Example Capability object - - - Beispiel Capability Element - - - - ExampleCapability - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Capabilities/ExampleCapability - - - - - - - Parameter - - - - - - Example BasicEvent object - - - Beispiel BasicEvent Element - - - - ExampleBasicEvent - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Events/ExampleBasicEvent - - - - - - - false - - - - Parameter - - - - - - Example SubmodelElementCollectionOrdered object - - - Beispiel SubmodelElementCollectionOrdered Element - - - - ExampleSubmodelCollectionOrdered - - - - true - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered - - - - - Constant - - - - - - Example Property object - - - Beispiel Property Element - - - - ExampleProperty - - - - - - http://acplt.org/Qualifier/ExampleQualifier - - - - string - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Properties/ExampleProperty - - - - exampleValue - - - - string - - - - - - - - Constant - - - - - - Example MultiLanguageProperty object - - - Beispiel MulitLanguageProperty Element - - - - ExampleMultiLanguageProperty - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty - - - - - - Example value of a MultiLanguageProperty element - - - Beispielswert für ein MulitLanguageProperty-Element - - - - - - - - Parameter - - - - - - Example Range object - - - Beispiel Range Element - - - - ExampleRange - - - - 100 - - - - 0 - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Ranges/ExampleRange - - - - int - - - - - - - - - false - - - - Parameter - - - - - - Example SubmodelElementCollectionUnordered object - - - Beispiel SubmodelElementCollectionUnordered Element - - - - ExampleSubmodelCollectionUnordered - - - - false - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered - - - - - Parameter - - - - - - Example Blob object - - - Beispiel Blob Element - - - - ExampleBlob - - - - application/pdf - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Blobs/ExampleBlob - - - - AQIDBAU= - - - - - - - Parameter - - - - - - Example File object - - - Beispiel File Element - - - - ExampleFile - - - - application/pdf - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Files/ExampleFile - - - - /TestFile.pdf - - - - - application/pdf - - - /TestFile.pdf - - - - - - - Parameter - - - - - - Example Reference Element object - - - Beispiel Reference Element Element - - - - ExampleReferenceElement - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ReferenceElements/ExampleReferenceElement - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - - - - 0.9 - - - - - - - An example concept description for the test application - - - Ein Beispiel-ConceptDescription für eine Test-Anwendung - - - - TestConceptDescription - - - - - - IRI - - - - https://acplt.org/Test_ConceptDescription - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/DataSpecifications/ConceptDescriptions/TestConceptDescription - - - - - - - - - - - - - IRI - - - - https://acplt.org/Test_ConceptDescription_Mandatory - - - - - - - - - - 0 - - - - 0.9 - - - - - - - An example concept description for the test application - - - Ein Beispiel-ConceptDescription für eine Test-Anwendung - - - - TestConceptDescription - - - - - - IRI - - - - https://acplt.org/Test_ConceptDescription_Missing - - - - - - - - - - 0 - - - - 0.9 - - - - - TestSpec_01 - - - - - - IRI - - - - http://acplt.org/DataSpecifciations/Example/Identification - - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/ReferenceElements/ConceptDescriptionX - - - - - REAL_MEASURE - - - - - - Dies ist eine Data Specification für Testzwecke - - - This is a DataSpecification for testing purposes - - - - - - Test Specification - - - TestSpecification - - - - - - Test Spec - - - TestSpec - - - - http://acplt.org/DataSpec/ExampleDef - - - - SU - - - - SpaceUnit - - - - (GLOBAL_REFERENCE)[IRI]http://acplt.org/Units/SpaceUnit - - - - TEST - - - - string - - - - - - - - - Interface Class Library according to Details of the Asset Administration Shell V2.0. - 1.0.0 - - A FileDataReference represents the address to a File. FileDataReference is derived from the AutomationML Interface Class ExternalDataReference that is defined in AutomationML BPR_005E_ExternalDataReference_v1.0.0_2:The interface class “ExternalDataReference” shall be used in order to reference external documents out of the scope of AutomationML. - - - Reference to any other referable element of the same of any other AAS or a reference to an external object or entity. For local references inside the same Asset Administration Shell an InternalLink between two objects with this interface "ReferableReference" shall be set. In this case the attribute value has to be empty. For references between different Asset Administration Shells or external objects or entities the attribute value shall be used and no InternalLink shall be set. - - Reference to any other referable element of any other AAS or a reference to an external object or entity. Note: For references to any other referable element of the same AAS InternalLinks are used and this attribute value shall be empty. - - - - - - Standard Automation Markup Language Interface Class Library - Part 1 Content extended with Part 3 and Part 4 Content - 2.2.2 - - - - - - - - - - The attribute refURI is an IRI that can represent an absolute or relative path to an L document. An added fragment (with #) references inside the document - - - - - - - - - - - - - - - - - true - - - - - - - - - - - - - 1.0.0 - - - Mime type of the content of the File. - - - - - Role Class Library according to Details of the Asset Administration Shell V2.0. - 1.0.0 - - An Asset Administration Shell. - - Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - 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. - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - - - - - Abstract attribute class for identification. Has the subattributes id and idType. - - - Identifier of the element. Its type is defined in idType. Id is a subproperty of identification. - - - - - Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the enumeration “IdentifierType”. IdType is a subproperty of identification. - - - - - - Abstract attribute for administration. Has the subattributes revision and version. - - - Revision of the element. Constraint AASd-005: A revision requires a version. This means, if there is no version there is no revision neither. Revision is a subproperty of administration. - - - - - Version of the element. Version is a subproperty of administration. - - - - - - Global reference to the data specification template used by the element. - - - - - The derivedFrom attribute is used to establish a relationship between two Asset Administration Shells that are derived from each other. - - - - - - An Asset describes meta data of an asset that is represented by an AAS. The asset may either represent an asset type or an asset instance. The asset has a globally unique identifier plus – if needed – additional domain specific (proprietary) identifiers. - - Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - 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. - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - Abstract attribute class for identification. Has the subattributes id and idType. - - - Identifier of the element. Its type is defined in idType. - - - - - Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the enumeration “IdentifierType”. IdType is a subproperty of identification. - - - - - - Abstract attribute for administration. Has the subattributes revision and version. - - - Revision of the element. Constraint AASd-005: A revision requires a version. This means, if there is no version there is no revision neither. Revision is a subproperty of administration. - - - - - Version of the element. Version is a subproperty of administration. - - - - - - Global reference to the data specification template used by the element. - - - - - Kind of the asset: either type or instance. - Instance - Instance - - - - Instance - Type - - - - - - A Submodel defines a specific aspect of the asset represented by the AAS. A submodel is used to structure the virtual representation and technical functionality of an Administration Shell into distinguishable parts. Each submodel refers to a well-defined domain or subject matter. Submodels can become standardized and thus become submodels types. Submodels can have different life-cycles. - - Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - 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. - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - Abstract attribute class for identification. Has the subattributes id and idType. - - - Identifier of the element. Its type is defined in idType. Id is a subproperty of identification. - - - - - Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the enumeration “IdentifierType”. IdType is a subproperty of identification. - - - - - - Abstract attribute for administration. Has the subattributes revision and version. - - - Revision of the element. Constraint AASd-005: A revision requires a version. This means, if there is no version there is no revision neither. Revision is a subproperty of administration. - - - - - Version of the element. Version of the element. Version is a subproperty of administration. - - - - - - Global reference to the data specification template used by the element. - - - - - Kind of the element: either template or instance. - Instance - Instance - - - - Instance - Type - - - - - Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. - - - - - A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. - - - The type describes the type of the qualifier that is applied to the element. - - - - - The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. - - - - - Reference to the global unqiue id of a coded value. - - - - - - - A submodel element collection is a set or list of submodel elements. - - Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - 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. - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - Global reference to the data specification template used by the element. - - - - - Kind of the element: either template or instance. - Instance - Instance - - - - Instance - Type - - - - - Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. - - - - - A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. - - - The type describes the type of the qualifier that is applied to the element. - - - - - The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. - - - - - Reference to the global unqiue id of a coded value. - - - - - - If allowDuplicates=true, then it is allowed that the collection contains the same element several times. - false - - - - If ordered=false, then the elements in the property collection are not ordered. If ordered=true then the elements in the collection are ordered. Default = false. Note: An ordered submodel element collection is typically implemented as an indexed array. - false - - - - Submodel element contained in the collection. - - - - - A BLOB is a data element that represents a file that is contained with its source code in the value attribute. - - Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - 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. - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - Global reference to the data specification template used by the element. - - - - - Kind of the element: either template or instance. - Instance - Instance - - - - Instance - Type - - - - - Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. - - - - - A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. - - - The type describes the type of the qualifier that is applied to the element. - - - - - The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. - - - - - Reference to the global unqiue id of a coded value. - - - - - - Mime type of the content of the BLOB. The mime type states which file extension the file has. Valid values are e.g. “application/json”, “application/xls”, ”image/jpg”. The allowed values are defined as in RFC2046. - - - - - The value of the BLOB instance of a blob data element. Note: In contrast to the file property the file content is stored directly as value in the Blob data element. - - - - - - A capability is the implementation-independent description of the potential of an asset to achieve a certain effect in the physical or virtual world. - - Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - 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. - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - Global reference to the data specification template used by the element. - - - - - Kind of the element: either template or instance. - Instance - Instance - - - - Instance - Type - - - - - Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. - - - - - A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. - - - The type describes the type of the qualifier that is applied to the element. - - - - - The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. - - - - - Reference to the global unqiue id of a coded value. - - - - - - - A role class for a File that a data element that represents an address to a file. It is derived from the AutomationML role class ExternalData that is an role type for a document type and the base class for all document type roles. It describes different document types. ExternalData is defined in AutomationML BPR_005E_ExternalDataReference_v1.0.0_2. - - Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - 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. - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - Global reference to the data specification template used by the element. - - - - - Kind of the element: either template or instance. - Instance - Instance - - - - Instance - Type - - - - - Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. - - - - - A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. - - - The type describes the type of the qualifier that is applied to the element. - - - - - The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. - - - - - Reference to the global unqiue id of a coded value. - - - - - - - The attribute refURI is an IRI that can represent an absolute or relative path to an L document. An added fragment (with #) references inside the document - - - Mime type of the content of the File. - - - - - A property is a data element that has a single value. - - Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - 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. - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - Global reference to the data specification template used by the element. - - - - - Kind of the element: either template or instance. - Instance - Instance - - - - Instance - Type - - - - - Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. - - - - - A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. - - - The type describes the type of the qualifier that is applied to the element. - - - - - The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. - - - - - Reference to the global unqiue id of a coded value. - - - - - - The value of the property instance. - - - - Reference to the global unique id if a coded value. - - - - - A reference element is a data element that defines a logical reference to another element within the same or another AAS or a reference to an external object or entity. - - Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - 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. - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - Global reference to the data specification template used by the element. - - - - - Kind of the element: either template or instance. - Instance - Instance - - - - Instance - Type - - - - - Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. - - - - - A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. - - - The type describes the type of the qualifier that is applied to the element. - - - - - The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. - - - - - Reference to the global unqiue id of a coded value. - - - - - - - Reference to any other referable element of any other AAS or a reference to an external object or entity. Note: For references to any other referable elment of the same AAS InternalLinks are used and this attribute value shall be empty. - - - - - - A relationship element is used to define a relationship between two referable elements. - - Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - 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. - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - Global reference to the data specification template used by the element. - - - - - Kind of the element: either template or instance. - Instance - Instance - - - - Instance - Type - - - - - Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. - - - - - A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. - - - The type describes the type of the qualifier that is applied to the element. - - - - - The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. - - - - - Reference to the global unqiue id of a coded value. - - - - - - - Reference to any other referable element of any other AAS or a reference to an external object or entity. Note: For references to any other referable elment of the same AAS InternalLinks are used and this attribute value shall be empty. - - - - - Reference to any other referable element of any other AAS or a reference to an external object or entity. Note: For references to any other referable elment of the same AAS InternalLinks are used and this attribute value shall be empty. - - - - - An annotated relationship element is an relationship element that can be annotated with additional data elements. - - Annotations that hold for the relationships between the two elements. - - - - - An operation is a submodel element with input and output variables. - - Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - 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. - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - Global reference to the data specification template used by the element. - - - - - Kind of the element: either template or instance. - Instance - Instance - - - - Instance - Type - - - - - Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. - - - - - A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. - - - The type describes the type of the qualifier that is applied to the element. - - - - - The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. - - - - - Reference to the global unqiue id of a coded value. - - - - - - - The list of AAS OperationVariableIn entities. In AML, the corresponding InternalElement with this role is a child of the InternalElement with the Operation role. - - - The list of AAS OperationVariableOut entities. In AML, the corresponding InternalElement with this role is a child of the InternalElement with the Operation role. - - - The list of AAS OperationVariableOut entities. In AML, the corresponding InternalElement with this role is a child of the InternalElement with the Operation role. - - - A view is a collection of referable elements w.r.t. to a specific viewpoint of one or more stakeholders. - - Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - 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. - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - Global reference to the data specification template used by the element. - - - - - Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. - - - - - - A dictionary contains elements that can be reused. - - Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - 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. - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - - - - - - Explanation: The semantics of a property or other elements that may have a semantic description is defined by a concept description. The description of the concept should follow a standardized schema (realized as data specification template). - - Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - 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. - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - Abstract attribute class for identification. Has the subattributes id and idType. - - - Identifier of the element. Its type is defined in idType. Id is a subproperty of identification. - - - - - Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the enumeration “IdentifierType”. IdType is a subproperty of identification. - - - - - - Abstract attribute for administration. Has the subattributes revision and version. - - - Revision of the element. Constraint AASd-005: A revision requires a version. This means, if there is no version there is no revision neither. Revision is a subproperty of administration. - - - - - Version of the element. Version is a subproperty of administration. - - - - - - Global reference to the data specification template used by the element. - - - - Global reference to an external definition the concept is compatible to or was derived from. - - - - - - Description Role class of an element that has a data specification template. A template defines the additional attributes an element may or shall have. - - Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - 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. - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - - - - - Abstract attribute class for identification. Has the subattributes id and idType. - - - Identifier of the element. Its type is defined in idType. Id is a subproperty of identification. - - - - - Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the enumeration “IdentifierType”. IdType is a subproperty of identification. - - - - - - Abstract attribute for administration. Has the subattributes revision and version. - - - Revision of the element. Constraint AASd-005: A revision requires a version. This means, if there is no version there is no revision neither. Revision is a subproperty of administration. - - - - - Version of the element. Version is a subproperty of administration. - - - - - - - Content of the data specification template. - - - An entity is a submodel element that is used to model entities. Constraint AASd-056: If the semanticId of a Entity submodel element references a ConceptDescription then the ConceptDescription/category shall be one of following values: ENTITY. The ConceptDescription describes the elements assigned to the entity via Entity/statement. - - Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - 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. - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - Global reference to the data specification template used by the element. - - - - - Kind of the element: either template or instance. - Instance - Instance - - - - Instance - Type - - - - - Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. - - - - - A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. - - - The type describes the type of the qualifier that is applied to the element. - - - - - The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. - - - - - Reference to the global unqiue id of a coded value. - - - - - - Describes statements applicable to the entity by a set of submodel elements, typically with a qualified value. - - - - Describes whether the entity is a co-managed entity or a self-managed entity. - SelfManagedEntity - SelfManagedEntity - - - - CoManagedEntity - SelfManagedEntity - - - - - Reference to an identifier key value pair representing a specific identifier of the asset represented by the asset administration shell. See Constraint AASd-014 - - - - Reference to the asset the entity is representing. Constraint AASd-014: Either the attribute globalAssetId or specificAssetId of an Entity must be set if Entity/entityType is set to "SelfManagedEntity". They are not existing otherwise. - - - - - - Automation Markup Language Base Role Class Library - Part 1 Content extended with Part 3 and Part 4 Content - 2.2.2 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1.0.0 - - - - - - - - INSTANCE - - - - (ASSET)[IRI]https://acplt.org/Test_Asset_Mandatory - - - - - - - - - - - IRI - - - - https://acplt.org/Test_AssetAdministrationShell_Mandatory - - - - - - - - - - - - IRI - - - - https://acplt.org/Test_Submodel_Mandatory - - - - - TEMPLATE - - - - - ExampleRelationshipElement - - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - - - ExampleAnnotatedRelationshipElement - - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - - - ExampleOperation - - - - - - - ExampleCapability - - - - - - - ExampleBasicEvent - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - - - false - - - - ExampleSubmodelCollectionOrdered - - - - true - - - - - ExampleProperty - - - - string - - - - - - - ExampleMultiLanguageProperty - - - - - - - ExampleRange - - - - int - - - - - - - - - false - - - - ExampleSubmodelCollectionUnordered - - - - false - - - - - ExampleBlob - - - - application/pdf - - - - - - - ExampleFile - - - - application/pdf - - - - - application/pdf - - - - - - - - ExampleReferenceElement - - - - - - - - - - - - false - - - - ExampleSubmodelCollectionUnordered2 - - - - false - - - - - - - - - - - - - - - IRI - - - - https://acplt.org/Test_Submodel2_Mandatory - - - - - INSTANCE - - - - - - - - - - - - - - - IRI - - - - https://acplt.org/Test_Submodel_Mandatory - - - - - TEMPLATE - - - - - ExampleRelationshipElement - - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - - - ExampleAnnotatedRelationshipElement - - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - - - ExampleOperation - - - - - - - ExampleCapability - - - - - - - ExampleBasicEvent - - - - (PROPERTY)[ID_SHORT]ExampleProperty - - - - - - - false - - - - ExampleSubmodelCollectionOrdered - - - - true - - - - - ExampleProperty - - - - string - - - - - - - ExampleMultiLanguageProperty - - - - - - - ExampleRange - - - - int - - - - - - - - - false - - - - ExampleSubmodelCollectionUnordered - - - - false - - - - - ExampleBlob - - - - application/pdf - - - - - - - ExampleFile - - - - application/pdf - - - - - application/pdf - - - - - - - - ExampleReferenceElement - - - - - - - - - - - - false - - - - ExampleSubmodelCollectionUnordered2 - - - - false - - - - - - - - - 0 - - An AAS Data Specification template for IEC61369. A template consists of the DataSpecificationContent containing the additional attributes to be added to the element instance that references the data specification template and meta information about the template itself (this is why DataSpecification inherits from Identifiable). In UML these are two separated classes. - - Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. - - - - 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. - - - - - Description or comments on the element. The description can be provided in several languages. - - - - - - - - - - - Abstract attribute class for identification. Has the subattributes id and idType. - - - Identifier of the element. Its type is defined in idType. Id is a subproperty of identification. - http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360 - - - - Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the enumeration “IdentifierType”. IdType is a subproperty of identification. - IRI - - - - - Abstract attribute for administration. Has the subattributes revision and version. - - - Revision of the element. Constraint AASd-005: A revision requires a version. This means, if there is no version there is no revision neither. Revision is a subproperty of administration. - - - - - Version of the element. Version is a subproperty of administration. - - - - - - - The content of an AAS Data Specification template for IEC61360. - - Identifies the attribute hierarchy for preferredName in above attribute hierachy. Subordinate attributes are designated by the country code information (see aml-lang literal). - - - - Identifies the attribute for shortName in above attribute hierarchy. - - - - Identifies the attribute for unit in above attribute hierarchy. - - - - Identifies the attribute for unitId in above attribute hierarchy in its string serialization. - - - - Identifies the attribute for sourceOfDefinition in above attribute hierachy. Subordinate attributes are designated by the country code information (see aml-lang literal). - - - - Identifies the attribute for symbol in above attribute hierarchy. - - - - Identifies the attribute for dataType in above attribute hierarchy. - - - - Identifies the attribute for definition in above attribute hierachy. Subordinate attributes are designated by the country code information (see aml-lang literal). - - - - Identifies the attribute for valueFormat in above attribute hierarchy. - - - - Identifies the attribute for valueList in above attribute hierarchy. - - - - The attribute value. - - - - The id for the value. - - - - - - - \ No newline at end of file + + + + + foo + bar + 05-08-2021 15:14:40 + + + + + AutomationML Editor + 916578CA-FE0D-474E-A4FC-9E1719892369 + AutomationML e.V. + www.AutomationML.org + 5.3.3.0 + 5.3.3.0 + 2021-08-12T15:21:38.8927896 + unspecified + unspecified + + + + + + + + 0 + + + + 0.9 + + + + + + + INSTANCE + + + + (Submodel)[IRI]http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial + + + + (Asset)[IRI]https://acplt.org/Test_Asset + + + + + (AssetAdministrationShell)[IRI]https://acplt.org/TestAssetAdministrationShell2 + + + + + + An Example Asset Administration Shell for the test application + + + Ein Beispiel-Verwaltungsschale für eine Test-Anwendung + + + + TestAssetAdministrationShell + + + + + + IRI + + + + https://acplt.org/Test_AssetAdministrationShell + + + + + + + + 0 + + + + 0.9 + + + + + + + An example submodel for the test application + + + Ein Beispiel-Teilmodell für eine Test-Anwendung + + + + TestSubmodel + + + + + + IRI + + + + https://acplt.org/Test_Submodel + + + + + INSTANCE + + + + (GlobalReference)[IRI]http://acplt.org/SubmodelTemplates/ExampleSubmodel + + + + + Parameter + + + + + + Example RelationshipElement object + + + Beispiel RelationshipElement Element + + + + ExampleRelationshipElement + + + + (GlobalReference)[IRI]http://acplt.org/RelationshipElements/ExampleRelationshipElement + + + + + + + + + + Parameter + + + + + + Example AnnotatedRelationshipElement object + + + Beispiel AnnotatedRelationshipElement Element + + + + ExampleAnnotatedRelationshipElement + + + + (GlobalReference)[IRI]http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement + + + + + + Parameter + + + + ExampleProperty3 + + + + INSTANCE + + + + some example annotation + + + + string + + + + + + + + + + + Parameter + + + + + + Example Operation object + + + Beispiel Operation Element + + + + ExampleOperation + + + + (GlobalReference)[IRI]http://acplt.org/Operations/ExampleOperation + + + + + + Constant + + + + + + Example Property object + + + Beispiel Property Element + + + + ExampleProperty3 + + + + (GlobalReference)[IRI]http://acplt.org/Properties/ExampleProperty + + + + exampleValue + + + + (GlobalReference)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + string + + + + + + + + + + Constant + + + + + + Example Property object + + + Beispiel Property Element + + + + ExampleProperty1 + + + + (GlobalReference)[IRI]http://acplt.org/Properties/ExampleProperty + + + + exampleValue + + + + (GlobalReference)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + string + + + + + + + + + + Constant + + + + + + Example Property object + + + Beispiel Property Element + + + + ExampleProperty2 + + + + (GlobalReference)[IRI]http://acplt.org/Properties/ExampleProperty + + + + exampleValue + + + + (GlobalReference)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + string + + + + + + + + + + + Parameter + + + + + + Example Capability object + + + Beispiel Capability Element + + + + ExampleCapability + + + + (GlobalReference)[IRI]http://acplt.org/Capabilities/ExampleCapability + + + + + + + Parameter + + + + + + Example BasicEvent object + + + Beispiel BasicEvent Element + + + + ExampleBasicEvent + + + + (Submodel)[IRI]https://acplt.org/Test_Submodel,(SubmodelElementCollection)[ID_SHORT]ExampleSubmodelCollectionOrdered,(Property)[ID_SHORT]ExampleProperty + + + + (GlobalReference)[IRI]http://acplt.org/Events/ExampleBasicEvent + + + + + + + false + + + + Parameter + + + + + + Example SubmodelElementCollectionOrdered object + + + Beispiel SubmodelElementCollectionOrdered Element + + + + ExampleSubmodelCollectionOrdered + + + + true + + + + (GlobalReference)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered + + + + + Constant + + + + + + Example Property object + + + Beispiel Property Element + + + + ExampleProperty + + + + (GlobalReference)[IRI]http://acplt.org/Properties/ExampleProperty + + + + exampleValue + + + + (GlobalReference)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + string + + + + + + + + Constant + + + + + + Example MultiLanguageProperty object + + + Beispiel MulitLanguageProperty Element + + + + ExampleMultiLanguageProperty + + + + (GlobalReference)[IRI]http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty + + + + (GlobalReference)[IRI]http://acplt.org/ValueId/ExampleMultiLanguageValueId + + + + + + Example value of a MultiLanguageProperty element + + + Beispielswert für ein MulitLanguageProperty-Element + + + + + + + Parameter + + + + + + Example Range object + + + Beispiel Range Element + + + + ExampleRange + + + + 100 + + + + 0 + + + + (GlobalReference)[IRI]http://acplt.org/Ranges/ExampleRange + + + + int + + + + + + + + + false + + + + Parameter + + + + + + Example SubmodelElementCollectionUnordered object + + + Beispiel SubmodelElementCollectionUnordered Element + + + + ExampleSubmodelCollectionUnordered + + + + false + + + + (GlobalReference)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered + + + + + Parameter + + + + + + Example Blob object + + + Beispiel Blob Element + + + + ExampleBlob + + + + application/pdf + + + + (GlobalReference)[IRI]http://acplt.org/Blobs/ExampleBlob + + + + AQIDBAU= + + + + + + + Parameter + + + + + + Example File object + + + Beispiel File Element + + + + ExampleFile + + + + application/pdf + + + + (GlobalReference)[IRI]http://acplt.org/Files/ExampleFile + + + + /TestFile.pdf + + + + + application/pdf + + + /TestFile.pdf + + + + + + + Parameter + + + + + + Example Reference Element object + + + Beispiel Reference Element Element + + + + ExampleReferenceElement + + + + (GlobalReference)[IRI]http://acplt.org/ReferenceElements/ExampleReferenceElement + + + + + + + + + + + + + + + 0.9 + + + + + + + An example bill of material submodel for the test application + + + Ein Beispiel-BillofMaterial-Submodel für eine Test-Anwendung + + + + BillOfMaterial + + + + + + IRI + + + + http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial + + + + + INSTANCE + + + + (Submodel)[IRI]http://acplt.org/SubmodelTemplates/BillOfMaterial + + + + + + + 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. + + + 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 + + + + CO_MANAGED_ENTITY + + + + ExampleEntity + + + + (GlobalReference)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber + + + + + Constant + + + + + + Example Property object + + + Beispiel Property Element + + + + ExampleProperty2 + + + + (GlobalReference)[IRI]http://acplt.org/Properties/ExampleProperty + + + + exampleValue2 + + + + (GlobalReference)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + string + + + + + + + + Constant + + + + + + Example Property object + + + Beispiel Property Element + + + + ExampleProperty + + + + (GlobalReference)[IRI]http://acplt.org/Properties/ExampleProperty + + + + exampleValue + + + + (GlobalReference)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + string + + + + + + + + + + + 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. + + + 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 + + + + SELF_MANAGED_ENTITY + + + + (Asset)[IRI]https://acplt.org/Test_Asset2 + + + + ExampleEntity2 + + + + (GlobalReference)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber + + + + + + + + + + + 0 + + + + 0.9 + + + + + + + An example asset identification submodel for the test application + + + Ein Beispiel-Identifikations-Submodel für eine Test-Anwendung + + + + Identification + + + + + + IRI + + + + http://acplt.org/Submodels/Assets/TestAsset/Identification + + + + + INSTANCE + + + + (Submodel)[IRI]http://acplt.org/SubmodelTemplates/AssetIdentification + + + + + + + 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. + + + 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 + + + + ManufacturerName + + + + + + http://acplt.org/Qualifier/ExampleQualifier + + + + 100 + + + + (GlobalReference)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + int + + + + + + + http://acplt.org/Qualifier/ExampleQualifier2 + + + + 50 + + + + (GlobalReference)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + int + + + + + (GlobalReference)[IRI]0173-1#02-AAO677#002 + + + + ACPLT + + + + (GlobalReference)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + string + + + + + + + + + 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. + + + 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 + + + + InstanceId + + + + (GlobalReference)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber + + + + 978-8234-234-342 + + + + (GlobalReference)[IRI]http://acplt.org/ValueId/ExampleValueId + + + + string + + + + + + + + + + + + + INSTANCE + + + + (Asset)[IRI]https://acplt.org/Test_Asset_Mandatory + + + + + + + + + + + IRI + + + + https://acplt.org/Test_AssetAdministrationShell_Mandatory + + + + + + + + + + + + IRI + + + + https://acplt.org/Test_Submodel_Mandatory + + + + + TEMPLATE + + + + + ExampleRelationshipElement + + + + + + + + + + ExampleAnnotatedRelationshipElement + + + + + + + + + + ExampleOperation + + + + + + + ExampleCapability + + + + + + + ExampleBasicEvent + + + + (Submodel)[IRI]https://acplt.org/Test_Submodel_Mandatory,(SubmodelElementCollection)[ID_SHORT]ExampleSubmodelCollectionOrdered,(Property)[ID_SHORT]ExampleProperty + + + + + + + false + + + + ExampleSubmodelCollectionOrdered + + + + true + + + + + ExampleProperty + + + + string + + + + + + + + ExampleMultiLanguageProperty + + + + + + + + ExampleRange + + + + int + + + + + + + + + false + + + + ExampleSubmodelCollectionUnordered + + + + false + + + + + ExampleBlob + + + + application/pdf + + + + + + + ExampleFile + + + + application/pdf + + + + + application/pdf + + + + + + + + ExampleReferenceElement + + + + + + + + + false + + + + ExampleSubmodelCollectionUnordered2 + + + + false + + + + + + + + + + + + + + + IRI + + + + https://acplt.org/Test_Submodel2_Mandatory + + + + + INSTANCE + + + + + + + + + + + 0 + + + + 0.9 + + + + + + + INSTANCE + + + + (Asset)[IRI]https://acplt.org/Test_Asset_Missing + + + + + + + An Example Asset Administration Shell for the test application + + + Ein Beispiel-Verwaltungsschale für eine Test-Anwendung + + + + TestAssetAdministrationShell + + + + + + IRI + + + + https://acplt.org/Test_AssetAdministrationShell_Missing + + + + + + + + + + + + + + + 0 + + + + 0.9 + + + + + + + An example submodel for the test application + + + Ein Beispiel-Teilmodell für eine Test-Anwendung + + + + TestSubmodel + + + + + + IRI + + + + https://acplt.org/Test_Submodel_Missing + + + + + INSTANCE + + + + (GlobalReference)[IRI]http://acplt.org/SubmodelTemplates/ExampleSubmodel + + + + + Parameter + + + + + + Example RelationshipElement object + + + Beispiel RelationshipElement Element + + + + ExampleRelationshipElement + + + + (GlobalReference)[IRI]http://acplt.org/RelationshipElements/ExampleRelationshipElement + + + + + + + + + + Parameter + + + + + + Example AnnotatedRelationshipElement object + + + Beispiel AnnotatedRelationshipElement Element + + + + ExampleAnnotatedRelationshipElement + + + + (GlobalReference)[IRI]http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement + + + + + + Parameter + + + + ExampleProperty + + + + INSTANCE + + + + some example annotation + + + + string + + + + + + + + + + + Parameter + + + + + + Example Operation object + + + Beispiel Operation Element + + + + ExampleOperation + + + + (GlobalReference)[IRI]http://acplt.org/Operations/ExampleOperation + + + + + + Constant + + + + + + Example Property object + + + Beispiel Property Element + + + + ExampleProperty3 + + + + + + http://acplt.org/Qualifier/ExampleQualifier + + + + string + + + + + (GlobalReference)[IRI]http://acplt.org/Properties/ExampleProperty + + + + exampleValue + + + + string + + + + + + + + + + Constant + + + + + + Example Property object + + + Beispiel Property Element + + + + ExampleProperty1 + + + + + + http://acplt.org/Qualifier/ExampleQualifier + + + + string + + + + + (GlobalReference)[IRI]http://acplt.org/Properties/ExampleProperty + + + + exampleValue + + + + string + + + + + + + + + + Constant + + + + + + Example Property object + + + Beispiel Property Element + + + + ExampleProperty2 + + + + + + http://acplt.org/Qualifier/ExampleQualifier + + + + string + + + + + (GlobalReference)[IRI]http://acplt.org/Properties/ExampleProperty + + + + exampleValue + + + + string + + + + + + + + + + + Parameter + + + + + + Example Capability object + + + Beispiel Capability Element + + + + ExampleCapability + + + + (GlobalReference)[IRI]http://acplt.org/Capabilities/ExampleCapability + + + + + + + Parameter + + + + + + Example BasicEvent object + + + Beispiel BasicEvent Element + + + + ExampleBasicEvent + + + + (Submodel)[IRI]https://acplt.org/Test_Submodel_Missing,(SubmodelElementCollection)[ID_SHORT]ExampleSubmodelCollectionOrdered,(Property)[ID_SHORT]ExampleProperty + + + + (GlobalReference)[IRI]http://acplt.org/Events/ExampleBasicEvent + + + + + + + false + + + + Parameter + + + + + + Example SubmodelElementCollectionOrdered object + + + Beispiel SubmodelElementCollectionOrdered Element + + + + ExampleSubmodelCollectionOrdered + + + + true + + + + (GlobalReference)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered + + + + + Constant + + + + + + Example Property object + + + Beispiel Property Element + + + + ExampleProperty + + + + + + http://acplt.org/Qualifier/ExampleQualifier + + + + string + + + + + (GlobalReference)[IRI]http://acplt.org/Properties/ExampleProperty + + + + exampleValue + + + + string + + + + + + + + Constant + + + + + + Example MultiLanguageProperty object + + + Beispiel MulitLanguageProperty Element + + + + ExampleMultiLanguageProperty + + + + (GlobalReference)[IRI]http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty + + + + + + Example value of a MultiLanguageProperty element + + + Beispielswert für ein MulitLanguageProperty-Element + + + + + + + + Parameter + + + + + + Example Range object + + + Beispiel Range Element + + + + ExampleRange + + + + 100 + + + + 0 + + + + (GlobalReference)[IRI]http://acplt.org/Ranges/ExampleRange + + + + int + + + + + + + + + false + + + + Parameter + + + + + + Example SubmodelElementCollectionUnordered object + + + Beispiel SubmodelElementCollectionUnordered Element + + + + ExampleSubmodelCollectionUnordered + + + + false + + + + (GlobalReference)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered + + + + + Parameter + + + + + + Example Blob object + + + Beispiel Blob Element + + + + ExampleBlob + + + + application/pdf + + + + (GlobalReference)[IRI]http://acplt.org/Blobs/ExampleBlob + + + + AQIDBAU= + + + + + + + Parameter + + + + + + Example File object + + + Beispiel File Element + + + + ExampleFile + + + + application/pdf + + + + (GlobalReference)[IRI]http://acplt.org/Files/ExampleFile + + + + /TestFile.pdf + + + + + application/pdf + + + /TestFile.pdf + + + + + + + Parameter + + + + + + Example Reference Element object + + + Beispiel Reference Element Element + + + + ExampleReferenceElement + + + + (GlobalReference)[IRI]http://acplt.org/ReferenceElements/ExampleReferenceElement + + + + + + + + + + + + + + + + + + + 0 + + + + 0.9 + + + + + + + An example concept description for the test application + + + Ein Beispiel-ConceptDescription für eine Test-Anwendung + + + + TestConceptDescription + + + + + + IRI + + + + https://acplt.org/Test_ConceptDescription + + + + + (GlobalReference)[IRI]http://acplt.org/DataSpecifications/ConceptDescriptions/TestConceptDescription + + + + + + + + + + + + + IRI + + + + https://acplt.org/Test_ConceptDescription_Mandatory + + + + + + + + + + 0 + + + + 0.9 + + + + + + + An example concept description for the test application + + + Ein Beispiel-ConceptDescription für eine Test-Anwendung + + + + TestConceptDescription1 + + + + + + IRI + + + + https://acplt.org/Test_ConceptDescription_Missing + + + + + + + + + + 0 + + + + 0.9 + + + + + TestSpec_01 + + + + + + IRI + + + + http://acplt.org/DataSpecifciations/Example/Identification + + + + + (GlobalReference)[IRI]http://acplt.org/ReferenceElements/ConceptDescriptionX + + + + + REAL_MEASURE + + + + + + Dies ist eine Data Specification für Testzwecke + + + This is a DataSpecification for testing purposes + + + + + + Test Specification + + + TestSpecification + + + + + + Test Spec + + + TestSpec + + + + http://acplt.org/DataSpec/ExampleDef + + + + SU + + + + SpaceUnit + + + + (GlobalReference)[IRI]http://acplt.org/Units/SpaceUnit + + + + TEST + + + + string + + + + + + + + + Interface Class Library according to Details of the Asset Administration Shell V2.0. + 1.0.0 + + A FileDataReference represents the address to a File. FileDataReference is derived from the AutomationML Interface Class ExternalDataReference that is defined in AutomationML BPR_005E_ExternalDataReference_v1.0.0_2:The interface class “ExternalDataReference” shall be used in order to reference external documents out of the scope of AutomationML. + + + Reference to any other referable element of the same of any other AAS or a reference to an external object or entity. For local references inside the same Asset Administration Shell an InternalLink between two objects with this interface "ReferableReference" shall be set. In this case the attribute value has to be empty. For references between different Asset Administration Shells or external objects or entities the attribute value shall be used and no InternalLink shall be set. + + Reference to any other referable element of any other AAS or a reference to an external object or entity. Note: For references to any other referable element of the same AAS InternalLinks are used and this attribute value shall be empty. + + + + + + Standard Automation Markup Language Interface Class Library - Part 1 Content extended with Part 3 and Part 4 Content + 2.2.2 + + + + + + + + + + The attribute refURI is an IRI that can represent an absolute or relative path to an L document. An added fragment (with #) references inside the document + + + + + + + + + + + + + + + + + true + + + + + + + + + + + + + 1.0.0 + + + Mime type of the content of the File. + + + + + Role Class Library according to Details of the Asset Administration Shell V2.0. + 1.0.0 + + An Asset Administration Shell. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + + + + + + Abstract attribute class for identification. Has the subattributes id and idType. + + + Identifier of the element. Its type is defined in idType. Id is a subproperty of identification. + + + + + Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the enumeration “IdentifierType”. IdType is a subproperty of identification. + + + + + + Abstract attribute for administration. Has the subattributes revision and version. + + + Revision of the element. Constraint AASd-005: A revision requires a version. This means, if there is no version there is no revision neither. Revision is a subproperty of administration. + + + + + Version of the element. Version is a subproperty of administration. + + + + + + Global reference to the data specification template used by the element. + + + + + The derivedFrom attribute is used to establish a relationship between two Asset Administration Shells that are derived from each other. + + + + + + An Asset describes meta data of an asset that is represented by an AAS. The asset may either represent an asset type or an asset instance. The asset has a globally unique identifier plus – if needed – additional domain specific (proprietary) identifiers. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + Abstract attribute class for identification. Has the subattributes id and idType. + + + Identifier of the element. Its type is defined in idType. + + + + + Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the enumeration “IdentifierType”. IdType is a subproperty of identification. + + + + + + Abstract attribute for administration. Has the subattributes revision and version. + + + Revision of the element. Constraint AASd-005: A revision requires a version. This means, if there is no version there is no revision neither. Revision is a subproperty of administration. + + + + + Version of the element. Version is a subproperty of administration. + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the asset: either type or instance. + Instance + Instance + + + + Instance + Type + + + + + + A Submodel defines a specific aspect of the asset represented by the AAS. A submodel is used to structure the virtual representation and technical functionality of an Administration Shell into distinguishable parts. Each submodel refers to a well-defined domain or subject matter. Submodels can become standardized and thus become submodels types. Submodels can have different life-cycles. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + Abstract attribute class for identification. Has the subattributes id and idType. + + + Identifier of the element. Its type is defined in idType. Id is a subproperty of identification. + + + + + Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the enumeration “IdentifierType”. IdType is a subproperty of identification. + + + + + + Abstract attribute for administration. Has the subattributes revision and version. + + + Revision of the element. Constraint AASd-005: A revision requires a version. This means, if there is no version there is no revision neither. Revision is a subproperty of administration. + + + + + Version of the element. Version of the element. Version is a subproperty of administration. + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. + + + + + Reference to the global unqiue id of a coded value. + + + + + + + A submodel element collection is a set or list of submodel elements. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. + + + + + Reference to the global unqiue id of a coded value. + + + + + + If allowDuplicates=true, then it is allowed that the collection contains the same element several times. + false + + + + If ordered=false, then the elements in the property collection are not ordered. If ordered=true then the elements in the collection are ordered. Default = false. Note: An ordered submodel element collection is typically implemented as an indexed array. + false + + + + Submodel element contained in the collection. + + + + + A BLOB is a data element that represents a file that is contained with its source code in the value attribute. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. + + + + + Reference to the global unqiue id of a coded value. + + + + + + Mime type of the content of the BLOB. The mime type states which file extension the file has. Valid values are e.g. “application/json”, “application/xls”, ”image/jpg”. The allowed values are defined as in RFC2046. + + + + + The value of the BLOB instance of a blob data element. Note: In contrast to the file property the file content is stored directly as value in the Blob data element. + + + + + + A capability is the implementation-independent description of the potential of an asset to achieve a certain effect in the physical or virtual world. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. + + + + + Reference to the global unqiue id of a coded value. + + + + + + + A role class for a File that a data element that represents an address to a file. It is derived from the AutomationML role class ExternalData that is an role type for a document type and the base class for all document type roles. It describes different document types. ExternalData is defined in AutomationML BPR_005E_ExternalDataReference_v1.0.0_2. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. + + + + + Reference to the global unqiue id of a coded value. + + + + + + + The attribute refURI is an IRI that can represent an absolute or relative path to an L document. An added fragment (with #) references inside the document + + + Mime type of the content of the File. + + + + + A property is a data element that has a single value. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. + + + + + Reference to the global unqiue id of a coded value. + + + + + + The value of the property instance. + + + + Reference to the global unique id if a coded value. + + + + + A reference element is a data element that defines a logical reference to another element within the same or another AAS or a reference to an external object or entity. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. + + + + + Reference to the global unqiue id of a coded value. + + + + + + + Reference to any other referable element of any other AAS or a reference to an external object or entity. Note: For references to any other referable elment of the same AAS InternalLinks are used and this attribute value shall be empty. + + + + + + A relationship element is used to define a relationship between two referable elements. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. + + + + + Reference to the global unqiue id of a coded value. + + + + + + + Reference to any other referable element of any other AAS or a reference to an external object or entity. Note: For references to any other referable elment of the same AAS InternalLinks are used and this attribute value shall be empty. + + + + + Reference to any other referable element of any other AAS or a reference to an external object or entity. Note: For references to any other referable elment of the same AAS InternalLinks are used and this attribute value shall be empty. + + + + + An annotated relationship element is an relationship element that can be annotated with additional data elements. + + Annotations that hold for the relationships between the two elements. + + + + + An operation is a submodel element with input and output variables. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. + + + + + Reference to the global unqiue id of a coded value. + + + + + + + The list of AAS OperationVariableIn entities. In AML, the corresponding InternalElement with this role is a child of the InternalElement with the Operation role. + + + The list of AAS OperationVariableOut entities. In AML, the corresponding InternalElement with this role is a child of the InternalElement with the Operation role. + + + The list of AAS OperationVariableOut entities. In AML, the corresponding InternalElement with this role is a child of the InternalElement with the Operation role. + + + A view is a collection of referable elements w.r.t. to a specific viewpoint of one or more stakeholders. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + Global reference to the data specification template used by the element. + + + + + Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. + + + + + + A dictionary contains elements that can be reused. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + + + + + + + Explanation: The semantics of a property or other elements that may have a semantic description is defined by a concept description. The description of the concept should follow a standardized schema (realized as data specification template). + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + Abstract attribute class for identification. Has the subattributes id and idType. + + + Identifier of the element. Its type is defined in idType. Id is a subproperty of identification. + + + + + Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the enumeration “IdentifierType”. IdType is a subproperty of identification. + + + + + + Abstract attribute for administration. Has the subattributes revision and version. + + + Revision of the element. Constraint AASd-005: A revision requires a version. This means, if there is no version there is no revision neither. Revision is a subproperty of administration. + + + + + Version of the element. Version is a subproperty of administration. + + + + + + Global reference to the data specification template used by the element. + + + + Global reference to an external definition the concept is compatible to or was derived from. + + + + + + Description Role class of an element that has a data specification template. A template defines the additional attributes an element may or shall have. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + + + + + + Abstract attribute class for identification. Has the subattributes id and idType. + + + Identifier of the element. Its type is defined in idType. Id is a subproperty of identification. + + + + + Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the enumeration “IdentifierType”. IdType is a subproperty of identification. + + + + + + Abstract attribute for administration. Has the subattributes revision and version. + + + Revision of the element. Constraint AASd-005: A revision requires a version. This means, if there is no version there is no revision neither. Revision is a subproperty of administration. + + + + + Version of the element. Version is a subproperty of administration. + + + + + + + Content of the data specification template. + + + An entity is a submodel element that is used to model entities. Constraint AASd-056: If the semanticId of a Entity submodel element references a ConceptDescription then the ConceptDescription/category shall be one of following values: ENTITY. The ConceptDescription describes the elements assigned to the entity via Entity/statement. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. + + + + + Reference to the global unqiue id of a coded value. + + + + + + Describes statements applicable to the entity by a set of submodel elements, typically with a qualified value. + + + + Describes whether the entity is a co-managed entity or a self-managed entity. + SelfManagedEntity + SelfManagedEntity + + + + CoManagedEntity + SelfManagedEntity + + + + + Reference to an identifier key value pair representing a specific identifier of the asset represented by the asset administration shell. See Constraint AASd-014 + + + + Reference to the asset the entity is representing. Constraint AASd-014: Either the attribute globalAssetId or specificAssetId of an Entity must be set if Entity/entityType is set to "SelfManagedEntity". They are not existing otherwise. + + + + + + Automation Markup Language Base Role Class Library - Part 1 Content extended with Part 3 and Part 4 Content + 2.2.2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1.0.0 + + + + + + + + INSTANCE + + + + (Asset)[IRI]https://acplt.org/Test_Asset_Mandatory + + + + + + + + + + + IRI + + + + https://acplt.org/Test_AssetAdministrationShell_Mandatory + + + + + + + + + + + + IRI + + + + https://acplt.org/Test_Submodel_Mandatory + + + + + TEMPLATE + + + + + ExampleRelationshipElement + + + + + + + + + + ExampleAnnotatedRelationshipElement + + + + + + + + + + ExampleOperation + + + + + + + ExampleCapability + + + + + + + ExampleBasicEvent + + + + (Submodel)[IRI]https://acplt.org/Test_Submodel_Mandatory,(SubmodelElementCollection)[ID_SHORT]ExampleSubmodelCollectionOrdered,(Property)[ID_SHORT]ExampleProperty + + + + + + + false + + + + ExampleSubmodelCollectionOrdered + + + + true + + + + + ExampleProperty + + + + string + + + + + + + + ExampleMultiLanguageProperty + + + + + + + + ExampleRange + + + + int + + + + + + + + + false + + + + ExampleSubmodelCollectionUnordered + + + + false + + + + + ExampleBlob + + + + application/pdf + + + + + + + ExampleFile + + + + application/pdf + + + + + application/pdf + + + + + + + + ExampleReferenceElement + + + + + + + + + false + + + + ExampleSubmodelCollectionUnordered2 + + + + false + + + + + + + + + + + + + + + IRI + + + + https://acplt.org/Test_Submodel2_Mandatory + + + + + INSTANCE + + + + + + + + + + + + + + + IRI + + + + https://acplt.org/Test_Submodel_Mandatory + + + + + TEMPLATE + + + + + ExampleRelationshipElement + + + + + + + + + + ExampleAnnotatedRelationshipElement + + + + + + + + + + ExampleOperation + + + + + + + ExampleCapability + + + + + + + ExampleBasicEvent + + + + (Submodel)[IRI]https://acplt.org/Test_Submodel_Mandatory,(SubmodelElementCollection)[ID_SHORT]ExampleSubmodelCollectionOrdered,(Property)[ID_SHORT]ExampleProperty + + + + + + + false + + + + ExampleSubmodelCollectionOrdered + + + + true + + + + + ExampleProperty + + + + string + + + + + + + + ExampleMultiLanguageProperty + + + + + + + + ExampleRange + + + + int + + + + + + + + + false + + + + ExampleSubmodelCollectionUnordered + + + + false + + + + + ExampleBlob + + + + application/pdf + + + + + + + ExampleFile + + + + application/pdf + + + + + application/pdf + + + + + + + + ExampleReferenceElement + + + + + + + + + false + + + + ExampleSubmodelCollectionUnordered2 + + + + false + + + + + + + + + 0 + + An AAS Data Specification template for IEC61369. A template consists of the DataSpecificationContent containing the additional attributes to be added to the element instance that references the data specification template and meta information about the template itself (this is why DataSpecification inherits from Identifiable). In UML these are two separated classes. + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + + + + + + Abstract attribute class for identification. Has the subattributes id and idType. + + + Identifier of the element. Its type is defined in idType. Id is a subproperty of identification. + http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360 + + + + Type of the Identifier, e.g. IRI, IRDI etc. The supported Identifier types are defined in the enumeration “IdentifierType”. IdType is a subproperty of identification. + IRI + + + + + Abstract attribute for administration. Has the subattributes revision and version. + + + Revision of the element. Constraint AASd-005: A revision requires a version. This means, if there is no version there is no revision neither. Revision is a subproperty of administration. + + + + + Version of the element. Version is a subproperty of administration. + + + + + + + The content of an AAS Data Specification template for IEC61360. + + Identifies the attribute hierarchy for preferredName in above attribute hierachy. Subordinate attributes are designated by the country code information (see aml-lang literal). + + + + Identifies the attribute for shortName in above attribute hierarchy. + + + + Identifies the attribute for unit in above attribute hierarchy. + + + + Identifies the attribute for unitId in above attribute hierarchy in its string serialization. + + + + Identifies the attribute for sourceOfDefinition in above attribute hierachy. Subordinate attributes are designated by the country code information (see aml-lang literal). + + + + Identifies the attribute for symbol in above attribute hierarchy. + + + + Identifies the attribute for dataType in above attribute hierarchy. + + + + Identifies the attribute for definition in above attribute hierachy. Subordinate attributes are designated by the country code information (see aml-lang literal). + + + + Identifies the attribute for valueFormat in above attribute hierarchy. + + + + Identifies the attribute for valueList in above attribute hierarchy. + + + + The attribute value. + + + + The id for the value. + + + + + + + diff --git a/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/ReflectionHelper.java b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/ReflectionHelper.java index b920a783..48924e93 100644 --- a/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/ReflectionHelper.java +++ b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/ReflectionHelper.java @@ -15,6 +15,8 @@ */ package io.adminshell.aas.v3.dataformat.core; +import com.google.common.reflect.TypeToken; +import io.adminshell.aas.v3.dataformat.core.util.MostSpecificTypeTokenComparator; import io.adminshell.aas.v3.model.Constraint; import io.adminshell.aas.v3.model.Referable; import io.github.classgraph.ClassGraph; @@ -174,9 +176,13 @@ public static Class getAasInterface(Class type) { return null; } if (implementedAasInterfaces.size() == 1) { - logger.warn("class '{}' implements more than one AAS interface, but only first one is used", type.getName()); + return implementedAasInterfaces.iterator().next(); } - 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) { diff --git a/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/util/AasUtils.java b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/util/AasUtils.java index ee3c53cb..ebc40a9d 100644 --- a/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/util/AasUtils.java +++ b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/util/AasUtils.java @@ -69,7 +69,7 @@ public static String asString(Reference reference) { return null; } return reference.getKeys().stream() - .map(x -> String.format("(%s)[%s]%s", x.getType(), x.getIdType(), x.getValue())) + .map(x -> String.format("(%s)[%s]%s", serializeEnumName(x.getType().name()), x.getIdType(), x.getValue())) .collect(Collectors.joining(",")); } @@ -248,10 +248,11 @@ public static boolean sameAs(Reference ref1, Reference ref2) { Key ref2Key = ref2.getKeys().get(ref2.getKeys().size() - (i + 1)); Class ref1Type = keyTypeToClass(ref1Key.getType()); Class ref2Type = keyTypeToClass(ref2Key.getType()); - if (ref1Type != ref2Type) { + if ((ref1Type == null && ref2Type != null) + || (ref1Type != null && ref2Type == null)) { return false; } - if (ref1Type != null) { + if (ref1Type != ref2Type) { if (!(ref1Type.isAssignableFrom(ref2Type) || ref2Type.isAssignableFrom(ref1Type))) { return false; diff --git a/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/util/FooBar.java b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/util/FooBar.java deleted file mode 100644 index e82f19d9..00000000 --- a/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/core/util/FooBar.java +++ /dev/null @@ -1,24 +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 io.adminshell.aas.v3.dataformat.core.util; - -/** - * - * @author jab - */ -public class FooBar { - -} diff --git a/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/SourceBasedMapper.java b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/SourceBasedMapper.java index c206e8b0..5e3eee9d 100644 --- a/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/SourceBasedMapper.java +++ b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/SourceBasedMapper.java @@ -27,10 +27,11 @@ public interface SourceBasedMapper ex /** * 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 + * @throws MappingException */ public void map(T value, G generator, C context) throws MappingException; } From a578b9df29e614264b0b837baa883511d8c1a230 Mon Sep 17 00:00:00 2001 From: Jacoby Date: Mon, 16 Aug 2021 08:34:09 +0200 Subject: [PATCH 16/18] updated readme --- README.md | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 438095fb..c07f660b 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,7 @@ The project contains several modules: - `dataformat-aasx` AASX de-/serializer - `dataformat-json` JSON de-/serializer - `dataformat-xml` XML de-/serializer +- `dataformat-aml` AutomationML de-/serializer @@ -44,15 +45,16 @@ We always look for contributions, bug reports, feature requests etc. Simply open # Contributors -| Name | Affiliation | Github Account | parent | core | aasx | json | xml | ---- | --- | --- | :---: | :---: | :---: | :---: | :---: -| Mohammad Alreeni | Fraunhofer IWU | []() | | | | | x | -| Sebastian Bader | Fraunhofer IAIS | [sebbader](https://github.com/sebbader) | x | | | | | -| Matthias Böckmann | Fraunhofer IAIS | [maboeckmann](https://github.com/maboeckmann) | x | | | | | -| Maximilian Conradi | Fraunhofer IESE | []() | | | x | | x | -| Daniel Espen | Fraunhofer IESE | [daespen](https://github.com/daespen) | | x | x | x | x | -| Michael Jacoby | Fraunhofer IOSB| [mjacoby](https://github.com/mjacoby) | x | x | | x | x | -| Jens Müller | Fraunhofer IOSB | [JensMueller2709](https://github.com/JensMueller2709) | | | | x | | -| Bastian Rössl | Fraunhofer IOSB-INA | [br-iosb](https://github.com/br-iosb) | | | | x | | -| Frank Schnicke | Fraunhofer IESE | [frankschnicke](https://github.com/frankschnicke) | | | x | | x | -| Arno Weiss | Fraunhofer IWU | []() | | | | x | | +| Name | Affiliation | Github Account | parent | core | aasx | json | xml | aml | +--- | --- | --- | :---: | :---: | :---: | :---: | :---: | :---: +| Mohammad Alreeni | Fraunhofer IWU | []() | | | | | x | | +| Sebastian Bader | Fraunhofer IAIS | [sebbader](https://github.com/sebbader) | x | | | | | | +| Matthias Böckmann | Fraunhofer IAIS | [maboeckmann](https://github.com/maboeckmann) | x | | | | | | +| Maximilian Conradi | Fraunhofer IESE | []() | | | x | | x | | +| Daniel Espen | Fraunhofer IESE | [daespen](https://github.com/daespen) | | x | x | x | x | | +| Michael Jacoby | Fraunhofer IOSB| [mjacoby](https://github.com/mjacoby) | x | x | | x | x | x | +| Jens Müller | Fraunhofer IOSB | [JensMueller2709](https://github.com/JensMueller2709) | | | | x | | x | +| Bastian Rössl | Fraunhofer IOSB-INA | [br-iosb](https://github.com/br-iosb) | | | | x | | | +| Frank Schnicke | Fraunhofer IESE | [frankschnicke](https://github.com/frankschnicke) | | | x | | x | | +| Arno Weiss | Fraunhofer IWU | []() | | | | x | | | +| Jan-Wilhelm Blume | Fraunhofer IOSB | []() | | | | | | x | From 691a815267169fc43798c01577aab44e5fa7f1e6 Mon Sep 17 00:00:00 2001 From: Jacoby Date: Mon, 16 Aug 2021 08:34:19 +0200 Subject: [PATCH 17/18] removed unused dependencies --- dataformat-aml/pom.xml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/dataformat-aml/pom.xml b/dataformat-aml/pom.xml index d51550d6..0837c2ae 100644 --- a/dataformat-aml/pom.xml +++ b/dataformat-aml/pom.xml @@ -22,11 +22,6 @@ ${revision} compile - - com.google.guava - guava - 30.1.1-jre - org.slf4j slf4j-api @@ -48,12 +43,6 @@ ${junit.version} test - - org.skyscreamer - jsonassert - ${jsonassert.version} - test - net.codesup.util jaxb2-rich-contract-plugin From 27dd8925a85add247053957ae2434f3cee16e258 Mon Sep 17 00:00:00 2001 From: Jacoby Date: Tue, 17 Aug 2021 15:56:30 +0200 Subject: [PATCH 18/18] fixed some issues with attribute naming (e.g. now using singular names instead of plural names) --- .../aml/serialization/AasToAmlMapper.java | 15 +- .../aml/serialization/AmlGenerator.java | 7 +- .../DefaultCollectionMapper.java | 8 + .../aml/serialization/DefaultMapper.java | 14 +- .../AbstractElementMapperWithValueType.java | 116 ++++ .../mappers/ConceptDescriptionMapper.java | 60 ++ .../mappers/LangStringCollectionMapper.java | 10 +- .../serialization/mappers/PropertyMapper.java | 22 + .../mappers/QualifierMapper.java | 3 +- .../serialization/mappers/RangeMapper.java | 28 + .../mappers/ReferenceCollectionMapper.java | 4 +- .../mappers/ReferenceMapper.java | 9 + .../naming/AbstractClassNamingStrategy.java | 6 + .../naming/IdClassNamingStrategy.java | 1 - .../serialization/naming/NamingStrategy.java | 2 + .../naming/PropertyNamingStrategy.java | 32 +- .../resources/AssetAdministrationShellLib.aml | 192 ++++++ .../aml/serialize/AmlDeserializerTest.java | 37 -- .../test/resources/test_demo_full_example.aml | 571 ++++++++++-------- 19 files changed, 814 insertions(+), 323 deletions(-) create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/AbstractElementMapperWithValueType.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/ConceptDescriptionMapper.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/PropertyMapper.java create mode 100644 dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/RangeMapper.java delete mode 100644 dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/serialize/AmlDeserializerTest.java diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/AasToAmlMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/AasToAmlMapper.java index c10052d9..0491c97f 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/AasToAmlMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/AasToAmlMapper.java @@ -37,16 +37,20 @@ import io.adminshell.aas.v3.dataformat.aml.serialization.mappers.SubmodelMapper; import io.adminshell.aas.v3.dataformat.aml.serialization.mappers.ViewMapper; import io.adminshell.aas.v3.dataformat.aml.model.caex.CAEXFile; +import io.adminshell.aas.v3.dataformat.aml.serialization.mappers.ConceptDescriptionMapper; +import io.adminshell.aas.v3.dataformat.aml.serialization.mappers.PropertyMapper; +import io.adminshell.aas.v3.dataformat.aml.serialization.mappers.RangeMapper; import io.adminshell.aas.v3.dataformat.aml.serialization.mappers.ReferenceMapper; import io.adminshell.aas.v3.dataformat.mapping.MappingException; import io.adminshell.aas.v3.dataformat.mapping.MappingProvider; import io.adminshell.aas.v3.model.AssetAdministrationShellEnvironment; -import io.adminshell.aas.v3.model.ConceptDescription; import io.adminshell.aas.v3.model.LangString; import io.adminshell.aas.v3.model.Qualifier; import io.adminshell.aas.v3.model.Referable; import org.slf4j.LoggerFactory; import io.adminshell.aas.v3.dataformat.mapping.SourceBasedMapper; +import io.adminshell.aas.v3.model.MultiLanguageProperty; +import io.adminshell.aas.v3.model.Reference; /** * Maps an AssetAdministrationShellEnvironment to an AML file @@ -68,9 +72,9 @@ public CAEXFile map(AssetAdministrationShellEnvironment env, AmlSerializationCon AbstractClassNamingStrategy classNamingStrategy = new NumberingClassNamingStrategy(); classNamingStrategy.registerCustomNaming(LangString.class, x -> "aml-lang=" + x.getLanguage()); PropertyNamingStrategy propertyNamingStrategy = new PropertyNamingStrategy(); - propertyNamingStrategy.registerCustomNaming(Referable.class, "descriptions", "description"); - propertyNamingStrategy.registerCustomNaming(Qualifier.class, x -> "qualifier:" + x.getType() + "=" + x.getValue()); - propertyNamingStrategy.registerCustomNaming(ConceptDescription.class, "isCaseOfs", "isCaseOf"); + propertyNamingStrategy.registerCustomNaming(Referable.class, "descriptions", "description", true); + propertyNamingStrategy.registerCustomNaming(MultiLanguageProperty.class, "values", "value", true); + propertyNamingStrategy.registerCustomNaming(Qualifier.class, x -> "qualifier:" + x.getType() + "=" + x.getValue(), false); MappingProvider mappingProvider = new MappingProvider<>( SourceBasedMapper.class, new DefaultMapper(), @@ -93,6 +97,9 @@ public CAEXFile map(AssetAdministrationShellEnvironment env, AmlSerializationCon mappingProvider.register(new RelationshipElementMapper()); mappingProvider.register(new DataSpecificationIEC61360Mapper()); mappingProvider.register(new ViewMapper()); + mappingProvider.register(new PropertyMapper()); + mappingProvider.register(new RangeMapper()); + mappingProvider.register(new ConceptDescriptionMapper()); MappingContext context = new MappingContext( mappingProvider, classNamingStrategy, diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/AmlGenerator.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/AmlGenerator.java index 97d28d51..cc4fb335 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/AmlGenerator.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/AmlGenerator.java @@ -382,13 +382,14 @@ public AttributeType.RefSemantic refSemantic(Class type, String propertyName) } /** - * Creates a refSemantic object for a given property + * Creates a refSemantic object for a given property and property name. * * @param property the property + * @param propertyName the property name to use in the refSemantic. * @return the generated refSemantic object */ - public AttributeType.RefSemantic refSemantic(PropertyDescriptor property) { - return refSemantic(property.getReadMethod().getDeclaringClass(), property.getName()); + public AttributeType.RefSemantic refSemantic(PropertyDescriptor property, String propertyName) { + return refSemantic(property.getReadMethod().getDeclaringClass(), propertyName); } /** diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/DefaultCollectionMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/DefaultCollectionMapper.java index 584b1974..5fbba9dc 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/DefaultCollectionMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/DefaultCollectionMapper.java @@ -55,4 +55,12 @@ protected void asAttribute(Collection collection, AmlGenerator generator, Map generator.add(builder.build()); } } + + @Override + protected String getAttributeName(Collection value, MappingContext context) { + return context.getAttributeNamingStrategy().getName( + context.getProperty().getReadMethod().getDeclaringClass(), + value, + context.getProperty().getName()); + } } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/DefaultMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/DefaultMapper.java index 31e6e3bf..f65b4d61 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/DefaultMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/DefaultMapper.java @@ -20,7 +20,6 @@ import io.adminshell.aas.v3.dataformat.core.ReflectionHelper; import io.adminshell.aas.v3.dataformat.core.util.AasUtils; import io.adminshell.aas.v3.dataformat.mapping.MappingException; -import io.adminshell.aas.v3.model.MultiLanguageProperty; import io.adminshell.aas.v3.model.Referable; import java.beans.PropertyDescriptor; import java.lang.reflect.InvocationTargetException; @@ -95,7 +94,12 @@ protected InternalElementType.RoleRequirements getRoleRequirementClass(T value, } protected AttributeType.RefSemantic getRefSemantic(T value, AmlGenerator generator, MappingContext context) { - return generator.refSemantic(context.getProperty()); + return generator.refSemantic( + context.getProperty(), + context.getAttributeNamingStrategy().getNameForRefSemantic( + context.getProperty().getReadMethod().getGenericReturnType(), + value, + context.getProperty().getName())); } protected String getInternalElementName(Object value, MappingContext context) { @@ -105,12 +109,6 @@ protected String getInternalElementName(Object value, MappingContext context) { null); } -// protected String getId(T value, AmlGenerator generator, MappingContext context) { -// if (value != null && Referable.class.isAssignableFrom(value.getClass())) { -// return context.getId(AasUtils.asReference(generator.getReference(), (Referable) value)); -// } -// return context.getId(null); -// } protected String getAttributeName(T value, MappingContext context) { return context.getAttributeNamingStrategy().getName( context.getProperty().getReadMethod().getGenericReturnType(), diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/AbstractElementMapperWithValueType.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/AbstractElementMapperWithValueType.java new file mode 100644 index 00000000..bdd5cd38 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/AbstractElementMapperWithValueType.java @@ -0,0 +1,116 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.serialization.mappers; + +import io.adminshell.aas.v3.dataformat.aml.model.caex.AttributeType; +import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; +import io.adminshell.aas.v3.dataformat.aml.serialization.AmlGenerator; +import io.adminshell.aas.v3.dataformat.aml.serialization.DefaultMapper; +import io.adminshell.aas.v3.dataformat.aml.serialization.MappingContext; +import io.adminshell.aas.v3.dataformat.core.util.AasUtils; +import io.adminshell.aas.v3.dataformat.mapping.MappingException; +import java.beans.PropertyDescriptor; +import java.lang.reflect.InvocationTargetException; +import java.util.Arrays; +import java.util.List; +import java.util.Optional; +import java.util.stream.Collectors; + +/** + * Abstract base class for AAS types that have the properties 'value' and + * 'valueType' that ensures valueType is serialized as attribute of value + * + */ +public abstract class AbstractElementMapperWithValueType extends DefaultMapper { + + protected static final String PROPERTY_VALUE_NAME = "value"; + protected static final String PROPERTY_VALUE_TYPE_NAME = "valueType"; + protected static final String PROPERTY_VALUE_TYPE_NAMESPACE_PREFIX = "xs:"; + private List typedProperties = List.of(PROPERTY_VALUE_NAME); + + protected AbstractElementMapperWithValueType(String... typedProperties) { + super(PROPERTY_VALUE_TYPE_NAME); + this.typedProperties = Arrays.asList(typedProperties); + } + + protected AbstractElementMapperWithValueType() { + super(PROPERTY_VALUE_TYPE_NAME); + } + + @Override + protected InternalElementType.Builder toInternalElement(T value, AmlGenerator generator, MappingContext context) throws MappingException { + InternalElementType original = super.toInternalElement(value, generator, context).build(); + Optional valueTypeProperty = AasUtils.getAasProperties(value.getClass()).stream() + .filter(x -> PROPERTY_VALUE_TYPE_NAME.equals(x.getName())) + .findFirst(); + List untouchedAttributes = original.getAttribute().stream() + .filter(x -> !typedProperties.contains(x.getName())) + .collect(Collectors.toList()); + InternalElementType.Builder builder = InternalElementType + .copyOf(original) + .withAttribute(untouchedAttributes); + for (String property : typedProperties) { + Optional attributeToType = original.getAttribute().stream() + .filter(x -> property.equals(x.getName())) + .findFirst(); + if (attributeToType.isPresent()) { + AttributeType.Builder typedAttributeBuilder = AttributeType.copyOf(attributeToType.get()); + if (valueTypeProperty.isPresent()) { + try { + typedAttributeBuilder = typedAttributeBuilder.withAttributeDataType( + PROPERTY_VALUE_TYPE_NAMESPACE_PREFIX + valueTypeProperty.get().getReadMethod().invoke(value)); + } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException ex) { + throw new MappingException(String.format("error reading property %s", PROPERTY_VALUE_TYPE_NAME)); + } + } + builder = builder.addAttribute(typedAttributeBuilder.build()); + } + } + return builder; + } + + @Override + protected AttributeType.Builder toAttribute(T value, AmlGenerator generator, MappingContext context) throws MappingException { + AttributeType original = super.toAttribute(value, generator, context).build(); + Optional valueTypeProperty = AasUtils.getAasProperties(value.getClass()).stream() + .filter(x -> PROPERTY_VALUE_TYPE_NAME.equals(x.getName())) + .findFirst(); + List untouchedAttributes = original.getAttribute().stream() + .filter(x -> !typedProperties.contains(x.getName())) + .collect(Collectors.toList()); + AttributeType.Builder builder = AttributeType + .copyOf(original) + .withAttribute(untouchedAttributes); + for (String property : typedProperties) { + Optional attributeToType = original.getAttribute().stream() + .filter(x -> property.equals(x.getName())) + .findFirst(); + if (attributeToType.isPresent()) { + AttributeType.Builder typedAttributeBuilder = AttributeType.copyOf(attributeToType.get()); + if (valueTypeProperty.isPresent()) { + try { + typedAttributeBuilder = typedAttributeBuilder.withAttributeDataType( + PROPERTY_VALUE_TYPE_NAMESPACE_PREFIX + valueTypeProperty.get().getReadMethod().invoke(value)); + } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException ex) { + throw new MappingException(String.format("error reading property %s", PROPERTY_VALUE_TYPE_NAME)); + } + } + builder = builder.addAttribute(typedAttributeBuilder.build()); + } + } + return builder; + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/ConceptDescriptionMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/ConceptDescriptionMapper.java new file mode 100644 index 00000000..d38d9189 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/ConceptDescriptionMapper.java @@ -0,0 +1,60 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.serialization.mappers; + +import io.adminshell.aas.v3.dataformat.aml.model.caex.AttributeType; +import io.adminshell.aas.v3.dataformat.aml.model.caex.AttributeType.RefSemantic; +import io.adminshell.aas.v3.dataformat.aml.model.caex.InternalElementType; +import io.adminshell.aas.v3.dataformat.aml.serialization.AmlGenerator; +import io.adminshell.aas.v3.dataformat.aml.serialization.DefaultMapper; +import io.adminshell.aas.v3.dataformat.aml.serialization.MappingContext; +import io.adminshell.aas.v3.dataformat.mapping.MappingException; +import io.adminshell.aas.v3.model.ConceptDescription; +import java.util.List; +import java.util.Optional; +import java.util.stream.Collectors; + +public class ConceptDescriptionMapper extends DefaultMapper { + + protected static final String PROPERTY_IS_CASE_OF_NAME = "isCaseOf"; + protected static final String PROPERTY_IS_CASE_OFS_NAME = PROPERTY_IS_CASE_OF_NAME + "s"; + + @Override + protected InternalElementType.Builder toInternalElement(ConceptDescription value, AmlGenerator generator, MappingContext context) throws MappingException { + InternalElementType original = super.toInternalElement(value, generator, context).build(); + List untouchedAttributes = original.getAttribute().stream() + .filter(x -> !PROPERTY_IS_CASE_OFS_NAME.equals(x.getName())) + .collect(Collectors.toList()); + InternalElementType.Builder builder = InternalElementType + .copyOf(original) + .withAttribute(untouchedAttributes); + Optional isCaseOfAttribute = original.getAttribute().stream() + .filter(x -> PROPERTY_IS_CASE_OFS_NAME.equals(x.getName())) + .findFirst(); + if (isCaseOfAttribute.isPresent()) { + String path = isCaseOfAttribute.get().getRefSemantic().get(0).getCorrespondingAttributePath(); + String newPath = path.substring(0, path.lastIndexOf("/") + 1) + PROPERTY_IS_CASE_OF_NAME; + builder = builder.addAttribute(AttributeType + .copyOf(isCaseOfAttribute.get()) + .withName(PROPERTY_IS_CASE_OF_NAME) + .withRefSemantic(RefSemantic.copyOf(isCaseOfAttribute.get().getRefSemantic().get(0)) + .withCorrespondingAttributePath(newPath) + .build()) + .build()); + } + return builder; + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/LangStringCollectionMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/LangStringCollectionMapper.java index b803c908..58fbbf30 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/LangStringCollectionMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/LangStringCollectionMapper.java @@ -19,12 +19,13 @@ import io.adminshell.aas.v3.dataformat.aml.serialization.AmlGenerator; import io.adminshell.aas.v3.dataformat.aml.serialization.MappingContext; import io.adminshell.aas.v3.dataformat.aml.model.caex.AttributeType; +import io.adminshell.aas.v3.dataformat.aml.serialization.DefaultCollectionMapper; import io.adminshell.aas.v3.model.LangString; import java.lang.reflect.ParameterizedType; import java.util.Collection; import java.util.stream.Collectors; -public class LangStringCollectionMapper extends DefaultMapper> { +public class LangStringCollectionMapper extends DefaultCollectionMapper { private static final String NAME_PREFIX = "aml-lang="; @@ -43,7 +44,12 @@ public void map(Collection value, AmlGenerator generator, MappingCon context.getProperty().getReadMethod().getDeclaringClass(), value, context.getProperty().getName())) - .withRefSemantic(generator.refSemantic(context.getProperty())) + .withRefSemantic(generator.refSemantic( + context.getProperty(), + context.getAttributeNamingStrategy().getNameForRefSemantic( + context.getProperty().getReadMethod().getDeclaringClass(), + value, + context.getProperty().getName()))) .addAttribute(value.stream() .map(x -> AttributeType.builder() .withName(NAME_PREFIX + x.getLanguage()) diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/PropertyMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/PropertyMapper.java new file mode 100644 index 00000000..fd369150 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/PropertyMapper.java @@ -0,0 +1,22 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.serialization.mappers; + +import io.adminshell.aas.v3.model.Property; + +public class PropertyMapper extends AbstractElementMapperWithValueType { + +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/QualifierMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/QualifierMapper.java index 2198a20c..3495405f 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/QualifierMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/QualifierMapper.java @@ -15,13 +15,12 @@ */ package io.adminshell.aas.v3.dataformat.aml.serialization.mappers; -import io.adminshell.aas.v3.dataformat.aml.serialization.DefaultMapper; import io.adminshell.aas.v3.dataformat.aml.serialization.AmlGenerator; import io.adminshell.aas.v3.dataformat.aml.serialization.MappingContext; import io.adminshell.aas.v3.dataformat.mapping.MappingException; import io.adminshell.aas.v3.model.Qualifier; -public class QualifierMapper extends DefaultMapper { +public class QualifierMapper extends AbstractElementMapperWithValueType { @Override public void map(Qualifier value, AmlGenerator generator, MappingContext context) throws MappingException { diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/RangeMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/RangeMapper.java new file mode 100644 index 00000000..8aea3809 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/RangeMapper.java @@ -0,0 +1,28 @@ +/* + * 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 io.adminshell.aas.v3.dataformat.aml.serialization.mappers; + +import io.adminshell.aas.v3.model.Range; + +public class RangeMapper extends AbstractElementMapperWithValueType { + + protected static final String PROPERTY_MIN_NAME = "min"; + protected static final String PROPERTY_MAX_NAME = "max"; + + public RangeMapper() { + super(PROPERTY_MIN_NAME, PROPERTY_MAX_NAME); + } +} diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/ReferenceCollectionMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/ReferenceCollectionMapper.java index 81b8ca63..84d7f376 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/ReferenceCollectionMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/ReferenceCollectionMapper.java @@ -15,14 +15,14 @@ */ package io.adminshell.aas.v3.dataformat.aml.serialization.mappers; -import io.adminshell.aas.v3.dataformat.aml.serialization.Mapper; import io.adminshell.aas.v3.dataformat.aml.serialization.AmlGenerator; +import io.adminshell.aas.v3.dataformat.aml.serialization.DefaultCollectionMapper; import io.adminshell.aas.v3.dataformat.aml.serialization.MappingContext; import io.adminshell.aas.v3.dataformat.mapping.MappingException; import io.adminshell.aas.v3.model.Reference; import java.util.Collection; -public class ReferenceCollectionMapper implements Mapper> { +public class ReferenceCollectionMapper extends DefaultCollectionMapper { @Override public void map(Collection value, AmlGenerator generator, MappingContext context) throws MappingException { diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/ReferenceMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/ReferenceMapper.java index 0bffea29..4b00027e 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/ReferenceMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/ReferenceMapper.java @@ -21,6 +21,7 @@ import io.adminshell.aas.v3.dataformat.aml.serialization.MappingContext; import io.adminshell.aas.v3.dataformat.core.util.AasUtils; import io.adminshell.aas.v3.dataformat.mapping.MappingException; +import io.adminshell.aas.v3.model.Qualifier; import io.adminshell.aas.v3.model.Reference; public class ReferenceMapper extends DefaultMapper { @@ -36,4 +37,12 @@ protected AttributeType.Builder toAttribute(Reference value, AmlGenerator genera } return builder; } + + @Override + protected String getAttributeName(Reference value, MappingContext context) { + return context.getAttributeNamingStrategy().getName( + Reference.class, + value, + context.getProperty().getName()); + } } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/naming/AbstractClassNamingStrategy.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/naming/AbstractClassNamingStrategy.java index 7d2cf7e5..4fe99457 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/naming/AbstractClassNamingStrategy.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/naming/AbstractClassNamingStrategy.java @@ -67,6 +67,7 @@ protected AbstractClassNamingStrategy(boolean preferIdShort) { this.preferIdShort = preferIdShort; } + @Override public String getName(Type type, Object obj, String property) { if (cache.containsKey(obj)) { return cache.get(obj); @@ -91,5 +92,10 @@ public String getName(Type type, Object obj, String property) { return result; } + @Override + public String getNameForRefSemantic(Type type, Object obj, String property) { + return getName(type, obj, property); + } + protected abstract String generateName(Object obj); } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/naming/IdClassNamingStrategy.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/naming/IdClassNamingStrategy.java index 4b4a2894..66a01acc 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/naming/IdClassNamingStrategy.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/naming/IdClassNamingStrategy.java @@ -31,5 +31,4 @@ public IdClassNamingStrategy(boolean preferIdShort) { protected String generateName(Object obj) { return UUID.randomUUID().toString(); } - } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/naming/NamingStrategy.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/naming/NamingStrategy.java index 3cd74554..93dfdecc 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/naming/NamingStrategy.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/naming/NamingStrategy.java @@ -20,4 +20,6 @@ public interface NamingStrategy { public String getName(Type type, Object obj, String property); + + public String getNameForRefSemantic(Type type, Object obj, String property); } diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/naming/PropertyNamingStrategy.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/naming/PropertyNamingStrategy.java index b8409bc4..48050167 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/naming/PropertyNamingStrategy.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/naming/PropertyNamingStrategy.java @@ -31,36 +31,50 @@ public class PropertyNamingStrategy implements NamingStrategy { protected class TypeSafeFunction { - public TypeSafeFunction(Class inputType, BiFunction provider) { + public TypeSafeFunction(Class inputType, BiFunction provider, boolean applyToRefSemantic) { this.inputType = TypeToken.of(inputType); this.provider = provider; + this.applyToRefSemantic = applyToRefSemantic; } TypeToken inputType; BiFunction provider; + boolean applyToRefSemantic; } - public void registerCustomNaming(Class type, BiFunction provider) { - customNamings.add(new TypeSafeFunction(type, provider)); + public void registerCustomNaming(Class type, BiFunction provider, boolean applyToRefSemantic) { + customNamings.add(new TypeSafeFunction(type, provider, applyToRefSemantic)); } - public void registerCustomNaming(Class type, String oldName, String newName) { - customNamings.add(new TypeSafeFunction(type, (obj, property) -> Objects.equals(oldName, property) ? newName : null)); + public void registerCustomNaming(Class type, String oldName, String newName, boolean applyToRefSemantic) { + customNamings.add(new TypeSafeFunction(type, (obj, property) -> Objects.equals(oldName, property) ? newName : null, applyToRefSemantic)); } - public void registerCustomNaming(Class type, Function provider) { - customNamings.add(new TypeSafeFunction(type, (x, y) -> provider.apply((T) x))); + public void registerCustomNaming(Class type, Function provider, boolean applyToRefSemantic) { + customNamings.add(new TypeSafeFunction(type, (x, y) -> provider.apply((T) x), applyToRefSemantic)); } - private List getCustomNaming(Type type, String property) { + private List getCustomNaming(Type type, String property, boolean applyToRefSemantic) { return customNamings.stream() .filter(x -> x.inputType.isSupertypeOf(type)) + .filter(x -> !applyToRefSemantic || x.applyToRefSemantic) .sorted((x, y) -> Objects.compare(x.inputType, y.inputType, new MostSpecificTypeTokenComparator())) .collect(Collectors.toList()); } @Override public String getName(Type type, Object obj, String property) { - for (TypeSafeFunction customNaming : getCustomNaming(type, property)) { + for (TypeSafeFunction customNaming : getCustomNaming(type, property, false)) { + String result = (String) customNaming.provider.apply(obj, property); + if (result != null) { + return result; + } + } + return property; + } + + @Override + public String getNameForRefSemantic(Type type, Object obj, String property) { + for (TypeSafeFunction customNaming : getCustomNaming(type, property, true)) { String result = (String) customNaming.provider.apply(obj, property); if (result != null) { return result; diff --git a/dataformat-aml/src/main/resources/AssetAdministrationShellLib.aml b/dataformat-aml/src/main/resources/AssetAdministrationShellLib.aml index 46ab3419..06506457 100644 --- a/dataformat-aml/src/main/resources/AssetAdministrationShellLib.aml +++ b/dataformat-aml/src/main/resources/AssetAdministrationShellLib.aml @@ -1083,6 +1083,198 @@ + + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. + + + + + Reference to the global unqiue id of a coded value. + + + + + + + + + + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. + + + + + Reference to the global unqiue id of a coded value. + + + + + + Reference to the global unique id if a coded value. + + + + + + + + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. + + + + + Reference to the global unqiue id of a coded value. + + + + + + The value of the property instance. + + + + Reference to the global unique id if a coded value. + + + Automation Markup Language Base Role Class Library - Part 1 Content extended with Part 3 and Part 4 Content diff --git a/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/serialize/AmlDeserializerTest.java b/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/serialize/AmlDeserializerTest.java deleted file mode 100644 index 0693c93a..00000000 --- a/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/serialize/AmlDeserializerTest.java +++ /dev/null @@ -1,37 +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 io.adminshell.aas.v3.dataformat.aml.serialize; - -import io.adminshell.aas.v3.dataformat.DeserializationException; -import io.adminshell.aas.v3.dataformat.aml.AmlDeserializer; -import io.adminshell.aas.v3.dataformat.aml.fixtures.FullExample; -import io.adminshell.aas.v3.model.AssetAdministrationShellEnvironment; -import java.io.FileNotFoundException; -import static org.junit.Assert.assertEquals; -import org.junit.Ignore; -import org.junit.Test; - -public class AmlDeserializerTest { - - private final AmlDeserializer deserializer = new AmlDeserializer(); - - @Test - @Ignore - public void testExample() throws FileNotFoundException, DeserializationException { - AssetAdministrationShellEnvironment actual = deserializer.read(FullExample.FILE); - assertEquals(FullExample.ENVIRONMENT, actual); - } -} diff --git a/dataformat-aml/src/test/resources/test_demo_full_example.aml b/dataformat-aml/src/test/resources/test_demo_full_example.aml index 75b2392b..e29583fa 100644 --- a/dataformat-aml/src/test/resources/test_demo_full_example.aml +++ b/dataformat-aml/src/test/resources/test_demo_full_example.aml @@ -1,25 +1,6 @@ + - - - foo - bar - 05-08-2021 15:14:40 - - - - - AutomationML Editor - 916578CA-FE0D-474E-A4FC-9E1719892369 - AutomationML e.V. - www.AutomationML.org - 5.3.3.0 - 5.3.3.0 - 2021-08-12T15:21:38.8927896 - unspecified - unspecified - - @@ -53,7 +34,7 @@ - + An Example Asset Administration Shell for the test application @@ -89,7 +70,7 @@ - + An example submodel for the test application @@ -126,7 +107,7 @@ - + Example RelationshipElement object @@ -153,7 +134,7 @@ - + Example AnnotatedRelationshipElement object @@ -183,14 +164,10 @@ INSTANCE - + some example annotation - - string - - @@ -203,7 +180,7 @@ - + Example Operation object @@ -226,7 +203,7 @@ - + Example Property object @@ -242,17 +219,13 @@ (GlobalReference)[IRI]http://acplt.org/Properties/ExampleProperty - - exampleValue - - (GlobalReference)[IRI]http://acplt.org/ValueId/ExampleValueId - - string - + + exampleValue + @@ -265,7 +238,7 @@ - + Example Property object @@ -281,17 +254,13 @@ (GlobalReference)[IRI]http://acplt.org/Properties/ExampleProperty - - exampleValue - - (GlobalReference)[IRI]http://acplt.org/ValueId/ExampleValueId - - string - + + exampleValue + @@ -304,7 +273,7 @@ - + Example Property object @@ -320,17 +289,13 @@ (GlobalReference)[IRI]http://acplt.org/Properties/ExampleProperty - - exampleValue - - (GlobalReference)[IRI]http://acplt.org/ValueId/ExampleValueId - - string - + + exampleValue + @@ -344,7 +309,7 @@ - + Example Capability object @@ -368,7 +333,7 @@ - + Example BasicEvent object @@ -400,7 +365,7 @@ - + Example SubmodelElementCollectionOrdered object @@ -426,7 +391,7 @@ - + Example Property object @@ -442,17 +407,13 @@ (GlobalReference)[IRI]http://acplt.org/Properties/ExampleProperty - - exampleValue - - (GlobalReference)[IRI]http://acplt.org/ValueId/ExampleValueId - - string - + + exampleValue + @@ -463,7 +424,7 @@ - + Example MultiLanguageProperty object @@ -483,8 +444,8 @@ (GlobalReference)[IRI]http://acplt.org/ValueId/ExampleMultiLanguageValueId - - + + Example value of a MultiLanguageProperty element @@ -500,7 +461,7 @@ - + Example Range object @@ -512,21 +473,17 @@ ExampleRange - - 100 - - - - 0 - - (GlobalReference)[IRI]http://acplt.org/Ranges/ExampleRange - - int - + + 0 + + + + 100 + @@ -542,7 +499,7 @@ - + Example SubmodelElementCollectionUnordered object @@ -568,7 +525,7 @@ - + Example Blob object @@ -600,7 +557,7 @@ - + Example File object @@ -640,7 +597,7 @@ - + Example Reference Element object @@ -673,7 +630,7 @@ - + An example bill of material submodel for the test application @@ -706,7 +663,7 @@ - + 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. @@ -732,7 +689,7 @@ - + Example Property object @@ -748,17 +705,13 @@ (GlobalReference)[IRI]http://acplt.org/Properties/ExampleProperty - - exampleValue2 - - (GlobalReference)[IRI]http://acplt.org/ValueId/ExampleValueId - - string - + + exampleValue2 + @@ -769,7 +722,7 @@ - + Example Property object @@ -785,17 +738,13 @@ (GlobalReference)[IRI]http://acplt.org/Properties/ExampleProperty - - exampleValue - - (GlobalReference)[IRI]http://acplt.org/ValueId/ExampleValueId - - string - + + exampleValue + @@ -803,7 +752,7 @@ - + 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. @@ -844,7 +793,7 @@ - + An example asset identification submodel for the test application @@ -877,7 +826,7 @@ - + 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. @@ -895,17 +844,13 @@ http://acplt.org/Qualifier/ExampleQualifier - - 100 - - (GlobalReference)[IRI]http://acplt.org/ValueId/ExampleValueId - - int - + + 100 + @@ -914,40 +859,32 @@ http://acplt.org/Qualifier/ExampleQualifier2 - - 50 - - (GlobalReference)[IRI]http://acplt.org/ValueId/ExampleValueId - - int - + + 50 + (GlobalReference)[IRI]0173-1#02-AAO677#002 - - ACPLT - - (GlobalReference)[IRI]http://acplt.org/ValueId/ExampleValueId - - string - + + ACPLT + - + 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. @@ -963,17 +900,13 @@ (GlobalReference)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber - - 978-8234-234-342 - - (GlobalReference)[IRI]http://acplt.org/ValueId/ExampleValueId - - string - + + 978-8234-234-342 + @@ -1091,10 +1024,6 @@ ExampleProperty - - string - - @@ -1111,10 +1040,6 @@ ExampleRange - - int - - @@ -1234,7 +1159,7 @@ - + An Example Asset Administration Shell for the test application @@ -1277,7 +1202,7 @@ - + An example submodel for the test application @@ -1314,7 +1239,7 @@ - + Example RelationshipElement object @@ -1341,7 +1266,7 @@ - + Example AnnotatedRelationshipElement object @@ -1371,14 +1296,10 @@ INSTANCE - + some example annotation - - string - - @@ -1391,7 +1312,7 @@ - + Example Operation object @@ -1414,7 +1335,7 @@ - + Example Property object @@ -1432,23 +1353,15 @@ http://acplt.org/Qualifier/ExampleQualifier - - string - - (GlobalReference)[IRI]http://acplt.org/Properties/ExampleProperty - + exampleValue - - string - - @@ -1460,7 +1373,7 @@ - + Example Property object @@ -1478,23 +1391,15 @@ http://acplt.org/Qualifier/ExampleQualifier - - string - - (GlobalReference)[IRI]http://acplt.org/Properties/ExampleProperty - + exampleValue - - string - - @@ -1506,7 +1411,7 @@ - + Example Property object @@ -1524,23 +1429,15 @@ http://acplt.org/Qualifier/ExampleQualifier - - string - - (GlobalReference)[IRI]http://acplt.org/Properties/ExampleProperty - + exampleValue - - string - - @@ -1553,7 +1450,7 @@ - + Example Capability object @@ -1577,7 +1474,7 @@ - + Example BasicEvent object @@ -1609,7 +1506,7 @@ - + Example SubmodelElementCollectionOrdered object @@ -1635,7 +1532,7 @@ - + Example Property object @@ -1653,23 +1550,15 @@ http://acplt.org/Qualifier/ExampleQualifier - - string - - (GlobalReference)[IRI]http://acplt.org/Properties/ExampleProperty - + exampleValue - - string - - @@ -1679,7 +1568,7 @@ - + Example MultiLanguageProperty object @@ -1695,8 +1584,8 @@ (GlobalReference)[IRI]http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty - - + + Example value of a MultiLanguageProperty element @@ -1713,7 +1602,7 @@ - + Example Range object @@ -1725,21 +1614,17 @@ ExampleRange - - 100 - - - - 0 - - (GlobalReference)[IRI]http://acplt.org/Ranges/ExampleRange - - int - + + 0 + + + + 100 + @@ -1755,7 +1640,7 @@ - + Example SubmodelElementCollectionUnordered object @@ -1781,7 +1666,7 @@ - + Example Blob object @@ -1813,7 +1698,7 @@ - + Example File object @@ -1853,7 +1738,7 @@ - + Example Reference Element object @@ -1894,7 +1779,7 @@ - + An example concept description for the test application @@ -1917,9 +1802,9 @@ - + (GlobalReference)[IRI]http://acplt.org/DataSpecifications/ConceptDescriptions/TestConceptDescription - + @@ -1954,7 +1839,7 @@ - + An example concept description for the test application @@ -2006,9 +1891,9 @@ - + (GlobalReference)[IRI]http://acplt.org/ReferenceElements/ConceptDescriptionX - + @@ -2078,7 +1963,7 @@ A FileDataReference represents the address to a File. FileDataReference is derived from the AutomationML Interface Class ExternalDataReference that is defined in AutomationML BPR_005E_ExternalDataReference_v1.0.0_2:The interface class “ExternalDataReference” shall be used in order to reference external documents out of the scope of AutomationML. - Reference to any other referable element of the same of any other AAS or a reference to an external object or entity. For local references inside the same Asset Administration Shell an InternalLink between two objects with this interface "ReferableReference" shall be set. In this case the attribute value has to be empty. For references between different Asset Administration Shells or external objects or entities the attribute value shall be used and no InternalLink shall be set. + Reference to any other referable element of the same of any other AAS or a reference to an external object or entity. For local references inside the same Asset Administration Shell an InternalLink between two objects with this interface "ReferableReference" shall be set. In this case the attribute value has to be empty. For references between different Asset Administration Shells or external objects or entities the attribute value shall be used and no InternalLink shall be set. Reference to any other referable element of any other AAS or a reference to an external object or entity. Note: For references to any other referable element of the same AAS InternalLinks are used and this attribute value shall be empty. @@ -2140,7 +2025,7 @@ An Asset Administration Shell. - Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. @@ -2201,7 +2086,7 @@ An Asset describes meta data of an asset that is represented by an AAS. The asset may either represent an asset type or an asset instance. The asset has a globally unique identifier plus – if needed – additional domain specific (proprietary) identifiers. - Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. @@ -2264,7 +2149,7 @@ A Submodel defines a specific aspect of the asset represented by the AAS. A submodel is used to structure the virtual representation and technical functionality of an Administration Shell into distinguishable parts. Each submodel refers to a well-defined domain or subject matter. Submodels can become standardized and thus become submodels types. Submodels can have different life-cycles. - Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. @@ -2351,7 +2236,7 @@ A submodel element collection is a set or list of submodel elements. - Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. @@ -2424,7 +2309,7 @@ A BLOB is a data element that represents a file that is contained with its source code in the value attribute. - Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. @@ -2493,7 +2378,7 @@ A capability is the implementation-independent description of the potential of an asset to achieve a certain effect in the physical or virtual world. - Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. @@ -2552,7 +2437,7 @@ A role class for a File that a data element that represents an address to a file. It is derived from the AutomationML role class ExternalData that is an role type for a document type and the base class for all document type roles. It describes different document types. ExternalData is defined in AutomationML BPR_005E_ExternalDataReference_v1.0.0_2. - Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. @@ -2619,7 +2504,7 @@ A property is a data element that has a single value. - Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. @@ -2686,7 +2571,7 @@ A reference element is a data element that defines a logical reference to another element within the same or another AAS or a reference to an external object or entity. - Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. @@ -2751,7 +2636,7 @@ A relationship element is used to define a relationship between two referable elements. - Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. @@ -2827,7 +2712,7 @@ An operation is a submodel element with input and output variables. - Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. @@ -2895,7 +2780,7 @@ A view is a collection of referable elements w.r.t. to a specific viewpoint of one or more stakeholders. - Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. @@ -2923,7 +2808,7 @@ A dictionary contains elements that can be reused. - Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. @@ -2946,7 +2831,7 @@ Explanation: The semantics of a property or other elements that may have a semantic description is defined by a concept description. The description of the concept should follow a standardized schema (realized as data specification template). - Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. @@ -3000,7 +2885,7 @@ Description Role class of an element that has a data specification template. A template defines the additional attributes an element may or shall have. - Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. @@ -3054,7 +2939,7 @@ An entity is a submodel element that is used to model entities. Constraint AASd-056: If the semanticId of a Entity submodel element references a ConceptDescription then the ConceptDescription/category shall be one of following values: ENTITY. The ConceptDescription describes the elements assigned to the entity via Entity/statement. - Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. @@ -3130,10 +3015,202 @@ - Reference to the asset the entity is representing. Constraint AASd-014: Either the attribute globalAssetId or specificAssetId of an Entity must be set if Entity/entityType is set to "SelfManagedEntity". They are not existing otherwise. + Reference to the asset the entity is representing. Constraint AASd-014: Either the attribute globalAssetId or specificAssetId of an Entity must be set if Entity/entityType is set to "SelfManagedEntity". They are not existing otherwise. + + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. + + + + + Reference to the global unqiue id of a coded value. + + + + + + + + + + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. + + + + + Reference to the global unqiue id of a coded value. + + + + + + Reference to the global unique id if a coded value. + + + + + + + + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + 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. + + + + + Description or comments on the element. The description can be provided in several languages. + + + + + + Global reference to the data specification template used by the element. + + + + + Kind of the element: either template or instance. + Instance + Instance + + + + Instance + Type + + + + + Description or comments on the element. The description can be provided in several languages. This attribute has the name of the label and has a value with the label written in the default language. The individual languages are modelled as child attributes. The names of the child attributes are the prefix “aml-lang=” with the expression of the language in compliance with RFC5646. At it, the values of the child attributes are the labels within the respective language. + + + + + A qualifier is a type-value-pair that makes additional statements w.r.t. the value of the element. [TYPE] is the value of the attribute type and [VALUE] is the value of the attribute value. + + + The type describes the type of the qualifier that is applied to the element. + + + + + The qualifier value is the value of the qualifier. Constraint AASd-006: if both, the value and the valueId are present then the value needs to be identical to the value of the referenced coded value in valueId. + + + + + Reference to the global unqiue id of a coded value. + + + + + + The value of the property instance. + + + + Reference to the global unique id if a coded value. + + + Automation Markup Language Base Role Class Library - Part 1 Content extended with Part 3 and Part 4 Content @@ -3282,10 +3359,6 @@ ExampleProperty - - string - - @@ -3302,10 +3375,6 @@ ExampleRange - - int - - @@ -3484,10 +3553,6 @@ ExampleProperty - - string - - @@ -3504,10 +3569,6 @@ ExampleRange - - int - - @@ -3585,7 +3646,7 @@ An AAS Data Specification template for IEC61369. A template consists of the DataSpecificationContent containing the additional attributes to be added to the element instance that references the data specification template and meta information about the template itself (this is why DataSpecification inherits from Identifiable). In UML these are two separated classes. - Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA.