Skip to content

Commit

Permalink
examples, test: add exemplary usages of new `AdministrativeInformatio…
Browse files Browse the repository at this point in the history
…n` attributes
  • Loading branch information
jkhsjdhjs authored and s-heppner committed Aug 22, 2023
1 parent db77f66 commit 3108a22
Show file tree
Hide file tree
Showing 8 changed files with 202 additions and 13 deletions.
39 changes: 34 additions & 5 deletions basyx/aas/examples/data/example_aas.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,14 @@ def create_example_asset_identification_submodel() -> model.Submodel:
'de': 'Ein Beispiel-Identifikations-Submodel für eine Test-Anwendung'}),
parent=None,
administration=model.AdministrativeInformation(version='9',
revision='0'),
revision='0',
creator=model.GlobalReference((
model.Key(model.KeyTypes.GLOBAL_REFERENCE,
'http://acplt.org/AdministrativeInformation/'
'TestAsset/Identification'),
)),
template_id='http://acplt.org/AdministrativeInformation'
'Templates/TestAsset/Identification'),
semantic_id=model.ModelReference((model.Key(type_=model.KeyTypes.SUBMODEL,
value='http://acplt.org/SubmodelTemplates/AssetIdentification'),),
model.Submodel),
Expand Down Expand Up @@ -313,7 +320,9 @@ def create_example_bill_of_material_submodel() -> model.Submodel:
description=model.LangStringSet({'en-US': 'An example bill of material submodel for the test application',
'de': 'Ein Beispiel-BillofMaterial-Submodel für eine Test-Anwendung'}),
parent=None,
administration=model.AdministrativeInformation(version='9'),
administration=model.AdministrativeInformation(version='9',
template_id='http://acplt.org/AdministrativeInformation'
'Templates/TestAsset/BillOfMaterial'),
semantic_id=model.ModelReference((model.Key(type_=model.KeyTypes.SUBMODEL,
value='http://acplt.org/SubmodelTemplates/BillOfMaterial'),),
model.Submodel),
Expand Down Expand Up @@ -703,7 +712,12 @@ def create_example_submodel() -> model.Submodel:
'de': 'Ein Beispiel-Teilmodell für eine Test-Anwendung'}),
parent=None,
administration=model.AdministrativeInformation(version='9',
revision='0'),
revision='0',
creator=model.GlobalReference((
model.Key(model.KeyTypes.GLOBAL_REFERENCE,
'http://acplt.org/AdministrativeInformation/'
'Test_Submodel'),
)),),
semantic_id=model.GlobalReference((model.Key(type_=model.KeyTypes.GLOBAL_REFERENCE,
value='http://acplt.org/SubmodelTemplates/'
'ExampleSubmodel'),)),
Expand Down Expand Up @@ -732,7 +746,15 @@ def create_example_concept_description() -> model.ConceptDescription:
description=model.LangStringSet({'en-US': 'An example concept description for the test application',
'de': 'Ein Beispiel-ConceptDescription für eine Test-Anwendung'}),
parent=None,
administration=model.AdministrativeInformation(version='9', revision='0',
administration=model.AdministrativeInformation(version='9',
revision='0',
creator=model.GlobalReference((
model.Key(model.KeyTypes.GLOBAL_REFERENCE,
'http://acplt.org/AdministrativeInformation/'
'Test_ConceptDescription'),
)),
template_id='http://acplt.org/AdministrativeInformation'
'Templates/Test_ConceptDescription',
embedded_data_specifications=(
_embedded_data_specification_iec61360,
)),
Expand Down Expand Up @@ -778,7 +800,14 @@ def create_example_asset_administration_shell() -> \
'de': 'Ein Beispiel-Verwaltungsschale für eine Test-Anwendung'}),
parent=None,
administration=model.AdministrativeInformation(version='9',
revision='0'),
revision='0',
creator=model.GlobalReference((
model.Key(model.KeyTypes.GLOBAL_REFERENCE,
'http://acplt.org/AdministrativeInformation/'
'Test_AssetAdministrationShell'),
)),
template_id='http://acplt.org/AdministrativeInformation'
'Templates/Test_AssetAdministrationShell'),
submodel={model.ModelReference((model.Key(type_=model.KeyTypes.SUBMODEL,
value='https://acplt.org/Test_Submodel'),),
model.Submodel,
Expand Down
48 changes: 44 additions & 4 deletions test/compliance_tool/files/test_demo_full_example.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,17 @@
"id": "https://acplt.org/Test_AssetAdministrationShell",
"administration": {
"version": "9",
"revision": "0"
"revision": "0",
"creator": {
"type": "GlobalReference",
"keys": [
{
"type": "GlobalReference",
"value": "http://acplt.org/AdministrativeInformation/Test_AssetAdministrationShell"
}
]
},
"templateId": "http://acplt.org/AdministrativeInformationTemplates/Test_AssetAdministrationShell"
},
"derivedFrom": {
"type": "ModelReference",
Expand Down Expand Up @@ -322,7 +332,17 @@
"id": "http://acplt.org/Submodels/Assets/TestAsset/Identification",
"administration": {
"version": "9",
"revision": "0"
"revision": "0",
"creator": {
"type": "GlobalReference",
"keys": [
{
"type": "GlobalReference",
"value": "http://acplt.org/AdministrativeInformation/TestAsset/Identification"
}
]
},
"templateId": "http://acplt.org/AdministrativeInformationTemplates/TestAsset/Identification"
},
"semanticId": {
"type": "ModelReference",
Expand Down Expand Up @@ -488,7 +508,8 @@
"modelType": "Submodel",
"id": "http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial",
"administration": {
"version": "9"
"version": "9",
"templateId": "http://acplt.org/AdministrativeInformationTemplates/TestAsset/BillOfMaterial"
},
"semanticId": {
"type": "ModelReference",
Expand Down Expand Up @@ -760,7 +781,16 @@
"id": "https://acplt.org/Test_Submodel",
"administration": {
"version": "9",
"revision": "0"
"revision": "0",
"creator": {
"type": "GlobalReference",
"keys": [
{
"type": "GlobalReference",
"value": "http://acplt.org/AdministrativeInformation/Test_Submodel"
}
]
}
},
"semanticId": {
"type": "GlobalReference",
Expand Down Expand Up @@ -3086,6 +3116,16 @@
"administration": {
"version": "9",
"revision": "0",
"creator": {
"type": "GlobalReference",
"keys": [
{
"type": "GlobalReference",
"value": "http://acplt.org/AdministrativeInformation/Test_ConceptDescription"
}
]
},
"templateId": "http://acplt.org/AdministrativeInformationTemplates/Test_ConceptDescription",
"embeddedDataSpecifications": [
{
"dataSpecification": {
Expand Down
40 changes: 40 additions & 0 deletions test/compliance_tool/files/test_demo_full_example.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@
<aas:administration>
<aas:version>9</aas:version>
<aas:revision>0</aas:revision>
<aas:creator>
<aas:type>GlobalReference</aas:type>
<aas:keys>
<aas:key>
<aas:type>GlobalReference</aas:type>
<aas:value>http://acplt.org/AdministrativeInformation/Test_AssetAdministrationShell</aas:value>
</aas:key>
</aas:keys>
</aas:creator>
<aas:templateId>http://acplt.org/AdministrativeInformationTemplates/Test_AssetAdministrationShell</aas:templateId>
</aas:administration>
<aas:id>https://acplt.org/Test_AssetAdministrationShell</aas:id>
<aas:embeddedDataSpecifications>
Expand Down Expand Up @@ -308,6 +318,16 @@
<aas:administration>
<aas:version>9</aas:version>
<aas:revision>0</aas:revision>
<aas:creator>
<aas:type>GlobalReference</aas:type>
<aas:keys>
<aas:key>
<aas:type>GlobalReference</aas:type>
<aas:value>http://acplt.org/AdministrativeInformation/TestAsset/Identification</aas:value>
</aas:key>
</aas:keys>
</aas:creator>
<aas:templateId>http://acplt.org/AdministrativeInformationTemplates/TestAsset/Identification</aas:templateId>
</aas:administration>
<aas:id>http://acplt.org/Submodels/Assets/TestAsset/Identification</aas:id>
<aas:kind>Instance</aas:kind>
Expand Down Expand Up @@ -472,6 +492,7 @@
</aas:description>
<aas:administration>
<aas:version>9</aas:version>
<aas:templateId>http://acplt.org/AdministrativeInformationTemplates/TestAsset/BillOfMaterial</aas:templateId>
</aas:administration>
<aas:id>http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial</aas:id>
<aas:kind>Instance</aas:kind>
Expand Down Expand Up @@ -638,6 +659,15 @@
<aas:administration>
<aas:version>9</aas:version>
<aas:revision>0</aas:revision>
<aas:creator>
<aas:type>GlobalReference</aas:type>
<aas:keys>
<aas:key>
<aas:type>GlobalReference</aas:type>
<aas:value>http://acplt.org/AdministrativeInformation/Test_Submodel</aas:value>
</aas:key>
</aas:keys>
</aas:creator>
</aas:administration>
<aas:id>https://acplt.org/Test_Submodel</aas:id>
<aas:kind>Instance</aas:kind>
Expand Down Expand Up @@ -3031,6 +3061,16 @@
</aas:embeddedDataSpecifications>
<aas:version>9</aas:version>
<aas:revision>0</aas:revision>
<aas:creator>
<aas:type>GlobalReference</aas:type>
<aas:keys>
<aas:key>
<aas:type>GlobalReference</aas:type>
<aas:value>http://acplt.org/AdministrativeInformation/Test_ConceptDescription</aas:value>
</aas:key>
</aas:keys>
</aas:creator>
<aas:templateId>http://acplt.org/AdministrativeInformationTemplates/Test_ConceptDescription</aas:templateId>
</aas:administration>
<aas:id>https://acplt.org/Test_ConceptDescription</aas:id>
<aas:embeddedDataSpecifications>
Expand Down
Binary file modified test/compliance_tool/files/test_demo_full_example_json.aasx
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,17 @@
"id": "https://acplt.org/Test_AssetAdministrationShell",
"administration": {
"version": "9",
"revision": "0"
"revision": "0",
"creator": {
"type": "GlobalReference",
"keys": [
{
"type": "GlobalReference",
"value": "http://acplt.org/AdministrativeInformation/Test_AssetAdministrationShell"
}
]
},
"templateId": "http://acplt.org/AdministrativeInformationTemplates/Test_AssetAdministrationShell"
},
"derivedFrom": {
"type": "ModelReference",
Expand Down Expand Up @@ -322,7 +332,17 @@
"id": "http://acplt.org/Submodels/Assets/TestAsset/Identification",
"administration": {
"version": "9",
"revision": "0"
"revision": "0",
"creator": {
"type": "GlobalReference",
"keys": [
{
"type": "GlobalReference",
"value": "http://acplt.org/AdministrativeInformation/TestAsset/Identification"
}
]
},
"templateId": "http://acplt.org/AdministrativeInformationTemplates/TestAsset/Identification"
},
"semanticId": {
"type": "ModelReference",
Expand Down Expand Up @@ -488,7 +508,8 @@
"modelType": "Submodel",
"id": "http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial",
"administration": {
"version": "9"
"version": "9",
"templateId": "http://acplt.org/AdministrativeInformationTemplates/TestAsset/BillOfMaterial"
},
"semanticId": {
"type": "ModelReference",
Expand Down Expand Up @@ -760,7 +781,16 @@
"id": "https://acplt.org/Test_Submodel",
"administration": {
"version": "9",
"revision": "0"
"revision": "0",
"creator": {
"type": "GlobalReference",
"keys": [
{
"type": "GlobalReference",
"value": "http://acplt.org/AdministrativeInformation/Test_Submodel"
}
]
}
},
"semanticId": {
"type": "GlobalReference",
Expand Down Expand Up @@ -3086,6 +3116,16 @@
"administration": {
"version": "9",
"revision": "0",
"creator": {
"type": "GlobalReference",
"keys": [
{
"type": "GlobalReference",
"value": "http://acplt.org/AdministrativeInformation/Test_ConceptDescription"
}
]
},
"templateId": "http://acplt.org/AdministrativeInformationTemplates/Test_ConceptDescription",
"embeddedDataSpecifications": [
{
"dataSpecification": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@
<aas:administration>
<aas:version>9</aas:version>
<aas:revision>0</aas:revision>
<aas:creator>
<aas:type>GlobalReference</aas:type>
<aas:keys>
<aas:key>
<aas:type>GlobalReference</aas:type>
<aas:value>http://acplt.org/AdministrativeInformation/Test_AssetAdministrationShell</aas:value>
</aas:key>
</aas:keys>
</aas:creator>
<aas:templateId>http://acplt.org/AdministrativeInformationTemplates/Test_AssetAdministrationShell</aas:templateId>
</aas:administration>
<aas:id>https://acplt.org/Test_AssetAdministrationShell</aas:id>
<aas:embeddedDataSpecifications>
Expand Down Expand Up @@ -308,6 +318,16 @@
<aas:administration>
<aas:version>9</aas:version>
<aas:revision>0</aas:revision>
<aas:creator>
<aas:type>GlobalReference</aas:type>
<aas:keys>
<aas:key>
<aas:type>GlobalReference</aas:type>
<aas:value>http://acplt.org/AdministrativeInformation/TestAsset/Identification</aas:value>
</aas:key>
</aas:keys>
</aas:creator>
<aas:templateId>http://acplt.org/AdministrativeInformationTemplates/TestAsset/Identification</aas:templateId>
</aas:administration>
<aas:id>http://acplt.org/Submodels/Assets/TestAsset/Identification</aas:id>
<aas:kind>Instance</aas:kind>
Expand Down Expand Up @@ -472,6 +492,7 @@
</aas:description>
<aas:administration>
<aas:version>9</aas:version>
<aas:templateId>http://acplt.org/AdministrativeInformationTemplates/TestAsset/BillOfMaterial</aas:templateId>
</aas:administration>
<aas:id>http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial</aas:id>
<aas:kind>Instance</aas:kind>
Expand Down Expand Up @@ -638,6 +659,15 @@
<aas:administration>
<aas:version>9</aas:version>
<aas:revision>0</aas:revision>
<aas:creator>
<aas:type>GlobalReference</aas:type>
<aas:keys>
<aas:key>
<aas:type>GlobalReference</aas:type>
<aas:value>http://acplt.org/AdministrativeInformation/Test_Submodel</aas:value>
</aas:key>
</aas:keys>
</aas:creator>
</aas:administration>
<aas:id>https://acplt.org/Test_Submodel</aas:id>
<aas:kind>Instance</aas:kind>
Expand Down Expand Up @@ -3031,6 +3061,16 @@
</aas:embeddedDataSpecifications>
<aas:version>9</aas:version>
<aas:revision>0</aas:revision>
<aas:creator>
<aas:type>GlobalReference</aas:type>
<aas:keys>
<aas:key>
<aas:type>GlobalReference</aas:type>
<aas:value>http://acplt.org/AdministrativeInformation/Test_ConceptDescription</aas:value>
</aas:key>
</aas:keys>
</aas:creator>
<aas:templateId>http://acplt.org/AdministrativeInformationTemplates/Test_ConceptDescription</aas:templateId>
</aas:administration>
<aas:id>https://acplt.org/Test_ConceptDescription</aas:id>
<aas:embeddedDataSpecifications>
Expand Down
Binary file modified test/compliance_tool/files/test_demo_full_example_xml.aasx
Binary file not shown.
Binary file not shown.

0 comments on commit 3108a22

Please sign in to comment.