Skip to content

[3.0, 3.1] Make qualifier constraint implementation specific#386

Open
empwilli wants to merge 1 commit intoaas-core-works:mainfrom
empwilli:empwilli/fix_qualifier_kind_constraint
Open

[3.0, 3.1] Make qualifier constraint implementation specific#386
empwilli wants to merge 1 commit intoaas-core-works:mainfrom
empwilli:empwilli/fix_qualifier_kind_constraint

Conversation

@empwilli
Copy link
Contributor

@empwilli empwilli commented Jan 8, 2026

The current implementation of constraint AAS-129 is incomplete: it only checks
the constraint for the direct children of Submodel, whereas the constraint
requires that its condition is checked for all SubmodelElements in the whole
Submodel recursively. This, however, can currently not be expressed in the meta
model description. Hence, we extract the constraint into a separate method and
annotate it as implementation specific.

This addresses #374.

The current implementation of constraint AAS-129 is incomplete: it only
checks the constraint for the direct children of Submodel, whereas the
constraint requires that its condition is checked for all
SubmodelElements in the whole Submodel recursively. This, however, can
currently not be expressed in the meta model description. Hence, we
extract the constraint into a separate method and annotate it as
implementation specific.
@empwilli empwilli changed the title Make qualifier constraint implementation specific [3.0, 3.1] Make qualifier constraint implementation specific Jan 9, 2026
return True


@verification
Copy link
Contributor

Choose a reason for hiding this comment

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

Add a transpilable verification function so that we have the hard parts dealt with outside of the snippet:

    not (self.submodel_elements is not None)
    or (
        not (self.kind_or_default() != Modelling_kind.Template)
        or (
            all(
                not (submodel_element.qualifiers is not None)
                or all(
                    qualifier.kind_or_default() != Qualifier_kind.Template_qualifier
                    for qualifier in submodel_element.qualifiers
                )
                for submodel_element in self.submodel_elements
            )
        )
    )

Add a comment that the two methods must be in sync -- include an assertion in tests/ that the code is exactly the same for the two methods (one for submodel element list and the other for submodel element collection).

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