Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V3.1: Introduce new abstract Container_element #356

Draft
wants to merge 1 commit into
base: v3.1/main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 48 additions & 7 deletions aas_core_meta/v3_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -2621,6 +2621,41 @@ def __init__(
)


@abstract
class Container_element(Submodel_element):
"""
A container element is a submodel element that is composed of
other submodel elements.
"""

def __init__(
self,
extensions: Optional[List["Extension"]] = None,
category: Optional[Name_type] = None,
ID_short: Optional[ID_short_type] = None,
display_name: Optional[List["Lang_string_name_type"]] = None,
description: Optional[List["Lang_string_text_type"]] = None,
semantic_ID: Optional["Reference"] = None,
supplemental_semantic_IDs: Optional[List["Reference"]] = None,
qualifiers: Optional[List["Qualifier"]] = None,
embedded_data_specifications: Optional[
List["Embedded_data_specification"]
] = None,
) -> None:
Submodel_element.__init__(
self,
extensions=extensions,
category=category,
ID_short=ID_short,
display_name=display_name,
description=description,
semantic_ID=semantic_ID,
supplemental_semantic_IDs=supplemental_semantic_IDs,
qualifiers=qualifiers,
embedded_data_specifications=embedded_data_specifications,
)


class Relationship_element(Submodel_element):
"""
A relationship element is used to define a relationship between two elements
Expand Down Expand Up @@ -2688,6 +2723,7 @@ class AAS_submodel_elements(Enum):
Reference_element = "ReferenceElement"
Relationship_element = "RelationshipElement"
Submodel_element = "SubmodelElement"
Container_element = "ContainerElement"
Submodel_element_list = "SubmodelElementList"
Submodel_element_collection = "SubmodelElementCollection"

Expand Down Expand Up @@ -2764,7 +2800,7 @@ class AAS_submodel_elements(Enum):
"Value must be either not set or have at least one item."
)
# fmt: on
class Submodel_element_list(Submodel_element):
class Submodel_element_list(Container_element):
"""
A submodel element list is an ordered list of submodel elements.

Expand Down Expand Up @@ -2867,7 +2903,7 @@ def __init__(
value_type_list_element: Optional["Data_type_def_XSD"] = None,
value: Optional[List["Submodel_element"]] = None,
) -> None:
Submodel_element.__init__(
Container_element.__init__(
self,
extensions=extensions,
category=category,
Expand Down Expand Up @@ -2912,7 +2948,7 @@ def __init__(
"Value must be either not set or have at least one item."
)
# fmt: on
class Submodel_element_collection(Submodel_element):
class Submodel_element_collection(Container_element):
"""
A submodel element collection is a kind of struct, i.e. a a logical encapsulation
of multiple named values. It has a fixed number of submodel elements.
Expand All @@ -2938,7 +2974,7 @@ def __init__(
] = None,
value: Optional[List["Submodel_element"]] = None,
) -> None:
Submodel_element.__init__(
Container_element.__init__(
self,
extensions=extensions,
category=category,
Expand Down Expand Up @@ -3423,7 +3459,7 @@ def __init__(
"Annotations must be either not set or have at least one item."
)
# fmt: on
class Annotated_relationship_element(Relationship_element):
class Annotated_relationship_element(Relationship_element, Container_element):
"""
An annotated relationship element is a relationship element that can be annotated
with additional data elements.
Expand Down Expand Up @@ -3514,7 +3550,7 @@ def __init__(
"Statements must be either not set or have at least one item."
)
# fmt: on
class Entity(Submodel_element):
class Entity(Container_element):
"""
An entity is a submodel element that is used to model entities.

Expand Down Expand Up @@ -3568,7 +3604,7 @@ def __init__(
global_asset_ID: Optional["Identifier"] = None,
specific_asset_IDs: Optional[List["Specific_asset_ID"]] = None,
) -> None:
Submodel_element.__init__(
Container_element.__init__(
self,
extensions=extensions,
category=category,
Expand Down Expand Up @@ -4754,6 +4790,7 @@ class Key_types(Enum):
Blob = "Blob"
Capability = "Capability"
Concept_description = "ConceptDescription"
Container_element = "ContainerElement"

Data_element = "DataElement"
"""
Expand Down Expand Up @@ -4871,6 +4908,7 @@ class Key_types(Enum):
Key_types.Basic_event_element,
Key_types.Blob,
Key_types.Capability,
Key_types.Container_element,
Key_types.Data_element,
Key_types.Entity,
Key_types.Event_element,
Expand All @@ -4895,6 +4933,7 @@ class Key_types(Enum):
Key_types.Basic_event_element,
Key_types.Blob,
Key_types.Capability,
Key_types.Container_element,
Key_types.Data_element,
Key_types.Entity,
Key_types.Event_element,
Expand Down Expand Up @@ -4935,6 +4974,7 @@ class Key_types(Enum):
Key_types.Referable,
Key_types.Relationship_element,
Key_types.Submodel_element,
Key_types.Container_element,
Key_types.Submodel_element_collection,
Key_types.Submodel_element_list,
],
Expand Down Expand Up @@ -4964,6 +5004,7 @@ class Key_types(Enum):
Key_types.Basic_event_element,
Key_types.Blob,
Key_types.Capability,
Key_types.Container_element,
Key_types.Data_element,
Key_types.Entity,
Key_types.Event_element,
Expand Down
Loading