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 [#12] which makes the
  errors in XML more meaningful and easier to debug, and
* 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

[#12]: aas-core-works/aas-core3.0-testgen#12
[#13]: aas-core-works/aas-core3.0-testgen#13
  • Loading branch information
mristin committed Jun 24, 2023
1 parent 7001e48 commit 053e8ea
Show file tree
Hide file tree
Showing 199 changed files with 290 additions and 1,227 deletions.
134 changes: 88 additions & 46 deletions aas_core3/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -639,17 +639,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 @@ -1003,29 +1003,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 @@ -4378,25 +4378,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 @@ -5847,20 +5882,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 @@ -5878,6 +5899,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 aas_core3/verification.py
Original file line number Diff line number Diff line change
Expand Up @@ -2216,7 +2216,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 @@ -2465,7 +2466,7 @@ def transform_submodel(self, that: aas_types.Submodel) -> Iterator[Error]:
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 @@ -5695,7 +5696,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 requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ pylint==2.15.4
coverage>=6.5.0,<7
pyinstaller>=5<6
twine
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
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,7 @@
"assetAdministrationShells": [
{
"administration": {
"creator": [
{
"keys": [
{
"type": "GlobalReference",
"value": "unexpected instance"
}
],
"type": "ExternalReference"
}
],
"creator": "Unexpected string value",
"embeddedDataSpecifications": [
{
"dataSpecification": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
assetAdministrationShells[0].administration.creator: Expected a mapping, but got: <class 'list'>
assetAdministrationShells[0].administration.creator: Expected a mapping, but got: <class 'str'>
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,7 @@
"name": "something_aa1af8b3"
}
],
"first": [
{
"keys": [
{
"type": "GlobalReference",
"value": "unexpected instance"
}
],
"type": "ExternalReference"
}
],
"first": "Unexpected string value",
"idShort": "PiXO1wyHierj",
"modelType": "AnnotatedRelationshipElement",
"qualifiers": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
submodels[0].submodelElements[0].first: Expected a mapping, but got: <class 'list'>
submodels[0].submodelElements[0].first: Expected a mapping, but got: <class 'str'>
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,7 @@
"valueType": "xs:long"
}
],
"second": [
{
"keys": [
{
"type": "GlobalReference",
"value": "unexpected instance"
}
],
"type": "ExternalReference"
}
],
"second": "Unexpected string value",
"semanticId": {
"keys": [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
submodels[0].submodelElements[0].second: Expected a mapping, but got: <class 'list'>
submodels[0].submodelElements[0].second: Expected a mapping, but got: <class 'str'>
Original file line number Diff line number Diff line change
Expand Up @@ -82,17 +82,7 @@
],
"type": "ExternalReference"
},
"semanticId": [
{
"keys": [
{
"type": "GlobalReference",
"value": "unexpected instance"
}
],
"type": "ExternalReference"
}
],
"semanticId": "Unexpected string value",
"supplementalSemanticIds": [
{
"keys": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
submodels[0].submodelElements[0].semanticId: Expected a mapping, but got: <class 'list'>
submodels[0].submodelElements[0].semanticId: Expected a mapping, but got: <class 'str'>
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
{
"assetAdministrationShells": [
{
"administration": [
{
"keys": [
{
"type": "GlobalReference",
"value": "unexpected instance"
}
],
"type": "ExternalReference"
}
],
"administration": "Unexpected string value",
"assetInformation": {
"assetKind": "NotApplicable",
"globalAssetId": "something_eea66fa1"
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
assetAdministrationShells[0].administration: Expected a mapping, but got: <class 'list'>
assetAdministrationShells[0].administration: Expected a mapping, but got: <class 'str'>
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,7 @@
"assetAdministrationShells": [
{
"administration": {},
"assetInformation": [
{
"keys": [
{
"type": "GlobalReference",
"value": "unexpected instance"
}
],
"type": "ExternalReference"
}
],
"assetInformation": "Unexpected string value",
"category": "something_1dc62cea",
"derivedFrom": {
"keys": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
assetAdministrationShells[0].assetInformation: Expected a mapping, but got: <class 'list'>
assetAdministrationShells[0].assetInformation: Expected a mapping, but got: <class 'str'>
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,7 @@
"globalAssetId": "something_eea66fa1"
},
"category": "something_1dc62cea",
"derivedFrom": [
{
"keys": [
{
"type": "GlobalReference",
"value": "unexpected instance"
}
],
"type": "ExternalReference"
}
],
"derivedFrom": "Unexpected string value",
"description": [
{
"language": "Tvwqa-500-8EQd-y-8f5-k-vqdMn7-Ohw9-CcA628-DHKP-hPAjUZ-cnr1REUf-S8-p-9X0r-wtCI-KunG3uzI-7dGUsrTu-fY7-C3-hFN-Y-ML69DgnJ-0-Y0H-TLACBVB-Z0HRibbz-yzSf8dvR-zAn-B-6h8VjcKX-jnwR-0Z8l-ghRIZ7mo-wZG7-zXHdSIV-Oy-8dH00A6L-nJY2dA1-57o8dQ-RpxkBTbE-qBJR-M-DyGDA3U-aguRfIhj-x-XmO-1u",
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
assetAdministrationShells[0].derivedFrom: Expected a mapping, but got: <class 'list'>
assetAdministrationShells[0].derivedFrom: Expected a mapping, but got: <class 'str'>
Loading

0 comments on commit 053e8ea

Please sign in to comment.