Skip to content

Commit

Permalink
Update to aas-core-meta, codegen, testgen 44756fb, 607f65c, bf3720d7
Browse files Browse the repository at this point in the history
We update the development requirements to and re-generate everything
with:
* [aas-core-meta 44756fb],
* [aas-core-codegen 607f65c] and
* [aas-core3.0-testgen bf3720d7].

This is an important patch propagating in particular the following fixes
which affected the constraints and their documentation:

* Pull requests in aas-core-meta [#271], [#272] and [#273] which affect the
  nullability checks in constraints,
* Pull request in aas-core-meta [#275] which affects the documentation
  of many constraints.

This patch also includes a propagation of improved test data:

* Pull request in aas-core3.0-testgen [#13] which makes the type
  violations of enumerations more explicit and thus easier to debug.

[aas-core-meta 44756fb]: aas-core-works/aas-core-meta@44756fb
[aas-core-codegen 607f65c]: aas-core-works/aas-core-codegen@607f65c
[aas-core3.0-testgen bf3720d7]: aas-core-works/aas-core3.0-testgen@bf3720d7

[#271]: aas-core-works/aas-core-meta#271
[#272]: aas-core-works/aas-core-meta#272
[#273]: aas-core-works/aas-core-meta#273
[#275]: aas-core-works/aas-core-meta#275

[#13]: aas-core-works/aas-core3.0-testgen#13
  • Loading branch information
mristin committed Jun 24, 2023
1 parent 9d01794 commit 8ca55d9
Show file tree
Hide file tree
Showing 104 changed files with 251 additions and 666 deletions.
2 changes: 1 addition & 1 deletion dev_scripts/aas_core3/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
This copy is necessary so that we can decouple from ``aas-core*-python`` repository.
The revision of aas-core-codegen was: a8a510e
The revision of aas-core-codegen was: 607f65c
"""
134 changes: 88 additions & 46 deletions dev_scripts/aas_core3/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -680,17 +680,17 @@ class Qualifiable(Class):
The value of a qualifiable element may be further qualified by one or more
qualifiers.
.. note::
This constraint is checked at :py:class:`Submodel`.
:constraint AASd-119:
.. _constraint_AASd-119:
If any :py:attr:`Qualifier.kind` value of :py:attr:`qualifiers` is
equal to :py:attr:`QualifierKind.TEMPLATE_QUALIFIER` and the qualified element
inherits from :py:class:`HasKind` then the qualified element shall be of
kind Template (:py:attr:`HasKind.kind` = :py:attr:`ModellingKind.TEMPLATE`).
.. note::
This constraint is checked at :py:class:`Submodel`.
"""

#: Additional qualification of a qualifiable element.
Expand Down Expand Up @@ -1063,29 +1063,29 @@ class AssetInformation(Class):
does not already exist, the corresponding attribute :py:attr:`global_asset_id` is
optional.
.. note::
:ref:`Constraint AASd-116 <constraint_AASd-116>` is important to enable a generic search across global
and specific asset IDs.
.. note::
In the book, :ref:`Constraint AASd-116 <constraint_AASd-116>` imposes a
case-insensitive equality against ``globalAssetId``. This is
culturally-dependent, and depends on the system settings.
For example, the case-folding for the letters "i" and "I" is
different in Turkish from English.
We implement the constraint as case-sensitive instead to allow
for interoperability across different culture settings.
:constraint AASd-116:
.. _constraint_AASd-116:
``globalAssetId`` is a reserved key. If used as value for
:py:attr:`SpecificAssetID.name` then :py:attr:`SpecificAssetID.value` shall be
identical to :py:attr:`global_asset_id`.
.. note::
:ref:`Constraint AASd-116 <constraint_AASd-116>` is important to enable a generic search across
global and specific asset IDs.
.. note::
In the book, :ref:`Constraint AASd-116 <constraint_AASd-116>` imposes a
case-insensitive equality against ``globalAssetId``. This is
culturally-dependent, and depends on the system settings.
For example, the case-folding for the letters "i" and "I" is
different in Turkish from English.
We implement the constraint as case-sensitive instead to allow
for interoperability across different culture settings.
:constraint AASd-131:
.. _constraint_AASd-131:
Expand Down Expand Up @@ -4585,25 +4585,60 @@ class ConceptDescription(Identifiable, HasDataSpecification):
The description of the concept should follow a standardized schema (realized as
data specification template).
.. note::
:constraint AASc-3a-004:
.. _constraint_AASc-3a-004:
Note: categories are deprecated since V3.0 of Part 1a of the document series
"Details of the Asset Administration Shell".
For a :py:class:`ConceptDescription` with :py:attr:`category` ``PROPERTY`` or
``VALUE`` using data specification IEC61360,
the :py:attr:`DataSpecificationIEC61360.data_type` is mandatory and shall be
one of: ``DATE``, ``STRING``, ``STRING_TRANSLATABLE``, ``INTEGER_MEASURE``,
``INTEGER_COUNT``, ``INTEGER_CURRENCY``, ``REAL_MEASURE``, ``REAL_COUNT``,
``REAL_CURRENCY``, ``BOOLEAN``, ``RATIONAL``, ``RATIONAL_MEASURE``,
``TIME``, ``TIMESTAMP``.
.. note::
.. note::
Note: categories are deprecated since V3.0 of Part 1a of the document series
"Details of the Asset Administration Shell".
Note: categories are deprecated since V3.0 of Part 1a of the document series
"Details of the Asset Administration Shell".
.. note::
:constraint AASc-3a-005:
.. _constraint_AASc-3a-005:
Categories are deprecated since V3.0 of Part 1a of the document series
"Details of the Asset Administration Shell".
For a :py:class:`ConceptDescription` with :py:attr:`category` ``REFERENCE``
using data specification template IEC61360,
the :py:attr:`DataSpecificationIEC61360.data_type` shall be
one of: ``STRING``, ``IRI``, ``IRDI``.
.. note::
.. note::
Note: categories are deprecated since V3.0 of Part 1a of the document series
"Details of the Asset Administration Shell".
:constraint AASc-3a-006:
.. _constraint_AASc-3a-006:
For a :py:class:`ConceptDescription` with :py:attr:`category` ``DOCUMENT``
using data specification IEC61360,
the :py:attr:`DataSpecificationIEC61360.data_type` shall be one of ``FILE``,
``BLOB``, ``HTML``
.. note::
Categories are deprecated since V3.0 of Part 1a of the document series
"Details of the Asset Administration Shell".
Categories are deprecated since V3.0 of Part 1a of the document series
"Details of the Asset Administration Shell".
:constraint AASc-3a-007:
.. _constraint_AASc-3a-007:
For a :py:class:`ConceptDescription` with :py:attr:`category` ``QUALIFIER_TYPE``
using data specification IEC61360,
the :py:attr:`DataSpecificationIEC61360.data_type` is mandatory and shall be
defined.
.. note::
Categories are deprecated since V3.0 of Part 1a of the document series
"Details of the Asset Administration Shell".
:constraint AASc-3a-008:
.. _constraint_AASc-3a-008:
Expand Down Expand Up @@ -6187,20 +6222,6 @@ class DataSpecificationIEC61360(DataSpecificationContent):
Content of data specification template for concept descriptions for properties,
values and value lists conformant to IEC 61360.
.. note::
It is also possible that both :py:attr:`value` and :py:attr:`value_list` are empty.
This is the case for concept descriptions that define the semantics of a
property but do not have an enumeration (:py:attr:`value_list`) as data type.
.. note::
Although it is possible to define a :py:class:`ConceptDescription` for a
:attr:´value_list`,
it is not possible to reuse this :py:attr:`value_list`.
It is only possible to directly add a :py:attr:`value_list` as data type
to a specific semantic definition of a property.
.. note::
IEC61360 requires also a globally unique identifier for a concept
Expand All @@ -6218,6 +6239,27 @@ class DataSpecificationIEC61360(DataSpecificationContent):
:py:attr:`preferred_name`. Same holds for
:py:attr:`ConceptDescription.description` and :py:attr:`definition`.
:constraint AASc-3a-010:
.. _constraint_AASc-3a-010:
If :py:attr:`value` is not empty then :py:attr:`value_list` shall be empty
and vice versa.
.. note::
It is also possible that both :py:attr:`value` and :py:attr:`value_list` are
empty. This is the case for concept descriptions that define the semantics
of a property but do not have an enumeration (:py:attr:`value_list`) as
data type.
.. note::
Although it is possible to define a :py:class:`ConceptDescription` for a
:attr:´value_list`,
it is not possible to reuse this :py:attr:`value_list`.
It is only possible to directly add a :py:attr:`value_list` as data type
to a specific semantic definition of a property.
:constraint AASc-3a-009:
.. _constraint_AASc-3a-009:
Expand Down
7 changes: 4 additions & 3 deletions dev_scripts/aas_core3/verification.py
Original file line number Diff line number Diff line change
Expand Up @@ -2439,7 +2439,8 @@ def transform_asset_information(
specific_asset_id.name != 'globalAssetId'
or (
(
specific_asset_id.name == 'globalAssetId'
(that.global_asset_id is not None)
and specific_asset_id.name == 'globalAssetId'
and specific_asset_id.value == that.global_asset_id
)
)
Expand Down Expand Up @@ -2784,7 +2785,7 @@ def transform_submodel(
if not (
not (that.submodel_elements is not None)
or (
not (that.kind != aas_types.ModellingKind.TEMPLATE)
not (that.kind_or_default() != aas_types.ModellingKind.TEMPLATE)
or (
all(
not (submodel_element.qualifiers is not None)
Expand Down Expand Up @@ -8085,7 +8086,7 @@ def transform_data_specification_iec_61360(
if not (
not (
(
(that.data_type is None)
(that.data_type is not None)
and (that.data_type in aas_constants.IEC_61360_DATA_TYPES_WITH_UNIT)
)
)
Expand Down
4 changes: 2 additions & 2 deletions dev_scripts/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
packages=find_packages(exclude=["tests", "continuous_integration", "dev_scripts"]),
install_requires=[
"icontract>=2.6.1,<3",
"aas-core-meta@git+https://github.com/aas-core-works/aas-core-meta@0b256cc#egg=aas-core-meta",
"aas-core-codegen@git+https://github.com/aas-core-works/aas-core-codegen@a8a510e#egg=aas-core-codegen"
"aas-core-meta@git+https://github.com/aas-core-works/aas-core-meta@44756fb#egg=aas-core-meta",
"aas-core-codegen@git+https://github.com/aas-core-works/aas-core-codegen@607f65c#egg=aas-core-codegen"
],
py_modules=["test_codegen"],
)
77 changes: 54 additions & 23 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -728,15 +728,14 @@ export class AdministrativeInformation extends Class implements IHasDataSpecific
* The value of a qualifiable element may be further qualified by one or more
* qualifiers.
*
* @remarks
* **Note**:
* This constraint is checked at {@link Submodel}.
*
* Constraint `AASd-119`:
* If any {@link Qualifier.kind} value of {@link qualifiers} is
* equal to {@link QualifierKind.TemplateQualifier} and the qualified element
* inherits from {@link IHasKind} then the qualified element shall be of
* kind Template ({@link IHasKind.kind} = {@link ModellingKind.Template}).
*
* **Note**:
* This constraint is checked at {@link Submodel}.
*/
export interface IQualifiable extends Class {
/**
Expand Down Expand Up @@ -1356,9 +1355,14 @@ export class AssetAdministrationShell
* does not already exist, the corresponding attribute {@link AssetInformation.globalAssetId} is
* optional.
*
* Constraint `AASd-116`:
* `globalAssetId` is a reserved key. If used as value for
* {@link SpecificAssetId.name} then {@link SpecificAssetId.value} shall be
* identical to {@link AssetInformation.globalAssetId}.
*
* **Note**:
* Constraint AASd-116 is important to enable a generic search across global
* and specific asset IDs.
* Constraint AASd-116 is important to enable a generic search across
* global and specific asset IDs.
*
* **Note**:
* In the book, Constraint AASd-116 imposes a
Expand All @@ -1370,11 +1374,6 @@ export class AssetAdministrationShell
* We implement the constraint as case-sensitive instead to allow
* for interoperability across different culture settings.
*
* Constraint `AASd-116`:
* `globalAssetId` is a reserved key. If used as value for
* {@link SpecificAssetId.name} then {@link SpecificAssetId.value} shall be
* identical to {@link AssetInformation.globalAssetId}.
*
* Constraint `AASd-131`:
* For {@link AssetInformation} either the {@link AssetInformation.globalAssetId} shall be
* defined or at least one item in {@link AssetInformation.specificAssetIds}.
Expand Down Expand Up @@ -8092,18 +8091,45 @@ export class Capability extends Class implements ISubmodelElement {
* The description of the concept should follow a standardized schema (realized as
* data specification template).
*
* Constraint `AASc-3a-004`:
* For a {@link ConceptDescription} with {@link ConceptDescription.category} `PROPERTY` or
* `VALUE` using data specification IEC61360,
* the {@link DataSpecificationIec61360.dataType} is mandatory and shall be
* one of: `DATE`, `STRING`, `STRING_TRANSLATABLE`, `INTEGER_MEASURE`,
* `INTEGER_COUNT`, `INTEGER_CURRENCY`, `REAL_MEASURE`, `REAL_COUNT`,
* `REAL_CURRENCY`, `BOOLEAN`, `RATIONAL`, `RATIONAL_MEASURE`,
* `TIME`, `TIMESTAMP`.
*
* **Note**:
* Note: categories are deprecated since V3.0 of Part 1a of the document series
* "Details of the Asset Administration Shell".
*
* Constraint `AASc-3a-005`:
* For a {@link ConceptDescription} with {@link ConceptDescription.category} `REFERENCE`
* using data specification template IEC61360,
* the {@link DataSpecificationIec61360.dataType} shall be
* one of: `STRING`, `IRI`, `IRDI`.
*
* **Note**:
* Note: categories are deprecated since V3.0 of Part 1a of the document series
* "Details of the Asset Administration Shell".
*
* Constraint `AASc-3a-006`:
* For a {@link ConceptDescription} with {@link ConceptDescription.category} `DOCUMENT`
* using data specification IEC61360,
* the {@link DataSpecificationIec61360.dataType} shall be one of `FILE`,
* `BLOB`, `HTML`
*
* **Note**:
* Categories are deprecated since V3.0 of Part 1a of the document series
* "Details of the Asset Administration Shell".
*
* Constraint `AASc-3a-007`:
* For a {@link ConceptDescription} with {@link ConceptDescription.category} `QUALIFIER_TYPE`
* using data specification IEC61360,
* the {@link DataSpecificationIec61360.dataType} is mandatory and shall be
* defined.
*
* **Note**:
* Categories are deprecated since V3.0 of Part 1a of the document series
* "Details of the Asset Administration Shell".
Expand Down Expand Up @@ -10236,18 +10262,6 @@ export class LangStringDefinitionTypeIec61360
*
* @remarks
* **Note**:
* It is also possible that both {@link DataSpecificationIec61360.value} and {@link DataSpecificationIec61360.valueList} are empty.
* This is the case for concept descriptions that define the semantics of a
* property but do not have an enumeration ({@link DataSpecificationIec61360.valueList}) as data type.
*
* **Note**:
* Although it is possible to define a {@link ConceptDescription} for a
* :attr:´value_list`,
* it is not possible to reuse this {@link DataSpecificationIec61360.valueList}.
* It is only possible to directly add a {@link DataSpecificationIec61360.valueList} as data type
* to a specific semantic definition of a property.
*
* **Note**:
* IEC61360 requires also a globally unique identifier for a concept
* description. This ID is not part of the data specification template.
* Instead the {@link ConceptDescription.id} as inherited via
Expand All @@ -10262,6 +10276,23 @@ export class LangStringDefinitionTypeIec61360
* {@link DataSpecificationIec61360.preferredName}. Same holds for
* {@link ConceptDescription.description} and {@link DataSpecificationIec61360.definition}.
*
* Constraint `AASc-3a-010`:
* If {@link DataSpecificationIec61360.value} is not empty then {@link DataSpecificationIec61360.valueList} shall be empty
* and vice versa.
*
* **Note**:
* It is also possible that both {@link DataSpecificationIec61360.value} and {@link DataSpecificationIec61360.valueList} are
* empty. This is the case for concept descriptions that define the semantics
* of a property but do not have an enumeration ({@link DataSpecificationIec61360.valueList}) as
* data type.
*
* **Note**:
* Although it is possible to define a {@link ConceptDescription} for a
* :attr:´value_list`,
* it is not possible to reuse this {@link DataSpecificationIec61360.valueList}.
* It is only possible to directly add a {@link DataSpecificationIec61360.valueList} as data type
* to a specific semantic definition of a property.
*
* Constraint `AASc-3a-009`:
* If {@link DataSpecificationIec61360.dataType} one of:
* {@link DataTypeIec61360.IntegerMeasure},
Expand Down
Loading

0 comments on commit 8ca55d9

Please sign in to comment.