diff --git a/basyx/aas/adapter/aasx.py b/basyx/aas/adapter/aasx.py index a43f8c706..7b17bc090 100644 --- a/basyx/aas/adapter/aasx.py +++ b/basyx/aas/adapter/aasx.py @@ -119,10 +119,10 @@ 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 - :class:`~aas.model.submodel.File` objects to extract the supplementary + `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:`~aas.model.submodel.File` objects' values are updated with the absolute name of the supplementary file + :class:`~basyx.aas.model.submodel.File` objects' values are updated with the absolute name of the supplementary file to allow for robust resolution the file within the `file_store` later. @@ -131,10 +131,10 @@ def read_into(self, object_store: model.AbstractObjectStore, :param file_store: A :class:`SupplementaryFileContainer <.AbstractSupplementaryFileContainer>` to add the embedded supplementary files to :param override_existing: If `True`, existing objects in the object store are overridden with objects from the - AASX that have the same :class:`~aas.model.base.Identifier`. Default behavior is to skip those objects from + AASX that have the same :class:`~basyx.aas.model.base.Identifier`. Default behavior is to skip those objects from the AASX. - :return: A set of the :class:`Identifiers ` of all - :class:`~aas.model.base.Identifiable` objects parsed from the AASX file + :return: A set of the :class:`Identifiers ` of all + :class:`~basyx.aas.model.base.Identifiable` objects parsed from the AASX file """ # Find AASX-Origin part core_rels = self.reader.get_related_parts_by_type() @@ -323,18 +323,18 @@ def write_aas(self, write_json: bool = False) -> None: """ Convenience method to write one or more - :class:`AssetAdministrationShells ` with all included and referenced + :class:`AssetAdministrationShells ` with all included and referenced objects to the AASX package according to the part name conventions from DotAAS. - This method takes the AASs' :class:`Identifiers ` (as `aas_ids`) to retrieve the + 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:`ConceptDescriptions ` (via semanticId attributes) are also + :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:`~aas.model.submodel.File` object in any of the - :class:`Submodels ` are also added to the AASX + 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 package. This method uses `write_all_aas_objects()` to write the AASX part. @@ -348,21 +348,21 @@ def write_aas(self, To write multiple Asset Administration Shells to a single AASX package file, call this method once, passing a list of AAS Identifiers to the `aas_ids` parameter. - :param aas_ids: :class:`~aas.model.base.Identifier` or Iterable of - :class:`Identifiers ` of the AAS(s) to be written to the AASX file + :param aas_ids: :class:`~basyx.aas.model.base.Identifier` or Iterable of + :class:`Identifiers ` of the AAS(s) to be written to the AASX file :param object_store: :class:`ObjectStore ` to retrieve the - :class:`~aas.model.base.Identifiable` AAS objects (:class:`~aas.model.aas.AssetAdministrationShell`, - :class:`~aas.model.concept.ConceptDescription` and :class:`~aas.model.submodel.Submodel`) from + :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 :param file_store: :class:`SupplementaryFileContainer <~.AbstractSupplementaryFileContainer>` to retrieve - supplementary files from, which are referenced by :class:`~aas.model.submodel.File` objects - :param write_json: If `True`, JSON parts are created for the AAS and each :class:`~aas.model.submodel.Submodel` + 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` 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:`ConceptDescriptions ` are skipped, logging a warning/info + :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 - :class:`~aas.model.base.Identifiable` object) + :class:`~basyx.aas.model.base.Identifiable` object) """ if isinstance(aas_ids, model.Identifier): aas_ids = (aas_ids,) @@ -428,10 +428,10 @@ def write_aas_objects(self, """ A thin wrapper around :meth:`write_all_aas_objects` to ensure downwards compatibility - This method takes the AAS's :class:`~aas.model.base.Identifier` (as `aas_id`) to retrieve it from the given + This method takes the AAS's :class:`~basyx.aas.model.base.Identifier` (as `aas_id`) to retrieve it from the given object_store. If the list of written objects includes :class:`aas.model.submodel.Submodel` objects, Supplementary files which are - referenced by :class:`~aas.model.submodel.File` objects within + referenced by :class:`~basyx.aas.model.submodel.File` objects within those submodels, are also added to the AASX package. .. attention:: @@ -442,12 +442,12 @@ def write_aas_objects(self, :param part_name: Name of the Part within the AASX package to write the files to. Must be a valid ECMA376-2 part name and unique within the package. The extension of the part should match the data format (i.e. '.json' if `write_json` else '.xml'). - :param object_ids: A list of :class:`Identifiers ` of the objects to be written to - the AASX package. Only these :class:`~aas.model.base.Identifiable` objects (and included - :class:`~aas.model.base.Referable` objects) are written to the package. - :param object_store: The objects store to retrieve the :class:`~aas.model.base.Identifiable` objects from + :param object_ids: A list of :class:`Identifiers ` of the objects to be written to + the AASX package. Only these :class:`~basyx.aas.model.base.Identifiable` objects (and included + :class:`~basyx.aas.model.base.Referable` objects) are written to the package. + :param object_store: The objects store to retrieve the :class:`~basyx.aas.model.base.Identifiable` objects from :param file_store: The :class:`SupplementaryFileContainer ` - to retrieve supplementary files from (if there are any :class:`~aas.model.submodel.File` + to retrieve supplementary files from (if there are any :class:`~basyx.aas.model.submodel.File` objects within the written objects. :param write_json: If `True`, the part is written as a JSON file instead of an XML file. Defaults to `False`. :param split_part: If `True`, no aas-spec relationship is added from the aasx-origin to this part. You must make @@ -486,7 +486,7 @@ def write_all_aas_objects(self, This method takes an :class:`ObjectStore ` and writes all contained objects into an "aas_env" part in the AASX package. If the ObjectStore includes :class:`~aas.model.submodel.Submodel` objects, supplementary files which are - referenced by :class:`~aas.model.submodel.File` objects + referenced by :class:`~basyx.aas.model.submodel.File` objects within those Submodels, are fetched from the `file_store` and added to the AASX package. .. attention:: @@ -712,7 +712,7 @@ class AbstractSupplementaryFileContainer(metaclass=abc.ABCMeta): Supplementary files may be PDF files or other binary or textual files, referenced in a File object of an AAS by their name. They are used to provide associated documents without embedding their contents (as - :class:`~aas.model.submodel.Blob` object) in the AAS. + :class:`~basyx.aas.model.submodel.Blob` object) in the AAS. A SupplementaryFileContainer keeps track of the name and content_type (MIME type) for each file. Additionally it allows to resolve name conflicts by comparing the files' contents and providing an alternative name for a dissimilar diff --git a/basyx/aas/adapter/json/json_deserialization.py b/basyx/aas/adapter/json/json_deserialization.py index 6524f4b4d..436a6e567 100644 --- a/basyx/aas/adapter/json/json_deserialization.py +++ b/basyx/aas/adapter/json/json_deserialization.py @@ -21,7 +21,7 @@ complete AAS JSON file, reads its contents and stores the objects in the provided :class:`~aas.model.provider.AbstractObjectStore`. :meth:`~aas.adapter.json.json_deserialization.read_aas_json_file` is a wrapper for this function. Instead of storing the objects in a given :class:`~aas.model.provider.AbstractObjectStore`, -it returns a :class:`~aas.model.provider.DictObjectStore` containing parsed objects. +it returns a :class:`~basyx.aas.model.provider.DictObjectStore` containing parsed objects. The deserialization is performed in a bottom-up approach: The `object_hook()` method gets called for every parsed JSON object (as dict) and checks for existence of the `modelType` attribute. If it is present, the `AAS_CLASS_PARSERS` dict @@ -367,7 +367,7 @@ def _construct_administrative_information( def _construct_operation_variable(cls, dct: Dict[str, object]) -> model.SubmodelElement: """ Since we don't implement `OperationVariable`, this constructor discards the wrapping `OperationVariable` object - and just returns the contained :class:`~aas.model.submodel.SubmodelElement`. + and just returns the contained :class:`~basyx.aas.model.submodel.SubmodelElement`. """ # TODO: remove the following type: ignore comments when mypy supports abstract types for Type[T] # see https://github.com/python/mypy/issues/5374 @@ -814,7 +814,7 @@ def read_aas_json_file_into(object_store: model.AbstractObjectStore, file: IO, r See https://git.rwth-aachen.de/acplt/pyi40aas/-/issues/91 This parameter is ignored if a decoder class is specified. :param decoder: The decoder class used to decode the JSON objects - :return: A set of :class:`Identifiers ` that were added to object_store + :return: A set of :class:`Identifiers ` that were added to object_store """ ret: Set[model.Identifier] = set() decoder_ = _select_decoder(failsafe, stripped, decoder) @@ -867,12 +867,12 @@ def read_aas_json_file_into(object_store: model.AbstractObjectStore, file: IO, r def read_aas_json_file(file: IO, **kwargs) -> model.DictObjectStore[model.Identifiable]: """ A wrapper of :meth:`~aas.adapter.json.json_deserialization.read_aas_json_file_into`, that reads all objects in an - empty :class:`~aas.model.provider.DictObjectStore`. This function supports the same keyword arguments as + empty :class:`~basyx.aas.model.provider.DictObjectStore`. This function supports the same keyword arguments as :meth:`~aas.adapter.json.json_deserialization.read_aas_json_file_into`. :param file: A filename or file-like object to read the JSON-serialized data from :param kwargs: Keyword arguments passed to :meth:`~aas.adapter.json.json_deserialization.read_aas_json_file_into` - :return: A :class:`~aas.model.provider.DictObjectStore` containing all AAS objects from the JSON file + :return: A :class:`~basyx.aas.model.provider.DictObjectStore` containing all AAS objects from the JSON file """ object_store: model.DictObjectStore[model.Identifiable] = model.DictObjectStore() read_aas_json_file_into(object_store, file, **kwargs) diff --git a/basyx/aas/adapter/json/json_serialization.py b/basyx/aas/adapter/json/json_serialization.py index 17fff2680..09dace4aa 100644 --- a/basyx/aas/adapter/json/json_serialization.py +++ b/basyx/aas/adapter/json/json_serialization.py @@ -579,7 +579,7 @@ def _operation_variable_to_json(cls, obj: model.SubmodelElement) -> Dict[str, ob """ serialization of an object from class SubmodelElement to a json OperationVariable representation Since we don't implement the `OperationVariable` class, which is just a wrapper for a single - :class:`~aas.model.submodel.SubmodelElement`, elements are serialized as the `value` attribute of an + :class:`~basyx.aas.model.submodel.SubmodelElement`, elements are serialized as the `value` attribute of an `operationVariable` object. :param obj: object of class `SubmodelElement` diff --git a/basyx/aas/adapter/xml/xml_deserialization.py b/basyx/aas/adapter/xml/xml_deserialization.py index f8136a64b..fa78706fe 100644 --- a/basyx/aas/adapter/xml/xml_deserialization.py +++ b/basyx/aas/adapter/xml/xml_deserialization.py @@ -16,7 +16,7 @@ - :meth:`~aas.adapter.xml.xml_deserialization.read_aas_xml_file_into` constructs all elements of an XML document and stores them in a given :class:`ObjectStore ` - :meth:`~aas.adapter.xml.xml_deserialization.read_aas_xml_file` constructs all elements of an XML document and returns - them in a :class:`~aas.model.provider.DictObjectStore` + them in a :class:`~basyx.aas.model.provider.DictObjectStore` These functions take a decoder class as keyword argument, which allows parsing in failsafe (default) or non-failsafe mode. Parsing stripped elements - used in the HTTP adapter - is also possible. It is also possible to subclass the @@ -543,7 +543,7 @@ def _construct_referable_reference(cls, element: etree.Element, **kwargs: Any) \ def _construct_operation_variable(cls, element: etree.Element, **kwargs: Any) -> model.SubmodelElement: """ Since we don't implement `OperationVariable`, this constructor discards the wrapping `aas:operationVariable` - and `aas:value` and just returns the contained :class:`~aas.model.submodel.SubmodelElement`. + and `aas:value` and just returns the contained :class:`~basyx.aas.model.submodel.SubmodelElement`. """ value = _get_child_mandatory(element, NS_AAS + "value") if len(value) == 0: @@ -1407,7 +1407,7 @@ def read_aas_xml_file_into(object_store: model.AbstractObjectStore[model.Identif into a given :class:`ObjectStore `. :param object_store: The :class:`ObjectStore ` in which the - :class:`~aas.model.base.Identifiable` objects should be stored + :class:`~basyx.aas.model.base.Identifiable` objects should be stored :param file: A filename or file-like object to read the XML-serialized data from :param replace_existing: Whether to replace existing objects with the same identifier in the object store or not :param ignore_existing: Whether to ignore existing objects (e.g. log a message) or raise an error. @@ -1420,7 +1420,7 @@ def read_aas_xml_file_into(object_store: model.AbstractObjectStore[model.Identif This parameter is ignored if a decoder class is specified. :param decoder: The decoder class used to decode the XML elements :param parser_kwargs: Keyword arguments passed to the XMLParser constructor - :return: A set of :class:`Identifiers ` that were added to object_store + :return: A set of :class:`Identifiers ` that were added to object_store """ ret: Set[model.Identifier] = set() @@ -1474,12 +1474,12 @@ def read_aas_xml_file_into(object_store: model.AbstractObjectStore[model.Identif def read_aas_xml_file(file: IO, **kwargs: Any) -> model.DictObjectStore[model.Identifiable]: """ A wrapper of :meth:`~aas.adapter.xml.xml_deserialization.read_aas_xml_file_into`, that reads all objects in an - empty :class:`~aas.model.provider.DictObjectStore`. This function supports + empty :class:`~basyx.aas.model.provider.DictObjectStore`. This function supports the same keyword arguments as :meth:`~aas.adapter.xml.xml_deserialization.read_aas_xml_file_into`. :param file: A filename or file-like object to read the XML-serialized data from :param kwargs: Keyword arguments passed to :meth:`~aas.adapter.xml.xml_deserialization.read_aas_xml_file_into` - :return: A :class:`~aas.model.provider.DictObjectStore` containing all AAS objects from the XML file + :return: A :class:`~basyx.aas.model.provider.DictObjectStore` containing all AAS objects from the XML file """ object_store: model.DictObjectStore[model.Identifiable] = model.DictObjectStore() read_aas_xml_file_into(object_store, file, **kwargs) diff --git a/basyx/aas/adapter/xml/xml_serialization.py b/basyx/aas/adapter/xml/xml_serialization.py index 106535ae1..656d65eb6 100644 --- a/basyx/aas/adapter/xml/xml_serialization.py +++ b/basyx/aas/adapter/xml/xml_serialization.py @@ -181,9 +181,9 @@ def lang_string_set_to_xml(obj: model.LangStringSet, tag: str) -> etree.Element: def administrative_information_to_xml(obj: model.AdministrativeInformation, tag: str = NS_AAS+"administration") -> etree.Element: """ - Serialization of objects of class :class:`~aas.model.base.AdministrativeInformation` to XML + Serialization of objects of class :class:`~basyx.aas.model.base.AdministrativeInformation` to XML - :param obj: Object of class :class:`~aas.model.base.AdministrativeInformation` + :param obj: Object of class :class:`~basyx.aas.model.base.AdministrativeInformation` :param tag: Namespace+Tag of the serialized element. Default is "aas:administration" :return: Serialized ElementTree object """ @@ -201,9 +201,9 @@ def administrative_information_to_xml(obj: model.AdministrativeInformation, def data_element_to_xml(obj: model.DataElement) -> etree.Element: """ - Serialization of objects of class :class:`~aas.model.submodel.DataElement` to XML + Serialization of objects of class :class:`~basyx.aas.model.submodel.DataElement` to XML - :param obj: Object of class :class:`~aas.model.submodel.DataElement` + :param obj: Object of class :class:`~basyx.aas.model.submodel.DataElement` :return: Serialized ElementTree element """ if isinstance(obj, model.MultiLanguageProperty): @@ -222,9 +222,9 @@ def data_element_to_xml(obj: model.DataElement) -> etree.Element: def reference_to_xml(obj: model.Reference, tag: str = NS_AAS+"reference") -> etree.Element: """ - Serialization of objects of class :class:`~aas.model.base.Reference` to XML + Serialization of objects of class :class:`~basyx.aas.model.base.Reference` to XML - :param obj: Object of class :class:`~aas.model.base.Reference` + :param obj: Object of class :class:`~basyx.aas.model.base.Reference` :param tag: Namespace+Tag of the returned element. Default is "aas:reference" :return: Serialized ElementTree """ @@ -331,9 +331,9 @@ def value_list_to_xml(obj: model.ValueList, def specific_asset_id_to_xml(obj: model.SpecificAssetId, tag: str = NS_AAS + "specifidAssetId") \ -> etree.Element: """ - Serialization of objects of class :class:`~aas.model.base.SpecificAssetId` to XML + Serialization of objects of class :class:`~basyx.aas.model.base.SpecificAssetId` to XML - :param obj: Object of class :class:`~aas.model.base.SpecificAssetId` + :param obj: Object of class :class:`~basyx.aas.model.base.SpecificAssetId` :param tag: Namespace+Tag of the ElementTree object. Default is "aas:identifierKeyValuePair" :return: Serialized ElementTree object """ @@ -374,9 +374,9 @@ def asset_information_to_xml(obj: model.AssetInformation, tag: str = NS_AAS+"ass def concept_description_to_xml(obj: model.ConceptDescription, tag: str = NS_AAS+"conceptDescription") -> etree.Element: """ - Serialization of objects of class :class:`~aas.model.concept.ConceptDescription` to XML + Serialization of objects of class :class:`~basyx.aas.model.concept.ConceptDescription` to XML - :param obj: Object of class :class:`~aas.model.concept.ConceptDescription` + :param obj: Object of class :class:`~basyx.aas.model.concept.ConceptDescription` :param tag: Namespace+Tag of the ElementTree object. Default is "aas:conceptDescription" :return: Serialized ElementTree object """ @@ -468,9 +468,9 @@ def data_specification_iec61360_to_xml(obj: model.DataSpecificationIEC61360, def asset_administration_shell_to_xml(obj: model.AssetAdministrationShell, tag: str = NS_AAS+"assetAdministrationShell") -> etree.Element: """ - Serialization of objects of class :class:`~aas.model.aas.AssetAdministrationShell` to XML + Serialization of objects of class :class:`~basyx.aas.model.aas.AssetAdministrationShell` to XML - :param obj: Object of class :class:`~aas.model.aas.AssetAdministrationShell` + :param obj: Object of class :class:`~basyx.aas.model.aas.AssetAdministrationShell` :param tag: Namespace+Tag of the ElementTree object. Default is "aas:assetAdministrationShell" :return: Serialized ElementTree object """ @@ -493,9 +493,9 @@ def asset_administration_shell_to_xml(obj: model.AssetAdministrationShell, def submodel_element_to_xml(obj: model.SubmodelElement) -> etree.Element: """ - Serialization of objects of class :class:`~aas.model.submodel.SubmodelElement` to XML + Serialization of objects of class :class:`~basyx.aas.model.submodel.SubmodelElement` to XML - :param obj: Object of class :class:`~aas.model.submodel.SubmodelElement` + :param obj: Object of class :class:`~basyx.aas.model.submodel.SubmodelElement` :return: Serialized ElementTree object """ if isinstance(obj, model.DataElement): @@ -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:`~aas.model.submodel.Submodel` to XML + Serialization of objects of class :class:`~basyx.aas.model.submodel.SubmodelElement` to XML - :param obj: Object of class :class:`~aas.model.submodel.Submodel` + :param obj: Object of class :class:`~basyx.aas.model.submodel.SubmodelElement` :param tag: Namespace+Tag of the serialized element (optional). Default is "aas:submodel" :return: Serialized ElementTree object """ @@ -539,9 +539,9 @@ def submodel_to_xml(obj: model.Submodel, def property_to_xml(obj: model.Property, tag: str = NS_AAS+"property") -> etree.Element: """ - Serialization of objects of class :class:`~aas.model.submodel.Property` to XML + Serialization of objects of class :class:`~basyx.aas.model.submodel.Property` to XML - :param obj: Object of class :class:`~aas.model.submodel.Property` + :param obj: Object of class :class:`~basyx.aas.model.submodel.Property` :param tag: Namespace+Tag of the serialized element (optional). Default is "aas:property" :return: Serialized ElementTree object """ @@ -557,9 +557,9 @@ def property_to_xml(obj: model.Property, def multi_language_property_to_xml(obj: model.MultiLanguageProperty, tag: str = NS_AAS+"multiLanguageProperty") -> etree.Element: """ - Serialization of objects of class :class:`~aas.model.submodel.MultiLanguageProperty` to XML + Serialization of objects of class :class:`~basyx.aas.model.submodel.MultiLanguageProperty` to XML - :param obj: Object of class :class:`~aas.model.submodel.MultiLanguageProperty` + :param obj: Object of class :class:`~basyx.aas.model.submodel.MultiLanguageProperty` :param tag: Namespace+Tag of the serialized element (optional). Default is "aas:multiLanguageProperty" :return: Serialized ElementTree object """ @@ -574,9 +574,9 @@ def multi_language_property_to_xml(obj: model.MultiLanguageProperty, def range_to_xml(obj: model.Range, tag: str = NS_AAS+"range") -> etree.Element: """ - Serialization of objects of class :class:`~aas.model.submodel.Range` to XML + Serialization of objects of class :class:`~basyx.aas.model.submodel.Range` to XML - :param obj: Object of class :class:`~aas.model.submodel.Range` + :param obj: Object of class :class:`~basyx.aas.model.submodel.Range` :param tag: Namespace+Tag of the serialized element (optional). Default is "aas:range" :return: Serialized ElementTree object """ @@ -593,9 +593,9 @@ def range_to_xml(obj: model.Range, def blob_to_xml(obj: model.Blob, tag: str = NS_AAS+"blob") -> etree.Element: """ - Serialization of objects of class :class:`~aas.model.submodel.Blob` to XML + Serialization of objects of class :class:`~basyx.aas.model.submodel.Blob` to XML - :param obj: Object of class :class:`~aas.model.submodel.Blob` + :param obj: Object of class :class:`~basyx.aas.model.submodel.Blob` :param tag: Namespace+Tag of the serialized element. Default is "blob" :return: Serialized ElementTree object """ @@ -611,9 +611,9 @@ def blob_to_xml(obj: model.Blob, def file_to_xml(obj: model.File, tag: str = NS_AAS+"file") -> etree.Element: """ - Serialization of objects of class :class:`~aas.model.submodel.File` to XML + Serialization of objects of class :class:`~basyx.aas.model.submodel.File` to XML - :param obj: Object of class :class:`~aas.model.submodel.File` + :param obj: Object of class :class:`~basyx.aas.model.submodel.File` :param tag: Namespace+Tag of the serialized element. Default is "aas:file" :return: Serialized ElementTree object """ @@ -643,9 +643,9 @@ def resource_to_xml(obj: model.Resource, def reference_element_to_xml(obj: model.ReferenceElement, tag: str = NS_AAS+"referenceElement") -> etree.Element: """ - Serialization of objects of class :class:`~aas.model.submodel.ReferenceElement` to XMl + Serialization of objects of class :class:`~basyx.aas.model.submodel.ReferenceElement` to XMl - :param obj: Object of class :class:`~aas.model.submodel.ReferenceElement` + :param obj: Object of class :class:`~basyx.aas.model.submodel.ReferenceElement` :param tag: Namespace+Tag of the serialized element (optional). Default is "aas:referenceElement" :return: Serialized ElementTree object """ @@ -658,11 +658,11 @@ def reference_element_to_xml(obj: model.ReferenceElement, def submodel_element_collection_to_xml(obj: model.SubmodelElementCollection, tag: str = NS_AAS+"submodelElementCollection") -> etree.Element: """ - Serialization of objects of class :class:`~aas.model.submodel.SubmodelElementCollection` to XML + Serialization of objects of class :class:`~basyx.aas.model.submodel.SubmodelElementCollection` to XML Note that we do not have parameter "allowDuplicates" in out implementation - :param obj: Object of class :class:`~aas.model.submodel.SubmodelElementCollection` + :param obj: Object of class :class:`~basyx.aas.model.submodel.SubmodelElementCollection` :param tag: Namespace+Tag of the serialized element (optional). Default is "aas:submodelElementCollection" :return: Serialized ElementTree object """ @@ -698,9 +698,9 @@ def submodel_element_list_to_xml(obj: model.SubmodelElementList, def relationship_element_to_xml(obj: model.RelationshipElement, tag: str = NS_AAS+"relationshipElement") -> etree.Element: """ - Serialization of objects of class :class:`~aas.model.submodel.RelationshipElement` to XML + Serialization of objects of class :class:`~basyx.aas.model.submodel.RelationshipElement` to XML - :param obj: Object of class :class:`~aas.model.submodel.RelationshipElement` + :param obj: Object of class :class:`~basyx.aas.model.submodel.RelationshipElement` :param tag: Namespace+Tag of the serialized element (optional). Default is "aas:relationshipElement" :return: Serialized ELementTree object """ @@ -713,9 +713,9 @@ def relationship_element_to_xml(obj: model.RelationshipElement, def annotated_relationship_element_to_xml(obj: model.AnnotatedRelationshipElement, tag: str = NS_AAS+"annotatedRelationshipElement") -> etree.Element: """ - Serialization of objects of class :class:`~aas.model.submodel.AnnotatedRelationshipElement` to XML + Serialization of objects of class :class:`~basyx.aas.model.submodel.AnnotatedRelationshipElement` to XML - :param obj: Object of class :class:`~aas.model.submodel.AnnotatedRelationshipElement` + :param obj: Object of class :class:`~basyx.aas.model.submodel.AnnotatedRelationshipElement` :param tag: Namespace+Tag of the serialized element (optional): Default is "aas:annotatedRelationshipElement" :return: Serialized ElementTree object """ @@ -730,12 +730,12 @@ def annotated_relationship_element_to_xml(obj: model.AnnotatedRelationshipElemen def operation_variable_to_xml(obj: model.SubmodelElement, tag: str = NS_AAS+"operationVariable") -> etree.Element: """ - Serialization of :class:`~aas.model.submodel.SubmodelElement` to the XML OperationVariable representation + Serialization of :class:`~basyx.aas.model.submodel.SubmodelElement` to the XML OperationVariable representation Since we don't implement the `OperationVariable` class, which is just a wrapper for a single - :class:`~aas.model.submodel.SubmodelElement`, elements are serialized as the `aas:value` child of an + :class:`~basyx.aas.model.submodel.SubmodelElement`, elements are serialized as the `aas:value` child of an `aas:operationVariable` element. - :param obj: Object of class :class:`~aas.model.submodel.SubmodelElement` + :param obj: Object of class :class:`~basyx.aas.model.submodel.SubmodelElement` :param tag: Namespace+Tag of the serialized element (optional). Default is "aas:operationVariable" :return: Serialized ElementTree object """ @@ -749,9 +749,9 @@ def operation_variable_to_xml(obj: model.SubmodelElement, tag: str = NS_AAS+"ope def operation_to_xml(obj: model.Operation, tag: str = NS_AAS+"operation") -> etree.Element: """ - Serialization of objects of class :class:`~aas.model.submodel.Operation` to XML + Serialization of objects of class :class:`~basyx.aas.model.submodel.Operation` to XML - :param obj: Object of class :class:`~aas.model.submodel.Operation` + :param obj: Object of class :class:`~basyx.aas.model.submodel.Operation` :param tag: Namespace+Tag of the serialized element (optional). Default is "aas:operation" :return: Serialized ElementTree object """ @@ -770,9 +770,9 @@ def operation_to_xml(obj: model.Operation, def capability_to_xml(obj: model.Capability, tag: str = NS_AAS+"capability") -> etree.Element: """ - Serialization of objects of class :class:`~aas.model.submodel.Capability` to XML + Serialization of objects of class :class:`~basyx.aas.model.submodel.Capability` to XML - :param obj: Object of class :class:`~aas.model.submodel.Capability` + :param obj: Object of class :class:`~basyx.aas.model.submodel.Capability` :param tag: Namespace+Tag of the serialized element, default is "aas:capability" :return: Serialized ElementTree object """ @@ -782,9 +782,9 @@ def capability_to_xml(obj: model.Capability, def entity_to_xml(obj: model.Entity, tag: str = NS_AAS+"entity") -> etree.Element: """ - Serialization of objects of class :class:`~aas.model.submodel.Entity` to XML + Serialization of objects of class :class:`~basyx.aas.model.submodel.Entity` to XML - :param obj: Object of class :class:`~aas.model.submodel.Entity` + :param obj: Object of class :class:`~basyx.aas.model.submodel.Entity` :param tag: Namespace+Tag of the serialized element (optional). Default is "aas:entity" :return: Serialized ElementTree object """ @@ -807,9 +807,9 @@ def entity_to_xml(obj: model.Entity, def basic_event_element_to_xml(obj: model.BasicEventElement, tag: str = NS_AAS+"basicEventElement") -> etree.Element: """ - Serialization of objects of class :class:`~aas.model.submodel.BasicEventElement` to XML + Serialization of objects of class :class:`~basyx.aas.model.submodel.BasicEventElement` to XML - :param obj: Object of class :class:`~aas.model.submodel.BasicEventElement` + :param obj: Object of class :class:`~basyx.aas.model.submodel.BasicEventElement` :param tag: Namespace+Tag of the serialized element (optional). Default is "aas:basicEventElement" :return: Serialized ElementTree object """ diff --git a/basyx/aas/backend/__init__.py b/basyx/aas/backend/__init__.py index eac661ea1..2d53e2668 100644 --- a/basyx/aas/backend/__init__.py +++ b/basyx/aas/backend/__init__.py @@ -1,7 +1,7 @@ """ This module implements a standardized way of integrating data from existing systems into AAS objects. To achieve this, -the abstract :class:`~aas.backend.backends.Backend` class implements the classmethods -:meth:`~aas.backend.backends.Backend.update_object` and :meth:`~aas.backend.backends.Backend.commit_object`, which every +the abstract :class:`~basyx.aas.backend.backends.Backend` class implements the classmethods +:meth:`~basyx.aas.backend.backends.Backend.update_object` and :meth:`~basyx.aas.backend.backends.Backend.commit_object`, which every implementation of a backend needs to overwrite. For a tutorial on how to implement a backend, see :ref:`this tutorial ` """ diff --git a/basyx/aas/backend/backends.py b/basyx/aas/backend/backends.py index e1bac1dca..4e94f7600 100644 --- a/basyx/aas/backend/backends.py +++ b/basyx/aas/backend/backends.py @@ -9,13 +9,13 @@ synchronize Referable AAS objects or their included data with external data sources such as a remote API or a local source for real time data. Each backend provides access to one kind of data source. -The data source of an individual object is specified as an URI in its :attr:`~aas.model.base.Referable.source` +The data source of an individual object is specified as an URI in its :attr:`~basyx.aas.model.base.Referable.source` attribute. The schema part of that URI defines the type of data source and, in consequence, the backend class to use for synchronizing this object. Custom backends for additional types of data sources can be implemented by subclassing the `Backend` class and implementing the :meth:`~.Backend.commit_object` and :meth:`~.Backend.update_object` class methods. These are used -internally by the objects' :meth:`~aas.model.base.Referable.update` and :meth:`~aas.model.base.Referable.commit` +internally by the objects' :meth:`~basyx.aas.model.base.Referable.update` and :meth:`~basyx.aas.model.base.Referable.commit` methods when the backend is applicable for the relevant source URI. Then, the Backend class needs to be registered to handle update/commit requests for a specific URI schema, using :meth:`~aas.backend.backends.register_backend`. @@ -35,7 +35,7 @@ class Backend(metaclass=abc.ABCMeta): Each Backend class is typically capable of synchronizing (updating/committing) objects with a type of external data source, identified by one or more source URI schemas. Custom backends for custom source URI schemas should inherit from this class and be registered via :meth:`~aas.backend.backends.register_backend`. to be used by Referable - object's :meth:`~aas.model.base.Referable.update` and :meth:`~aas.model.base.Referable.commit` methods when + object's :meth:`~basyx.aas.model.base.Referable.update` and :meth:`~basyx.aas.model.base.Referable.commit` methods when required. """ @@ -49,7 +49,7 @@ def commit_object(cls, Function (class method) to be called when an object shall be committed (local changes pushed to the external data source) via this backend implementation. - It is automatically called by the :meth:`~aas.model.base.Referable.commit` implementation, when the source + It is automatically called by the :meth:`~basyx.aas.model.base.Referable.commit` implementation, when the source URI of the object or the source URI one of its ancestors in the AAS object containment hierarchy include an URI schema for which this backend has been registered. Both of the objects are passed to this function: the one which shall be committed @@ -86,7 +86,7 @@ def update_object(cls, Function (class method) to be called when an object shall be updated (local object updated with changes from the external data source) via this backend implementation. - It is automatically called by the :meth:`~aas.model.base.Referable.update` implementation, when the source URI + It is automatically called by the :meth:`~basyx.aas.model.base.Referable.update` implementation, when the source URI of the object or the source URI one of its ancestors in the AAS object containment hierarchy include an URI schema for which this backend has been registered. Both of the objects are passed to this function: the one which shall be update diff --git a/basyx/aas/backend/couchdb.py b/basyx/aas/backend/couchdb.py index ec7caec1b..2495451a0 100644 --- a/basyx/aas/backend/couchdb.py +++ b/basyx/aas/backend/couchdb.py @@ -5,7 +5,7 @@ # # SPDX-License-Identifier: MIT """ -This module adds the functionality of storing and retrieving :class:`~aas.model.base.Identifiable` objects in a CouchDB. +This module adds the functionality of storing and retrieving :class:`~basyx.aas.model.base.Identifiable` objects in a CouchDB. The :class:`~.CouchDBBackend` takes care of updating and committing objects from and to the CouchDB, while the :class:`~CouchDBObjectStore` handles adding, deleting and otherwise managing the AAS objects in a specific CouchDB. @@ -181,7 +181,7 @@ def register_credentials(url: str, username: str, password: str): .. Warning:: Do not use this function, while other threads may be accessing the credentials via the - :class:`~.CouchDBObjectStore` or update or commit functions of :class:`~.aas.model.base.Referable` objects! + :class:`~.CouchDBObjectStore` or update or commit functions of :class:`~.basyx.aas.model.base.Referable` objects! :param url: Toplevel URL :param username: Username to that CouchDB instance @@ -230,7 +230,7 @@ def delete_couchdb_revision(url: str): class CouchDBObjectStore(model.AbstractObjectStore): """ - An ObjectStore implementation for :class:`~aas.model.base.Identifiable` BaSyx Python SDK objects backed by a CouchDB + An ObjectStore implementation for :class:`~basyx.aas.model.base.Identifiable` BaSyx Python SDK objects backed by a CouchDB database server. All methods of the `CouchDBObjectStore` are blocking, i.e. they stop the current thread's execution until they @@ -322,7 +322,7 @@ def get_identifiable_by_couchdb_id(self, couchdb_id: str) -> model.Identifiable: def get_identifiable(self, identifier: model.Identifier) -> model.Identifiable: """ - Retrieve an AAS object from the CouchDB by its :class:`~aas.model.base.Identifier` + Retrieve an AAS object from the CouchDB by its :class:`~basyx.aas.model.base.Identifier` :raises KeyError: If no such object is stored in the database :raises CouchDBError: If error occur during the request to the CouchDB server (see `_do_request()` for details) @@ -363,7 +363,7 @@ def add(self, x: model.Identifiable) -> None: def discard(self, x: model.Identifiable, safe_delete=False) -> None: """ - Delete an :class:`~aas.model.base.Identifiable` AAS object from the CouchDB database + Delete an :class:`~basyx.aas.model.base.Identifiable` AAS object from the CouchDB database :param x: The object to be deleted :param safe_delete: If `True`, only delete the object if it has not been modified in the database in comparison @@ -417,10 +417,10 @@ def discard(self, x: model.Identifiable, safe_delete=False) -> None: def __contains__(self, x: object) -> bool: """ - Check if an object with the given :class:`~aas.model.base.Identifier` or the same - :class:`~aas.model.base.Identifier` as the given object is contained in the CouchDB database + Check if an object with the given :class:`~basyx.aas.model.base.Identifier` or the same + :class:`~basyx.aas.model.base.Identifier` as the given object is contained in the CouchDB database - :param x: AAS object :class:`~aas.model.base.Identifier` or :class:`~aas.model.base.Identifiable` AAS object + :param x: AAS object :class:`~basyx.aas.model.base.Identifier` or :class:`~basyx.aas.model.base.Identifiable` AAS object :return: `True` if such an object exists in the database, `False` otherwise :raises CouchDBError: If error occur during the request to the CouchDB server (see `_do_request()` for details) """ @@ -454,7 +454,7 @@ def __len__(self) -> int: def __iter__(self) -> Iterator[model.Identifiable]: """ - Iterate all :class:`~aas.model.base.Identifiable` objects in the CouchDB database. + Iterate all :class:`~basyx.aas.model.base.Identifiable` objects in the CouchDB database. This method returns a lazy iterator, containing only a list of all identifiers in the database and retrieving the identifiable objects on the fly. @@ -490,7 +490,7 @@ def _transform_id(identifier: model.Identifier, url_quote=True) -> str: def generate_source(self, identifiable: model.Identifiable): """ - Generates the source string for an :class:`~aas.model.base.Identifiable` object that is backed by the Couchdb + Generates the source string for an :class:`~basyx.aas.model.base.Identifiable` object that is backed by the Couchdb :param identifiable: Identifiable object """ diff --git a/basyx/aas/backend/local_file.py b/basyx/aas/backend/local_file.py index c521fa32e..5f6b0b350 100644 --- a/basyx/aas/backend/local_file.py +++ b/basyx/aas/backend/local_file.py @@ -5,7 +5,7 @@ # # SPDX-License-Identifier: MIT """ -This module adds the functionality of storing and retrieving :class:`~aas.model.base.Identifiable` objects in local +This module adds the functionality of storing and retrieving :class:`~basyx.aas.model.base.Identifiable` objects in local files. The :class:`~.LocalFileBackend` takes care of updating and committing objects from and to the files, while the @@ -68,7 +68,7 @@ def commit_object(cls, class LocalFileObjectStore(model.AbstractObjectStore): """ - An ObjectStore implementation for :class:`~aas.model.base.Identifiable` BaSyx Python SDK objects backed by a local + An ObjectStore implementation for :class:`~basyx.aas.model.base.Identifiable` BaSyx Python SDK objects backed by a local file based local backend """ def __init__(self, directory_path: str): @@ -131,7 +131,7 @@ def get_identifiable_by_hash(self, hash_: str) -> model.Identifiable: def get_identifiable(self, identifier: model.Identifier) -> model.Identifiable: """ - Retrieve an AAS object from the local file by its :class:`~aas.model.base.Identifier` + Retrieve an AAS object from the local file by its :class:`~basyx.aas.model.base.Identifier` :raises KeyError: If the respective file could not be found """ @@ -157,7 +157,7 @@ def add(self, x: model.Identifiable) -> None: def discard(self, x: model.Identifiable) -> None: """ - Delete an :class:`~aas.model.base.Identifiable` AAS object from the local file store + Delete an :class:`~basyx.aas.model.base.Identifiable` AAS object from the local file store :param x: The object to be deleted :raises KeyError: If the object does not exist in the database @@ -173,10 +173,10 @@ def discard(self, x: model.Identifiable) -> None: def __contains__(self, x: object) -> bool: """ - Check if an object with the given :class:`~aas.model.base.Identifier` or the same - :class:`~aas.model.base.Identifier` as the given object is contained in the local file database + Check if an object with the given :class:`~basyx.aas.model.base.Identifier` or the same + :class:`~basyx.aas.model.base.Identifier` as the given object is contained in the local file database - :param x: AAS object :class:`~aas.model.base.Identifier` or :class:`~aas.model.base.Identifiable` AAS object + :param x: AAS object :class:`~basyx.aas.model.base.Identifier` or :class:`~basyx.aas.model.base.Identifiable` AAS object :return: `True` if such an object exists in the database, `False` otherwise """ if isinstance(x, model.Identifier): @@ -199,7 +199,7 @@ def __len__(self) -> int: def __iter__(self) -> Iterator[model.Identifiable]: """ - Iterate all :class:`~aas.model.base.Identifiable` objects in the CouchDB database. + Iterate all :class:`~basyx.aas.model.base.Identifiable` objects in the CouchDB database. This method returns an iterator, containing only a list of all identifiers in the database and retrieving the identifiable objects on the fly. @@ -217,7 +217,7 @@ def _transform_id(identifier: model.Identifier) -> str: def generate_source(self, identifiable: model.Identifiable) -> str: """ - Generates the source string for an :class:`~aas.model.base.Identifiable` object that is backed by the File + Generates the source string for an :class:`~basyx.aas.model.base.Identifiable` object that is backed by the File :param identifiable: Identifiable object """ diff --git a/basyx/aas/compliance_tool/compliance_check_json.py b/basyx/aas/compliance_tool/compliance_check_json.py index f83b8c773..53b37f14a 100644 --- a/basyx/aas/compliance_tool/compliance_check_json.py +++ b/basyx/aas/compliance_tool/compliance_check_json.py @@ -118,7 +118,7 @@ def check_deserialization(file_path: str, state_manager: ComplianceToolStateMana :param file_path: Given file which should be deserialized :param state_manager: :class:`~aas.compliance_tool.state_manager.ComplianceToolStateManager` to log the steps :param file_info: Additional information about the file for name of the steps - :return: The deserialized :class:`~aas.model.provider.DictObjectStore` + :return: The deserialized :class:`~basyx.aas.model.provider.DictObjectStore` """ logger = logging.getLogger('compliance_check') logger.addHandler(state_manager) diff --git a/basyx/aas/examples/data/example_aas.py b/basyx/aas/examples/data/example_aas.py index 925b4508f..a04df563d 100644 --- a/basyx/aas/examples/data/example_aas.py +++ b/basyx/aas/examples/data/example_aas.py @@ -5,7 +5,7 @@ # # SPDX-License-Identifier: MIT """ -Module for the creation of an :class:`ObjectStore ` with an example asset +Module for the creation of an :class:`ObjectStore ` with an example asset administration shell and example submodels and an example concept description To get this object store use the function :meth:`~aas.examples.data.example_aas.create_full_example`. @@ -49,11 +49,11 @@ def create_full_example() -> model.DictObjectStore: """ - Creates an object store which is filled with an example :class:`~aas.model.submodel.Submodel`, - :class:`~aas.model.concept.ConceptDescription` and :class:`~aas.model.aas.AssetAdministrationShell` + Creates an object store which is filled with an example :class:`~basyx.aas.model.submodel.SubmodelElement`, + :class:`~basyx.aas.model.concept.ConceptDescription` and :class:`~basyx.aas.model.aas.AssetAdministrationShell` using the functions of this module - :return: :class:`~aas.model.provider.DictObjectStore` + :return: :class:`~basyx.aas.model.provider.DictObjectStore` """ obj_store: model.DictObjectStore[model.Identifiable] = model.DictObjectStore() obj_store.add(create_example_asset_identification_submodel()) @@ -66,7 +66,7 @@ def create_full_example() -> model.DictObjectStore: def create_example_asset_identification_submodel() -> model.Submodel: """ - Creates a :class:`~aas.model.submodel.Submodel` containing two :class:`~aas.model.submodel.Property` elements + Creates a :class:`~basyx.aas.model.submodel.SubmodelElement` 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:`~aas.model.submodel.Submodel` for the bill of material containing two entities one + creates a :class:`~basyx.aas.model.submodel.SubmodelElement` for the bill of material containing two entities one co-managed and one self-managed :return: example bill of material submodel @@ -329,8 +329,8 @@ def create_example_bill_of_material_submodel() -> model.Submodel: def create_example_submodel() -> model.Submodel: """ - Creates an example :class:`~aas.model.submodel.Submodel` containing all kind of - :class:`~aas.model.submodel.SubmodelElement` objects + Creates an example :class:`~basyx.aas.model.submodel.SubmodelElement` containing all kind of + :class:`~basyx.aas.model.submodel.SubmodelElement` objects :return: example submodel """ @@ -758,7 +758,7 @@ def create_example_submodel() -> model.Submodel: def create_example_concept_description() -> model.ConceptDescription: """ - Creates an example :class:`~aas.model.concept.ConceptDescription` + Creates an example :class:`~basyx.aas.model.concept.ConceptDescription` :return: example concept description """ @@ -791,10 +791,10 @@ def create_example_concept_description() -> model.ConceptDescription: def create_example_asset_administration_shell() -> \ model.AssetAdministrationShell: """ - Creates an :class:`~aas.model.aas.AssetAdministrationShell` with references to an example + Creates an :class:`~basyx.aas.model.aas.AssetAdministrationShell` with references to an example :class:`~aas.model.submodel.Submodel`. - :return: example :class:`~aas.model.aas.AssetAdministrationShell` + :return: example :class:`~basyx.aas.model.aas.AssetAdministrationShell` """ asset_information = model.AssetInformation( diff --git a/basyx/aas/examples/data/example_aas_mandatory_attributes.py b/basyx/aas/examples/data/example_aas_mandatory_attributes.py index aa83d3f93..b6f036b14 100644 --- a/basyx/aas/examples/data/example_aas_mandatory_attributes.py +++ b/basyx/aas/examples/data/example_aas_mandatory_attributes.py @@ -5,10 +5,10 @@ # # SPDX-License-Identifier: MIT """ -Module for the creation of an :class:`ObjectStore ` with an example -:class:`~aas.model.aas.AssetAdministrationShell` and example :class:`Submodels ` +Module for the creation of an :class:`ObjectStore ` with an example +:class:`~basyx.aas.model.aas.AssetAdministrationShell` and example :class:`Submodels ` and a :class:`~aas.model.concept.ConceptDictionary` containing an -example :class:`~aas.model.concept.ConceptDescription`. All objects only contain mandatory +example :class:`~basyx.aas.model.concept.ConceptDescription`. All objects only contain mandatory attributes. To get this object store use the function @@ -25,11 +25,11 @@ def create_full_example() -> model.DictObjectStore: """ - Creates an :class:`~.aas.model.provider.DictObjectStore` which is filled with an example - :class:`~aas.model.submodel.Submodel`, :class:`~aas.model.concept.ConceptDescription` - and :class:`~aas.model.aas.AssetAdministrationShell` using the functions of this module + 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` + and :class:`~basyx.aas.model.aas.AssetAdministrationShell` using the functions of this module - :return: :class:`~aas.model.provider.DictObjectStore` + :return: :class:`~basyx.aas.model.provider.DictObjectStore` """ obj_store: model.DictObjectStore[model.Identifiable] = model.DictObjectStore() obj_store.add(create_example_submodel()) @@ -42,8 +42,8 @@ def create_full_example() -> model.DictObjectStore: def create_example_submodel() -> model.Submodel: """ - Creates an example :class:`~aas.model.submodel.Submodel` containing all kind of - :class:`~aas.model.submodel.SubmodelElement` objects where only mandatory attributes are set + Creates an example :class:`~basyx.aas.model.submodel.SubmodelElement` 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:`~aas.model.submodel.Submodel` where only the id attribute is set + Creates an example empty :class:`~basyx.aas.model.submodel.SubmodelElement` where only the id attribute is set :return: example submodel """ @@ -160,7 +160,7 @@ def create_example_empty_submodel() -> model.Submodel: def create_example_concept_description() -> model.ConceptDescription: """ - Creates an example :class:`~aas.model.concept.ConceptDescription` where only the id attribute is set + Creates an example :class:`~basyx.aas.model.concept.ConceptDescription` where only the id attribute is set :return: example concept description """ @@ -172,8 +172,8 @@ def create_example_concept_description() -> model.ConceptDescription: def create_example_asset_administration_shell() -> \ model.AssetAdministrationShell: """ - Creates an example :class:`~aas.model.aas.AssetAdministrationShell` containing references to the example, - the example :class:`~Submodels `. + Creates an example :class:`~basyx.aas.model.aas.AssetAdministrationShell` containing references to the example, + the example :class:`~Submodels `. :return: example asset administration shell """ @@ -195,8 +195,8 @@ def create_example_asset_administration_shell() -> \ def create_example_empty_asset_administration_shell() -> model.AssetAdministrationShell: """ - Creates an example empty :class:`~aas.model.aas.AssetAdministrationShell` with just - an empty :class:`~aas.model.aas.AssetInformation` and an :class:`~aas.model.base.Identifier` + Creates an example empty :class:`~basyx.aas.model.aas.AssetAdministrationShell` with just + an empty :class:`~aas.model.aas.AssetInformation` and an :class:`~basyx.aas.model.base.Identifier` :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 cb296c764..5d5e36766 100644 --- a/basyx/aas/examples/data/example_aas_missing_attributes.py +++ b/basyx/aas/examples/data/example_aas_missing_attributes.py @@ -5,7 +5,7 @@ # # SPDX-License-Identifier: MIT """ -Module for the creation of an :class:`ObjectStore ` with missing object attribute +Module for the creation of an :class:`ObjectStore ` with missing object attribute combination for testing the serialization """ import datetime @@ -19,11 +19,11 @@ def create_full_example() -> model.DictObjectStore: """ - Creates an :class:`~aas.model.provider.DictObjectStore` containing an example :class:`~aas.model.submodel.Submodel`, - an example :class:`~aas.model.concept.ConceptDescription` and an example - :class:`~aas.model.aas.AssetAdministrationShell` + Creates an :class:`~basyx.aas.model.provider.DictObjectStore` containing an example :class:`~basyx.aas.model.submodel.SubmodelElement`, + an example :class:`~basyx.aas.model.concept.ConceptDescription` and an example + :class:`~basyx.aas.model.aas.AssetAdministrationShell` - :return: :class:`aas.model.provider.DictObjectStore` + :return: :class:`basyx.aas.model.provider.DictObjectStore` """ obj_store: model.DictObjectStore[model.Identifiable] = model.DictObjectStore() obj_store.add(create_example_submodel()) @@ -34,8 +34,8 @@ def create_full_example() -> model.DictObjectStore: def create_example_submodel() -> model.Submodel: """ - Creates an example :class:`~aas.model.submodel.Submodel` containing all kind of - :class:`~aas.model.submodel.SubmodelElement` objects + Creates an example :class:`~basyx.aas.model.submodel.SubmodelElement` containing all kind of + :class:`~basyx.aas.model.submodel.SubmodelElement` objects :return: example submodel """ @@ -339,7 +339,7 @@ def create_example_submodel() -> model.Submodel: def create_example_concept_description() -> model.ConceptDescription: """ - Creates an example :class:`~aas.model.concept.ConceptDescription` + Creates an example :class:`~basyx.aas.model.concept.ConceptDescription` :return: example concept description """ @@ -358,8 +358,8 @@ def create_example_concept_description() -> model.ConceptDescription: def create_example_asset_administration_shell() -> model.AssetAdministrationShell: """ - Creates an example :class:`~aas.model.aas.AssetAdministrationShell` containing a reference to an example - :class:`~aas.model.submodel.Submodel` + Creates an example :class:`~basyx.aas.model.aas.AssetAdministrationShell` containing a reference to an example + :class:`~basyx.aas.model.submodel.SubmodelElement` :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 ad930f794..8d4eeda8d 100644 --- a/basyx/aas/examples/data/example_submodel_template.py +++ b/basyx/aas/examples/data/example_submodel_template.py @@ -5,8 +5,8 @@ # # SPDX-License-Identifier: MIT """ -Module for the creation of an example :class:`~aas.model.submodel.Submodel` template containing all kind of -:class:`SubmodelElements ` where the kind is +Module for the creation of an example :class:`~basyx.aas.model.submodel.SubmodelElement` template containing all kind of +:class:`SubmodelElements ` where the kind is always `TEMPLATE`. """ import datetime @@ -20,8 +20,8 @@ def create_example_submodel_template() -> model.Submodel: """ - Creates an example :class:`~aas.model.submodel.Submodel` template containing all kind of - :class:`~aas.model.submodel.SubmodelElement` objects where the kind is always + Creates an example :class:`~basyx.aas.model.submodel.SubmodelElement` template containing all kind of + :class:`~basyx.aas.model.submodel.SubmodelElement` objects where the kind is always `TEMPLATE` :return: example submodel diff --git a/basyx/aas/model/__init__.py b/basyx/aas/model/__init__.py index 0e7cad672..db91d8802 100644 --- a/basyx/aas/model/__init__.py +++ b/basyx/aas/model/__init__.py @@ -17,13 +17,13 @@ higher level structures. concept.py - :class:`~aas.model.concept.ConceptDescription` from the AAS meta model - as well as specialized :class:`ConceptDescriptions ` like + :class:`~basyx.aas.model.concept.ConceptDescription` from the AAS meta model + as well as specialized :class:`ConceptDescriptions ` like :class:`~aas.model.concept.IEC61360ConceptDescription` provider.py - Providers for AAS objects, in order to store and retrieve :class:`~aas.model.base.Identifiable` objects by their - :class:`~aas.model.base.Identifier`. + Providers for AAS objects, in order to store and retrieve :class:`~basyx.aas.model.base.Identifiable` objects by their + :class:`~basyx.aas.model.base.Identifier`. submodel.py Meta-model of the submodels and events. diff --git a/basyx/aas/model/aas.py b/basyx/aas/model/aas.py index 9edf891ea..3075e2af4 100644 --- a/basyx/aas/model/aas.py +++ b/basyx/aas/model/aas.py @@ -31,16 +31,16 @@ class AssetInformation: *Constraint AASd-131*: The globalAssetId or at least one specificAssetId shall be defined for AssetInformation. - :ivar asset_kind: Denotes whether the Asset is of :class:`~aas.model.base.AssetKind` "TYPE" or "INSTANCE". + :ivar asset_kind: Denotes whether the Asset is of :class:`~basyx.aas.model.base.AssetKind` "TYPE" or "INSTANCE". Default is "INSTANCE". - :ivar global_asset_id: :class:`~aas.model.base.Identifier` modelling the identifier of the asset the AAS is + :ivar global_asset_id: :class:`~basyx.aas.model.base.Identifier` modelling the identifier of the asset the AAS is representing. This attribute is required as soon as the AAS is exchanged via partners in the life cycle of the asset. In a first phase of the life cycle the asset might not yet have a global id but already an internal identifier. The internal identifier would be modelled via :attr:`~.specificAssetId`. :ivar specific_asset_id: Additional domain specific, typically proprietary Identifier (Set of - :class:`SpecificAssetIds ` for the asset like + :class:`SpecificAssetIds ` for the asset like e.g. serial number etc. :ivar asset_type: In case AssetInformation/assetKind is applicable the AssetInformation/assetType is the asset ID of the type asset of the asset under consideration as identified by @@ -125,26 +125,26 @@ class AssetAdministrationShell(base.Identifiable, base.UniqueIdShortNamespace, b An Asset Administration Shell :ivar asset_information: :class:`~.AssetInformation` of the asset this AssetAdministrationShell is representing - :ivar ~.id: The globally unique id (:class:`~aas.model.base.Identifier`) of the element. - (inherited from :class:`~aas.model.base.Identifiable`) + :ivar ~.id: The globally unique id (:class:`~basyx.aas.model.base.Identifier`) of the element. + (inherited from :class:`~basyx.aas.model.base.Identifiable`) :ivar id_short: Identifying string of the element within its name space. (inherited from - :class:`~aas.model.base.Referable`) - :ivar display_name: Can be provided in several languages. (inherited from :class:`~aas.model.base.Referable`) + :class:`~basyx.aas.model.base.Referable`) + :ivar display_name: Can be provided in several languages. (inherited from :class:`~basyx.aas.model.base.Referable`) :ivar category: The category is a value that gives further meta information w.r.t. to the class of the element. It affects the expected existence of attributes and the applicability of constraints. - (inherited from :class:`~aas.model.base.Referable`) - :ivar description: Description or comments on the element. (inherited from :class:`~aas.model.base.Referable`) + (inherited from :class:`~basyx.aas.model.base.Referable`) + :ivar description: Description or comments on the element. (inherited from :class:`~basyx.aas.model.base.Referable`) :ivar parent: Reference to the next referable parent element of the element. (inherited from - :class:`~aas.model.base.Referable`) - :ivar administration: :class:`~aas.model.base.AdministrativeInformation` of an - :class:`~.aas.model.base.Identifiable` element. (inherited from - :class:`~aas.model.base.Identifiable`) - :ivar ~.submodel: Unordered list of :class:`submodels ` to describe typically the asset + :class:`~basyx.aas.model.base.Referable`) + :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 of an AAS. (Initialization-parameter: `submodel_`) - :ivar derived_from: The :class:`reference ` to the AAS the AAs was derived from + :ivar derived_from: The :class:`reference ` to the AAS the AAs was derived from :ivar embedded_data_specifications: List of Embedded data specification. :ivar extension: An extension of the element. - (from :class:`~aas.model.base.HasExtensions`) + (from :class:`~basyx.aas.model.base.HasExtensions`) """ def __init__(self, asset_information: AssetInformation, diff --git a/basyx/aas/model/base.py b/basyx/aas/model/base.py index dc3079625..af12183ed 100644 --- a/basyx/aas/model/base.py +++ b/basyx/aas/model/base.py @@ -51,37 +51,37 @@ class KeyTypes(Enum): **IdentifiableElements starting from 0** - :cvar ASSET_ADMINISTRATION_SHELL: :class:`~aas.model.aas.AssetAdministrationShell` - :cvar CONCEPT_DESCRIPTION: :class:`~aas.model.concept.ConceptDescription` - :cvar SUBMODEL: :class:`~aas.model.submodel.Submodel` + :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` **ReferableElements starting from 1000** *Note:* DataElement is abstract, i. e. if a key uses :attr:`~.KeyTypes.DATA_ELEMENT` the reference may be - :class:`~aas.model.submodel.Property`, :class:`~aas.model.submodel.File` etc. + :class:`~basyx.aas.model.submodel.Property`, :class:`~basyx.aas.model.submodel.File` etc. *Note:* SubmodelElement is abstract, i.e. if a key uses :attr:`~.KeyTypes.SUBMODEL_ELEMENT` - the reference may be a :class:`~aas.model.submodel.Property`, a - :class:`~aas.model.submodel.SubmodelElementCollection`, an :class:`~aas.model.submodel.Operation` etc. - - :cvar ANNOTATED_RELATIONSHIP_ELEMENT: :class:`~aas.model.submodel.AnnotatedRelationshipElement` - :cvar BASIC_EVENT_ELEMENT: :class:`~aas.model.submodel.BasicEventElement` - :cvar BLOB: :class:`~aas.model.submodel.Blob` - :cvar CAPABILITY: :class:`~aas.model.submodel.Capability` - :cvar DATA_ELEMENT: :class:`~aas.model.submodel.DataElement` - :cvar ENTITY: :class:`~aas.model.submodel.Entity` - :cvar EVENT_ELEMENT: :class:`~aas.model.submodel.EventElement`, Note: EventElement is abstract - :cvar FILE: :class:`~aas.model.submodel.File` - :cvar MULTI_LANGUAGE_PROPERTY: :class:`~aas.model.submodel.MultiLanguageProperty` property with a value that can be + the reference may be a :class:`~basyx.aas.model.submodel.Property`, a + :class:`~basyx.aas.model.submodel.SubmodelElementCollection`, an :class:`~basyx.aas.model.submodel.Operation` etc. + + :cvar ANNOTATED_RELATIONSHIP_ELEMENT: :class:`~basyx.aas.model.submodel.AnnotatedRelationshipElement` + :cvar BASIC_EVENT_ELEMENT: :class:`~basyx.aas.model.submodel.BasicEventElement` + :cvar BLOB: :class:`~basyx.aas.model.submodel.Blob` + :cvar CAPABILITY: :class:`~basyx.aas.model.submodel.Capability` + :cvar DATA_ELEMENT: :class:`~basyx.aas.model.submodel.DataElement` + :cvar ENTITY: :class:`~basyx.aas.model.submodel.Entity` + :cvar EVENT_ELEMENT: :class:`~basyx.aas.model.submodel.EventElement`, Note: EventElement is abstract + :cvar FILE: :class:`~basyx.aas.model.submodel.File` + :cvar MULTI_LANGUAGE_PROPERTY: :class:`~basyx.aas.model.submodel.MultiLanguageProperty` property with a value that can be provided in multiple languages - :cvar OPERATION: :class:`~aas.model.submodel.Operation` - :cvar PROPERTY: :class:`~aas.model.submodel.Property` - :cvar RANGE: :class:`~aas.model.submodel.Range` with min and max - :cvar REFERENCE_ELEMENT: :class:`~aas.model.submodel.ReferenceElement` - :cvar RELATIONSHIP_ELEMENT: :class:`~aas.model.submodel.RelationshipElement` - :cvar SUBMODEL_ELEMENT: :class:`~aas.model.submodel.SubmodelElement` - :cvar SUBMODEL_ELEMENT_COLLECTION: :class:`~aas.model.submodel.SubmodelElementCollection` - :cvar SUBMODEL_ELEMENT_LIST: :class:`~aas.model.submodel.SubmodelElementList` + :cvar OPERATION: :class:`~basyx.aas.model.submodel.Operation` + :cvar PROPERTY: :class:`~basyx.aas.model.submodel.Property` + :cvar RANGE: :class:`~basyx.aas.model.submodel.Range` with min and max + :cvar REFERENCE_ELEMENT: :class:`~basyx.aas.model.submodel.ReferenceElement` + :cvar RELATIONSHIP_ELEMENT: :class:`~basyx.aas.model.submodel.RelationshipElement` + :cvar SUBMODEL_ELEMENT: :class:`~basyx.aas.model.submodel.SubmodelElement` + :cvar SUBMODEL_ELEMENT_COLLECTION: :class:`~basyx.aas.model.submodel.SubmodelElementCollection` + :cvar SUBMODEL_ELEMENT_LIST: :class:`~basyx.aas.model.submodel.SubmodelElementList` **KeyTypes starting from 2000** @@ -179,10 +179,10 @@ class EntityType(Enum): Enumeration for denoting whether an entity is a self-managed or a co-managed entity :cvar CO_MANAGED_ENTITY: For co-managed entities there is no separate - :class:`AAS `. Co-managed entities need to be part + :class:`AAS `. Co-managed entities need to be part of a self-managed entity :cvar SELF_MANAGED_ENTITY: Self-managed entities have their own - :class:`AAS `, but can be part of the bill of + :class:`AAS `, but can be part of the bill of material of a composite self-managed entity. """ @@ -249,7 +249,7 @@ class QualifierKind(Enum): @unique class Direction(Enum): """ - Direction of an event. Used in :class:`aas.model.submodel.BasicEventElement`. + Direction of an event. Used in :class:`basyx.aas.model.submodel.BasicEventElement`. """ INPUT = 0 @@ -259,7 +259,7 @@ class Direction(Enum): @unique class StateOfEvent(Enum): """ - State of an event. Used in :class:`aas.model.submodel.BasicEventElement`. + State of an event. Used in :class:`basyx.aas.model.submodel.BasicEventElement`. """ ON = 0 @@ -473,7 +473,7 @@ class Namespace(metaclass=abc.ABCMeta): <> - :ivar namespace_element_sets: List of :class:`NamespaceSets ` + :ivar namespace_element_sets: List of :class:`NamespaceSets ` """ @abc.abstractmethod def __init__(self) -> None: @@ -533,10 +533,10 @@ class HasExtension(Namespace, metaclass=abc.ABCMeta): TODO: This constraint is not yet implemented, a new Class for CustomSets should be implemented - :ivar namespace_element_sets: List of :class:`NamespaceSets ` + :ivar namespace_element_sets: List of :class:`NamespaceSets ` :ivar extension: A :class:`~.NamespaceSet` of :class:`Extensions <.Extension>` of the element. - :ivar _MEMBER_OBJ_TYPE: :class:`_NSO ` - :ivar _ATTRIBUTE_NAME: Specific attribute name `. + :ivar _MEMBER_OBJ_TYPE: :class:`_NSO ` + :ivar _ATTRIBUTE_NAME: Specific attribute name `. """ @abc.abstractmethod def __init__(self) -> None: @@ -836,7 +836,7 @@ def _direct_source_commit(self): class UnexpectedTypeError(TypeError): """ - Exception to be raised by :meth:`aas.model.base.ModelReference.resolve` if the retrieved object has not the expected + Exception to be raised by :meth:`basyx.aas.model.base.ModelReference.resolve` if the retrieved object has not the expected type. :ivar value: The object of unexpected type @@ -990,10 +990,10 @@ def resolve(self, provider_: "provider.AbstractObjectProvider") -> _RT: """ Follow the :class:`~.Reference` and retrieve the :class:`~.Referable` object it points to - :param provider_: :class:`~aas.model.provider.AbstractObjectProvider` + :param provider_: :class:`~basyx.aas.model.provider.AbstractObjectProvider` :return: The referenced object (or a proxy object for it) :raises IndexError: If the list of keys is empty - :raises TypeError: If one of the intermediate objects on the path is not a :class:`~aas.model.base.Namespace` + :raises TypeError: If one of the intermediate objects on the path is not a :class:`~basyx.aas.model.base.Namespace` :raises UnexpectedTypeError: If the retrieved object is not of the expected type (or one of its subclasses). The object is stored in the `value` attribute of the exception :raises KeyError: If the reference could not be resolved @@ -1072,9 +1072,9 @@ def from_referable(referable: Referable) -> "ModelReference": :class:`~.Identifiable` object. Additionally, the object must be an instance of a known :class:`~.Referable` type. - :param referable: :class:`~aas.model.base.Referable` object to construct the :class:`~.ModelReference` from + :param referable: :class:`~basyx.aas.model.base.Referable` object to construct the :class:`~.ModelReference` from :returns: Constructed :class:`~.ModelReference` - :raises ValueError: If no :class:`~aas.model.base.Identifiable` object is found while traversing the object's + :raises ValueError: If no :class:`~basyx.aas.model.base.Identifiable` object is found while traversing the object's ancestors """ # Get the first class from the base classes list (via inspect.getmro), that is contained in KEY_ELEMENTS_CLASSES @@ -1449,7 +1449,7 @@ class Extension(HasSemantics): :ivar semantic_id: The semantic_id defined in the :class:`~.HasSemantics` class. :ivar supplemental_semantic_id: Identifier of a supplemental semantic definition of the element. It is called supplemental semantic ID of the element. (inherited from - :class:`~aas.model.base.HasSemantics`) + :class:`~basyx.aas.model.base.HasSemantics`) """ def __init__(self, @@ -1589,7 +1589,7 @@ class Qualifier(HasSemantics): :ivar semantic_id: The semantic_id defined in :class:`~.HasSemantics`. :ivar supplemental_semantic_id: Identifier of a supplemental semantic definition of the element. It is called supplemental semantic ID of the element. (inherited from - :class:`~aas.model.base.HasSemantics`) + :class:`~basyx.aas.model.base.HasSemantics`) """ def __init__(self, @@ -2170,10 +2170,10 @@ class SpecificAssetId(HasSemantics): :ivar semantic_id: Identifier of the semantic definition of the element. It is called semantic id of the element. The semantic id may either reference an external global id or it may reference a referable model element of kind=Type that defines the semantics of the element. - (inherited from :class:`~aas.model.base.HasSemantics`) + (inherited from :class:`~basyx.aas.model.base.HasSemantics`) :ivar supplemental_semantic_id: Identifier of a supplemental semantic definition of the element. It is called supplemental semantic ID of the element. (inherited from - :class:`~aas.model.base.HasSemantics`) + :class:`~basyx.aas.model.base.HasSemantics`) """ def __init__(self, @@ -2314,7 +2314,7 @@ class DataSpecificationIEC61360(DataSpecificationContent): :ivar data_type: Data type of the data object :ivar definition: Definition of the data object :ivar parent: Reference to the next referable parent element of the element. - (inherited from :class:`~aas.model.base.Referable`) + (inherited from :class:`~basyx.aas.model.base.Referable`) :ivar unit: Optional unit of the data object :ivar unit_id: Optional reference to a unit id :ivar source_of_definition: Optional source of the definition diff --git a/basyx/aas/model/concept.py b/basyx/aas/model/concept.py index 89a8e9b83..8f1a20730 100644 --- a/basyx/aas/model/concept.py +++ b/basyx/aas/model/concept.py @@ -38,23 +38,23 @@ class ConceptDescription(base.Identifiable, base.HasDataSpecification): *Note:* Compare :attr:`~.ConceptDescription.is_case_of` to is-case-of relationship in ISO 13584-32 & IEC EN 61360 :ivar ~.id: The globally unique id of the element. (inherited from - :class:`~aas.model.base.Identifiable`) - :ivar is_case_of: Unordered list of global :class:`References ` to external definitions + :class:`~basyx.aas.model.base.Identifiable`) + :ivar is_case_of: Unordered list of global :class:`References ` to external definitions the concept is compatible to or was derived from. :ivar id_short: Identifying string of the element within its name space. (inherited from - :class:`~aas.model.base.Referable`) - :ivar display_name: Can be provided in several languages. (inherited from :class:`~aas.model.base.Referable`) + :class:`~basyx.aas.model.base.Referable`) + :ivar display_name: Can be provided in several languages. (inherited from :class:`~basyx.aas.model.base.Referable`) :ivar category: The category is a value that gives further meta information w.r.t. to the class of the element. It affects the expected existence of attributes and the applicability of constraints. - (inherited from :class:`~aas.model.base.Referable`) - :ivar description: Description or comments on the element. (inherited from :class:`~aas.model.base.Referable`) + (inherited from :class:`~basyx.aas.model.base.Referable`) + :ivar description: Description or comments on the element. (inherited from :class:`~basyx.aas.model.base.Referable`) :ivar parent: Reference to the next referable parent element of the element. (inherited from - :class:`~aas.model.base.Referable`) + :class:`~basyx.aas.model.base.Referable`) :ivar administration: Administrative information of an identifiable element. (inherited from - :class:`~aas.model.base.Identifiable`) + :class:`~basyx.aas.model.base.Identifiable`) :ivar embedded_data_specifications: List of Embedded data specification. :ivar extension: An extension of the element. (from - :class:`~aas.model.base.HasExtension`) + :class:`~basyx.aas.model.base.HasExtension`) """ def __init__(self, diff --git a/basyx/aas/model/datatypes.py b/basyx/aas/model/datatypes.py index 31f1ad657..aac5b1a6d 100644 --- a/basyx/aas/model/datatypes.py +++ b/basyx/aas/model/datatypes.py @@ -16,10 +16,10 @@ There are three conversion functions for usage in BaSyx Python SDK's model and adapters: * :meth:`~aas.model.datatypes.xsd_repr` serializes any XSD type from this module into it's lexical representation -* :meth:`~aas.model.datatypes.from_xsd` parses an XSD type from its lexical representation (its required to name the +* :meth:`~basyx.aas.model.datatypes.from_xsd` parses an XSD type from its lexical representation (its required to name the type for unambiguous conversion) -* :meth:`~aas.model.datatypes.trivial_cast` type-cast a python value into an XSD type, if this is trivially possible. - Meant for fixing the type of :class:`Properties' ` values automatically, esp. for literal +* :meth:`~basyx.aas.model.datatypes.trivial_cast` type-cast a python value into an XSD type, if this is trivially possible. + Meant for fixing the type of :class:`Properties' ` values automatically, esp. for literal values. """ import base64 @@ -398,16 +398,16 @@ def trivial_cast(value, type_: Type[AnyXSDType]) -> AnyXSDType: # workaround. W """ Type-cast a python value into an XSD type, if this is a trivial conversion - The main purpose of this function is to allow AAS :class:`Properties ` + The main purpose of this function is to allow AAS :class:`Properties ` (and similar objects with XSD-type values) to take Python literal values and convert them to their XSD type. However, we want to stay strongly typed, so we only allow this type-cast if it is trivial to do, i.e. does not change the value's semantics. Examples, where this holds true: - * int → :class:`aas.model.datatypes.Int` (if the value is in the expected range) - * bytes → :class:`aas.model.datatypes.Base64Binary` + * int → :class:`basyx.aas.model.datatypes.Int` (if the value is in the expected range) + * bytes → :class:`basyx.aas.model.datatypes.Base64Binary` * datetime.date → :class:`aas.model.datatypes.Date` - Yet, it is not allowed to cast float → :class:`aas.model.datatypes.Int`. + Yet, it is not allowed to cast float → :class:`basyx.aas.model.datatypes.Int`. :param value: The value to cast :param type_: Target type to cast into. Must be an XSD type from this module diff --git a/basyx/aas/model/provider.py b/basyx/aas/model/provider.py index 311618fea..9415c61cc 100644 --- a/basyx/aas/model/provider.py +++ b/basyx/aas/model/provider.py @@ -6,8 +6,8 @@ # SPDX-License-Identifier: MIT """ This module implements Registries for the AAS, in order to enable resolving global -:class:`Identifiers `; and mapping :class:`Identifiers ` to -:class:`~aas.model.base.Identifiable` objects. +:class:`Identifiers `; and mapping :class:`Identifiers ` to +:class:`~basyx.aas.model.base.Identifiable` objects. """ import abc @@ -18,36 +18,36 @@ class AbstractObjectProvider(metaclass=abc.ABCMeta): """ - Abstract baseclass for all objects, that allow to retrieve :class:`~aas.model.base.Identifiable` objects - (resp. proxy objects for remote :class:`~aas.model.base.Identifiable` objects) by their - :class:`~aas.model.base.Identifier`. + Abstract baseclass for all objects, that allow to retrieve :class:`~basyx.aas.model.base.Identifiable` objects + (resp. proxy objects for remote :class:`~basyx.aas.model.base.Identifiable` objects) by their + :class:`~basyx.aas.model.base.Identifier`. This includes local object stores, database clients and AAS API clients. """ @abc.abstractmethod def get_identifiable(self, identifier: Identifier) -> Identifiable: """ - Find an :class:`~aas.model.base.Identifiable` by its :class:`~aas.model.base.Identifier` + Find an :class:`~basyx.aas.model.base.Identifiable` by its :class:`~basyx.aas.model.base.Identifier` This may include looking up the object's endpoint in a registry and fetching it from an HTTP server or a database. - :param identifier: :class:`~aas.model.base.Identifier` of the object to return - :return: The :class:`~aas.model.base.Identifiable` object (or a proxy object for a remote - :class:`~aas.model.base.Identifiable` object) - :raises KeyError: If no such :class:`~.aas.model.base.Identifiable` can be found + :param identifier: :class:`~basyx.aas.model.base.Identifier` of the object to return + :return: The :class:`~basyx.aas.model.base.Identifiable` object (or a proxy object for a remote + :class:`~basyx.aas.model.base.Identifiable` object) + :raises KeyError: If no such :class:`~.basyx.aas.model.base.Identifiable` can be found """ pass def get(self, identifier: Identifier, default: Optional[Identifiable] = None) -> Optional[Identifiable]: """ - Find an object in this set by its :class:`id `, with fallback parameter + Find an object in this set by its :class:`id `, with fallback parameter - :param identifier: :class:`~aas.model.base.Identifier` of the object to return + :param identifier: :class:`~basyx.aas.model.base.Identifier` of the object to return :param default: An object to be returned, if no object with the given - :class:`id ` is found - :return: The :class:`~aas.model.base.Identifiable` object with the given - :class:`id ` in the provider. Otherwise the `default` object + :class:`id ` is found + :return: The :class:`~basyx.aas.model.base.Identifiable` object with the given + :class:`id ` in the provider. Otherwise the `default` object or None, if none is given. """ try: @@ -61,12 +61,12 @@ def get(self, identifier: Identifier, default: Optional[Identifiable] = None) -> class AbstractObjectStore(AbstractObjectProvider, MutableSet[_IT], Generic[_IT], metaclass=abc.ABCMeta): """ - Abstract baseclass of for container-like objects for storage of :class:`~aas.model.base.Identifiable` objects. + Abstract baseclass of for container-like objects for storage of :class:`~basyx.aas.model.base.Identifiable` objects. ObjectStores are special ObjectProvides that – in addition to retrieving objects by - :class:`~aas.model.base.Identifier` – allow to add and delete objects (i.e. behave like a Python set). + :class:`~basyx.aas.model.base.Identifier` – allow to add and delete objects (i.e. behave like a Python set). This includes local object stores (like :class:`~.DictObjectStore`) and database - :class:`Backends `. + :class:`Backends `. The AbstractObjectStore inherits from the `MutableSet` abstract collections class and therefore implements all the functions of this class. @@ -82,8 +82,8 @@ def update(self, other: Iterable[_IT]) -> None: class DictObjectStore(AbstractObjectStore[_IT], Generic[_IT]): """ - A local in-memory object store for :class:`~aas.model.base.Identifiable` objects, backed by a dict, mapping - :class:`~aas.model.base.Identifier` → :class:`~aas.model.base.Identifiable` + A local in-memory object store for :class:`~basyx.aas.model.base.Identifiable` objects, backed by a dict, mapping + :class:`~basyx.aas.model.base.Identifier` → :class:`~basyx.aas.model.base.Identifiable` """ def __init__(self, objects: Iterable[_IT] = ()) -> None: super().__init__() @@ -120,10 +120,10 @@ def __iter__(self) -> Iterator[_IT]: class ObjectProviderMultiplexer(AbstractObjectProvider): """ - A multiplexer for Providers of :class:`~aas.model.base.Identifiable` objects. + A multiplexer for Providers of :class:`~basyx.aas.model.base.Identifiable` objects. - This class combines multiple registries of :class:`~aas.model.base.Identifiable` objects into a single one to allow - retrieving :class:`~aas.model.base.Identifiable` objects from different sources. + This class combines multiple registries of :class:`~basyx.aas.model.base.Identifiable` objects into a single one to allow + retrieving :class:`~basyx.aas.model.base.Identifiable` objects from different sources. It implements the :class:`~.AbstractObjectProvider` interface to be used as registry itself. :ivar registries: A list of :class:`AbstractObjectProviders <.AbstractObjectProvider>` to query when looking up an diff --git a/basyx/aas/model/submodel.py b/basyx/aas/model/submodel.py index 4dc2e5297..656370735 100644 --- a/basyx/aas/model/submodel.py +++ b/basyx/aas/model/submodel.py @@ -29,25 +29,25 @@ class SubmodelElement(base.Referable, base.Qualifiable, base.HasSemantics, property-value pair in certain standards. :ivar id_short: Identifying string of the element within its name space. (inherited from - :class:`~aas.model.base.Referable`) - :ivar display_name: Can be provided in several languages. (inherited from :class:`~aas.model.base.Referable`) + :class:`~basyx.aas.model.base.Referable`) + :ivar display_name: Can be provided in several languages. (inherited from :class:`~basyx.aas.model.base.Referable`) :ivar category: The category is a value that gives further meta information w.r.t. to the class of the element. It affects the expected existence of attributes and the applicability of constraints. - (inherited from :class:`~aas.model.base.Referable`) - :ivar description: Description or comments on the element. (inherited from :class:`~aas.model.base.Referable`) + (inherited from :class:`~basyx.aas.model.base.Referable`) + :ivar description: Description or comments on the element. (inherited from :class:`~basyx.aas.model.base.Referable`) :ivar parent: Reference to the next referable parent element of the element. (inherited from - :class:`~aas.model.base.Referable`) + :class:`~basyx.aas.model.base.Referable`) :ivar semantic_id: Identifier of the semantic definition of the element. It is called semantic id of the element. The semantic id may either reference an external global id or it may reference a referable model element of kind=Type that defines the semantics of the element. - (inherited from :class:`~aas.model.base.HasSemantics`) + (inherited from :class:`~basyx.aas.model.base.HasSemantics`) :ivar qualifier: Unordered list of Qualifiers that gives additional qualification of a qualifiable element. - (from :class:`~aas.model.base.Qualifiable`) + (from :class:`~basyx.aas.model.base.Qualifiable`) :ivar extension: An extension of the element. (inherited from - :class:`aas.model.base.HasExtension`) + :class:`basyx.aas.model.base.HasExtension`) :ivar supplemental_semantic_id: Identifier of a supplemental semantic definition of the element. It is called supplemental semantic ID of the element. (inherited from - :class:`~aas.model.base.HasSemantics`) + :class:`~basyx.aas.model.base.HasSemantics`) :ivar embedded_data_specifications: List of Embedded data specification. """ @abc.abstractmethod @@ -90,32 +90,32 @@ class Submodel(base.Identifiable, base.HasSemantics, base.HasKind, base.Qualifia standardized and thus become submodel types. Submodels can have different life-cycles. :ivar ~.id: The globally unique id of the element. - (inherited from :class:`~aas.model.base.Identifiable`) + (inherited from :class:`~basyx.aas.model.base.Identifiable`) :ivar submodel_element: Unordered list of :class:`SubmodelElements <.SubmodelElement>` :ivar id_short: Identifying string of the element within its name space. (inherited from - :class:`~aas.model.base.Referable`) - :ivar display_name: Can be provided in several languages. (inherited from :class:`~aas.model.base.Referable`) + :class:`~basyx.aas.model.base.Referable`) + :ivar display_name: Can be provided in several languages. (inherited from :class:`~basyx.aas.model.base.Referable`) :ivar category: The category is a value that gives further meta information w.r.t. to the class of the element. It affects the expected existence of attributes and the applicability of constraints. - (inherited from :class:`~aas.model.base.Referable`) - :ivar description: Description or comments on the element. (inherited from :class:`~aas.model.base.Referable`) + (inherited from :class:`~basyx.aas.model.base.Referable`) + :ivar description: Description or comments on the element. (inherited from :class:`~basyx.aas.model.base.Referable`) :ivar parent: Reference to the next referable parent element of the element. (inherited from - :class:`~aas.model.base.Referable`) + :class:`~basyx.aas.model.base.Referable`) :ivar administration: Administrative information of an identifiable element. (inherited from - :class:`~aas.model.base.Identifiable`) + :class:`~basyx.aas.model.base.Identifiable`) :ivar semantic_id: Identifier of the semantic definition of the element. It is called semantic id of the element. The semantic id may either reference an external global id or it may reference a referable model element of kind=Type that defines the semantics of the element. - (inherited from :class:`~aas.model.base.HasSemantics`) + (inherited from :class:`~basyx.aas.model.base.HasSemantics`) :ivar qualifier: Unordered list of Qualifiers that gives additional qualification of a qualifiable element. - (from :class:`~aas.model.base.Qualifiable`) + (from :class:`~basyx.aas.model.base.Qualifiable`) :ivar kind: Kind of the element: Either `TYPE` or `INSTANCE`. Default is `INSTANCE`. (inherited from :class:`aas.model.base.HasKind`) :ivar extension: An extension of the element. (inherited from - :class:`aas.model.base.HasExtension`) + :class:`basyx.aas.model.base.HasExtension`) :ivar supplemental_semantic_id: Identifier of a supplemental semantic definition of the element. It is called supplemental semantic ID of the element. (inherited from - :class:`~aas.model.base.HasSemantics`) + :class:`~basyx.aas.model.base.HasSemantics`) :ivar embedded_data_specifications: List of Embedded data specification. """ @@ -169,25 +169,25 @@ class DataElement(SubmodelElement, metaclass=abc.ABCMeta): <> :ivar id_short: Identifying string of the element within its name space. (inherited from - :class:`~aas.model.base.Referable`) - :ivar display_name: Can be provided in several languages. (inherited from :class:`~aas.model.base.Referable`) + :class:`~basyx.aas.model.base.Referable`) + :ivar display_name: Can be provided in several languages. (inherited from :class:`~basyx.aas.model.base.Referable`) :ivar category: The category is a value that gives further meta information w.r.t. to the class of the element. It affects the expected existence of attributes and the applicability of constraints. - (inherited from :class:`~aas.model.base.Referable`) - :ivar description: Description or comments on the element. (inherited from :class:`~aas.model.base.Referable`) + (inherited from :class:`~basyx.aas.model.base.Referable`) + :ivar description: Description or comments on the element. (inherited from :class:`~basyx.aas.model.base.Referable`) :ivar parent: Reference to the next referable parent element of the element. (inherited from - :class:`~aas.model.base.Referable`) + :class:`~basyx.aas.model.base.Referable`) :ivar semantic_id: Identifier of the semantic definition of the element. It is called semantic id of the element. The semantic id may either reference an external global id or it may reference a referable model element of kind=Type that defines the semantics of the element. - (inherited from :class:`~aas.model.base.HasSemantics`) + (inherited from :class:`~basyx.aas.model.base.HasSemantics`) :ivar qualifier: Unordered list of Qualifiers that gives additional qualification of a qualifiable element. - (from :class:`~aas.model.base.Qualifiable`) + (from :class:`~basyx.aas.model.base.Qualifiable`) :ivar extension: An extension of the element. (inherited from - :class:`aas.model.base.HasExtension`) + :class:`basyx.aas.model.base.HasExtension`) :ivar supplemental_semantic_id: Identifier of a supplemental semantic definition of the element. It is called supplemental semantic ID of the element. (inherited from - :class:`~aas.model.base.HasSemantics`) + :class:`~basyx.aas.model.base.HasSemantics`) :ivar embedded_data_specifications: List of Embedded data specification. """ @abc.abstractmethod @@ -229,28 +229,28 @@ class Property(DataElement): the value needs to be identical to the value of the referenced coded value in Qualifier/valueId. :ivar id_short: Identifying string of the element within its name space. (inherited from - :class:`~aas.model.base.Referable`) + :class:`~basyx.aas.model.base.Referable`) :ivar value_type: Data type of the value :ivar value: The value of the property instance. - :ivar value_id: :class:`~aas.model.base.Reference` to the global unique id of a coded value - :ivar display_name: Can be provided in several languages. (inherited from :class:`~aas.model.base.Referable`) + :ivar value_id: :class:`~basyx.aas.model.base.Reference` to the global unique id of a coded value + :ivar display_name: Can be provided in several languages. (inherited from :class:`~basyx.aas.model.base.Referable`) :ivar category: The category is a value that gives further meta information w.r.t. to the class of the element. It affects the expected existence of attributes and the applicability of constraints. - (inherited from :class:`~aas.model.base.Referable`) - :ivar description: Description or comments on the element. (inherited from :class:`~aas.model.base.Referable`) + (inherited from :class:`~basyx.aas.model.base.Referable`) + :ivar description: Description or comments on the element. (inherited from :class:`~basyx.aas.model.base.Referable`) :ivar parent: Reference to the next referable parent element of the element. (inherited from - :class:`~aas.model.base.Referable`) + :class:`~basyx.aas.model.base.Referable`) :ivar semantic_id: Identifier of the semantic definition of the element. It is called semantic id of the element. The semantic id may either reference an external global id or it may reference a referable model element of kind=Type that defines the semantics of the element. - (inherited from :class:`~aas.model.base.HasSemantics`) + (inherited from :class:`~basyx.aas.model.base.HasSemantics`) :ivar qualifier: Unordered list of Qualifiers that gives additional qualification of a qualifiable element. - (from :class:`~aas.model.base.Qualifiable`) + (from :class:`~basyx.aas.model.base.Qualifiable`) :ivar extension: An extension of the element. (inherited from - :class:`aas.model.base.HasExtension`) + :class:`basyx.aas.model.base.HasExtension`) :ivar supplemental_semantic_id: Identifier of a supplemental semantic definition of the element. It is called supplemental semantic ID of the element. (inherited from - :class:`~aas.model.base.HasSemantics`) + :class:`~basyx.aas.model.base.HasSemantics`) :ivar embedded_data_specifications: List of Embedded data specification. """ @@ -300,27 +300,27 @@ class MultiLanguageProperty(DataElement): as specified inMultiLanguageProperty/valueId. :ivar id_short: Identifying string of the element within its name space. (inherited from - :class:`~aas.model.base.Referable`) + :class:`~basyx.aas.model.base.Referable`) :ivar value: The value of the property instance. - :ivar value_id: :class:`~aas.model.base.Reference` to the global unique id of a coded value - :ivar display_name: Can be provided in several languages. (inherited from :class:`~aas.model.base.Referable`) + :ivar value_id: :class:`~basyx.aas.model.base.Reference` to the global unique id of a coded value + :ivar display_name: Can be provided in several languages. (inherited from :class:`~basyx.aas.model.base.Referable`) :ivar category: The category is a value that gives further meta information w.r.t. to the class of the element. It affects the expected existence of attributes and the applicability of constraints. - (inherited from :class:`~aas.model.base.Referable`) - :ivar description: Description or comments on the element. (inherited from :class:`~aas.model.base.Referable`) + (inherited from :class:`~basyx.aas.model.base.Referable`) + :ivar description: Description or comments on the element. (inherited from :class:`~basyx.aas.model.base.Referable`) :ivar parent: Reference to the next referable parent element of the element. (inherited from - :class:`~aas.model.base.Referable`) + :class:`~basyx.aas.model.base.Referable`) :ivar semantic_id: Identifier of the semantic definition of the element. It is called semantic id of the element. The semantic id may either reference an external global id or it may reference a referable model element of kind=Type that defines the semantics of the element. - (inherited from :class:`~aas.model.base.HasSemantics`) + (inherited from :class:`~basyx.aas.model.base.HasSemantics`) :ivar qualifier: Unordered list of Qualifiers that gives additional qualification of a qualifiable element. - (from :class:`~aas.model.base.Qualifiable`) + (from :class:`~basyx.aas.model.base.Qualifiable`) :ivar extension: An extension of the element. (inherited from - :class:`aas.model.base.HasExtension`) + :class:`basyx.aas.model.base.HasExtension`) :ivar supplemental_semantic_id: Identifier of a supplemental semantic definition of the element. It is called supplemental semantic ID of the element. (inherited from - :class:`~aas.model.base.HasSemantics`) + :class:`~basyx.aas.model.base.HasSemantics`) :ivar embedded_data_specifications: List of Embedded data specification. """ @@ -355,29 +355,29 @@ class Range(DataElement): need to be defined :ivar id_short: Identifying string of the element within its name space. (inherited from - :class:`~aas.model.base.Referable`) + :class:`~basyx.aas.model.base.Referable`) :ivar value_type: Data type of the min and max :ivar min: The minimum value of the range. If the min value is missing then the value is assumed to be negative infinite :ivar max: The maximum of the range. If the max value is missing then the value is assumed to be positive infinite - :ivar display_name: Can be provided in several languages. (inherited from :class:`~aas.model.base.Referable`) + :ivar display_name: Can be provided in several languages. (inherited from :class:`~basyx.aas.model.base.Referable`) :ivar category: The category is a value that gives further meta information w.r.t. to the class of the element. It affects the expected existence of attributes and the applicability of constraints. - (inherited from :class:`~aas.model.base.Referable`) - :ivar description: Description or comments on the element. (inherited from :class:`~aas.model.base.Referable`) + (inherited from :class:`~basyx.aas.model.base.Referable`) + :ivar description: Description or comments on the element. (inherited from :class:`~basyx.aas.model.base.Referable`) :ivar parent: Reference to the next referable parent element of the element. (inherited from - :class:`~aas.model.base.Referable`) + :class:`~basyx.aas.model.base.Referable`) :ivar semantic_id: Identifier of the semantic definition of the element. It is called semantic id of the element. The semantic id may either reference an external global id or it may reference a referable model element of kind=Type that defines the semantics of the element. - (inherited from :class:`~aas.model.base.HasSemantics`) + (inherited from :class:`~basyx.aas.model.base.HasSemantics`) :ivar qualifier: Unordered list of Qualifiers that gives additional qualification of a qualifiable element. - (from :class:`~aas.model.base.Qualifiable`) + (from :class:`~basyx.aas.model.base.Qualifiable`) :ivar extension: An extension of the element. (inherited from - :class:`aas.model.base.HasExtension`) + :class:`basyx.aas.model.base.HasExtension`) :ivar supplemental_semantic_id: Identifier of a supplemental semantic definition of the element. It is called supplemental semantic ID of the element. (inherited from - :class:`~aas.model.base.HasSemantics`) + :class:`~basyx.aas.model.base.HasSemantics`) :ivar embedded_data_specifications: List of Embedded data specification. """ @@ -437,29 +437,29 @@ class Blob(DataElement): *Note:* In contrast to the file property the file content is stored directly as value in the Blob data element. :ivar id_short: Identifying string of the element within its name space. (inherited from - :class:`~aas.model.base.Referable`) + :class:`~basyx.aas.model.base.Referable`) :ivar content_type: Mime type of the content of the BLOB. The mime type states which file extension the file has. Valid values are e.g. “application/json”, “application/xls”, ”image/jpg”. The allowed values are defined as in RFC2046. :ivar value: The value of the BLOB instance of a blob data element. - :ivar display_name: Can be provided in several languages. (inherited from :class:`~aas.model.base.Referable`) + :ivar display_name: Can be provided in several languages. (inherited from :class:`~basyx.aas.model.base.Referable`) :ivar category: The category is a value that gives further meta information w.r.t. to the class of the element. It affects the expected existence of attributes and the applicability of constraints. - (inherited from :class:`~aas.model.base.Referable`) - :ivar description: Description or comments on the element. (inherited from :class:`~aas.model.base.Referable`) + (inherited from :class:`~basyx.aas.model.base.Referable`) + :ivar description: Description or comments on the element. (inherited from :class:`~basyx.aas.model.base.Referable`) :ivar parent: Reference to the next referable parent element of the element. (inherited from - :class:`~aas.model.base.Referable`) + :class:`~basyx.aas.model.base.Referable`) :ivar semantic_id: Identifier of the semantic definition of the element. It is called semantic id of the element. The semantic id may either reference an external global id or it may reference a referable model element of kind=Type that defines the semantics of the element. - (inherited from :class:`~aas.model.base.HasSemantics`) + (inherited from :class:`~basyx.aas.model.base.HasSemantics`) :ivar qualifier: Unordered list of Qualifiers that gives additional qualification of a qualifiable element. - (from :class:`~aas.model.base.Qualifiable`) + (from :class:`~basyx.aas.model.base.Qualifiable`) :ivar extension: An extension of the element. (inherited from - :class:`aas.model.base.HasExtension`) + :class:`basyx.aas.model.base.HasExtension`) :ivar supplemental_semantic_id: Identifier of a supplemental semantic definition of the element. It is called supplemental semantic ID of the element. (inherited from - :class:`~aas.model.base.HasSemantics`) + :class:`~basyx.aas.model.base.HasSemantics`) :ivar embedded_data_specifications: List of Embedded data specification. """ @@ -493,27 +493,27 @@ class File(DataElement): A File is a :class:`~.DataElement` that represents a file via its path description. :ivar id_short: Identifying string of the element within its name space. (inherited from - :class:`~aas.model.base.Referable`) + :class:`~basyx.aas.model.base.Referable`) :ivar content_type: Mime type of the content of the File. :ivar value: Path and name of the referenced file (with file extension). The path can be absolute or relative. - :ivar display_name: Can be provided in several languages. (inherited from :class:`~aas.model.base.Referable`) + :ivar display_name: Can be provided in several languages. (inherited from :class:`~basyx.aas.model.base.Referable`) :ivar category: The category is a value that gives further meta information w.r.t. to the class of the element. It affects the expected existence of attributes and the applicability of constraints. - (inherited from :class:`~aas.model.base.Referable`) - :ivar description: Description or comments on the element. (inherited from :class:`~aas.model.base.Referable`) + (inherited from :class:`~basyx.aas.model.base.Referable`) + :ivar description: Description or comments on the element. (inherited from :class:`~basyx.aas.model.base.Referable`) :ivar parent: Reference to the next referable parent element of the element. (inherited from - :class:`~aas.model.base.Referable`) + :class:`~basyx.aas.model.base.Referable`) :ivar semantic_id: Identifier of the semantic definition of the element. It is called semantic id of the element. The semantic id may either reference an external global id or it may reference a referable model element of kind=Type that defines the semantics of the element. - (inherited from :class:`~aas.model.base.HasSemantics`) + (inherited from :class:`~basyx.aas.model.base.HasSemantics`) :ivar qualifier: Unordered list of Qualifiers that gives additional qualification of a qualifiable element. - (from :class:`~aas.model.base.Qualifiable`) + (from :class:`~basyx.aas.model.base.Qualifiable`) :ivar extension: An extension of the element. (inherited from - :class:`aas.model.base.HasExtension`) + :class:`basyx.aas.model.base.HasExtension`) :ivar supplemental_semantic_id: Identifier of a supplemental semantic definition of the element. It is called supplemental semantic ID of the element. (inherited from - :class:`~aas.model.base.HasSemantics`) + :class:`~basyx.aas.model.base.HasSemantics`) :ivar embedded_data_specifications: List of Embedded data specification. """ @@ -542,31 +542,31 @@ def __init__(self, class ReferenceElement(DataElement): """ - A reference element is a :class:`DataElement` that defines a :class:`~aas.model.base.Reference` to another element - within the same or another AAS or a :class:`~aas.model.base.Reference` to an external object or entity. + A reference element is a :class:`DataElement` that defines a :class:`~basyx.aas.model.base.Reference` to another element + within the same or another AAS or a :class:`~basyx.aas.model.base.Reference` to an external object or entity. :ivar id_short: Identifying string of the element within its name space. (inherited from - :class:`~aas.model.base.Referable`) - :ivar value: :class:`~aas.model.base.Reference` to any other :class:`~aas.model.base.Referable` element of the same - or any other AAS or a :class:`~aas.model.base.Reference` to an external object or entity. - :ivar display_name: Can be provided in several languages. (inherited from :class:`~aas.model.base.Referable`) + :class:`~basyx.aas.model.base.Referable`) + :ivar value: :class:`~basyx.aas.model.base.Reference` to any other :class:`~basyx.aas.model.base.Referable` element of the same + or any other AAS or a :class:`~basyx.aas.model.base.Reference` to an external object or entity. + :ivar display_name: Can be provided in several languages. (inherited from :class:`~basyx.aas.model.base.Referable`) :ivar category: The category is a value that gives further meta information w.r.t. to the class of the element. It affects the expected existence of attributes and the applicability of constraints. - (inherited from :class:`~aas.model.base.Referable`) - :ivar description: Description or comments on the element. (inherited from :class:`~aas.model.base.Referable`) + (inherited from :class:`~basyx.aas.model.base.Referable`) + :ivar description: Description or comments on the element. (inherited from :class:`~basyx.aas.model.base.Referable`) :ivar parent: Reference to the next referable parent element of the element. (inherited from - :class:`~aas.model.base.Referable`) + :class:`~basyx.aas.model.base.Referable`) :ivar semantic_id: Identifier of the semantic definition of the element. It is called semantic id of the element. The semantic id may either reference an external global id or it may reference a referable model element of kind=Type that defines the semantics of the element. - (inherited from :class:`~aas.model.base.HasSemantics`) + (inherited from :class:`~basyx.aas.model.base.HasSemantics`) :ivar qualifier: Unordered list of Qualifiers that gives additional qualification of a qualifiable element. - (from :class:`~aas.model.base.Qualifiable`) + (from :class:`~basyx.aas.model.base.Qualifiable`) :ivar extension: An extension of the element. (inherited from - :class:`aas.model.base.HasExtension`) + :class:`basyx.aas.model.base.HasExtension`) :ivar supplemental_semantic_id: Identifier of a supplemental semantic definition of the element. It is called supplemental semantic ID of the element. (inherited from - :class:`~aas.model.base.HasSemantics`) + :class:`~basyx.aas.model.base.HasSemantics`) :ivar embedded_data_specifications: List of Embedded data specification. """ @@ -596,26 +596,26 @@ class SubmodelElementCollection(SubmodelElement, base.UniqueIdShortNamespace): A submodel element collection is a set or list of :class:`SubmodelElements <.SubmodelElement>`. :ivar id_short: Identifying string of the element within its name space. (inherited from - :class:`~aas.model.base.Referable`) + :class:`~basyx.aas.model.base.Referable`) :ivar value: list of :class:`SubmodelElements <.SubmodelElement>` - :ivar display_name: Can be provided in several languages. (inherited from :class:`~aas.model.base.Referable`) + :ivar display_name: Can be provided in several languages. (inherited from :class:`~basyx.aas.model.base.Referable`) :ivar category: The category is a value that gives further meta information w.r.t. to the class of the element. It affects the expected existence of attributes and the applicability of constraints. - (inherited from :class:`~aas.model.base.Referable`) - :ivar description: Description or comments on the element. (inherited from :class:`~aas.model.base.Referable`) + (inherited from :class:`~basyx.aas.model.base.Referable`) + :ivar description: Description or comments on the element. (inherited from :class:`~basyx.aas.model.base.Referable`) :ivar parent: Reference to the next referable parent element of the element. (inherited from - :class:`~aas.model.base.Referable`) + :class:`~basyx.aas.model.base.Referable`) :ivar semantic_id: Identifier of the semantic definition of the element. It is called semantic id of the element. The semantic id may either reference an external global id or it may reference a referable model element of kind=Type that defines the semantics of the element. - (inherited from :class:`~aas.model.base.HasSemantics`) + (inherited from :class:`~basyx.aas.model.base.HasSemantics`) :ivar qualifier: Unordered list of Qualifiers that gives additional qualification of a qualifiable element. - (from :class:`~aas.model.base.Qualifiable`) + (from :class:`~basyx.aas.model.base.Qualifiable`) :ivar extension: An extension of the element. (inherited from - :class:`aas.model.base.HasExtension`) + :class:`basyx.aas.model.base.HasExtension`) :ivar supplemental_semantic_id: Identifier of a supplemental semantic definition of the element. It is called supplemental semantic ID of the element. (inherited from - :class:`~aas.model.base.HasSemantics`) + :class:`~basyx.aas.model.base.HasSemantics`) :ivar embedded_data_specifications: List of Embedded data specification. """ def __init__(self, @@ -657,7 +657,7 @@ class SubmodelElementList(SubmodelElement, base.UniqueIdShortNamespace, Generic[ :class:`SubmodelElementList` shall have the value type as specified in SubmodelElementList/valueTypeListElement. :ivar id_short: Identifying string of the element within its name space. (inherited from - :class:`~aas.model.base.Referable`) + :class:`~basyx.aas.model.base.Referable`) :ivar type_value_list_element: The :class:`SubmodelElement` type of the submodel elements contained in the list. :ivar value: :class:`SubmodelElements <.SubmodelElement>` contained in the list. The list is ordered. :ivar semantic_id_list_element: Semantic ID of the :class:`SubmodelElements <.SubmodelElement>` contained in the @@ -665,24 +665,24 @@ class SubmodelElementList(SubmodelElement, base.UniqueIdShortNamespace, Generic[ :ivar value_type_list_element: The value type of the submodel element contained in the list. :ivar order_relevant: Defines whether order in list is relevant. If False the list is representing a set or a bag. Default: True - :ivar display_name: Can be provided in several languages. (inherited from :class:`~aas.model.base.Referable`) + :ivar display_name: Can be provided in several languages. (inherited from :class:`~basyx.aas.model.base.Referable`) :ivar category: The category is a value that gives further meta information w.r.t. to the class of the element. It affects the expected existence of attributes and the applicability of constraints. - (inherited from :class:`~aas.model.base.Referable`) - :ivar description: Description or comments on the element. (inherited from :class:`~aas.model.base.Referable`) + (inherited from :class:`~basyx.aas.model.base.Referable`) + :ivar description: Description or comments on the element. (inherited from :class:`~basyx.aas.model.base.Referable`) :ivar parent: Reference to the next referable parent element of the element. (inherited from - :class:`~aas.model.base.Referable`) + :class:`~basyx.aas.model.base.Referable`) :ivar semantic_id: Identifier of the semantic definition of the element. It is called semantic id of the element. The semantic id may either reference an external global id or it may reference a referable model element of kind=Type that defines the semantics of the element. - (inherited from :class:`~aas.model.base.HasSemantics`) + (inherited from :class:`~basyx.aas.model.base.HasSemantics`) :ivar qualifier: Unordered list of Qualifiers that gives additional qualification of a qualifiable element. - (from :class:`~aas.model.base.Qualifiable`) + (from :class:`~basyx.aas.model.base.Qualifiable`) :ivar extension: An extension of the element. (inherited from - :class:`aas.model.base.HasExtension`) + :class:`basyx.aas.model.base.HasExtension`) :ivar supplemental_semantic_id: Identifier of a supplemental semantic definition of the element. It is called supplemental semantic ID of the element. (inherited from - :class:`~aas.model.base.HasSemantics`) + :class:`~basyx.aas.model.base.HasSemantics`) :ivar embedded_data_specifications: List of Embedded data specification. """ def __init__(self, @@ -822,32 +822,32 @@ def value_type_list_element(self) -> Optional[base.DataTypeDefXsd]: class RelationshipElement(SubmodelElement): """ - A relationship element is used to define a relationship between two :class:`~aas.model.base.Referable` elements. + A relationship element is used to define a relationship between two :class:`~basyx.aas.model.base.Referable` elements. :ivar id_short: Identifying string of the element within its name space. (inherited from - :class:`~aas.model.base.Referable`) + :class:`~basyx.aas.model.base.Referable`) :ivar first: Reference to the first element in the relationship taking the role of the subject which have to be of class Referable. (inherited from :class:`~.RelationshipElement`) :ivar second: Reference to the second element in the relationship taking the role of the object which have to be of class Referable. (inherited from :class:`~.RelationshipElement`) - :ivar display_name: Can be provided in several languages. (inherited from :class:`~aas.model.base.Referable`) + :ivar display_name: Can be provided in several languages. (inherited from :class:`~basyx.aas.model.base.Referable`) :ivar category: The category is a value that gives further meta information w.r.t. to the class of the element. It affects the expected existence of attributes and the applicability of constraints. - (inherited from :class:`~aas.model.base.Referable`) - :ivar description: Description or comments on the element. (inherited from :class:`~aas.model.base.Referable`) + (inherited from :class:`~basyx.aas.model.base.Referable`) + :ivar description: Description or comments on the element. (inherited from :class:`~basyx.aas.model.base.Referable`) :ivar parent: Reference to the next referable parent element of the element. (inherited from - :class:`~aas.model.base.Referable`) + :class:`~basyx.aas.model.base.Referable`) :ivar semantic_id: Identifier of the semantic definition of the element. It is called semantic id of the element. The semantic id may either reference an external global id or it may reference a referable model element of kind=Type that defines the semantics of the element. - (inherited from :class:`~aas.model.base.HasSemantics`) + (inherited from :class:`~basyx.aas.model.base.HasSemantics`) :ivar qualifier: Unordered list of Qualifiers that gives additional qualification of a qualifiable element. - (from :class:`~aas.model.base.Qualifiable`) + (from :class:`~basyx.aas.model.base.Qualifiable`) :ivar extension: An extension of the element. (inherited from - :class:`aas.model.base.HasExtension`) + :class:`basyx.aas.model.base.HasExtension`) :ivar supplemental_semantic_id: Identifier of a supplemental semantic definition of the element. It is called supplemental semantic ID of the element. (inherited from - :class:`~aas.model.base.HasSemantics`) + :class:`~basyx.aas.model.base.HasSemantics`) :ivar embedded_data_specifications: List of Embedded data specification. """ @@ -880,31 +880,31 @@ class AnnotatedRelationshipElement(RelationshipElement, base.UniqueIdShortNamesp with additional :class:`DataElements <.DataElement>`. :ivar id_short: Identifying string of the element within its name space. (inherited from - :class:`~aas.model.base.Referable`) + :class:`~basyx.aas.model.base.Referable`) :ivar first: Reference to the first element in the relationship taking the role of the subject which have to be of class Referable. (inherited from :class:`~.RelationshipElement`) :ivar second: Reference to the second element in the relationship taking the role of the object which have to be of class Referable. (inherited from :class:`~.RelationshipElement`) :ivar annotation: Unordered list of :class:`DataElements <.DataElement>` that hold for the relationship between two elements - :ivar display_name: Can be provided in several languages. (inherited from :class:`~aas.model.base.Referable`) + :ivar display_name: Can be provided in several languages. (inherited from :class:`~basyx.aas.model.base.Referable`) :ivar category: The category is a value that gives further meta information w.r.t. to the class of the element. It affects the expected existence of attributes and the applicability of constraints. - (inherited from :class:`~aas.model.base.Referable`) - :ivar description: Description or comments on the element. (inherited from :class:`~aas.model.base.Referable`) + (inherited from :class:`~basyx.aas.model.base.Referable`) + :ivar description: Description or comments on the element. (inherited from :class:`~basyx.aas.model.base.Referable`) :ivar parent: Reference to the next referable parent element of the element. (inherited from - :class:`~aas.model.base.Referable`) + :class:`~basyx.aas.model.base.Referable`) :ivar semantic_id: Identifier of the semantic definition of the element. It is called semantic id of the element. The semantic id may either reference an external global id or it may reference a referable model element of kind=Type that defines the semantics of the element. - (inherited from :class:`~aas.model.base.HasSemantics`) + (inherited from :class:`~basyx.aas.model.base.HasSemantics`) :ivar qualifier: Unordered list of Qualifiers that gives additional qualification of a qualifiable element. - (from :class:`~aas.model.base.Qualifiable`) + (from :class:`~basyx.aas.model.base.Qualifiable`) :ivar extension: An extension of the element. (inherited from - :class:`aas.model.base.HasExtension`) + :class:`basyx.aas.model.base.HasExtension`) :ivar supplemental_semantic_id: Identifier of a supplemental semantic definition of the element. It is called supplemental semantic ID of the element. (inherited from - :class:`~aas.model.base.HasSemantics`) + :class:`~basyx.aas.model.base.HasSemantics`) :ivar embedded_data_specifications: List of Embedded data specification. """ @@ -937,7 +937,7 @@ class Operation(SubmodelElement, base.UniqueIdShortNamespace): In- and output variables are implemented as :class:`SubmodelElements <.SubmodelElement>` directly without the wrapping `OperationVariable`. This makes implementing *Constraint AASd-134* much easier since we can just use normal - :class:`NamespaceSets <~aas.model.base.NamespaceSet>`. Furthermore, an `OperationVariable` contains nothing besides + :class:`NamespaceSets <~basyx.aas.model.base.NamespaceSet>`. Furthermore, an `OperationVariable` contains nothing besides a single :class:`~.SubmodelElement` anyway, so implementing it would just make using `Operations` more tedious for no reason. @@ -945,29 +945,29 @@ class Operation(SubmodelElement, base.UniqueIdShortNamespace): and inoutputVariable/value shall be unique. :ivar id_short: Identifying string of the element within its name space. (inherited from - :class:`~aas.model.base.Referable`) + :class:`~basyx.aas.model.base.Referable`) :ivar input_variable: List of input parameters (:class:`SubmodelElements <.SubmodelElement>`) of the operation :ivar output_variable: List of output parameters (:class:`SubmodelElements <.SubmodelElement>`) of the operation :ivar in_output_variable: List of parameters (:class:`SubmodelElements <.SubmodelElement>`) that are input and output of the operation - :ivar display_name: Can be provided in several languages. (inherited from :class:`~aas.model.base.Referable`) + :ivar display_name: Can be provided in several languages. (inherited from :class:`~basyx.aas.model.base.Referable`) :ivar category: The category is a value that gives further meta information w.r.t. to the class of the element. It affects the expected existence of attributes and the applicability of constraints. - (inherited from :class:`~aas.model.base.Referable`) - :ivar description: Description or comments on the element. (inherited from :class:`~aas.model.base.Referable`) + (inherited from :class:`~basyx.aas.model.base.Referable`) + :ivar description: Description or comments on the element. (inherited from :class:`~basyx.aas.model.base.Referable`) :ivar parent: Reference to the next referable parent element of the element. (inherited from - :class:`~aas.model.base.Referable`) + :class:`~basyx.aas.model.base.Referable`) :ivar semantic_id: Identifier of the semantic definition of the element. It is called semantic id of the element. The semantic id may either reference an external global id or it may reference a referable model element of kind=Type that defines the semantics of the element. - (inherited from :class:`~aas.model.base.HasSemantics`) + (inherited from :class:`~basyx.aas.model.base.HasSemantics`) :ivar qualifier: Unordered list of Qualifiers that gives additional qualification of a qualifiable element. - (from :class:`~aas.model.base.Qualifiable`) + (from :class:`~basyx.aas.model.base.Qualifiable`) :ivar extension: An extension of the element. (inherited from - :class:`aas.model.base.HasExtension`) + :class:`basyx.aas.model.base.HasExtension`) :ivar supplemental_semantic_id: Identifier of a supplemental semantic definition of the element. It is called supplemental semantic ID of the element. (inherited from - :class:`~aas.model.base.HasSemantics`) + :class:`~basyx.aas.model.base.HasSemantics`) :ivar embedded_data_specifications: List of Embedded data specification. """ def __init__(self, @@ -1001,25 +1001,25 @@ class Capability(SubmodelElement): in the physical or virtual world :ivar id_short: Identifying string of the element within its name space. (inherited from - :class:`~aas.model.base.Referable`) - :ivar display_name: Can be provided in several languages. (inherited from :class:`~aas.model.base.Referable`) + :class:`~basyx.aas.model.base.Referable`) + :ivar display_name: Can be provided in several languages. (inherited from :class:`~basyx.aas.model.base.Referable`) :ivar category: The category is a value that gives further meta information w.r.t. to the class of the element. It affects the expected existence of attributes and the applicability of constraints. - (inherited from :class:`~aas.model.base.Referable`) - :ivar description: Description or comments on the element. (inherited from :class:`~aas.model.base.Referable`) + (inherited from :class:`~basyx.aas.model.base.Referable`) + :ivar description: Description or comments on the element. (inherited from :class:`~basyx.aas.model.base.Referable`) :ivar parent: Reference to the next referable parent element of the element. (inherited from - :class:`~aas.model.base.Referable`) + :class:`~basyx.aas.model.base.Referable`) :ivar semantic_id: Identifier of the semantic definition of the element. It is called semantic id of the element. The semantic id may either reference an external global id or it may reference a referable model element of kind=Type that defines the semantics of the element. - (inherited from :class:`~aas.model.base.HasSemantics`) + (inherited from :class:`~basyx.aas.model.base.HasSemantics`) :ivar qualifier: Unordered list of Qualifiers that gives additional qualification of a qualifiable element. - (from :class:`~aas.model.base.Qualifiable`) + (from :class:`~basyx.aas.model.base.Qualifiable`) :ivar extension: An extension of the element. (inherited from - :class:`aas.model.base.HasExtension`) + :class:`basyx.aas.model.base.HasExtension`) :ivar supplemental_semantic_id: Identifier of a supplemental semantic definition of the element. It is called supplemental semantic ID of the element. (inherited from - :class:`~aas.model.base.HasSemantics`) + :class:`~basyx.aas.model.base.HasSemantics`) :ivar embedded_data_specifications: List of Embedded data specification. """ @@ -1050,32 +1050,32 @@ class Entity(SubmodelElement, base.UniqueIdShortNamespace): :attr:`~.EntityType.SELF_MANAGED_ENTITY`. They must be empty otherwise. :ivar id_short: Identifying string of the element within its name space. (inherited from - :class:`~aas.model.base.Referable`) + :class:`~basyx.aas.model.base.Referable`) :ivar entity_type: Describes whether the entity is a co-managed or a self-managed entity. :ivar statement: Unordered list of statements (:class:`SubmodelElements <.SubmodelElement>`) applicable to the entity, typically with a qualified value. - :ivar global_asset_id: Global :class:`~aas.model.base.Identifier` of the asset the entity is representing. - :ivar specific_asset_id: :class:`~aas.model.base.Reference` to an identifier key value pair representing a specific + :ivar global_asset_id: Global :class:`~basyx.aas.model.base.Identifier` of the asset the entity is representing. + :ivar specific_asset_id: :class:`~basyx.aas.model.base.Reference` to an identifier key value pair representing a specific identifier of the asset represented by the asset administration shell. See Constraint AASd-014 - :ivar display_name: Can be provided in several languages. (inherited from :class:`~aas.model.base.Referable`) + :ivar display_name: Can be provided in several languages. (inherited from :class:`~basyx.aas.model.base.Referable`) :ivar category: The category is a value that gives further meta information w.r.t. to the class of the element. It affects the expected existence of attributes and the applicability of constraints. - (inherited from :class:`~aas.model.base.Referable`) - :ivar description: Description or comments on the element. (inherited from :class:`~aas.model.base.Referable`) + (inherited from :class:`~basyx.aas.model.base.Referable`) + :ivar description: Description or comments on the element. (inherited from :class:`~basyx.aas.model.base.Referable`) :ivar parent: Reference to the next referable parent element of the element. (inherited from - :class:`~aas.model.base.Referable`) + :class:`~basyx.aas.model.base.Referable`) :ivar semantic_id: Identifier of the semantic definition of the element. It is called semantic id of the element. The semantic id may either reference an external global id or it may reference a referable model element of kind=Type that defines the semantics of the element. - (inherited from :class:`~aas.model.base.HasSemantics`) + (inherited from :class:`~basyx.aas.model.base.HasSemantics`) :ivar qualifier: Unordered list of Qualifiers that gives additional qualification of a qualifiable element. - (from :class:`~aas.model.base.Qualifiable`) + (from :class:`~basyx.aas.model.base.Qualifiable`) :ivar extension: An extension of the element. (inherited from - :class:`aas.model.base.HasExtension`) + :class:`basyx.aas.model.base.HasExtension`) :ivar supplemental_semantic_id: Identifier of a supplemental semantic definition of the element. It is called supplemental semantic ID of the element. (inherited from - :class:`~aas.model.base.HasSemantics`) + :class:`~basyx.aas.model.base.HasSemantics`) :ivar embedded_data_specifications: List of Embedded data specification. """ @@ -1179,25 +1179,25 @@ class EventElement(SubmodelElement, metaclass=abc.ABCMeta): <> :ivar id_short: Identifying string of the element within its name space. (inherited from - :class:`~aas.model.base.Referable`) - :ivar display_name: Can be provided in several languages. (inherited from :class:`~aas.model.base.Referable`) + :class:`~basyx.aas.model.base.Referable`) + :ivar display_name: Can be provided in several languages. (inherited from :class:`~basyx.aas.model.base.Referable`) :ivar category: The category is a value that gives further meta information w.r.t. to the class of the element. It affects the expected existence of attributes and the applicability of constraints. - (inherited from :class:`~aas.model.base.Referable`) - :ivar description: Description or comments on the element. (inherited from :class:`~aas.model.base.Referable`) + (inherited from :class:`~basyx.aas.model.base.Referable`) + :ivar description: Description or comments on the element. (inherited from :class:`~basyx.aas.model.base.Referable`) :ivar parent: Reference to the next referable parent element of the element. (inherited from - :class:`~aas.model.base.Referable`) + :class:`~basyx.aas.model.base.Referable`) :ivar semantic_id: Identifier of the semantic definition of the element. It is called semantic id of the element. The semantic id may either reference an external global id or it may reference a referable model element of kind=Type that defines the semantics of the element. - (inherited from :class:`~aas.model.base.HasSemantics`) + (inherited from :class:`~basyx.aas.model.base.HasSemantics`) :ivar qualifier: Unordered list of Qualifiers that gives additional qualification of a qualifiable element. - (from :class:`~aas.model.base.Qualifiable`) + (from :class:`~basyx.aas.model.base.Qualifiable`) :ivar extension: An extension of the element. (inherited from - :class:`aas.model.base.HasExtension`) + :class:`basyx.aas.model.base.HasExtension`) :ivar supplemental_semantic_id: Identifier of a supplemental semantic definition of the element. It is called supplemental semantic ID of the element. (inherited from - :class:`~aas.model.base.HasSemantics`) + :class:`~basyx.aas.model.base.HasSemantics`) :ivar embedded_data_specifications: List of Embedded data specification. """ @abc.abstractmethod @@ -1222,19 +1222,19 @@ class BasicEventElement(EventElement): A basic event element. :ivar id_short: Identifying string of the element within its name space. (inherited from - :class:`~aas.model.base.Referable`) - :ivar observed: :class:`~aas.model.base.ModelReference` to the Referable, which defines the scope of the event. - Can be :class:`~aas.model.aas.AssetAdministrationShell`, :class:`~aas.model.submodel.Submodel` - or :class:`~aas.model.submodel.SubmodelElement`. Reference to a referable, e.g. a data element + :class:`~basyx.aas.model.base.Referable`) + :ivar observed: :class:`~basyx.aas.model.base.ModelReference` to the Referable, which defines the scope of the event. + Can be :class:`~basyx.aas.model.aas.AssetAdministrationShell`, :class:`~basyx.aas.model.submodel.SubmodelElement` + or :class:`~basyx.aas.model.submodel.SubmodelElement`. Reference to a referable, e.g. a data element or a submodel, that is being observed. - :ivar direction: Direction of event as :class:`~aas.model.base.Direction`. - :ivar state: State of event as :class:`~aas.model.base.StateOfEvent`. + :ivar direction: Direction of event as :class:`~basyx.aas.model.base.Direction`. + :ivar state: State of event as :class:`~basyx.aas.model.base.StateOfEvent`. :ivar message_topic: Information for the outer message infrastructure for scheduling the event to the respective communication channel. :ivar message_broker: Information, which outer message infrastructure shall handle messages for the EventElement. - Refers to a :class:`~aas.model.submodel.Submodel`, - :class:`~aas.model.submodel.SubmodelElementList`, - :class:`~aas.model.submodel.SubmodelElementCollection` or :class:`~aas.model.submodel.Entity`, + Refers to a :class:`~basyx.aas.model.submodel.SubmodelElement`, + :class:`~basyx.aas.model.submodel.SubmodelElementList`, + :class:`~basyx.aas.model.submodel.SubmodelElementCollection` or :class:`~basyx.aas.model.submodel.Entity`, which contains DataElements describing the proprietary specification for the message broker. Note: for different message infrastructure, e.g. OPC UA or MQTT or AMQP, this proprietary specification could be standardized by having respective Submodels. @@ -1245,23 +1245,23 @@ class BasicEventElement(EventElement): :ivar max_interval: For input direction: not applicable. For output direction: maximum interval in time, the respective Referable shall send an update of the status of the event, even if no other trigger condition for the event was not met. - :ivar display_name: Can be provided in several languages. (inherited from :class:`~aas.model.base.Referable`) + :ivar display_name: Can be provided in several languages. (inherited from :class:`~basyx.aas.model.base.Referable`) :ivar category: The category is a value that gives further meta information w.r.t. to the class of the element. It affects the expected existence of attributes and the applicability of constraints. - (inherited from :class:`~aas.model.base.Referable`) - :ivar description: Description or comments on the element. (inherited from :class:`~aas.model.base.Referable`) + (inherited from :class:`~basyx.aas.model.base.Referable`) + :ivar description: Description or comments on the element. (inherited from :class:`~basyx.aas.model.base.Referable`) :ivar parent: Reference to the next referable parent element of the element. (inherited from - :class:`~aas.model.base.Referable`) + :class:`~basyx.aas.model.base.Referable`) :ivar semantic_id: Identifier of the semantic definition of the element. It is called semantic id of the element. The semantic id may either reference an external global id or it may reference a referable model element of kind=Type that defines the semantics of the element. - (inherited from :class:`~aas.model.base.HasSemantics`) + (inherited from :class:`~basyx.aas.model.base.HasSemantics`) :ivar qualifier: Unordered list of Qualifiers that gives additional qualification of a qualifiable element. - (from :class:`~aas.model.base.Qualifiable`) - :ivar extension: An extension of the element. (inherited from :class:`aas.model.base.HasExtension`) + (from :class:`~basyx.aas.model.base.Qualifiable`) + :ivar extension: An extension of the element. (inherited from :class:`basyx.aas.model.base.HasExtension`) :ivar supplemental_semantic_id: Identifier of a supplemental semantic definition of the element. It is called supplemental semantic ID of the element. (inherited from - :class:`~aas.model.base.HasSemantics`) + :class:`~basyx.aas.model.base.HasSemantics`) :ivar embedded_data_specifications: List of Embedded data specification. """ diff --git a/basyx/aas/util/__init__.py b/basyx/aas/util/__init__.py index 42eb731bf..834214561 100644 --- a/basyx/aas/util/__init__.py +++ b/basyx/aas/util/__init__.py @@ -2,7 +2,7 @@ This package provides helpful utilities for working with a python based AAS model. `identification.py`: - Generate :class:`Identifiers ` + Generate :class:`Identifiers ` `traversal.py`: A module with helper functions for traversing AAS object structures. diff --git a/basyx/aas/util/identification.py b/basyx/aas/util/identification.py index 803eede1c..858b0f4bf 100644 --- a/basyx/aas/util/identification.py +++ b/basyx/aas/util/identification.py @@ -5,7 +5,7 @@ # # SPDX-License-Identifier: MIT """ -This module generates :class:`Identifiers `. +This module generates :class:`Identifiers `. To Generate [identifier]: -> Try: @@ -24,7 +24,7 @@ class AbstractIdentifierGenerator(metaclass=abc.ABCMeta): """ - Abstract base class for identifier generators that generate :class:`Identifiers ` based + Abstract base class for identifier generators that generate :class:`Identifiers ` based on an internal schema and an (optional) proposal. @@ -62,15 +62,15 @@ class NamespaceIRIGenerator(AbstractIdentifierGenerator): """ An IdentifierGenerator, that generates IRIs in a given namespace, checking uniqueness against a Registry. - :class:`Identifiers ` are generated by concatenating a fixed namespace with the proposed + :class:`Identifiers ` are generated by concatenating a fixed namespace with the proposed suffix. To verify uniqueness, the existence of the id is checked by querying the given Registry. If a collision is detected, a number is prepended :ivar namespace: The IRI Namespace to generate Identifiers in. It must be a valid IRI (starting with a scheme) and end on either #, /, or = to form a reasonable namespace. - :ivar ~.provider: An :class:`~aas.model.provider.AbstractObjectProvider` to check existence of - :class:`Identifiers ` + :ivar ~.provider: An :class:`~basyx.aas.model.provider.AbstractObjectProvider` to check existence of + :class:`Identifiers ` """ def __init__(self, namespace: str, provider: model.AbstractObjectProvider): """ diff --git a/basyx/aas/util/traversal.py b/basyx/aas/util/traversal.py index 921bdb81a..8e1d1a711 100644 --- a/basyx/aas/util/traversal.py +++ b/basyx/aas/util/traversal.py @@ -16,12 +16,12 @@ def walk_submodel(collection: Union[model.Submodel, model.SubmodelElementCollection, model.SubmodelElementList]) \ -> Iterator[model.SubmodelElement]: """ - Traverse the :class:`SubmodelElements ` in a - :class:`~aas.model.submodel.Submodel`, :class:`~aas.model.submodel.SubmodelElementCollection` or a - :class:`~aas.model.submodel.SubmodelElementList` recursively in post-order tree-traversal. + 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.SubmodelElementList` recursively in post-order tree-traversal. - This is a generator function, yielding all the :class:`SubmodelElements `. - No :class:`SubmodelElements ` should be added, removed or + This is a generator function, yielding all the :class:`SubmodelElements `. + No :class:`SubmodelElements ` should be added, removed or moved while iterating, as this could result in undefined behaviour. """ elements = collection.submodel_element if isinstance(collection, model.Submodel) else collection.value @@ -33,11 +33,11 @@ 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:`~aas.model.submodel.Submodel` with all recursively contained - :class:`SubmodelElements `) recursively and return all non-empty (!= None) + Traverse an AAS object hierarchy (e.g. a :class:`~basyx.aas.model.submodel.SubmodelElement` with all recursively contained + :class:`SubmodelElements `) recursively and return all non-empty (!= None) semanticIds. - This is a generator function, yielding all the semanticIds. No :class:`~aas.model.base.Referable` objects should be + This is a generator function, yielding all the semanticIds. No :class:`~basyx.aas.model.base.Referable` objects should be added, removed or moved to/from/in the AAS object hierarchy while iterating, as this could result in undefined behaviour. """