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

Commit dff58bb

Browse files
committed
Bugfix AML Serializer - added refSemantic for attributes of external interface of File
1 parent 23fdec6 commit dff58bb

2 files changed

Lines changed: 18 additions & 3 deletions

File tree

dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/FileMapper.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,14 @@ protected InternalElementType.Builder toInternalElement(File value, AmlGenerator
4646
.addAttribute(AttributeType.builder()
4747
.withName(ATTRIBUTE_MIMETYPE_NAME)
4848
.withAttributeDataType(ATTRIBUTE_MIMETYPE_DATATYPE)
49+
.withRefSemantic(generator.refSemantic(File.class, ATTRIBUTE_MIMETYPE_NAME))
4950
.withValue(value.getMimeType())
5051
.build())
5152
.addAttribute(AttributeType.builder()
5253
.withName(ATTRIBUTE_REFURI_NAME)
5354
.withValue(value.getValue())
5455
.withAttributeDataType(ATTRIBUTE_REFURI_DATATYPE)
56+
.withRefSemantic(generator.refSemantic(File.class, ATTRIBUTE_REFURI_NAME))
5557
.build())
5658
.build());
5759
}

dataformat-aml/src/test/resources/test_demo_full_example.aml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -584,9 +584,11 @@
584584
<ExternalInterface ID="28" Name="FileDataReference" RefBaseClassPath="AssetAdministrationShellInterfaceClassLib/FileDataReference">
585585
<Attribute Name="MIMEType" AttributeDataType="xs:string">
586586
<Value xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xsd:string">application/pdf</Value>
587+
<RefSemantic CorrespondingAttributePath="AAS:File/MIMEType"/>
587588
</Attribute>
588589
<Attribute Name="refURI" AttributeDataType="xs:anyURI">
589590
<Value xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xsd:string">/TestFile.pdf</Value>
591+
<RefSemantic CorrespondingAttributePath="AAS:File/refURI"/>
590592
</Attribute>
591593
</ExternalInterface>
592594
<RoleRequirements RefBaseRoleClassPath="AssetAdministrationShellRoleClassLib/File"/>
@@ -1080,8 +1082,11 @@
10801082
<ExternalInterface ID="64" Name="FileDataReference" RefBaseClassPath="AssetAdministrationShellInterfaceClassLib/FileDataReference">
10811083
<Attribute Name="MIMEType" AttributeDataType="xs:string">
10821084
<Value xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xsd:string">application/pdf</Value>
1085+
<RefSemantic CorrespondingAttributePath="AAS:File/MIMEType"/>
1086+
</Attribute>
1087+
<Attribute Name="refURI" AttributeDataType="xs:anyURI">
1088+
<RefSemantic CorrespondingAttributePath="AAS:File/refURI"/>
10831089
</Attribute>
1084-
<Attribute Name="refURI" AttributeDataType="xs:anyURI"/>
10851090
</ExternalInterface>
10861091
<RoleRequirements RefBaseRoleClassPath="AssetAdministrationShellRoleClassLib/File"/>
10871092
</InternalElement>
@@ -1733,9 +1738,11 @@
17331738
<ExternalInterface ID="103" Name="FileDataReference" RefBaseClassPath="AssetAdministrationShellInterfaceClassLib/FileDataReference">
17341739
<Attribute Name="MIMEType" AttributeDataType="xs:string">
17351740
<Value xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xsd:string">application/pdf</Value>
1741+
<RefSemantic CorrespondingAttributePath="AAS:File/MIMEType"/>
17361742
</Attribute>
17371743
<Attribute Name="refURI" AttributeDataType="xs:anyURI">
17381744
<Value xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xsd:string">/TestFile.pdf</Value>
1745+
<RefSemantic CorrespondingAttributePath="AAS:File/refURI"/>
17391746
</Attribute>
17401747
</ExternalInterface>
17411748
<RoleRequirements RefBaseRoleClassPath="AssetAdministrationShellRoleClassLib/File"/>
@@ -3423,8 +3430,11 @@
34233430
<ExternalInterface ID="136" Name="FileDataReference" RefBaseClassPath="AssetAdministrationShellInterfaceClassLib/FileDataReference">
34243431
<Attribute Name="MIMEType" AttributeDataType="xs:string">
34253432
<Value xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xsd:string">application/pdf</Value>
3433+
<RefSemantic CorrespondingAttributePath="AAS:File/MIMEType"/>
3434+
</Attribute>
3435+
<Attribute Name="refURI" AttributeDataType="xs:anyURI">
3436+
<RefSemantic CorrespondingAttributePath="AAS:File/refURI"/>
34263437
</Attribute>
3427-
<Attribute Name="refURI" AttributeDataType="xs:anyURI"/>
34283438
</ExternalInterface>
34293439
<RoleRequirements RefBaseRoleClassPath="AssetAdministrationShellRoleClassLib/File"/>
34303440
</InternalElement>
@@ -3617,8 +3627,11 @@
36173627
<ExternalInterface ID="164" Name="FileDataReference" RefBaseClassPath="AssetAdministrationShellInterfaceClassLib/FileDataReference">
36183628
<Attribute Name="MIMEType" AttributeDataType="xs:string">
36193629
<Value xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xsd:string">application/pdf</Value>
3630+
<RefSemantic CorrespondingAttributePath="AAS:File/MIMEType"/>
3631+
</Attribute>
3632+
<Attribute Name="refURI" AttributeDataType="xs:anyURI">
3633+
<RefSemantic CorrespondingAttributePath="AAS:File/refURI"/>
36203634
</Attribute>
3621-
<Attribute Name="refURI" AttributeDataType="xs:anyURI"/>
36223635
</ExternalInterface>
36233636
<RoleRequirements RefBaseRoleClassPath="AssetAdministrationShellRoleClassLib/File"/>
36243637
</InternalElement>

0 commit comments

Comments
 (0)