smia.utilities.properties_file_utils module

This class contains utility methods related to the ConfigMap file.

smia.utilities.properties_file_utils.create_empty_file()[source]

This method creates a properties configuration file for SMIA with default values (‘#’).

smia.utilities.properties_file_utils.update_properties_file_by_parser(new_config_parser)[source]

This method updates the content of the properties file by a given parser.

Parameters:

new_config_parser (configparser.RawConfigParser) – the parser with the new content for the properties file.

smia.utilities.properties_file_utils.update_properties_file_by_bytes(new_config_bytes)[source]

This method updates the content of the properties file by given properties in the form of bytes.

Parameters:

new_config_bytes (configparser.RawConfigParser) – the parser with the new content for the properties file.

smia.utilities.properties_file_utils.get_aas_general_property(property_name)[source]

This method returns the property of the AAS set in the ConfigMap by the AAS Controller during the deployment process. This information is stored in “general.properties” file within “AAS” section (with the ‘aas.’ prefix).

Parameters:

property_name (str) – The name of the property.

Returns:

The general property of the AAS.

Return type:

str

smia.utilities.properties_file_utils.set_aas_general_property(property_name, property_value)[source]

This method sets a new value for a property of the AAS. The information is stored in “general.properties” file within “AAS” section (with the ‘aas.’ prefix).

Parameters:
  • property_name (str) – The name of the property.

  • property_value (str) – The new value of the property.

smia.utilities.properties_file_utils.get_aas_model_filepath()[source]

This method returns the AAS model file path. The AAS model is specified in the ‘general.properties’ file within the ‘AAS’ section, with ‘aas.model.file’ attribute.

Returns:

The AAS model file path within the SMIA Archive.

Return type:

str

smia.utilities.properties_file_utils.get_dt_general_property(property_name)[source]

This method returns the DT property set in the ConfigMap during the deployment process. This information is stored in the ‘general.properties’ file within the ‘DT’ section (with the ‘dt.’ prefix).

Returns:

The general property of the DT.

Return type:

str

smia.utilities.properties_file_utils.set_dt_general_property(property_name, property_value)[source]

This method sets a new value for a property of the DT. The information is stored in “general.properties” file within “DT” section (with the ‘dt.’ prefix).

Parameters:
  • property_name (str) – The name of the property.

  • property_value (str) – The new value of the property.

smia.utilities.properties_file_utils.get_ontology_general_property(property_name)[source]

This method returns the property of the OWL set in the ConfigMap by the AAS Controller during the deployment process. This information is stored in “general.properties” file within “ONTOLOGY” section (with the ‘ontology.’ prefix).

Parameters:

property_name (str) – The name of the property.

Returns:

The general property of the ontology.

Return type:

str

smia.utilities.properties_file_utils.get_defined_ontology_filepath()[source]

This method returns the OWL ontology file path. If the file for the OWL ontology is specified in the ‘general.properties’ file, it is located within the ‘ONTOLOGY’ section, with ‘ontology.owl.file’ attribute.

Returns:

The ontology file path within the SMIA Archive.

Return type:

str

smia.utilities.properties_file_utils.create_ontology_file(file_bytes_content)[source]

This method creates the ontology OWL file with the given file content. This method is used when the ontology file is inside the AASX package, so it must be created outside in order to be available for loading.

Returns:

The new ontology OWL file path within the SMIA Archive.

Return type:

str

smia.utilities.properties_file_utils.get_asset_type()[source]

This method returns the asset type of the AAS set in the ConfigMap by the AAS Controller during the deployment process. This information is stored in “asset.properties” file.

Returns:

The asset type of the AAS.

Return type:

str

smia.utilities.properties_file_utils.get_submodel_names()[source]

This method returns all submodel names that have been selected for the AAS instance. It is the submodel properties file sections of the AAS configuration in the ConfigMap that will determine which submodels these are.

Returns:

A list with the sections of the submodel properties file, and therefore, the submodel names.

Return type:

list(str)

smia.utilities.properties_file_utils.get_submodel_information(submodel_name)[source]

This method returns the submodel information of a specific submodel, from the submodel properties file of the configuration from the ConfigMap.

Parameters:
  • submodel_name (str) – The name of the submodel. To read from the submodel properties file, it is also

  • section. (the name of the)

Returns:

The submodel information in the same format as the submodel properties file content.

Return type:

dict