Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Add Constraints 131, 133, 134 #91

Closed
wants to merge 13 commits into from

Conversation

dxvidnrt
Copy link
Contributor

This branch adds the new constraints of Version 3.0:

  • AASd-131
  • AASd-133
  • AASd-134

AASd-131: Has no Unittest yet, because there is no such file test_aas.py and the constraint is in aas.py
AASd-133: The constraint is added, there are no changes to the code, because our implementation already uses GlobalReference instead of Reference.

see: https://industrialdigitaltwin.org/wp-content/uploads/2023/04/IDTA-01001-3-0_SpecificationAssetAdministrationShell_Part1_Metamodel.pdf#Page=168

David Niebert added 9 commits June 10, 2023 17:29
* Add docs
* change `ValueError` to `AASConstraintViolation`
* Add check to constructor
Add Constraint to docs
Compare all `idShort`s in the constructor.
Set lists of variables private and check constraint when alternating lists.
Add Unittest
attribute `specific_asset_id` is now also private and checks constraint AASd-131 when being set.
…t AASd-131

The new implemented Constraints AASd-131 enforces, that either `globalAssetId` or `specificAssetId` is defined.
… AASd-134.

Constraint AASd-134 enforces, that all idShorts of input-/output-/inoutput-Variable/value are unique.
…ial_serialization_deserialization.py` to adapt to Constraint AASd-131.

Constraint AASd-131 enforces, that at least `globalAssetId` or `specificAssetId` is defined.
…py` and `json_deserialization.py` to adapt to Constraint AASd-131

Both methods create the `asset_information` object with the `globalAssetId` and `specificAssetId` instead of adding both afterward. This is important, because else AASd-131 is raised.
…to create set of all `specific_asset_ids`
@dxvidnrt dxvidnrt changed the title Add Constraints 131, 133, 134 WIP: Add Constraints 131, 133, 134 Jun 30, 2023
David Niebert added 4 commits June 30, 2023 12:11
…setInformation` without `global_asset_id` and `specific_asset_id`

Version 3.0 introduces new Constraint AASd-131 that prohibits the creation of `AssetInformation`-objects, where `global_asset_id` and `specific_asset_id` are None. Therefore, xml-/json-files that do so are adapted.
… in `test_xml_deserialization.py` or `test_json_deserialization.py`

Version 3.0 adds the Constraint AASd-131, that enforces `assetInformation`-objects to contain at least a `global_asset_id` or `specific_asset_id`
…ibutes.py` and `example_submodel_template.py`

Version 3.0 introduces a new Constraint that enforces all `OperationVariable`'s in one `Operation` element to have different `idShort`'s for their `value`
@dxvidnrt
Copy link
Contributor Author

@s-heppner
There are still some changes to be done.
The new introduced Constraints (131 and 134) don't allow certain creations of objects, such as:

  • assetInformation without global_asset_id and specific_asset_id
  • multiple OperationVariables that have a value with the same id_short

I was not able to resolve all errors in the XML, JSON and AASX files that are occurring because they are working with the above described objects.
All creations of invalid objects have to be removed not only in those files but also in the python-example that is used to compare the files. (example_aas_mandatory_attributes.create_full_example).

@s-heppner Can you assign someone to this PR?

@s-heppner s-heppner mentioned this pull request Sep 1, 2023
26 tasks
@s-heppner
Copy link
Contributor

  • Constraint AASd-131 is already implemented by now
  • We still need to implement AASd-133
  • We also still need to implement AASd-134

@s-heppner
Copy link
Contributor

We decided to implement them as separate PRs rather than this large one

@s-heppner s-heppner closed this Oct 19, 2023
@s-heppner s-heppner added the v3.0 label Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants