diff --git a/.github/workflows/docfx-build-publish.yml b/.github/workflows/docfx-build-publish.yml new file mode 100644 index 00000000..90eaaaed --- /dev/null +++ b/.github/workflows/docfx-build-publish.yml @@ -0,0 +1,29 @@ +# This workflow will build and publish documentation with docfx +# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path + +name: Documentation Publish + +on: + push: + branches: + - main + +jobs: + build_docs: + runs-on: ubuntu-latest + name: Build and publish documentation + steps: + - name: Checkout + uses: actions/checkout@v1 + + - name: Build docfx + uses: nikeee/docfx-action@v1.0.0 + with: + args: docs/docfx.json + + - name: Publish + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: docs/_site + force_orphan: true diff --git a/.github/workflows/maven-deploy-to-maven-central.yml b/.github/workflows/maven-deploy-to-maven-central.yml index cfaa7567..5213c968 100644 --- a/.github/workflows/maven-deploy-to-maven-central.yml +++ b/.github/workflows/maven-deploy-to-maven-central.yml @@ -5,8 +5,8 @@ name: Generate and Deploy to Sonatype on: - push: - branches: [ main ] + release: + types: [published] jobs: diff --git a/README.md b/README.md index 18937b0b..82b317c2 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,7 @@ root: `mvn clean package` + or by integrating the respective modules as dependencies from Maven Central Repository, for instance: ``` @@ -68,4 +69,4 @@ We always look for contributions, bug reports, feature requests etc. Simply open | Jan Blume | Fraunhofer IOSB | []() | | | | | | | | | x | This project was initiated by SAP and Fraunhofer to provide a foundation for the -AAS development and to foster its dissemination. \ No newline at end of file +AAS development and to foster its dissemination. diff --git a/dataformat-aasx/src/main/java/io/adminshell/aas/v3/dataformat/aasx/AASXDeserializer.java b/dataformat-aasx/src/main/java/io/adminshell/aas/v3/dataformat/aasx/AASXDeserializer.java index be79613f..a957dd97 100644 --- a/dataformat-aasx/src/main/java/io/adminshell/aas/v3/dataformat/aasx/AASXDeserializer.java +++ b/dataformat-aasx/src/main/java/io/adminshell/aas/v3/dataformat/aasx/AASXDeserializer.java @@ -47,7 +47,7 @@ public class AASXDeserializer { private static final String XML_TYPE = "http://www.admin-shell.io/aasx/relationships/aas-spec"; private static final String AASX_ORIGIN = "/aasx/aasx-origin"; - private XmlDeserializer deserializer = new XmlDeserializer(); + private final XmlDeserializer deserializer; private AssetAdministrationShellEnvironment environment; private final OPCPackage aasxRoot; @@ -61,6 +61,7 @@ public class AASXDeserializer { */ public AASXDeserializer(InputStream inputStream) throws InvalidFormatException, IOException { aasxRoot = OPCPackage.open(inputStream); + deserializer = new XmlDeserializer(); } /** diff --git a/dataformat-aasx/src/main/java/io/adminshell/aas/v3/dataformat/aasx/AASXSerializer.java b/dataformat-aasx/src/main/java/io/adminshell/aas/v3/dataformat/aasx/AASXSerializer.java index 5de4da07..b9bbc96e 100644 --- a/dataformat-aasx/src/main/java/io/adminshell/aas/v3/dataformat/aasx/AASXSerializer.java +++ b/dataformat-aasx/src/main/java/io/adminshell/aas/v3/dataformat/aasx/AASXSerializer.java @@ -61,12 +61,13 @@ public class AASXSerializer { private static final String AASSUPPL_RELTYPE = "http://www.admin-shell.io/aasx/relationships/aas-suppl"; - private Serializer xmlSerializer = new XmlSerializer(); + private final Serializer xmlSerializer; /** * Default constructor */ public AASXSerializer() { + xmlSerializer = new XmlSerializer(); } /** 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 ca5433e2..85d82242 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 @@ -25,12 +25,12 @@ 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.AssetInformation; import io.adminshell.aas.v3.model.Identifiable; import io.adminshell.aas.v3.model.MultiLanguageProperty; import io.adminshell.aas.v3.model.Referable; import io.adminshell.aas.v3.model.Qualifiable; - import java.util.List; /** @@ -64,8 +64,8 @@ public AssetAdministrationShellEnvironment map(CAEXFile aml) throws MappingExcep mappingProvider.register(new LangStringCollectionMapper()); mappingProvider.register(new RelationshipElementMapper()); mappingProvider.register(new ReferenceElementMapper()); - mappingProvider.register(new ReferableMapper()); - mappingProvider.register(new IdentifiableMapper()); + mappingProvider.register(new ReferableMapper<>()); + mappingProvider.register(new IdentifiableMapper<>()); mappingProvider.register(new ConstraintCollectionMapper()); mappingProvider.register(new QualifierMapper()); mappingProvider.register(new OperationCollectionMapper()); @@ -77,12 +77,15 @@ public AssetAdministrationShellEnvironment map(CAEXFile aml) throws MappingExcep mappingProvider.register(new EmbeddedDataSpecificationCollectionMapper()); mappingProvider.register(new DataSpecificationIEC61360Mapper()); mappingProvider.register(new EnumDataTypeIEC61360Mapper()); + mappingProvider.register(new IdentifierKeyValuePairCollectionMapper()); + AbstractClassNamingStrategy classNamingStrategy = new NumberingClassNamingStrategy(); PropertyNamingStrategy propertyNamingStrategy = new PropertyNamingStrategy(); propertyNamingStrategy.registerCustomNaming(Referable.class, "descriptions", "description"); propertyNamingStrategy.registerCustomNaming(MultiLanguageProperty.class, "values", "value"); - propertyNamingStrategy.registerCustomNaming(Qualifiable.class, "qualifiers", "qualifier","qualifier"); + propertyNamingStrategy.registerCustomNaming(Qualifiable.class, "qualifiers", "qualifier", "qualifier"); + propertyNamingStrategy.registerCustomNaming(AssetInformation.class, "specificAssetIds", "specificAssetId"); MappingContext context = new MappingContext(mappingProvider, classNamingStrategy, propertyNamingStrategy, config.getTypeFactory()); context.setDocumentInfo(AmlDocumentInfo.fromFile(aml)); AssetAdministrationShellEnvironment result = context.map(AssetAdministrationShellEnvironment.class, parser); diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/deserialization/mappers/AssetAdministrationShellEnvironmentMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/deserialization/mappers/AssetAdministrationShellEnvironmentMapper.java index 713f35c7..4049e910 100644 --- a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/deserialization/mappers/AssetAdministrationShellEnvironmentMapper.java +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/deserialization/mappers/AssetAdministrationShellEnvironmentMapper.java @@ -73,7 +73,7 @@ public AssetAdministrationShellEnvironment map(AmlParser parser, MappingContext CAEXFile.SystemUnitClassLib systemUnitClassLib = parser.getContent().getSystemUnitClassLib().stream() .filter(x -> x.getName().equalsIgnoreCase(ASSET_ADMINISTRATION_SHELL_SYSTEM_UNIT_CLASSES)) .findFirst() - .orElse(null); + .orElse(CAEXFile.SystemUnitClassLib.builder().build()); List systemUnitFamilyTypeShells = systemUnitClassLib.getSystemUnitClass().stream() .filter(x ->x.getSupportedRoleClass().get(0).getRefRoleClassPath().equalsIgnoreCase(ROLE_CLASS_LIB_ASSET_ADMINISTRATION_SHELL)) diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/deserialization/mappers/IdentifierKeyValuePairCollectionMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/deserialization/mappers/IdentifierKeyValuePairCollectionMapper.java new file mode 100644 index 00000000..fc4b2b82 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/deserialization/mappers/IdentifierKeyValuePairCollectionMapper.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.deserialization.mappers; + +import io.adminshell.aas.v3.dataformat.aml.deserialization.AmlParser; +import io.adminshell.aas.v3.dataformat.aml.deserialization.DefaultMapper; +import io.adminshell.aas.v3.dataformat.aml.deserialization.MappingContext; +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.core.util.AasUtils; +import io.adminshell.aas.v3.dataformat.mapping.MappingException; +import io.adminshell.aas.v3.model.IdentifierKeyValuePair; +import java.beans.PropertyDescriptor; + +import java.lang.reflect.InvocationTargetException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.logging.Level; +import java.util.logging.Logger; + +public class IdentifierKeyValuePairCollectionMapper extends DefaultMapper> { + + @Override + protected Collection mapCollectionValueProperty(AmlParser parser, MappingContext context) throws MappingException { + Collection result = new ArrayList<>(); + CAEXObject current = parser.getCurrent(); + AttributeType parent = findAttribute(current, context.getProperty(), context); + if (parent == null) { + return result; + } + List attributes = findAttributes(parent, x -> x.getName().startsWith("specificAssetId")); + for (AttributeType attribute : attributes) { + parser.setCurrent(attribute); + try { + IdentifierKeyValuePair element = context.getTypeFactory().newInstance(IdentifierKeyValuePair.class); + for (PropertyDescriptor property : AasUtils.getAasProperties(IdentifierKeyValuePair.class)) { + Object propertyValue = context + .with(element) + .with(property) + .withoutType() + .map(property.getReadMethod().getGenericReturnType(), parser); + if (propertyValue != null) { + try { + property.getWriteMethod().invoke(element, propertyValue); + } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException ex) { + throw new MappingException(String.format("error setting property value for property %s", property.getName()), ex); + } + } + } + parser.setCurrent(attribute); + result.add(element); + } catch (NoSuchMethodException ex) { + Logger.getLogger(IdentifierKeyValuePairCollectionMapper.class.getName()).log(Level.SEVERE, null, ex); + } catch (InstantiationException ex) { + Logger.getLogger(IdentifierKeyValuePairCollectionMapper.class.getName()).log(Level.SEVERE, null, ex); + } catch (IllegalAccessException ex) { + Logger.getLogger(IdentifierKeyValuePairCollectionMapper.class.getName()).log(Level.SEVERE, null, ex); + } catch (IllegalArgumentException ex) { + Logger.getLogger(IdentifierKeyValuePairCollectionMapper.class.getName()).log(Level.SEVERE, null, ex); + } catch (InvocationTargetException ex) { + Logger.getLogger(IdentifierKeyValuePairCollectionMapper.class.getName()).log(Level.SEVERE, null, ex); + } + } + parser.setCurrent(parent); + return result; + } + +} 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 9b788b1b..d94d6dbc 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 @@ -38,6 +38,7 @@ 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.IdentifierKeyValuePairCollectionMapper; 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; @@ -99,6 +100,7 @@ public CAEXFile map(AssetAdministrationShellEnvironment env, AmlSerializationCon mappingProvider.register(new PropertyMapper()); mappingProvider.register(new RangeMapper()); mappingProvider.register(new ConceptDescriptionMapper()); + mappingProvider.register(new IdentifierKeyValuePairCollectionMapper()); MappingContext context = new MappingContext( mappingProvider, classNamingStrategy, diff --git a/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/IdentifierKeyValuePairCollectionMapper.java b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/IdentifierKeyValuePairCollectionMapper.java new file mode 100644 index 00000000..8da1a775 --- /dev/null +++ b/dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/IdentifierKeyValuePairCollectionMapper.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.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.aml.model.caex.AttributeType; +import io.adminshell.aas.v3.dataformat.core.util.AasUtils; +import io.adminshell.aas.v3.dataformat.mapping.MappingException; +import io.adminshell.aas.v3.model.AssetInformation; +import io.adminshell.aas.v3.model.IdentifierKeyValuePair; +import java.beans.PropertyDescriptor; +import java.lang.reflect.InvocationTargetException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +public class IdentifierKeyValuePairCollectionMapper extends DefaultMapper> { + + private static final String ATTRIBUTE_NAME = "specificAssetId"; + + @Override + public void map(Collection value, AmlGenerator generator, MappingContext context) throws MappingException { + if (value == null || context == null || value.isEmpty()) { + return; + } + AttributeType.Builder wrapperBuilder = AttributeType.builder() + .withName(ATTRIBUTE_NAME) + .withRefSemantic(generator.refSemantic(AssetInformation.class, ATTRIBUTE_NAME)); + List attributes = new ArrayList<>(); + for (IdentifierKeyValuePair element : value) { + AttributeType.Builder builder = AttributeType.builder() + .withName(ATTRIBUTE_NAME + (value.size() > 1 ? "_" + (attributes.size() + 1) : "")); + for (PropertyDescriptor property : AasUtils.getAasProperties(element.getClass())) { + if (!skipProperty(property)) { + context.with(property) + .map(property.getReadMethod().getGenericReturnType(), + getElemenetPropertyValue(element, property, context), + generator.with(builder)); + } + } + attributes.add(builder.build()); + } + attributes.forEach(x -> wrapperBuilder.addAttribute(x)); + generator.add(wrapperBuilder.build()); + } + + protected Object getElemenetPropertyValue(IdentifierKeyValuePair elemenet, PropertyDescriptor property, MappingContext context) throws MappingException { + try { + return property.getReadMethod().invoke(elemenet); + } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException ex) { + throw new MappingException("failed to get property value for property " + property.getName(), ex); + } + } +} 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 c9f0e389..cf2c5a82 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 @@ -18,7 +18,9 @@ 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.dataformat.aml.fixtures.SimpleExample; import io.adminshell.aas.v3.dataformat.core.AASFull; +import io.adminshell.aas.v3.dataformat.core.AASSimple; import io.adminshell.aas.v3.model.*; import java.io.FileNotFoundException; @@ -27,7 +29,6 @@ import java.util.List; import java.util.stream.Collectors; -import org.junit.Before; import org.junit.Test; import static org.junit.Assert.assertEquals; @@ -36,18 +37,29 @@ public class AmlDeserializerTest { private final AmlDeserializer deserializer = new AmlDeserializer(); - private AssetAdministrationShellEnvironment actual; - private AssetAdministrationShellEnvironment expected; + @Test + public void testSAPFullExample() throws FileNotFoundException, DeserializationException { + AssetAdministrationShellEnvironment actual = deserializer.read(FullExample.FILE); + AssetAdministrationShellEnvironment expected = AASFull.createEnvironment(); + //some changes on the Full Example environment are necessary because there are some constructs inside which are + //not possible with AML due to the mapping specifications - @Before - public void init() throws FileNotFoundException, DeserializationException { - actual = deserializer.read(FullExample.FILE); - expected = AASFull.createEnvironment(); + //remove asset administration shells with no submodels + adaptAssetAdministrationShells(expected); + //remove leveltypes and valuelists from embedded dataspecification + adaptConceptDescriptions(expected); + //remove non referenced submodels + adaptSubmodels(expected); + //swap the idx of two submodels because assertEquals checks also the order of the elements + swapSubmodelIdx(actual, 0, 2); + assertEquals(expected, actual); } @Test - public void testSAPFullExample() { - //some changes on the Full Example environment are necessary because there are some constructs inside which are + public void testSAPSimpleExample() throws FileNotFoundException, DeserializationException { + AssetAdministrationShellEnvironment actual = deserializer.read(SimpleExample.FILE); + AssetAdministrationShellEnvironment expected = AASSimple.createEnvironment(); + //some changes on the Simple Example environment are necessary because there are some constructs inside which are //not possible with AML due to the mapping specifications //remove asset administration shells with no submodels @@ -57,19 +69,29 @@ public void testSAPFullExample() { //remove non referenced submodels adaptSubmodels(expected); //swap the idx of two submodels because assertEquals checks also the order of the elements - swapSubmodelIdx(actual,0,2); + swapSubmodelIdx(expected, 1, 2); + // remove assets as they are not part of the current AML specification + removeAssets(expected); + adaptAssetInformation(expected); assertEquals(expected, actual); } @Test - public void testSubmodels() { + public void testSubmodels() throws FileNotFoundException, DeserializationException { + AssetAdministrationShellEnvironment actual = deserializer.read(FullExample.FILE); + AssetAdministrationShellEnvironment expected = AASFull.createEnvironment(); adaptSubmodels(expected); - swapSubmodelIdx(actual, 0,2); - assertEquals(expected.getSubmodels(),actual.getSubmodels()); + swapSubmodelIdx(actual, 0, 2); + assertEquals(expected.getSubmodels(), actual.getSubmodels()); } - private void swapSubmodelIdx(AssetAdministrationShellEnvironment env, int idxSrc, int idxDest){ - Collections.swap(env.getSubmodels(),idxSrc,idxDest); + private void swapSubmodelIdx(AssetAdministrationShellEnvironment env, int idxSrc, int idxDest) { + Collections.swap(env.getSubmodels(), idxSrc, idxDest); + } + + private void adaptAssetInformation(AssetAdministrationShellEnvironment env) { + // remove thumbnail as it is not defined in current AML specification + env.getAssetAdministrationShells().forEach(x -> x.getAssetInformation().setDefaultThumbnail(null)); } private void adaptSubmodels(AssetAdministrationShellEnvironment env) { @@ -77,24 +99,30 @@ private void adaptSubmodels(AssetAdministrationShellEnvironment env) { List submodelIds = new ArrayList<>(); env.getAssetAdministrationShells().stream().forEach( x -> x.getSubmodels().stream() - .forEach(y -> y.getKeys().stream().forEach(z ->submodelIds.add(z.getValue())))); + .forEach(y -> y.getKeys().stream().forEach(z -> submodelIds.add(z.getValue())))); List referencedSubmodels = env.getSubmodels().stream().filter(x -> submodelIds.contains(x.getIdentification().getIdentifier())).collect(Collectors.toList()); env.setSubmodels(referencedSubmodels); } + private void removeAssets(AssetAdministrationShellEnvironment env) { + env.getAssets().clear(); + } + @Test - public void testAssetAdministrationShells() { + public void testAssetAdministrationShells() throws FileNotFoundException, DeserializationException { + AssetAdministrationShellEnvironment actual = deserializer.read(FullExample.FILE); + AssetAdministrationShellEnvironment expected = AASFull.createEnvironment(); adaptAssetAdministrationShells(expected); assertEquals(expected.getAssetAdministrationShells(), actual.getAssetAdministrationShells()); } - private void adaptAssetAdministrationShells(AssetAdministrationShellEnvironment env){ + private void adaptAssetAdministrationShells(AssetAdministrationShellEnvironment env) { //Need to remove Asset Administration Shell which have no Submodels //they are not considered in AML due to the specification List nonEmptyShells = new ArrayList<>(); - for(AssetAdministrationShell aas : env.getAssetAdministrationShells()){ - if(aas.getSubmodels() != null && aas.getSubmodels().size() > 0){ + for (AssetAdministrationShell aas : env.getAssetAdministrationShells()) { + if (aas.getSubmodels() != null && aas.getSubmodels().size() > 0) { nonEmptyShells.add(aas); } } @@ -102,19 +130,21 @@ private void adaptAssetAdministrationShells(AssetAdministrationShellEnvironment } @Test - public void testConceptDescriptions() { + public void testConceptDescriptions() throws FileNotFoundException, DeserializationException { + AssetAdministrationShellEnvironment actual = deserializer.read(FullExample.FILE); + AssetAdministrationShellEnvironment expected = AASFull.createEnvironment(); //Need to remove Level Types and Value Lists from embedded dataspecification //they are not considered in AML due to the specification adaptConceptDescriptions(expected); assertEquals(expected.getConceptDescriptions(), actual.getConceptDescriptions()); } - private void adaptConceptDescriptions(AssetAdministrationShellEnvironment env){ + private void adaptConceptDescriptions(AssetAdministrationShellEnvironment env) { List expectedConceptDescriptions = env.getConceptDescriptions(); - for(ConceptDescription c : expectedConceptDescriptions){ - for(EmbeddedDataSpecification embeddedDataSpecification : c.getEmbeddedDataSpecifications()){ - ((DataSpecificationIEC61360)embeddedDataSpecification.getDataSpecificationContent()).setLevelTypes(new ArrayList<>()); - ((DataSpecificationIEC61360)embeddedDataSpecification.getDataSpecificationContent()).setValueList(null); + for (ConceptDescription c : expectedConceptDescriptions) { + for (EmbeddedDataSpecification embeddedDataSpecification : c.getEmbeddedDataSpecifications()) { + ((DataSpecificationIEC61360) embeddedDataSpecification.getDataSpecificationContent()).setLevelTypes(new ArrayList<>()); + ((DataSpecificationIEC61360) embeddedDataSpecification.getDataSpecificationContent()).setValueList(null); } } diff --git a/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/fixtures/SimpleExample.java b/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/fixtures/SimpleExample.java new file mode 100644 index 00000000..4877ea48 --- /dev/null +++ b/dataformat-aml/src/test/java/io/adminshell/aas/v3/dataformat/aml/fixtures/SimpleExample.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.fixtures; + +public class SimpleExample { + + public static final java.io.File FILE = new java.io.File("src/test/resources/test_demo_simple_example.aml"); + +} \ No newline at end of file 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 d81c9d42..9f37a7c5 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 @@ -15,12 +15,15 @@ */ package io.adminshell.aas.v3.dataformat.aml.serialize; +import io.adminshell.aas.v3.dataformat.DeserializationException; 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.fixtures.SimpleExample; import io.adminshell.aas.v3.dataformat.aml.serialization.id.IntegerIdGenerator; import io.adminshell.aas.v3.dataformat.core.AASFull; +import io.adminshell.aas.v3.dataformat.core.AASSimple; import io.adminshell.aas.v3.model.AssetAdministrationShellEnvironment; import java.io.File; import java.io.IOException; @@ -41,6 +44,11 @@ public void testSAPFullExample() throws SerializationException, SAXException, IO validateAmlSerializer(FullExample.FILE, AASFull.ENVIRONMENT); } + @Test + public void testSimpleExample() throws SerializationException, SAXException, IOException, DeserializationException { + validateAmlSerializer(SimpleExample.FILE, AASSimple.ENVIRONMENT); + } + private void validateAmlSerializer(File expectedFile, AssetAdministrationShellEnvironment environment) throws SerializationException, SAXException, IOException { String expected = Files.readString(expectedFile.toPath()); 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 147423a9..8b95a7be 100644 --- a/dataformat-aml/src/test/resources/test_demo_full_example.aml +++ b/dataformat-aml/src/test/resources/test_demo_full_example.aml @@ -21,16 +21,16 @@ - (Submodel)[IRI]http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial + (Submodel)[Iri]http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial - (Asset)[IRI]https://acplt.org/Test_Asset + (Asset)[Iri]https://acplt.org/Test_Asset - (AssetAdministrationShell)[IRI]https://acplt.org/TestAssetAdministrationShell2 + (AssetAdministrationShell)[Iri]https://acplt.org/TestAssetAdministrationShell2 @@ -98,7 +98,7 @@ - (GlobalReference)[IRI]http://acplt.org/SubmodelTemplates/ExampleSubmodel + (GlobalReference)[Iri]http://acplt.org/SubmodelTemplates/ExampleSubmodel @@ -120,7 +120,7 @@ - (GlobalReference)[IRI]http://acplt.org/RelationshipElements/ExampleRelationshipElement + (GlobalReference)[Iri]http://acplt.org/RelationshipElements/ExampleRelationshipElement @@ -147,7 +147,7 @@ - (GlobalReference)[IRI]http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement + (GlobalReference)[Iri]http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement @@ -197,7 +197,7 @@ - (GlobalReference)[IRI]http://acplt.org/Operations/ExampleOperation + (GlobalReference)[Iri]http://acplt.org/Operations/ExampleOperation @@ -220,11 +220,11 @@ - (GlobalReference)[IRI]http://acplt.org/Properties/ExampleProperty + (GlobalReference)[Iri]http://acplt.org/Properties/ExampleProperty - (GlobalReference)[IRI]http://acplt.org/ValueId/ExampleValueId + (GlobalReference)[Iri]http://acplt.org/ValueId/ExampleValueId @@ -255,11 +255,11 @@ - (GlobalReference)[IRI]http://acplt.org/Properties/ExampleProperty + (GlobalReference)[Iri]http://acplt.org/Properties/ExampleProperty - (GlobalReference)[IRI]http://acplt.org/ValueId/ExampleValueId + (GlobalReference)[Iri]http://acplt.org/ValueId/ExampleValueId @@ -290,11 +290,11 @@ - (GlobalReference)[IRI]http://acplt.org/Properties/ExampleProperty + (GlobalReference)[Iri]http://acplt.org/Properties/ExampleProperty - (GlobalReference)[IRI]http://acplt.org/ValueId/ExampleValueId + (GlobalReference)[Iri]http://acplt.org/ValueId/ExampleValueId @@ -326,7 +326,7 @@ - (GlobalReference)[IRI]http://acplt.org/Capabilities/ExampleCapability + (GlobalReference)[Iri]http://acplt.org/Capabilities/ExampleCapability @@ -350,11 +350,11 @@ - (Submodel)[IRI]https://acplt.org/Test_Submodel,(SubmodelElementCollection)[ID_SHORT]ExampleSubmodelCollectionOrdered,(Property)[ID_SHORT]ExampleProperty + (Submodel)[Iri]https://acplt.org/Test_Submodel,(SubmodelElementCollection)[IdShort]ExampleSubmodelCollectionOrdered,(Property)[IdShort]ExampleProperty - (GlobalReference)[IRI]http://acplt.org/Events/ExampleBasicEvent + (GlobalReference)[Iri]http://acplt.org/Events/ExampleBasicEvent @@ -386,7 +386,7 @@ - (GlobalReference)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered + (GlobalReference)[Iri]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered @@ -408,11 +408,11 @@ - (GlobalReference)[IRI]http://acplt.org/Properties/ExampleProperty + (GlobalReference)[Iri]http://acplt.org/Properties/ExampleProperty - (GlobalReference)[IRI]http://acplt.org/ValueId/ExampleValueId + (GlobalReference)[Iri]http://acplt.org/ValueId/ExampleValueId @@ -441,11 +441,11 @@ - (GlobalReference)[IRI]http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty + (GlobalReference)[Iri]http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty - (GlobalReference)[IRI]http://acplt.org/ValueId/ExampleMultiLanguageValueId + (GlobalReference)[Iri]http://acplt.org/ValueId/ExampleMultiLanguageValueId @@ -478,7 +478,7 @@ - (GlobalReference)[IRI]http://acplt.org/Ranges/ExampleRange + (GlobalReference)[Iri]http://acplt.org/Ranges/ExampleRange @@ -520,7 +520,7 @@ - (GlobalReference)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered + (GlobalReference)[Iri]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered @@ -546,7 +546,7 @@ - (GlobalReference)[IRI]http://acplt.org/Blobs/ExampleBlob + (GlobalReference)[Iri]http://acplt.org/Blobs/ExampleBlob @@ -578,7 +578,7 @@ - (GlobalReference)[IRI]http://acplt.org/Files/ExampleFile + (GlobalReference)[Iri]http://acplt.org/Files/ExampleFile @@ -616,7 +616,7 @@ - (GlobalReference)[IRI]http://acplt.org/ReferenceElements/ExampleReferenceElement + (GlobalReference)[Iri]http://acplt.org/ReferenceElements/ExampleReferenceElement @@ -664,7 +664,7 @@ - (Submodel)[IRI]http://acplt.org/SubmodelTemplates/BillOfMaterial + (Submodel)[Iri]http://acplt.org/SubmodelTemplates/BillOfMaterial @@ -686,7 +686,7 @@ - (GlobalReference)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber + (GlobalReference)[Iri]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber @@ -708,11 +708,11 @@ - (GlobalReference)[IRI]http://acplt.org/Properties/ExampleProperty + (GlobalReference)[Iri]http://acplt.org/Properties/ExampleProperty - (GlobalReference)[IRI]http://acplt.org/ValueId/ExampleValue2 + (GlobalReference)[Iri]http://acplt.org/ValueId/ExampleValue2 @@ -741,11 +741,11 @@ - (GlobalReference)[IRI]http://acplt.org/Properties/ExampleProperty + (GlobalReference)[Iri]http://acplt.org/Properties/ExampleProperty - (GlobalReference)[IRI]http://acplt.org/ValueId/ExampleValueId + (GlobalReference)[Iri]http://acplt.org/ValueId/ExampleValueId @@ -771,7 +771,7 @@ - (Asset)[IRI]https://acplt.org/Test_Asset2 + (Asset)[Iri]https://acplt.org/Test_Asset2 @@ -779,7 +779,7 @@ - (GlobalReference)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber + (GlobalReference)[Iri]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber @@ -827,7 +827,7 @@ - (Submodel)[IRI]http://acplt.org/SubmodelTemplates/AssetIdentification + (Submodel)[Iri]http://acplt.org/SubmodelTemplates/AssetIdentification @@ -867,11 +867,11 @@ - (GlobalReference)[IRI]0173-1#02-AAO677#002 + (GlobalReference)[Iri]0173-1#02-AAO677#002 - (GlobalReference)[IRI]http://acplt.org/ValueId/ACPLT + (GlobalReference)[Iri]http://acplt.org/ValueId/ACPLT @@ -895,11 +895,11 @@ - (GlobalReference)[IRI]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber + (GlobalReference)[Iri]http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber - (GlobalReference)[IRI]978-8234-234-342 + (GlobalReference)[Iri]978-8234-234-342 @@ -920,7 +920,7 @@ - (Asset)[IRI]https://acplt.org/Test_Asset_Mandatory + (Asset)[Iri]https://acplt.org/Test_Asset_Mandatory @@ -1003,7 +1003,7 @@ - (Submodel)[IRI]https://acplt.org/Test_Submodel_Mandatory,(SubmodelElementCollection)[ID_SHORT]ExampleSubmodelCollectionOrdered,(Property)[ID_SHORT]ExampleProperty + (Submodel)[Iri]https://acplt.org/Test_Submodel_Mandatory,(SubmodelElementCollection)[IdShort]ExampleSubmodelCollectionOrdered,(Property)[IdShort]ExampleProperty @@ -1168,7 +1168,7 @@ - (Asset)[IRI]https://acplt.org/Test_Asset_Missing + (Asset)[Iri]https://acplt.org/Test_Asset_Missing @@ -1252,7 +1252,7 @@ - (GlobalReference)[IRI]http://acplt.org/SubmodelTemplates/ExampleSubmodel + (GlobalReference)[Iri]http://acplt.org/SubmodelTemplates/ExampleSubmodel @@ -1274,7 +1274,7 @@ - (GlobalReference)[IRI]http://acplt.org/RelationshipElements/ExampleRelationshipElement + (GlobalReference)[Iri]http://acplt.org/RelationshipElements/ExampleRelationshipElement @@ -1301,7 +1301,7 @@ - (GlobalReference)[IRI]http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement + (GlobalReference)[Iri]http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement @@ -1351,7 +1351,7 @@ - (GlobalReference)[IRI]http://acplt.org/Operations/ExampleOperation + (GlobalReference)[Iri]http://acplt.org/Operations/ExampleOperation @@ -1384,7 +1384,7 @@ - (GlobalReference)[IRI]http://acplt.org/Properties/ExampleProperty + (GlobalReference)[Iri]http://acplt.org/Properties/ExampleProperty @@ -1425,7 +1425,7 @@ - (GlobalReference)[IRI]http://acplt.org/Properties/ExampleProperty + (GlobalReference)[Iri]http://acplt.org/Properties/ExampleProperty @@ -1466,7 +1466,7 @@ - (GlobalReference)[IRI]http://acplt.org/Properties/ExampleProperty + (GlobalReference)[Iri]http://acplt.org/Properties/ExampleProperty @@ -1498,7 +1498,7 @@ - (GlobalReference)[IRI]http://acplt.org/Capabilities/ExampleCapability + (GlobalReference)[Iri]http://acplt.org/Capabilities/ExampleCapability @@ -1522,11 +1522,11 @@ - (Submodel)[IRI]https://acplt.org/Test_Submodel_Missing,(SubmodelElementCollection)[ID_SHORT]ExampleSubmodelCollectionOrdered,(Property)[ID_SHORT]ExampleProperty + (Submodel)[Iri]https://acplt.org/Test_Submodel_Missing,(SubmodelElementCollection)[IdShort]ExampleSubmodelCollectionOrdered,(Property)[IdShort]ExampleProperty - (GlobalReference)[IRI]http://acplt.org/Events/ExampleBasicEvent + (GlobalReference)[Iri]http://acplt.org/Events/ExampleBasicEvent @@ -1558,7 +1558,7 @@ - (GlobalReference)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered + (GlobalReference)[Iri]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered @@ -1590,7 +1590,7 @@ - (GlobalReference)[IRI]http://acplt.org/Properties/ExampleProperty + (GlobalReference)[Iri]http://acplt.org/Properties/ExampleProperty @@ -1619,7 +1619,7 @@ - (GlobalReference)[IRI]http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty + (GlobalReference)[Iri]http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty @@ -1653,7 +1653,7 @@ - (GlobalReference)[IRI]http://acplt.org/Ranges/ExampleRange + (GlobalReference)[Iri]http://acplt.org/Ranges/ExampleRange @@ -1695,7 +1695,7 @@ - (GlobalReference)[IRI]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered + (GlobalReference)[Iri]http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered @@ -1721,7 +1721,7 @@ - (GlobalReference)[IRI]http://acplt.org/Blobs/ExampleBlob + (GlobalReference)[Iri]http://acplt.org/Blobs/ExampleBlob @@ -1753,7 +1753,7 @@ - (GlobalReference)[IRI]http://acplt.org/Files/ExampleFile + (GlobalReference)[Iri]http://acplt.org/Files/ExampleFile @@ -1791,7 +1791,7 @@ - (GlobalReference)[IRI]http://acplt.org/ReferenceElements/ExampleReferenceElement + (GlobalReference)[Iri]http://acplt.org/ReferenceElements/ExampleReferenceElement @@ -1843,7 +1843,7 @@ - (GlobalReference)[IRI]http://acplt.org/DataSpecifications/ConceptDescriptions/TestConceptDescription + (GlobalReference)[Iri]http://acplt.org/DataSpecifications/ConceptDescriptions/TestConceptDescription @@ -1932,7 +1932,7 @@ - (GlobalReference)[IRI]http://acplt.org/ReferenceElements/ConceptDescriptionX + (GlobalReference)[Iri]http://acplt.org/ReferenceElements/ConceptDescriptionX @@ -1980,7 +1980,7 @@ - (GlobalReference)[IRI]http://acplt.org/Units/SpaceUnit + (GlobalReference)[Iri]http://acplt.org/Units/SpaceUnit @@ -3297,7 +3297,7 @@ - (Asset)[IRI]https://acplt.org/Test_Asset_Mandatory + (Asset)[Iri]https://acplt.org/Test_Asset_Mandatory @@ -3380,7 +3380,7 @@ - (Submodel)[IRI]https://acplt.org/Test_Submodel_Mandatory,(SubmodelElementCollection)[ID_SHORT]ExampleSubmodelCollectionOrdered,(Property)[ID_SHORT]ExampleProperty + (Submodel)[Iri]https://acplt.org/Test_Submodel_Mandatory,(SubmodelElementCollection)[IdShort]ExampleSubmodelCollectionOrdered,(Property)[IdShort]ExampleProperty @@ -3590,7 +3590,7 @@ - (Submodel)[IRI]https://acplt.org/Test_Submodel_Mandatory,(SubmodelElementCollection)[ID_SHORT]ExampleSubmodelCollectionOrdered,(Property)[ID_SHORT]ExampleProperty + (Submodel)[Iri]https://acplt.org/Test_Submodel_Mandatory,(SubmodelElementCollection)[IdShort]ExampleSubmodelCollectionOrdered,(Property)[IdShort]ExampleProperty diff --git a/dataformat-aml/src/test/resources/test_demo_simple_example.aml b/dataformat-aml/src/test/resources/test_demo_simple_example.aml new file mode 100644 index 00000000..388aa9ef --- /dev/null +++ b/dataformat-aml/src/test/resources/test_demo_simple_example.aml @@ -0,0 +1,1964 @@ + + + + + + + + + INSTANCE + + + + (Asset)[Iri]http://customer.com/assets/KHBVZJSQKIY + + + + + + + (GlobalReference)[Iri]http://customer.com/Systems/ERP/012 + + + + EquipmentID + + + + 538fd1b3-f99f-4a52-9c75-72e9fa921270 + + + + + + (GlobalReference)[Iri]http://customer.com/Systems/IoT/1 + + + + DeviceID + + + + QjYgPggjwkiHk4RrQiYSLg== + + + + + + + ExampleMotor + + + + + + IRI + + + + http://customer.com/aas/9175_7013_7091_9168 + + + + + + TechnicalData + + + + + + IRI + + + + http://i40.customer.com/type/1/1/7A7104BDAB57E184 + + + + + INSTANCE + + + + (GlobalReference)[Irdi]0173-1#01-AFZ615#016 + + + + + Parameter + + + + MaxRotationSpeed + + + + INSTANCE + + + + (ConceptDescription)[Irdi]0173-1#02-BAA120#008 + + + + 5000 + + + + + + + + + OperationalData + + + + + + IRI + + + + http://i40.customer.com/instance/1/1/AC69B1CB44F07935 + + + + + INSTANCE + + + + + Variable + + + + RotationSpeed + + + + INSTANCE + + + + (ConceptDescription)[Iri]http://customer.com/cd/1/1/18EBD56F6B43D895 + + + + 4370 + + + + + + + + + Documentation + + + + + + IRI + + + + http://i40.customer.com/type/1/1/1A7B62B529F19152 + + + + + INSTANCE + + + + + false + + + + OperatingManual + + + + INSTANCE + + + + false + + + + (ConceptDescription)[Iri]www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Document + + + + + Title + + + + INSTANCE + + + + (ConceptDescription)[Iri]www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Description/Title + + + + OperatingManual + + + + + + + DigitalFile_PDF + + + + INSTANCE + + + + application/pdf + + + + (ConceptDescription)[Iri]www.vdi2770.com/blatt1/Entwurf/Okt18/cd/StoredDocumentRepresentation/DigitalFile + + + + /aasx/OperatingManual.pdf + + + + + application/pdf + + + + /aasx/OperatingManual.pdf + + + + + + + + + + + + + + + + Title + + + + + + IRI + + + + www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Description/Title + + + + + + STRING_TRANSLATABLE + + + + + + SprachabhängigerTiteldesDokuments. + + + + + + Title + + + Titel + + + + + + Title + + + Titel + + + + ExampleString + + + + ExampleString + + + + + + + + + DigitalFile + + + + + + IRI + + + + www.vdi2770.com/blatt1/Entwurf/Okt18/cd/StoredDocumentRepresentation/DigitalFile + + + + + + STRING + + + + + + A file representing the document version. In addition to the mandatory PDF file, other files can be specified. + + + + + + DigitalFile + + + DigitalFile + + + + + + DigitalFile + + + DigitaleDatei + + + + ExampleString + + + + ExampleString + + + + + + + + + + + 2.1 + + + + 2 + + + + + PROPERTY + + + + MaxRotationSpeed + + + + + + IRDI + + + + 0173-1#02-BAA120#008 + + + + + + REAL_MEASURE + + + + + + HöchstezulässigeDrehzahl,mitwelcherderMotoroderdieSpeiseinheitbetriebenwerdendarf + + + Greatestpermissiblerotationspeedwithwhichthemotororfeedingunitmaybeoperated + + + + + + max.Drehzahl + + + Max.rotationspeed + + + + ExampleString + + + + 1/min + + + + (GlobalReference)[Irdi]0173-1#05-AAA650#002 + + + + + + + + + PROPERTY + + + + RotationSpeed + + + + + + IRI + + + + http://customer.com/cd/1/1/18EBD56F6B43D895 + + + + + + REAL_MEASURE + + + + + + Aktuelle Drehzahl, mitwelcher der Motor oder die Speiseinheit betrieben wird + + + Actual rotationspeed with which the motor or feedingunit is operated + + + + + + AktuelleDrehzahl + + + Actualrotationspeed + + + + + + AktuelleDrehzahl + + + ActualRotationSpeed + + + + ExampleString + + + + 1/min + + + + (GlobalReference)[Irdi]0173-1#05-AAA650#002 + + + + + + + + + Document + + + + + + IRI + + + + www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Document + + + + + + STRING + + + + + + Feste und geordnete Menge von für die Verwendung durch Personen bestimmte Informationen, die verwaltet und als Einheit zwischen Benutzern und System ausgetauscht werden kann. + + + + + + Document + + + + + + Document + + + Dokument + + + + [ISO15519-1:2010] + + + + ExampleString + + + + + + + + + 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. + + + + + + Identifying string of the element within its name space. Constraint AASd-001: In case of a referable element not being an identifiable element this id is mandatory and used for referring to the element in its name space. Constraint AASd-002: idShort shall only feature letters, digits, underscore ("_"); starting mandatory with a letter. Constraint AASd-003: idShort shall be matched case-insensitive. Note: In case of an identifiable element idShort is optional but recommended to be defined. It can be used for unique reference in its name space and thus allows better usability and a more performant implementation. In this case it is similar to the “BrowserPath” in OPC UA. + + + + The category is a value that gives further meta information w.r.t. to the class of the element. It affects 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 + 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-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 700e3b48..aa84850e 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 @@ -82,7 +82,10 @@ public static String asString(Reference reference) { return null; } return reference.getKeys().stream() - .map(x -> String.format("(%s)[%s]%s", serializeEnumName(x.getType().name()), x.getIdType(), x.getValue())) + .map(x -> String.format("(%s)[%s]%s", + serializeEnumName(x.getType().name()), + serializeEnumName(x.getIdType().name()), + x.getValue())) .collect(Collectors.joining(",")); } @@ -181,7 +184,7 @@ public static Key parseKey(String value) { Matcher matcher = KEY_REGEX.matcher(value); if (matcher.find()) { KeyElements keyElements = KeyElements.valueOf(deserializeEnumName(matcher.group(KEY_REGEX_GROUP_TYPE))); - KeyType keyType = KeyType.valueOf(matcher.group(KEY_REGEX_GROUP_ID_TYPE)); + KeyType keyType = KeyType.valueOf(deserializeEnumName(matcher.group(KEY_REGEX_GROUP_ID_TYPE))); return new DefaultKey.Builder() .type(keyElements) .idType(keyType) diff --git a/dataformat-core/src/test/java/io/adminshell/aas/v3/dataformat/core/AasUtilsTest.java b/dataformat-core/src/test/java/io/adminshell/aas/v3/dataformat/core/AasUtilsTest.java new file mode 100644 index 00000000..a670c3b7 --- /dev/null +++ b/dataformat-core/src/test/java/io/adminshell/aas/v3/dataformat/core/AasUtilsTest.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.core; + + +import io.adminshell.aas.v3.dataformat.core.util.AasUtils; +import io.adminshell.aas.v3.model.KeyElements; +import io.adminshell.aas.v3.model.KeyType; +import io.adminshell.aas.v3.model.Reference; +import org.junit.Assert; +import org.junit.Test; + +public class AasUtilsTest { + + @Test + public void testParseReference() { + Reference reference = AasUtils.parseReference("(Property)[IdShort]Temperature"); + Assert.assertNotNull(reference); + Assert.assertEquals(1, reference.getKeys().size()); + Assert.assertEquals(KeyElements.PROPERTY, reference.getKeys().get(0).getType()); + Assert.assertEquals(KeyType.ID_SHORT, reference.getKeys().get(0).getIdType()); + Assert.assertEquals("Temperature", reference.getKeys().get(0).getValue()); + } +} diff --git a/dataformat-xml/src/main/java/io/adminshell/aas/v3/dataformat/xml/XmlDeserializer.java b/dataformat-xml/src/main/java/io/adminshell/aas/v3/dataformat/xml/XmlDeserializer.java index bbda58c1..080f2b0d 100644 --- a/dataformat-xml/src/main/java/io/adminshell/aas/v3/dataformat/xml/XmlDeserializer.java +++ b/dataformat-xml/src/main/java/io/adminshell/aas/v3/dataformat/xml/XmlDeserializer.java @@ -22,6 +22,7 @@ import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.module.SimpleAbstractTypeResolver; import com.fasterxml.jackson.databind.module.SimpleModule; +import com.fasterxml.jackson.dataformat.xml.XmlFactory; import com.fasterxml.jackson.dataformat.xml.XmlMapper; import io.adminshell.aas.v3.dataformat.DeserializationException; @@ -34,18 +35,24 @@ public class XmlDeserializer implements Deserializer { + protected final XmlFactory xmlFactory; protected XmlMapper mapper; protected SimpleAbstractTypeResolver typeResolver; protected static Map, com.fasterxml.jackson.databind.JsonDeserializer> customDeserializers = Map.of( SubmodelElement.class, new SubmodelElementDeserializer()); public XmlDeserializer() { + this(new XmlFactory()); + } + + public XmlDeserializer(XmlFactory xmlFactory) { + this.xmlFactory = xmlFactory; initTypeResolver(); buildMapper(); } protected void buildMapper() { - mapper = XmlMapper.builder().enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY) + mapper = XmlMapper.builder(xmlFactory).enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY) .disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES) .serializationInclusion(JsonInclude.Include.NON_NULL) .annotationIntrospector(new XmlDataformatAnnotationIntrospector()) diff --git a/dataformat-xml/src/main/java/io/adminshell/aas/v3/dataformat/xml/XmlSerializer.java b/dataformat-xml/src/main/java/io/adminshell/aas/v3/dataformat/xml/XmlSerializer.java index 4a4cdbbb..1608fb85 100644 --- a/dataformat-xml/src/main/java/io/adminshell/aas/v3/dataformat/xml/XmlSerializer.java +++ b/dataformat-xml/src/main/java/io/adminshell/aas/v3/dataformat/xml/XmlSerializer.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.ObjectWriter; import com.fasterxml.jackson.databind.SerializationFeature; import com.fasterxml.jackson.databind.module.SimpleModule; +import com.fasterxml.jackson.dataformat.xml.XmlFactory; import com.fasterxml.jackson.dataformat.xml.XmlMapper; import com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator; @@ -42,6 +43,7 @@ import io.adminshell.aas.v3.model.Reference; public class XmlSerializer implements Serializer { + protected final XmlFactory xmlFactory; protected XmlMapper mapper; protected Map namespacePrefixes; @@ -50,6 +52,11 @@ public XmlSerializer() { } public XmlSerializer(Map namespacePrefixes) { + this(new XmlFactory(), namespacePrefixes); + } + + public XmlSerializer(XmlFactory xmlFactory, Map namespacePrefixes) { + this.xmlFactory = xmlFactory; this.namespacePrefixes = namespacePrefixes; buildMapper(); } diff --git a/docs/articles/building.md b/docs/articles/building.md index 5aa00287..0f135373 100644 --- a/docs/articles/building.md +++ b/docs/articles/building.md @@ -5,7 +5,7 @@ You can download and build the repository by yourself by following these steps: - Clone the GitHub repository: ```sh - git clone https://github.com/admin-shell-io/aasx-package-explorer + git clone https://github.com/admin-shell-io/java-serializer.git ``` - Use [Maven](https://maven.apache.org/) to build the project @@ -25,4 +25,4 @@ You can download and build the repository by yourself by following these steps: > 1.1.0 > ${revision} > ``` -> If you change the version of your local built, the `model.version` is also set to the updated artifact version from the [java-model](https://github.com/admin-shell-io/java-model) project. For the same version number, both artifacts are compatible. \ No newline at end of file +> If you change the version of your local built, the `model.version` is also set to the updated artifact version from the [java-model](https://github.com/admin-shell-io/java-model) project. For the same version number, both artifacts are compatible. diff --git a/docs/articles/development_workflow.md b/docs/articles/development_workflow.md index 3e35cba4..207c760e 100644 --- a/docs/articles/development_workflow.md +++ b/docs/articles/development_workflow.md @@ -2,9 +2,9 @@ We develop with Github using pull requests (see this [Github guide](https://guides.github.com/introduction/flow/) for a short introduction). -**Development branch.** The development branch is always `master`. Expect changes on this branch from time to time. +**Development branch.** The development branch is always `development`. Expect changes on this branch from time to time. -**Releases.** The releases mark the development milestones on the `master` branch with a certain feature completeness. +**Releases.** The releases mark the development milestones on the `main` branch with a certain feature completeness. ## Pull Requests @@ -18,6 +18,12 @@ Otherwise, if you are a non-member contributor, fork the repository and create t **Reviews.** Each PullRequest is reviewed by the Maintainers of the project. In order to simplify the workflow, please assign the PullRequest directly to the Maintainer you think is most knowledgable about your changes. +## CI Workflows +There are three workflows that will automatically handle specific events for the repository: +- Pull requests on one of the branches mentioned above will trigger CI actions that will automatically check, if all tests pass successfully +- Additionally, new commits on `main` will build the release artifacts and publish them on [Maven Central](https://mvnrepository.com/artifact/io.admin-shell.aas) +- The documentation found in /docs is automatically build with docFX and published to gh-pages, when a new release is pushed to the `main` branch + ## Commit Messages The commit messages should follow the guidelines from https://chris.beams.io/posts/git-commit: diff --git a/pom.xml b/pom.xml index f44acab5..cf27faaf 100644 --- a/pom.xml +++ b/pom.xml @@ -40,8 +40,12 @@ validator - 1.3.0-SNAPSHOT - 1.1.1 + 1 + 2 + 1 + + ${revision.major}.${revision.minor}.${revision.patch}${revision.suffix} + [${revision.major}.${revision.minor},) UTF-8 UTF-8