diff --git a/basyx/aas/adapter/aasx.py b/basyx/aas/adapter/aasx.py index 7b17bc090..76317c8df 100644 --- a/basyx/aas/adapter/aasx.py +++ b/basyx/aas/adapter/aasx.py @@ -119,7 +119,7 @@ def read_into(self, object_store: model.AbstractObjectStore, This function does the main job of reading the AASX file's contents. It traverses the relationships within the package to find AAS JSON or XML parts, parses them and adds the contained AAS objects into the provided - `object_store`. While doing so, it searches all parsed :class:`Submodels ` for + `object_store`. While doing so, it searches all parsed :class:`Submodels ` for :class:`~basyx.aas.model.submodel.File` objects to extract the supplementary files. The referenced supplementary files are added to the given `file_store` and the :class:`~basyx.aas.model.submodel.File` objects' values are updated with the absolute name of the supplementary file @@ -328,13 +328,13 @@ def write_aas(self, This method takes the AASs' :class:`Identifiers ` (as `aas_ids`) to retrieve the AASs from the given object_store. - :class:`References ` to :class:`Submodels ` and + :class:`References ` to :class:`Submodels ` and :class:`ConceptDescriptions ` (via semanticId attributes) are also resolved using the `object_store`. All of these objects are written to an aas-spec part `/aasx/data.xml` or `/aasx/data.json` in the AASX package, compliant to the convention presented in "Details of the Asset Administration Shell". Supplementary files which are referenced by a :class:`~basyx.aas.model.submodel.File` object in any of the - :class:`Submodels ` are also added to the AASX + :class:`Submodels ` are also added to the AASX package. This method uses `write_all_aas_objects()` to write the AASX part. @@ -352,13 +352,13 @@ def write_aas(self, :class:`Identifiers ` of the AAS(s) to be written to the AASX file :param object_store: :class:`ObjectStore ` to retrieve the :class:`~basyx.aas.model.base.Identifiable` AAS objects (:class:`~basyx.aas.model.aas.AssetAdministrationShell`, - :class:`~basyx.aas.model.concept.ConceptDescription` and :class:`~basyx.aas.model.submodel.SubmodelElement`) from + :class:`~basyx.aas.model.concept.ConceptDescription` and :class:`~basyx.aas.model.submodel.Submodel`) from :param file_store: :class:`SupplementaryFileContainer <~.AbstractSupplementaryFileContainer>` to retrieve supplementary files from, which are referenced by :class:`~basyx.aas.model.submodel.File` objects - :param write_json: If `True`, JSON parts are created for the AAS and each :class:`~basyx.aas.model.submodel.SubmodelElement` + :param write_json: If `True`, JSON parts are created for the AAS and each :class:`~basyx.aas.model.submodel.Submodel` in the AASX package file instead of XML parts. Defaults to `False`. :raises KeyError: If one of the AAS could not be retrieved from the object store (unresolvable - :class:`Submodels ` and + :class:`Submodels ` and :class:`ConceptDescriptions ` are skipped, logging a warning/info message) :raises TypeError: If one of the given AAS ids does not resolve to an AAS (but another diff --git a/basyx/aas/adapter/xml/xml_serialization.py b/basyx/aas/adapter/xml/xml_serialization.py index 656d65eb6..0376b6290 100644 --- a/basyx/aas/adapter/xml/xml_serialization.py +++ b/basyx/aas/adapter/xml/xml_serialization.py @@ -521,9 +521,9 @@ def submodel_element_to_xml(obj: model.SubmodelElement) -> etree.Element: def submodel_to_xml(obj: model.Submodel, tag: str = NS_AAS+"submodel") -> etree.Element: """ - Serialization of objects of class :class:`~basyx.aas.model.submodel.SubmodelElement` to XML + Serialization of objects of class :class:`~basyx.aas.model.submodel.Submodel` to XML - :param obj: Object of class :class:`~basyx.aas.model.submodel.SubmodelElement` + :param obj: Object of class :class:`~basyx.aas.model.submodel.Submodel` :param tag: Namespace+Tag of the serialized element (optional). Default is "aas:submodel" :return: Serialized ElementTree object """ diff --git a/basyx/aas/examples/data/example_aas.py b/basyx/aas/examples/data/example_aas.py index a04df563d..f773a07ed 100644 --- a/basyx/aas/examples/data/example_aas.py +++ b/basyx/aas/examples/data/example_aas.py @@ -49,7 +49,7 @@ def create_full_example() -> model.DictObjectStore: """ - Creates an object store which is filled with an example :class:`~basyx.aas.model.submodel.SubmodelElement`, + Creates an object store which is filled with an example :class:`~basyx.aas.model.submodel.Submodel`, :class:`~basyx.aas.model.concept.ConceptDescription` and :class:`~basyx.aas.model.aas.AssetAdministrationShell` using the functions of this module @@ -66,7 +66,7 @@ def create_full_example() -> model.DictObjectStore: def create_example_asset_identification_submodel() -> model.Submodel: """ - Creates a :class:`~basyx.aas.model.submodel.SubmodelElement` containing two :class:`~basyx.aas.model.submodel.Property` elements + Creates a :class:`~basyx.aas.model.submodel.Submodel` containing two :class:`~basyx.aas.model.submodel.Property` elements according to 'Verwaltungssschale in der Praxis' https://www.plattform-i40.de/PI40/Redaktion/DE/Downloads/Publikation/2019-verwaltungsschale-in-der-praxis.html @@ -198,7 +198,7 @@ def create_example_asset_identification_submodel() -> model.Submodel: def create_example_bill_of_material_submodel() -> model.Submodel: """ - creates a :class:`~basyx.aas.model.submodel.SubmodelElement` for the bill of material containing two entities one + creates a :class:`~basyx.aas.model.submodel.Submodel` for the bill of material containing two entities one co-managed and one self-managed :return: example bill of material submodel @@ -329,7 +329,7 @@ def create_example_bill_of_material_submodel() -> model.Submodel: def create_example_submodel() -> model.Submodel: """ - Creates an example :class:`~basyx.aas.model.submodel.SubmodelElement` containing all kind of + Creates an example :class:`~basyx.aas.model.submodel.Submodel` containing all kind of :class:`~basyx.aas.model.submodel.SubmodelElement` objects :return: example submodel diff --git a/basyx/aas/examples/data/example_aas_mandatory_attributes.py b/basyx/aas/examples/data/example_aas_mandatory_attributes.py index b6f036b14..b1d9dfc1a 100644 --- a/basyx/aas/examples/data/example_aas_mandatory_attributes.py +++ b/basyx/aas/examples/data/example_aas_mandatory_attributes.py @@ -6,7 +6,7 @@ # SPDX-License-Identifier: MIT """ Module for the creation of an :class:`ObjectStore ` with an example -:class:`~basyx.aas.model.aas.AssetAdministrationShell` and example :class:`Submodels ` +:class:`~basyx.aas.model.aas.AssetAdministrationShell` and example :class:`Submodels ` and a :class:`~aas.model.concept.ConceptDictionary` containing an example :class:`~basyx.aas.model.concept.ConceptDescription`. All objects only contain mandatory attributes. @@ -26,7 +26,7 @@ def create_full_example() -> model.DictObjectStore: """ Creates an :class:`~.basyx.aas.model.provider.DictObjectStore` which is filled with an example - :class:`~basyx.aas.model.submodel.SubmodelElement`, :class:`~basyx.aas.model.concept.ConceptDescription` + :class:`~basyx.aas.model.submodel.Submodel`, :class:`~basyx.aas.model.concept.ConceptDescription` and :class:`~basyx.aas.model.aas.AssetAdministrationShell` using the functions of this module :return: :class:`~basyx.aas.model.provider.DictObjectStore` @@ -42,7 +42,7 @@ def create_full_example() -> model.DictObjectStore: def create_example_submodel() -> model.Submodel: """ - Creates an example :class:`~basyx.aas.model.submodel.SubmodelElement` containing all kind of + Creates an example :class:`~basyx.aas.model.submodel.Submodel` containing all kind of :class:`~basyx.aas.model.submodel.SubmodelElement` objects where only mandatory attributes are set :return: example submodel @@ -150,7 +150,7 @@ def create_example_submodel() -> model.Submodel: def create_example_empty_submodel() -> model.Submodel: """ - Creates an example empty :class:`~basyx.aas.model.submodel.SubmodelElement` where only the id attribute is set + Creates an example empty :class:`~basyx.aas.model.submodel.Submodel` where only the id attribute is set :return: example submodel """ @@ -173,7 +173,7 @@ def create_example_asset_administration_shell() -> \ model.AssetAdministrationShell: """ Creates an example :class:`~basyx.aas.model.aas.AssetAdministrationShell` containing references to the example, - the example :class:`~Submodels `. + the example :class:`~Submodels `. :return: example asset administration shell """ diff --git a/basyx/aas/examples/data/example_aas_missing_attributes.py b/basyx/aas/examples/data/example_aas_missing_attributes.py index 5d5e36766..e37f48acd 100644 --- a/basyx/aas/examples/data/example_aas_missing_attributes.py +++ b/basyx/aas/examples/data/example_aas_missing_attributes.py @@ -19,7 +19,7 @@ def create_full_example() -> model.DictObjectStore: """ - Creates an :class:`~basyx.aas.model.provider.DictObjectStore` containing an example :class:`~basyx.aas.model.submodel.SubmodelElement`, + Creates an :class:`~basyx.aas.model.provider.DictObjectStore` containing an example :class:`~basyx.aas.model.submodel.Submodel`, an example :class:`~basyx.aas.model.concept.ConceptDescription` and an example :class:`~basyx.aas.model.aas.AssetAdministrationShell` @@ -34,7 +34,7 @@ def create_full_example() -> model.DictObjectStore: def create_example_submodel() -> model.Submodel: """ - Creates an example :class:`~basyx.aas.model.submodel.SubmodelElement` containing all kind of + Creates an example :class:`~basyx.aas.model.submodel.Submodel` containing all kind of :class:`~basyx.aas.model.submodel.SubmodelElement` objects :return: example submodel @@ -359,7 +359,7 @@ def create_example_concept_description() -> model.ConceptDescription: def create_example_asset_administration_shell() -> model.AssetAdministrationShell: """ Creates an example :class:`~basyx.aas.model.aas.AssetAdministrationShell` containing a reference to an example - :class:`~basyx.aas.model.submodel.SubmodelElement` + :class:`~basyx.aas.model.submodel.Submodel` :return: example asset administration shell """ diff --git a/basyx/aas/examples/data/example_submodel_template.py b/basyx/aas/examples/data/example_submodel_template.py index 8d4eeda8d..75ec7e357 100644 --- a/basyx/aas/examples/data/example_submodel_template.py +++ b/basyx/aas/examples/data/example_submodel_template.py @@ -5,7 +5,7 @@ # # SPDX-License-Identifier: MIT """ -Module for the creation of an example :class:`~basyx.aas.model.submodel.SubmodelElement` template containing all kind of +Module for the creation of an example :class:`~basyx.aas.model.submodel.Submodel` template containing all kind of :class:`SubmodelElements ` where the kind is always `TEMPLATE`. """ @@ -20,7 +20,7 @@ def create_example_submodel_template() -> model.Submodel: """ - Creates an example :class:`~basyx.aas.model.submodel.SubmodelElement` template containing all kind of + Creates an example :class:`~basyx.aas.model.submodel.Submodel` template containing all kind of :class:`~basyx.aas.model.submodel.SubmodelElement` objects where the kind is always `TEMPLATE` diff --git a/basyx/aas/model/aas.py b/basyx/aas/model/aas.py index 3075e2af4..8a6ffc70c 100644 --- a/basyx/aas/model/aas.py +++ b/basyx/aas/model/aas.py @@ -139,7 +139,7 @@ class AssetAdministrationShell(base.Identifiable, base.UniqueIdShortNamespace, b :ivar administration: :class:`~basyx.aas.model.base.AdministrativeInformation` of an :class:`~.basyx.aas.model.base.Identifiable` element. (inherited from :class:`~basyx.aas.model.base.Identifiable`) - :ivar ~.submodel: Unordered list of :class:`submodels ` to describe typically the asset + :ivar ~.submodel: Unordered list of :class:`submodels ` to describe typically the asset of an AAS. (Initialization-parameter: `submodel_`) :ivar derived_from: The :class:`reference ` to the AAS the AAs was derived from :ivar embedded_data_specifications: List of Embedded data specification. diff --git a/basyx/aas/model/base.py b/basyx/aas/model/base.py index af12183ed..59c0c11d9 100644 --- a/basyx/aas/model/base.py +++ b/basyx/aas/model/base.py @@ -53,7 +53,7 @@ class KeyTypes(Enum): :cvar ASSET_ADMINISTRATION_SHELL: :class:`~basyx.aas.model.aas.AssetAdministrationShell` :cvar CONCEPT_DESCRIPTION: :class:`~basyx.aas.model.concept.ConceptDescription` - :cvar SUBMODEL: :class:`~basyx.aas.model.submodel.SubmodelElement` + :cvar SUBMODEL: :class:`~basyx.aas.model.submodel.Submodel` **ReferableElements starting from 1000** diff --git a/basyx/aas/util/traversal.py b/basyx/aas/util/traversal.py index 8e1d1a711..64c182261 100644 --- a/basyx/aas/util/traversal.py +++ b/basyx/aas/util/traversal.py @@ -17,7 +17,7 @@ def walk_submodel(collection: Union[model.Submodel, model.SubmodelElementCollect -> Iterator[model.SubmodelElement]: """ Traverse the :class:`SubmodelElements ` in a - :class:`~basyx.aas.model.submodel.SubmodelElement`, :class:`~basyx.aas.model.submodel.SubmodelElementCollection` or a + :class:`~basyx.aas.model.submodel.Submodel`, :class:`~basyx.aas.model.submodel.SubmodelElementCollection` or a :class:`~basyx.aas.model.submodel.SubmodelElementList` recursively in post-order tree-traversal. This is a generator function, yielding all the :class:`SubmodelElements `. @@ -33,7 +33,7 @@ def walk_submodel(collection: Union[model.Submodel, model.SubmodelElementCollect def walk_semantic_ids_recursive(root: model.Referable) -> Iterator[model.Reference]: """ - Traverse an AAS object hierarchy (e.g. a :class:`~basyx.aas.model.submodel.SubmodelElement` with all recursively contained + Traverse an AAS object hierarchy (e.g. a :class:`~basyx.aas.model.submodel.Submodel` with all recursively contained :class:`SubmodelElements `) recursively and return all non-empty (!= None) semanticIds.