6.2. traversal - Functions for Traversing AAS Object structures

A module with helper functions for traversing AAS object structures.

walk_semantic_ids_recursive(root: Referable) Iterator[Reference]

Traverse an AAS object hierarchy (e.g. a Submodel with all recursively contained SubmodelElements) recursively and return all non-empty (!= None) semanticIds.

This is a generator function, yielding all the semanticIds. No Referable objects should be added, removed or moved to/from/in the AAS object hierarchy while iterating, as this could result in undefined behaviour.

walk_submodel(collection: Submodel | SubmodelElementCollection | SubmodelElementList) Iterator[SubmodelElement]

Traverse the SubmodelElements in a Submodel, SubmodelElementCollection or a SubmodelElementList recursively in post-order tree-traversal.

This is a generator function, yielding all the SubmodelElements. No SubmodelElements should be added, removed or moved while iterating, as this could result in undefined behaviour.