This is a repository for the FDO AAS Mapper, is a tool designed to transform extracted FDO records into Asset Administration Shell (AAS)-compliant formats. It enables the automated mapping of FDO Profiles to standardized AAS Submodels, facilitating interoperability and machine-readability in Industry 4.0 environments.
- ExampleFDOData - Contains example FDO records and schemas in JSON format that can be used for testing and demonstration purposes.
- Submodels - Contains Submodel Templates, which will be automatically read and used in the mapping process, if specified in the mapping file.
- Mapping - Contains the mapping schema and an example mapping file for mapping FDO Profiles to AAS Submodels.
- map_fdo_to_aas.py - Contains the main logic for transforming FDO records into AAS Submodels based on the provided mapping files. It includes functions for reading FDO records, applying mappings, and generating AAS Submodel instances.
- Install the package directly from GitHub using Pip's Git feature:
pip install fdo-aas-mapper@git+https://github.com/rwth-iat/fdo-aas-mapper@master- Run the script
fdo_aas_mapper/map_fdo_to_aas.pyas described in the section Running the Transformer
- Clone the repo
git clone https://github.com/rwth-iat/fdo-aas-mapper
- Install requirements:
- Go to the cloned repo folder
- Run:
pip install .- Run the script
fdo_aas_mapper/map_fdo_to_aas.pyas described in the section Running the Transformer
To transform FDO profiles into AAS-compliant Submodels, we defined a mapping format in JSON with a corresponding validation schema.
The mapping file specifies:
- FDO Profiles to be transformed
- Target AAS Submodel Templates
- Property-level mappings between FDO attributes and AAS Submodel elements
This approach allows:
- Modularity: one FDO Profile can be mapped to multiple Submodels
- Flexibility: new mappings can be added without modifying the core transformation logic
{
"21.T11966/308597028a16f11b683b": { // FDO Profile ID
"target_submodel_semantic_id": "0173-1#01-AHX837#002", // Target AAS Submodel Template Semantic ID to map to
"attribute_mappings": [ // List of attribute mappings
{
"source": "hdl:21.T11966/083f4dbdff26194bfb8f", // FDO attribute ID
"source_title": "mpn", // FDO attribute name (Optional, for documentation purposes)
"type": "number", // Data type of the FDO attribute
"target": "GeneralInformation.ManufacturerArticleNumber", // Target AAS Submodel Element idShort path
"target_submodel_semantic_id": "0173-1#01-AHX464#001" // (Optional) Target Submodel Semantic ID if different from the main target_submodel_semantic_id
},
{
"source": "hdl:21.T11966/0f7460b31f60734b26f0",
"source_title": "max_gain_error_[%]",
"type": "number",
"target": "SpecificDescriptions[0].G_Err.MaximumG_Err"
}
]
},
"SOME_OTHER_FDO_PROFILE_ID": {
"target_submodel_semantic_id": "SOME_OTHER_AAS_SUBMODEL_SEMANTIC_ID",
"attribute_mappings": [
{
"source": "SOME_OTHER_FDO_ATTRIBUTE_ID",
"source_title": "SOME_OTHER_FDO_ATTRIBUTE_NAME",
"type": "string",
"target": "SomeOtherSubmodelElement.idShort"
}
]
}
}To create a mapping for a new FDO Profile:
- Identify the target FDO Profile and determine the most appropriate AAS Submodel Template.
- If no suitable template exists, define a new one and add it to the
Submodelsdirectory. - To create/edit/view Submodel Templates, you can use the AAS Manager
- If no suitable template exists, define a new one and add it to the
- Add in the JSON mapping file in
Mappingsa mapping for the new FDO Profile.- To set a
targetattribute in the mapping you need an idShortPath of the target Submodel Element. To get this path:- Open the Submodel Template in AAS Manager
- Right-click on the target Submodel Element and select "Copy idShort Path"
- To set a
Run the transformer with the FDO record and mapping file as input with the command:
-
If you have installed the development version, run:
python fdo_aas_mapper/map_fdo_to_aas.py SOME_FDO_RECORD_FILE SOME_SUBMODEL_ID
OR
python3 fdo_aas_mapper/map_fdo_to_aas.py SOME_FDO_RECORD_FILE SOME_SUBMODEL_ID -m SOME_MAPPING_FILE -s SOME_SUBMODEL_TEMPLATES_DIR -o SOME_OUTPUT_FILE
where:
SOME_FDO_RECORD_FILE- Path to the FDO record JSON fileSOME_SUBMODEL_ID- Defines the ID (or a list of IDs) to be assigned to the generated AAS Submodel instance. If a list is provided, the IDs must follow the same sequence as specified in the mapping file.-m SOME_MAPPING_FILE- (Optional) Path to the mapping JSON file. Default isfdo_aas_mapper/Mapping/mapping.json-s SOME_SUBMODEL_TEMPLATES_DIR- (Optional) Path to the directory containing Submodel Templates. Default isfdo_aas_mapper/Submodels-o SOME_OUTPUT_FILE- (Optional) Path to the output file where the generated AAS Submodel instance will be saved. Default isoutput_submodel.json
-
If you have installed the user version, run:
map_fdo_to_aas SOME_FDO_RECORD_FILE SOME_SUBMODEL_ID
OR
map_fdo_to_aas SOME_FDO_RECORD_FILE SOME_SUBMODEL_ID -m SOME_MAPPING_FILE -s SOME_SUBMODEL_TEMPLATES_DIR -o SOME_OUTPUT_FILE
This repository also contains a battery-related use case from the FDO project, focusing on the representation of an amplifier as an AAS Submodel.
In the battery use-case of the fdo project we get an fdo record of an amplifier. In this use case, we receive an FDO record for an amplifier. This record represents an FDO Profile of Amplifier.
We analyzed the profile and investigated whether a suitable AAS Submodel Template already exists. Although IDTA does not provide a dedicated template for amplifiers, we determined that the Technical Data Submodel Template can be used for this purpose.
The Technical Data Submodel Template is a generic and flexible template suitable for representing technical specifications of a wide range of devices, including amplifiers. To ensure machine-readability and semantic interoperability, each property in the template is annotated with a semanticId referencing standard dictionaries such as eCl@ss or IEC CDD.
During our research, we identified a relevant IEC CDD class for an operational amplifier: https://cdd.iec.ch/CDD/iec61360/iec61360.nsf/TU0.L3/0112-2---61360_4%23AAA008
We created a Technical Data Submodel Template for Amplifier containing:
- Properties from the FDO profile of the amplifier
- Appropriate semanticIds from IEC CDD
- Additional relevant properties for amplifiers
This approach ensures machine-readability, standardization and interoperability by using IDTA Submodel Templates and IEC CDD semantics. Python classes were created for this Submodel Template, enabling programmatic creation of Submodel instances within AAS environments for further processing and integration.