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

Commit fcef0f9

Browse files
br-iosbweissarn
andauthored
Implementation of I4AAS Deserializer and minor refactorings (#2)
* Squashed commit of the following: commit d9c71d1 Author: br-iosb <70897399+br-iosb@users.noreply.github.com> Date: Thu Aug 12 08:48:37 2021 +0200 javadoc for serializer feature commit 8b16532 Author: br-iosb <70897399+br-iosb@users.noreply.github.com> Date: Thu Aug 12 08:40:20 2021 +0200 Full Test Example - added feature to ignore missing semanticIds in OPC UA Dictionary commit e6281cb Author: br-iosb <70897399+br-iosb@users.noreply.github.com> Date: Thu Aug 12 08:15:26 2021 +0200 fixed BoM Reference Parser commit d2da4c8 Author: br-iosb <70897399+br-iosb@users.noreply.github.com> Date: Thu Aug 12 08:07:16 2021 +0200 nonfunctional changes, organized imports and licence headers commit 691fe94 Author: br-iosb <70897399+br-iosb@users.noreply.github.com> Date: Wed Aug 11 13:41:13 2021 +0200 parser for concept descriptions commit e6921cf Author: br-iosb <70897399+br-iosb@users.noreply.github.com> Date: Wed Aug 11 12:13:16 2021 +0200 more integration tests commit 8b1d71b Author: br-iosb <70897399+br-iosb@users.noreply.github.com> Date: Wed Aug 11 09:55:30 2021 +0200 first integration test for blobs commit 5d154c8 Author: br-iosb <70897399+br-iosb@users.noreply.github.com> Date: Wed Aug 11 09:37:09 2021 +0200 first integration tests commit 6656edd Author: br-iosb <70897399+br-iosb@users.noreply.github.com> Date: Wed Aug 11 09:13:12 2021 +0200 parsers for submodel elements commit 67adc6a Author: br-iosb <70897399+br-iosb@users.noreply.github.com> Date: Wed Aug 11 08:25:19 2021 +0200 Blob Parser commit b0b667f Author: br-iosb <70897399+br-iosb@users.noreply.github.com> Date: Tue Aug 10 13:37:29 2021 +0200 moved HasKind Parser commit 31ddb9c Author: br-iosb <70897399+br-iosb@users.noreply.github.com> Date: Tue Aug 10 13:34:04 2021 +0200 Submodel and SME Parsers preparations commit 5fa5656 Author: br-iosb <70897399+br-iosb@users.noreply.github.com> Date: Tue Aug 10 12:40:18 2021 +0200 IdentifierKeyValue Parser commit 75f8a53 Author: br-iosb <70897399+br-iosb@users.noreply.github.com> Date: Tue Aug 10 11:47:56 2021 +0200 DataSpecification Parser commit 3739c76 Author: br-iosb <70897399+br-iosb@users.noreply.github.com> Date: Tue Aug 10 10:26:45 2021 +0200 refactored static string literal commit 483102e Author: br-iosb <70897399+br-iosb@users.noreply.github.com> Date: Tue Aug 10 10:23:00 2021 +0200 parser for references with I4AAS structure data type commit 455fa03 Author: br-iosb <70897399+br-iosb@users.noreply.github.com> Date: Tue Aug 10 08:52:42 2021 +0200 Update AASSimple_V3Draft.xml updated test resource commit f7d5458 Author: br-iosb <70897399+br-iosb@users.noreply.github.com> Date: Tue Aug 10 08:47:17 2021 +0200 fixed missing uniqueness for hasDataSpecification commit b38d543 Author: br-iosb <70897399+br-iosb@users.noreply.github.com> Date: Mon Aug 9 13:13:32 2021 +0200 Identifiable Administration Parser part 1/2 commit 5f267ed Author: br-iosb <70897399+br-iosb@users.noreply.github.com> Date: Mon Aug 9 12:55:34 2021 +0200 generic enum parser including JAXB integer support commit 5063037 Author: br-iosb <70897399+br-iosb@users.noreply.github.com> Date: Mon Aug 9 11:58:20 2021 +0200 Implemented anonymous unmarshalled String JAXBElement for Category commit 47f15da Author: br-iosb <70897399+br-iosb@users.noreply.github.com> Date: Mon Aug 9 10:53:01 2021 +0200 initial commit parsers * Review: Minor issues. * Update ReadMe.md Co-authored-by: weissarn <arno.weiss@iwu.fraunhofer.de>
1 parent a11b415 commit fcef0f9

File tree

79 files changed

+3245
-159
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+3245
-159
lines changed

README.md

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ the document 'Details of the Asset Administration Shell', published on
1212
You can build the project using Maven by simply executing at the repository
1313
root:
1414

15-
`mvn clean install`
15+
`mvn clean package`
1616

17-
or by integrating the respective modules as dependencies, for instance:
17+
or by integrating the respective modules as dependencies from Maven Central Repository, for instance:
1818

1919
```
2020
<dependency>
@@ -23,7 +23,6 @@ or by integrating the respective modules as dependencies, for instance:
2323
<version>latest-version</version>
2424
<dependency>
2525
```
26-
> **_NOTE:_** The library is yet not available as dependency but will be deployed via Maven Central in the future.
2726

2827
# Project Structure
2928

@@ -45,21 +44,21 @@ We always look for contributions, bug reports, feature requests etc. Simply open
4544

4645
# Contributors
4746

48-
| Name | Affiliation | Github Account | parent | core | aasx | json | xml | json-ld | validator|
49-
--- | --- | --- | :---: | :---: | :---: | :---: | :---: | :---: | :---:
47+
| Name | Affiliation | Github Account | parent | core | aasx | json | xml | json-ld | ua-nodeset | validator|
48+
--- | --- | --- | :---: | :---: | :---: | :---: | :---: | :---: | :---:| :---:
5049
| Mohammad Alreeni | Fraunhofer IWU | []() | | | | | x | | |
51-
| Sebastian Bader | Fraunhofer IAIS | [sebbader](https://github.com/sebbader) | x | | | | | x | x |
52-
| Matthias Böckmann | Fraunhofer IAIS | [maboeckmann](https://github.com/maboeckmann) | x | | | | | x | x |
53-
| Maximilian Conradi | Fraunhofer IESE | []() | | | x | | x | | |
54-
| Helge Dickel | SAP SE | [heldic](https://github.com/heldic) | x | | | x | x | | |
55-
| Daniel Espen | Fraunhofer IESE | [daespen](https://github.com/daespen) | | x | x | x | x | | |
56-
| Michael Jacoby | Fraunhofer IOSB| [mjacoby](https://github.com/mjacoby) | x | x | | x | x | | |
57-
| Jens Müller | Fraunhofer IOSB | [JensMueller2709](https://github.com/JensMueller2709) | | | | x | | | |
58-
| Orthodoxos Kipouridis | SAP SE | [akiskips](https://github.com/akiskips) | x | | | x | x | | |
59-
| Bastian Rössl | Fraunhofer IOSB-INA | [br-iosb](https://github.com/br-iosb) | | | | x | | | |
60-
| Frank Schnicke | Fraunhofer IESE | [frankschnicke](https://github.com/frankschnicke) | | | x | | x | | |
61-
| Manuel Sauer | SAP SE | [Manu3756](https://github.com/Manu3756) | x | | | | | | |
62-
| Arno Weiss | Fraunhofer IWU | [alw-iwu](https://github.com/alw-iwu) | | | | x | | | |
50+
| Sebastian Bader | Fraunhofer IAIS | [sebbader](https://github.com/sebbader) | x | | | | | x | | x |
51+
| Matthias Böckmann | Fraunhofer IAIS | [maboeckmann](https://github.com/maboeckmann) | x | | | | | x | | x |
52+
| Maximilian Conradi | Fraunhofer IESE | []() | | | x | | x | | | |
53+
| Helge Dickel | SAP SE | [heldic](https://github.com/heldic) | x | | | x | x | | | |
54+
| Daniel Espen | Fraunhofer IESE | [daespen](https://github.com/daespen) | | x | x | x | x | | | |
55+
| Michael Jacoby | Fraunhofer IOSB| [mjacoby](https://github.com/mjacoby) | x | x | | x | x | | | |
56+
| Jens Müller | Fraunhofer IOSB | [JensMueller2709](https://github.com/JensMueller2709) | | | | x | | | | |
57+
| Orthodoxos Kipouridis | SAP SE | [akiskips](https://github.com/akiskips) | x | | | x | x | | | |
58+
| Bastian Rössl | Fraunhofer IOSB-INA | [br-iosb](https://github.com/br-iosb) | | | | x | | | x | |
59+
| Frank Schnicke | Fraunhofer IESE | [frankschnicke](https://github.com/frankschnicke) | | | x | | x | | | |
60+
| Manuel Sauer | SAP SE | [Manu3756](https://github.com/Manu3756) | x | | | | | | | |
61+
| Arno Weiss | Fraunhofer IWU | [alw-iwu](https://github.com/alw-iwu) | | | | x | | | x | |
6362

6463
This project was initiated by SAP and Fraunhofer to provide a foundation for the
6564
AAS development and to foster its dissemination.

dataformat-uanodeset/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@
6060
<artifactId>maven-compiler-plugin</artifactId>
6161
<version>3.8.1</version>
6262
<configuration>
63-
<source>11</source>
64-
<target>11</target>
63+
<source>${maven.compiler.source}</source>
64+
<target>${maven.compiler.target}</target>
6565
</configuration>
6666
</plugin>
6767
<plugin>
@@ -132,7 +132,7 @@
132132
<artifactId>maven-javadoc-plugin</artifactId>
133133
<configuration>
134134
<!-- excluding generated classes and mappers which are not meant to be used directly -->
135-
<excludePackageNames>com.kscs.util.*:org.opcfoundation.*:io.adminshell.aas.v3.dataformat.i4aas.mappers:io.adminshell.aas.v3.dataformat.i4aas.mappers.*</excludePackageNames>
135+
<excludePackageNames>com.kscs.util.*:org.opcfoundation.*:io.adminshell.aas.v3.dataformat.i4aas.mappers:io.adminshell.aas.v3.dataformat.i4aas.mappers.*:io.adminshell.aas.v3.dataformat.i4aas.parsers</excludePackageNames>
136136
</configuration>
137137
</plugin>
138138
</plugins>

dataformat-uanodeset/src/main/java/io/adminshell/aas/v3/dataformat/i4aas/I4AASDeserializer.java

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,14 @@
1515
*/
1616
package io.adminshell.aas.v3.dataformat.i4aas;
1717

18+
import javax.xml.bind.JAXBException;
19+
20+
import org.opcfoundation.ua._2011._03.uanodeset.UANodeSet;
21+
1822
import io.adminshell.aas.v3.dataformat.DeserializationException;
1923
import io.adminshell.aas.v3.dataformat.Deserializer;
24+
import io.adminshell.aas.v3.dataformat.i4aas.parsers.EnvironmentParser;
25+
import io.adminshell.aas.v3.dataformat.i4aas.parsers.ParserContext;
2026
import io.adminshell.aas.v3.model.AssetAdministrationShellEnvironment;
2127

2228
/**
@@ -29,8 +35,15 @@ public class I4AASDeserializer implements Deserializer {
2935
* reads a I4AAS as string and return the model object
3036
*/
3137
@Override
32-
public AssetAdministrationShellEnvironment read(String value) throws DeserializationException {
33-
throw new UnsupportedOperationException("Not Implemented yet.");
38+
public AssetAdministrationShellEnvironment read(String input) throws DeserializationException {
39+
try {
40+
UANodeSet unmarshall = new UANodeSetUnmarshaller().unmarshall(input);
41+
ParserContext parserContext = new ParserContext(unmarshall);
42+
AssetAdministrationShellEnvironment parsedEnvironment = new EnvironmentParser(parserContext.getEnvironment(), parserContext).parse();
43+
return parsedEnvironment;
44+
} catch (JAXBException e) {
45+
throw new DeserializationException("Deserialization failed on unmarshalling.", e);
46+
}
3447
}
3548

3649
@Override

dataformat-uanodeset/src/main/java/io/adminshell/aas/v3/dataformat/i4aas/I4AASSerializer.java

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
package io.adminshell.aas.v3.dataformat.i4aas;
1717

1818
import javax.xml.bind.JAXBException;
19+
1920
import org.opcfoundation.ua._2011._03.uanodeset.UANodeSet;
2021
import org.opcfoundation.ua._2011._03.uanodeset.UAObject;
2122

@@ -30,15 +31,31 @@
3031
*
3132
*/
3233
public class I4AASSerializer implements Serializer {
34+
35+
private boolean addMissingSemanticIdsToDictionary;
36+
37+
/**
38+
* I4AASSerializer with addMissingSemanticIdsToDictionary defaults to true
39+
*/
40+
public I4AASSerializer() {
41+
this(true);
42+
}
43+
44+
/**
45+
* @param addMissingSemanticIdsToDictionary handles missing semanticIds in OPC UA Dictionary (caused by missing AAS Concept Description) by adding them automatically
46+
*/
47+
public I4AASSerializer(boolean addMissingSemanticIdsToDictionary) {
48+
this.addMissingSemanticIdsToDictionary = addMissingSemanticIdsToDictionary;
49+
}
3350

3451
/**
3552
* takes a AAS model and returns a I4AAS as string.
3653
*/
3754
@Override
3855
public String write(AssetAdministrationShellEnvironment aasEnvironment) throws SerializationException {
3956
MappingContext mappingContext = new MappingContext(aasEnvironment);
57+
mappingContext.setAddMissingSemanticIdsToDictionary(addMissingSemanticIdsToDictionary);
4058
UAObject uaEnv = new EnvironmentMapper(mappingContext.getEnvironment(), mappingContext).map();
41-
4259
//map action
4360
UANodeSet nodeset = mappingContext.getNodeSet();
4461

dataformat-uanodeset/src/main/java/io/adminshell/aas/v3/dataformat/i4aas/UANodeSetUnmarshaller.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,9 @@
1717

1818
import java.io.InputStream;
1919
import java.io.StringReader;
20-
import java.io.StringWriter;
2120

2221
import javax.xml.bind.JAXBContext;
2322
import javax.xml.bind.JAXBException;
24-
import javax.xml.bind.Marshaller;
2523
import javax.xml.bind.Unmarshaller;
2624

2725
import org.opcfoundation.ua._2008._02.types.ListOfExtensionObject;

dataformat-uanodeset/src/main/java/io/adminshell/aas/v3/dataformat/i4aas/mappers/AdministrationMapper.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import org.opcfoundation.ua._2011._03.uanodeset.UAObject;
1919
import org.opcfoundation.ua._2011._03.uanodeset.UAVariable;
2020

21-
import io.adminshell.aas.v3.dataformat.i4aas.mappers.utils.I4AASUtils;
2221
import io.adminshell.aas.v3.dataformat.i4aas.mappers.utils.I4AASIdentifier;
2322
import io.adminshell.aas.v3.model.AdministrativeInformation;
2423

@@ -32,8 +31,8 @@ public AdministrationMapper(AdministrativeInformation src, MappingContext ctx) {
3231
@Override
3332
protected UAObject createTargetObject() {
3433
target = UAObject.builder().withNodeId(ctx.newModelNodeIdAsString())
35-
.withBrowseName(createI4AASBrowseName("Administration"))
36-
.withDisplayName(createLocalizedText("Administration")).build();
34+
.withBrowseName(createI4AASBrowseName(ADMINISTRATION_BROWSENAME))
35+
.withDisplayName(createLocalizedText(ADMINISTRATION_BROWSENAME)).build();
3736
addTypeReference(I4AASIdentifier.AASAdministrativeInformationType);
3837
return target;
3938
}
@@ -43,13 +42,13 @@ protected void mapAndAttachChildren() {
4342
if (source != null) {
4443
String revision = source.getRevision();
4544
if (revision != null) {
46-
UAVariable revisionStringProperty = new StringPropertyMapper("Revision", revision, ctx,
45+
UAVariable revisionStringProperty = new StringPropertyMapper(ADMINISTRATION_REVISION_BROWSENAME, revision, ctx,
4746
ctx.getI4aasNsIndex()).map();
4847
attachAsProperty(target, revisionStringProperty);
4948
}
5049
String version = source.getVersion();
5150
if (version != null) {
52-
UAVariable versionStringProperty = new StringPropertyMapper("Version", version, ctx,
51+
UAVariable versionStringProperty = new StringPropertyMapper(ADMINISTRATION_VERSION_BROWSENAME, version, ctx,
5352
ctx.getI4aasNsIndex()).map();
5453
attachAsProperty(target, versionStringProperty);
5554
}

dataformat-uanodeset/src/main/java/io/adminshell/aas/v3/dataformat/i4aas/mappers/AssetAdministrationShellMapper.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,10 @@
1818
import java.util.List;
1919

2020
import org.opcfoundation.ua._2011._03.uanodeset.UAObject;
21+
2122
import io.adminshell.aas.v3.dataformat.i4aas.mappers.utils.I4AASIdentifier;
2223
import io.adminshell.aas.v3.model.AssetAdministrationShell;
2324
import io.adminshell.aas.v3.model.AssetInformation;
24-
import io.adminshell.aas.v3.model.DataTypeIEC61360;
25-
import io.adminshell.aas.v3.model.HasDataSpecification;
26-
import io.adminshell.aas.v3.model.Submodel;
2725

2826
public class AssetAdministrationShellMapper extends IdentifiableMapper<AssetAdministrationShell> implements HasDataSpecificationMapper {
2927

@@ -49,25 +47,27 @@ protected void mapAndAttachChildren() {
4947

5048
private void mapAsset() {
5149
AssetInformation assetInformation = source.getAssetInformation();
52-
UAObject uaAsset = new AssetInformationMapper(assetInformation, ctx).map();
53-
attachAsComponent(target, uaAsset);
50+
if (assetInformation != null) {
51+
UAObject uaAsset = new AssetInformationMapper(assetInformation, ctx).map();
52+
attachAsComponent(target, uaAsset);
53+
}
5454
}
5555

5656
private void mapSubmodels() {
57-
UAObject smFolder = createReferenceList("Submodel");
57+
UAObject smFolder = createReferenceList(AAS_SUBMODELREFERENCES_LIST_BROWSENAME);
5858
List<io.adminshell.aas.v3.model.Reference> submodels = source.getSubmodels();
5959
for (int i = 0; i < submodels.size(); i++) {
6060
io.adminshell.aas.v3.model.Reference reference = submodels.get(i);
6161
UAObject createSubmodelReferenceUaObject = new ReferenceMapper(reference, ctx,
62-
"Submodel:" + reference.getKeys().get(0).getValue()).map();
62+
SM_DISPLAYNAME_PREFIX + reference.getKeys().get(0).getValue()).map();
6363
attachAsComponent(smFolder, createSubmodelReferenceUaObject);
6464
}
6565
}
6666

6767
private void mapDerivedFrom() {
6868
io.adminshell.aas.v3.model.Reference derivedFrom = source.getDerivedFrom();
6969
if (derivedFrom != null) {
70-
UAObject uaDerivedFrom = new ReferenceMapper(derivedFrom, ctx, "DerivedFrom").map();
70+
UAObject uaDerivedFrom = new ReferenceMapper(derivedFrom, ctx, AAS_DERIVEDFROM_BROWSENAME).map();
7171
attachAsComponent(target, uaDerivedFrom);
7272
}
7373
}

dataformat-uanodeset/src/main/java/io/adminshell/aas/v3/dataformat/i4aas/mappers/AssetInformationMapper.java

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@
2121
import org.opcfoundation.ua._2011._03.uanodeset.UAVariable;
2222

2323
import io.adminshell.aas.v3.dataformat.i4aas.mappers.sme.FileMapper;
24-
import io.adminshell.aas.v3.dataformat.i4aas.mappers.utils.I4AASUtils;
2524
import io.adminshell.aas.v3.dataformat.i4aas.mappers.utils.I4AASIdentifier;
26-
import io.adminshell.aas.v3.dataformat.i4aas.mappers.utils.UaIdentifier;
2725
import io.adminshell.aas.v3.model.AssetInformation;
2826
import io.adminshell.aas.v3.model.AssetKind;
2927
import io.adminshell.aas.v3.model.File;
@@ -39,8 +37,8 @@ public AssetInformationMapper(AssetInformation src, MappingContext ctx) {
3937
@Override
4038
protected UAObject createTargetObject() {
4139
target = UAObject.builder().withNodeId(ctx.newModelNodeIdAsString())
42-
.withBrowseName(createI4AASBrowseName("AssetInformation"))
43-
.withDisplayName(createLocalizedText("AssetInformation")).build();
40+
.withBrowseName(createI4AASBrowseName(AAS_ASSETINFORMATION_BROWSENAME))
41+
.withDisplayName(createLocalizedText(AAS_ASSETINFORMATION_BROWSENAME)).build();
4442
addTypeReference(I4AASIdentifier.AASAssetInformationType);
4543
return target;
4644
}
@@ -53,26 +51,26 @@ protected void mapAndAttachChildren() {
5351

5452
Reference globalAssetId = source.getGlobalAssetId();
5553
if (globalAssetId != null) {
56-
UAObject uaIdentification = new ReferenceMapper(globalAssetId, ctx, "GlobalAssetId").map();
54+
UAObject uaIdentification = new ReferenceMapper(globalAssetId, ctx, ASSETINFO_GLOBAL_ASSET_ID_BROWSENAME).map();
5755
attachAsComponent(target, uaIdentification);
5856
}
5957

60-
UAObject uaBomList = createReferenceList("BillOfMaterial");
58+
UAObject uaBomList = createReferenceList(ASSETINFO_BILL_OF_MATERIAL_BROWSENAME);
6159
List<Reference> billOfMaterials = source.getBillOfMaterials();
6260
for (int i = 0; i < billOfMaterials.size(); i++) {
6361
Reference reference = billOfMaterials.get(i);
64-
UAObject uaBomListEntry = new ReferenceMapper(reference, ctx, "BillOfMaterial_" + i).map();
62+
UAObject uaBomListEntry = new ReferenceMapper(reference, ctx, ASSETINFO_BILL_OF_MATERIAL_BROWSENAME + "_" + i).map();
6563
attachAsComponent(uaBomList, uaBomListEntry);
6664
}
6765

6866
File defaultThumbnail = source.getDefaultThumbnail();
6967
if (defaultThumbnail != null) {
70-
UAObject uaThumbnail = new FileMapper(defaultThumbnail, ctx, "DefaultThumbnail", ctx.getI4aasNsIndex())
68+
UAObject uaThumbnail = new FileMapper(defaultThumbnail, ctx, ASSETINFO_DEFAULT_THUMBNAIL_BROWSENAME, ctx.getI4aasNsIndex())
7169
.map();
7270
attachAsComponent(target, uaThumbnail);
7371
}
7472

75-
UAObject folder = createIdentifierKeyValuePairList("SpecificAssetId");
73+
UAObject folder = createIdentifierKeyValuePairList(ASSETINFO_SPECIFIC_ASSET_ID_BROWSENAME);
7674
for (IdentifierKeyValuePair identifierKeyValuePair : source.getSpecificAssetIds()) {
7775
UAObject uaIdKVP = new IdentifierKeyValuePairMapper(identifierKeyValuePair, ctx).map();
7876
attachAsComponent(folder, uaIdKVP);

dataformat-uanodeset/src/main/java/io/adminshell/aas/v3/dataformat/i4aas/mappers/BooleanPropertyMapper.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import org.opcfoundation.ua._2008._02.types.ObjectFactory;
2121
import org.opcfoundation.ua._2011._03.uanodeset.UAVariable;
2222

23-
import io.adminshell.aas.v3.dataformat.i4aas.mappers.utils.I4AASUtils;
2423
import io.adminshell.aas.v3.dataformat.i4aas.mappers.utils.UaIdentifier;
2524

2625
public class BooleanPropertyMapper extends I4AASMapper<Boolean, UAVariable> {

dataformat-uanodeset/src/main/java/io/adminshell/aas/v3/dataformat/i4aas/mappers/ConceptDescriptionMapper.java

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
import io.adminshell.aas.v3.dataformat.i4aas.mappers.utils.I4AASIdentifier;
2121
import io.adminshell.aas.v3.model.ConceptDescription;
22+
import io.adminshell.aas.v3.model.Identifier;
2223
import io.adminshell.aas.v3.model.IdentifierType;
2324
import io.adminshell.aas.v3.model.Reference;
2425

@@ -32,14 +33,22 @@ public ConceptDescriptionMapper(ConceptDescription src, MappingContext ctx) {
3233
protected UAObject createTargetObject() {
3334
target = super.createTargetObject();
3435

35-
IdentifierType idType = source.getIdentification().getIdType();
36-
if (IdentifierType.IRI == idType) {
37-
addTypeReference(I4AASIdentifier.AASIriConceptDescriptionType);
38-
} else if (IdentifierType.IRDI == idType) {
39-
addTypeReference(I4AASIdentifier.AASIrdiConceptDescriptionType);
40-
} else if (IdentifierType.CUSTOM == idType) {
41-
addTypeReference(I4AASIdentifier.AASCustomConceptDescriptionType);
36+
Identifier identification = source.getIdentification();
37+
if (identification != null) {
38+
IdentifierType idType = identification.getIdType();
39+
if (IdentifierType.IRI == idType) {
40+
addTypeReference(I4AASIdentifier.AASIriConceptDescriptionType);
41+
} else if (IdentifierType.IRDI == idType) {
42+
addTypeReference(I4AASIdentifier.AASIrdiConceptDescriptionType);
43+
} else if (IdentifierType.CUSTOM == idType) {
44+
addTypeReference(I4AASIdentifier.AASCustomConceptDescriptionType);
45+
}
46+
if (identification.getIdentifier() != null) {
47+
//conflict: I4AAS says idshort, OPC UA says value
48+
target.setBrowseName(createModelBrowseName(identification.getIdentifier()));
49+
}
4250
}
51+
4352
return target;
4453
}
4554

0 commit comments

Comments
 (0)