7.2. aas.util.traversal - Functions for Traversing AAS Object structures
A module with helper functions for traversing AAS object structures.
- basyx.aas.util.traversal.walk_semantic_ids_recursive(root: basyx.aas.model.base.Referable) Iterator[basyx.aas.model.base.Reference]
Traverse an AAS object hierarchy (e.g. a
Submodelwith all recursively containedSubmodelElements) recursively and return all non-empty (!= None) semanticIds.This is a generator function, yielding all the semanticIds. No
Referableobjects should be added, removed or moved to/from/in the AAS object hierarchy while iterating, as this could result in undefined behaviour.
- basyx.aas.util.traversal.walk_submodel(collection: Union[basyx.aas.model.submodel.Submodel, basyx.aas.model.submodel.SubmodelElementCollection, basyx.aas.model.submodel.SubmodelElementList]) Iterator[basyx.aas.model.submodel.SubmodelElement]
Traverse the
SubmodelElementsin aSubmodel,SubmodelElementCollectionor aSubmodelElementListrecursively in post-order tree-traversal.This is a generator function, yielding all the
SubmodelElements. NoSubmodelElementsshould be added, removed or moved while iterating, as this could result in undefined behaviour.