aas-core-works / aas-core-meta

Provide formalized meta-models for Asset Administration Shell (AAS).
Other
9 stars 3 forks source link

Fix inconsistency between an invariant of `Concept_description` and its text #251

Closed mristin closed 1 year ago

mristin commented 1 year ago

The following invariant seems off:

@invariant(
    lambda self:
    not (
        self.category is not None
        and self.category != "VALUE"
        and self.embedded_data_specifications is not None
    ) or (
        data_specification_IEC_61360s_have_definition_at_least_in_english(
            self.embedded_data_specifications
        )
    ),
    "For a ConceptDescription referenced via value ID in a value list and "
    "using data specification template IEC61360 "
    "(http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/3/0), "
    "value shall be set."
)

https://github.com/aas-core-works/aas-core-meta/blob/d46eff4d84545ba7cc153f83478e0a13533ad050/aas_core_meta/v3.py#L4283

s-heppner commented 1 year ago

Removing this invariant was the right choice. The implementation had nothing to do with the text.

The actual invariant is that of AASc-3a-003 in the spec, with the same exact wording as in the docstring here.

The meaning of this constraint is the following: "In an Value_reference_pair, in which the Value_reference_pair.value_ID is a Reference to a Concept_description, in which the Concept_description.embedded_data_specifications is a Data_specification_IEC_61360, the Data_specification_IEC_61360.value cannot be None."

Still, this constraint is not entirely clear to us, considering Concept_description.embedded_data_specifications is a List of Data_specifications, yet the constraint speaks in singular. Also, the formulation is very confusing.

Nevertheless, this constraint cannot be implemented as invariant, since we cannot resolve references. Therefore, now the only thing left is to document our procedure.