smia.aas_model.extended_aas_model module

class smia.aas_model.extended_aas_model.ExtendedAASModel[source]

Bases: object

This class contains methods related to the AAS model stored in Python objects. These methods are useful when using the AAS model in the SMIA approach.

aas_model_object_store = None

Storage with all Python object obtained from the AAS model

capabilities_skills_dict = None

Dictionary with all information related to Capability-Skill model obtained from the AAS model

lock = None

Asyncio Lock object for secure access to shared AAS model objects

async set_aas_model_object_store(object_store)[source]

This method updates the object store for the AAS model.

Parameters:

object_store (basyx.aas.model.DictObjectStore) – object to store all Python elements of the AAS model.

async get_aas_model_object_store()[source]

This method returns the object store for the AAS model.

Returns:

object with all Python elements of the AAS model.

Return type:

basyx.aas.model.DictObjectStore

async execute_general_analysis(smia_agent)[source]

This method performs the general analysis on the AAS model to check if it is a valid AAS model for SMIA software, and provides information to the user via console or log file.

Parameters:

smia_agent (spade.agent.Agent) – SMIA SPADE agent object.

async get_aas_object()[source]

This method gets the stored AAS object.

Returns:

AAS object

Return type:

basyx.aas.model.AssetAdministrationShell

async get_aas_attribute_value(attrib)[source]

This method gets the value of a specific attribute of the AssetInformation of the associated AAS to the SMIA instance.

Parameters:

attrib (str) – name of the attribute.

Returns:

value of the attribute

Return type:

obj

async get_asset_information_attribute_value(attrib)[source]

This method gets the value of a specific attribute of the AssetInformation of the associated AAS to the SMIA instance.

Parameters:

attrib (str) – name of the attribute.

Returns:

value of the attribute

Return type:

obj

async set_capabilities_skills_object(cap_skills_object)[source]

This method updates the object that contains with all the information about Capabilities and Skills of the DT and the asset.

Parameters:

cap_skills_object (dict) – object with all the information about Capabilities and Skills of the DT and the asset.

async get_capabilities_skills_object()[source]

This method returns the object with all the information about Capabilities and Skills of the DT and the asset.

Returns:

all the information about Capabilities and Skills of the DT and the asset in JSON format.

Return type:

dict

async save_capability_skill_information(capability_type, cap_skill_info)[source]

This method saves the information of a capability and its associated skill in the global dictionary. It distinguishes between AgentCapabilities and AssetCapabilities.

Parameters:
  • capability_type (str) – type of the capability (AgentCapabilities or AssetCapabilities).

  • cap_skill_info (dict) – information in form of a JSON object.

async get_capability_dict_by_type(cap_type)[source]

This method returns the capability dictionary related to the given capability type.

Parameters:

cap_type (str) – type of the capability (AgentCapabilities or AssetCapabilities).

Returns:

dictionary will the information of all capabilities of the given type.

Return type:

dict

async get_object_by_reference(reference)[source]
This method gets the AAS meta-model Python object using the reference, distinguishing between ExternalReference

and ModelReference.

Parameters:

reference (basyx.aas.model.Reference) – reference object related to desired element

Returns:

Python object of the desired element associated to the reference.

Return type:

object

async get_submodel_elements_by_semantic_id(semantic_id_external_ref, sme_class=None)[source]

This method gets all SubmodelElements by the semantic id in form of an external reference. The SubmodelElements to obtain can be filtered by the meta-model class.

Parameters:
  • semantic_id_external_ref (str) – semantic id in form of an external reference

  • sme_class (basyx.aas.model.SubmodelElement) – Submodel Element class of the elements to be found (None if no filtering is required).

Returns:

list with all SubmodelElements of the given class.

Return type:

list(basyx.aas.model.SubmodelElement)

async get_submodel_elements_by_semantic_id_list(semantic_id_external_refs, sme_class=None)[source]

This method obtains all the SubmodelElements that have any of the given semantic identifiers (in form of an external references). The SubmodelElements to obtain can be filtered by the meta-model class.

Parameters:
  • semantic_id_external_refs (list(str)) – semantic identifiers in form of a list of external references

  • sme_class (basyx.aas.model.SubmodelElement) – Submodel Element class of the elements to be found (None if no filtering is required).

Returns:

list with all SubmodelElements of the given class.

Return type:

list(basyx.aas.model.SubmodelElement)

async get_submodel_by_semantic_id(sm_semantic_id)[source]

This method gets the Submodel object using its semantic identifier.

Parameters:

sm_semantic_id (str) – semantic identifier of the Submodel.

Returns:

Submodel in form of a Python object.

Return type:

basyx.aas.model.Submodel

async get_submodel_by_template_id(template_id)[source]

This method gets the Submodel object using its template identifier.

Parameters:

template_id (str) – template identifier of the Submodel.

Returns:

Submodel in form of a Python object.

Return type:

basyx.aas.model.Submodel

async check_and_adapt_for_templates(reference_dict)[source]

This method checks if the reference has any SubmodelElement model associated to any instance within the AAS model of SMIA. If found, it adapts the received reference, modifying the template by its instance

Parameters:

reference_dict (dict) – reference related to desired element in form of JSON

Returns:

adapted reference object

Return type:

dict

async check_element_exist_in_namespaceset_by_id_short(namespaceset_elem, elem_id_short)[source]

This method checks if an element exists in the NamespaceSet using its id_short.

Parameters:
  • namespaceset_elem (basyx.aas.model.NamespaceSet) – NamespaceSet element

  • elem_id_short (str) – id_short of the element.

Returns:

result of the check

Return type:

bool

async get_concept_description_pair_value_id_by_value_name(concept_description_id, value_name)[source]

This method gets the value_id of a pair within a Concept Description using the value name.

Parameters:
  • concept_description_id (str) – globally unique identifier of the Concept Description.

  • value_name (str) – name of the value inside the pair to find.

Returns:

value_id of the pair that contains the provided value name.

Return type:

str

async get_capability_by_id_short(cap_type, cap_id_short)[source]

This method gets the capability object with all its information using its id_short attribute and the type of the Capability.

Parameters:
  • cap_type (str) – type of the capability (AgentCapabilities or AssetCapabilities).

  • cap_id_short (str) – id_short of the Capability to find.

Returns:

Python object of capability to find (None if the Capability does not exist)

Return type:

basyx.aas.model.Capability

async get_cap_skill_elem_from_relationship(rel_element)[source]

This method returns the Capability and Skill objects from the Relationship element, no matter in which order they are specified.

Parameters:

rel_element (basyx.aas.model.RelationshipElement) – Python object of the RelationshipElement.

Returns:

capability and skill SME in Python reference objects.

Return type:

basyx.aas.model.Capability, basyx.aas.model.SubmodelElement

async get_elements_from_relationship(rel_element, first_elem_class=None, second_elem_class=None)[source]

This method returns the objects of a given Relationship element taking into account the type of class that is required for the objects referenced within the relationship. The objects will be returned in the order specified by the classes, no matter in which order they are defined in the AAS model (in the case of not specifying any class, it is returned in the original order).

Parameters:
  • rel_element (basyx.aas.model.RelationshipElement) – Python object of the RelationshipElement.

  • first_elem_class (basyx.aas.model.SubmodelElement) – Class required for the first element returned.

  • second_elem_class (basyx.aas.model.SubmodelElement) – Class required for the second element returned.

Returns:

SME Python objects with the required format.

Return type:

basyx.aas.model.SubmodelElement, basyx.aas.model.SubmodelElement

async get_capability_associated_constraints(capability_elem)[source]

This method gets the constraints associated to a capability.

Parameters:

capability_elem (basyx.aas.model.Capability) – capability Python object.

Returns:

list with all constraints of the selected capability in form of Python objects.

Return type:

list

async get_capability_associated_constraints_by_qualifier_data(capability_elem, qualifier_type, qualifier_value)[source]

This method gets the constraints associated to a capability that have specific qualifier data.

Parameters:
  • capability_elem (basyx.aas.model.Capability) – capability Python object.

  • qualifier_type (str) – type of the qualifier

  • qualifier_value (str) – value of the qualifier

Returns:

list with all constraints of the selected capability in form of Python objects.

Return type:

list

async get_skill_interface_by_skill_elem(skill_elem)[source]

This method gets the interfaces associated to a skill.

Parameters:

skill_elem (basyx.aas.model.SubmodelElement) – skill Python object in form of a SubmodelElement.

Returns:

the interface of the selected skill in form of Python object (None if it does not exist).

Return type:

(basyx.aas.model.SubmodelElement)

async get_asset_interface_interaction_metadata_by_value_semantic_id(value_semantic_id)[source]

This method reads the AssetInterfacesDescription submodel and returns an Interaction Metadata by a given value semanticID. This is how in this approach it is established that an attribute is of asset data type.

Parameters:

value_semantic_id (str) – semanticID of the value of the Interaction Metadata.

Returns:

SubmodelElement of the required Interaction Metadata (None if the semanticID does not exist)

Return type:

basyx.aas.model.SubmodelElementCollection

async get_skill_parameters_exposure_interface_elem(skill_elem)[source]

This method gets the exposure element within the skill interface linked to the parameters of the given skill.

Parameters:

skill_elem (basyx.aas.model.SubmodelElement) – skill Python object in form of a SubmodelElement.

Returns:

exposure submodel element of skill parameters.

Return type:

basyx.aas.model.SubmodelElement

async skill_feasibility_checking_post_conditions(capability_elem, constraints_data)[source]

This method checks the feasibility of a Capability element in relation with its post-conditions.

Parameters:
  • capability_elem (basyx.aas.model.Capability) – capability Python object.

  • constraints_data (dict) – JSON object with the data of the constraints (with required values)