From 29e40a4ca8a6dd4b23bd96d9a9ba0aa93371e48d Mon Sep 17 00:00:00 2001 From: Sebastian Heppner Date: Fri, 11 Aug 2023 14:39:07 +0200 Subject: [PATCH] model.base: Add new attributes to class AdministrativeInformation Version 3.0 of the spec introduces the 2 new attributes - `creator` - `template_id` to class `AdministrativeInformation`. This commit adds them to the class. --- basyx/aas/model/base.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/basyx/aas/model/base.py b/basyx/aas/model/base.py index 9dedc6e91..01427db72 100644 --- a/basyx/aas/model/base.py +++ b/basyx/aas/model/base.py @@ -1094,6 +1094,7 @@ def __init__( @_string_constraints.constrain_version_type("version") +@_string_constraints.constrain_identifier("template_id") class AdministrativeInformation(HasDataSpecification): """ Administrative meta-information for an element like version information. @@ -1103,6 +1104,17 @@ class AdministrativeInformation(HasDataSpecification): :ivar version: Version of the element. :ivar revision: Revision of the element. + :ivar creator: The subject ID of the subject responsible for making the element + :ivar template_id: Identifier of the template that guided the creation of the element + + *Note:* In case of a submodel, the template ID is the identifier of the submodel template that guided the + creation of the submodel. + + *Note:* The submodel template ID is not relevant for validation. Here, the Submodel/semanticId shall be used + + *Note:* Usage of the template ID is not restricted to submodel instances. + The creation of submodel templates can also be guided by another submodel template. + :ivar embedded_data_specifications: List of Embedded data specification. used by the element. """ @@ -1110,6 +1122,8 @@ class AdministrativeInformation(HasDataSpecification): def __init__(self, version: Optional[VersionType] = None, revision: Optional[RevisionType] = None, + creator: Optional[Reference] = None, + template_id: Optional[Identifier] = None, embedded_data_specifications: Iterable[EmbeddedDataSpecification] = ()): """ Initializer of AdministrativeInformation @@ -1122,6 +1136,8 @@ def __init__(self, self.version: Optional[VersionType] = version self._revision: Optional[RevisionType] self.revision = revision + self.creator: Optional[Reference] = creator + self.template_id: Optional[Identifier] = template_id self.embedded_data_specifications: List[EmbeddedDataSpecification] = list(embedded_data_specifications) def _get_revision(self):