Skip to content

model.base: Fix MultiLanguageNameType value length to 128#577

Open
thammel wants to merge 1 commit into
eclipse-basyx:developfrom
thammel:fix/check-short-name-type
Open

model.base: Fix MultiLanguageNameType value length to 128#577
thammel wants to merge 1 commit into
eclipse-basyx:developfrom
thammel:fix/check-short-name-type

Conversation

@thammel

@thammel thammel commented Jun 16, 2026

Copy link
Copy Markdown

Until now, each value of a MultiLanguageNameType was constrained to a maximum length of 64 via check_short_name_type. This never matched the specification: LangStringNameType/text has had a maximum length of 128 characters since AAS Part 1 Metamodel V3.0, identical to NameType.

MultiLanguageNameType now uses check_name_type instead. The now-unused check_short_name_type and constrain_short_name_type functions are removed accordingly.

Fixs #576

Until now, each value of a MultiLanguageNameType was constrained to a
maximum length of 64 via check_short_name_type. This never matched the
specification: LangStringNameType/text has had a maximum length of 128
characters since AAS Part 1 Metamodel V3.0, identical to NameType.

MultiLanguageNameType now uses check_name_type instead. The now-unused
check_short_name_type and constrain_short_name_type functions are
removed accordingly.
Comment on lines 111 to 115
This is the type-independent alternative to :func:`~.check_content_type`, :func:`~.check_identifier`, etc. It is
used for the definition of the :class:`ConstrainedLangStringSets <basyx.aas.model.base.ConstrainedLangStringSet>`,
as a "Basic" constrained string type only exists for :class:`~basyx.aas.model.base.MultiLanguageNameType`, where all
values are :class:`ShortNames <basyx.aas.model.base.ShortNameType>`. All other
values are :class:`NameTypes <basyx.aas.model.base.NameType>`. All other
:class:`:class:`ConstrainedLangStringSets <basyx.aas.model.base.ConstrainedLangStringSet>` use custom constraints.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the reference to ShortNameType or NameType here is more confusing than helpful in this docstring. I'd remove it completely, for example:

    Returns a ``check_type`` function for the given constraints.

    Use this instead of the named :func:`~.check_content_type`, :func:`~.check_identifier`, etc. when the
    constraints do not correspond to a predefined constrained string type — for example, in
    :class:`ConstrainedLangStringSets <basyx.aas.model.base.ConstrainedLangStringSet>` that define their own
    length and pattern rules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants