Skip to content
Open
Show file tree
Hide file tree
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
3 changes: 0 additions & 3 deletions sdk/basyx/aas/model/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -819,9 +819,6 @@ def _set_id_short(self, id_short: Optional[NameType]):
raise AASConstraintViolation(117, f"id_short of {self!r} cannot be unset, since it is already "
f"contained in {self.parent!r}")
from .submodel import SubmodelElementList
if isinstance(self.parent, SubmodelElementList):
raise AASConstraintViolation(120, f"id_short of {self!r} cannot be set, because it is "
f"contained in a {self.parent!r}")
for set_ in self.parent.namespace_element_sets:
if set_.contains_id("id_short", id_short):
raise AASConstraintViolation(22, "Object with id_short '{}' is already present in the parent "
Expand Down
3 changes: 0 additions & 3 deletions sdk/basyx/aas/model/submodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -750,9 +750,6 @@ def __init__(self,
raise

def _generate_id_short(self, new: _SE) -> None:
if new.id_short is not None:
raise base.AASConstraintViolation(120, "Objects with an id_short may not be added to a "
f"SubmodelElementList, got {new!r} with id_short={new.id_short}")
# Generate a unique id_short when a SubmodelElement is added, because children of a SubmodelElementList may not
# have an id_short. The alternative would be making SubmodelElementList a special kind of base.Namespace without
# a unique attribute for child-elements (which contradicts the definition of a Namespace).
Expand Down
2 changes: 0 additions & 2 deletions sdk/docs/source/constraints.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ an :class:`~basyx.aas.model.base.AASConstraintViolation` will be raised
.. |aasd117| replace:: ``idShort`` of non-identifiable ``Referables`` not being a direct child of a ``SubmodelElementList`` shall be specified.
.. |aasd118| replace:: If a supplemental semantic ID (``HasSemantics/supplementalSemanticId``) is defined, there shall also be a main semantic ID (``HasSemantics/semanticId``).
.. |aasd119| replace:: If any ``Qualifier/kind`` value of a ``Qualifiable/qualifier`` is equal to ``TemplateQualifier`` and the qualified element inherits from ``HasKind``, the qualified element shall be of kind ``Template`` (``HasKind/kind = Template``).
.. |aasd120| replace:: ``idShort`` of submodel elements being a direct child of a ``SubmodelElementList`` shall not be specified.
.. |aasd121| replace:: For ``References``, the value of ``Key/type`` of the first ``key`` of ``Reference/keys`` shall be one of ``GloballyIdentifiables``.
.. |aasd122| replace:: For external references, i.e. ``References`` with ``Reference/type = ExternalReference``, the value of ``Key/type`` of the first key of ``Reference/keys`` shall be one of ``GenericGloballyIdentifiables``.
.. |aasd123| replace:: For model references, i.e. ``References`` with ``Reference/type = ModellReference``, the value of ``Key/type`` of the first ``key`` of ``Reference/keys`` shall be one of ``AasIdentifiables``.
Expand Down Expand Up @@ -86,7 +85,6 @@ an :class:`~basyx.aas.model.base.AASConstraintViolation` will be raised
AASd-117, |aasd117|, ✅,
AASd-118, |aasd118|, ✅,
AASd-119, |aasd119|, ❌, See `#119 <https://github.com/eclipse-basyx/basyx-python-sdk/issues/119>`__
AASd-120, |aasd120|, ✅,
AASd-121, |aasd121|, ✅,
AASd-122, |aasd122|, ✅,
AASd-123, |aasd123|, ✅,
Expand Down
15 changes: 1 addition & 14 deletions sdk/test/model/test_submodel.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2025 the Eclipse BaSyx Authors
# Copyright (c) 2026 the Eclipse BaSyx Authors
#
# This program and the accompanying materials are made available under the terms of the MIT License, available in
# the LICENSE file of this project.
Expand Down Expand Up @@ -232,19 +232,6 @@ def test_constraints(self):
mlp2.semantic_id = semantic_id1
model.SubmodelElementList("test_list", model.MultiLanguageProperty, [mlp1, mlp2])

# AASd-120
mlp = model.MultiLanguageProperty("mlp")
with self.assertRaises(model.AASConstraintViolation) as cm:
model.SubmodelElementList("test_list", model.MultiLanguageProperty, [mlp])
self.assertEqual("Objects with an id_short may not be added to a SubmodelElementList, got "
"MultiLanguageProperty[mlp] with id_short=mlp (Constraint AASd-120)", str(cm.exception))
mlp.id_short = None
model.SubmodelElementList("test_list", model.MultiLanguageProperty, [mlp])
with self.assertRaises(model.AASConstraintViolation) as cm:
mlp.id_short = "mlp"
self.assertEqual("id_short of MultiLanguageProperty[test_list[0]] cannot be set, because it is "
"contained in a SubmodelElementList[test_list] (Constraint AASd-120)", str(cm.exception))

def test_aasd_108_add_set(self):
prop = model.Property(None, model.datatypes.Int)
mlp1 = model.MultiLanguageProperty(None)
Expand Down