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

SAMM-CLI aas generation: Mapping of Set Characteristics #597

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

Yauhenikapl
Copy link
Contributor

@Yauhenikapl Yauhenikapl commented Jun 21, 2024

Description

Changes:

  • update SubModel SemanticId type to Global Reference type;
  • Update SubModel relevantOrder to false for Collections;
  • Update typeModelElementList to subModelElementCollection and remove empty value in property;
  • Add generation unique Ids for enumeration elements.

Fixes #481

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works

@Yauhenikapl Yauhenikapl changed the title Update SubModel SemanticId type to Global Reference SAMM-CLI aas generation: Mapping of Set Characteristics Jun 26, 2024
@Yauhenikapl Yauhenikapl marked this pull request as ready for review June 27, 2024 06:05
@Yauhenikapl Yauhenikapl requested a review from atextor June 27, 2024 06:05
Copy link
Contributor

@BirgitBoss BirgitBoss left a comment

Choose a reason for hiding this comment

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

see finding from Andreas: it seems the characteristic is not taken into account when determining the typeValueElementList value.

* @return the transformed string in the format "_role[8_characters_of_hash]"
* @throws NoSuchAlgorithmException if the SHA-256 algorithm is not available
*/
private String transformEnumerationValue( final String enumValue ) throws NoSuchAlgorithmException {
Copy link
Contributor

Choose a reason for hiding this comment

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

How would the mapping work in the opposite direction with this approach?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think, that I have to add separate method in the opposite direction.

Thanks!

Copy link
Contributor

@BirgitBoss BirgitBoss left a comment

Choose a reason for hiding this comment

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

I did not check the complete code, but see some comments/questions

defaultProperty.setIdShort( context.getPropertyShortId() );
defaultProperty.setValueType( AasDataTypeMapper.mapAspectTypeToAasXsdDataType( mapType( type ) ) );
defaultProperty.setDisplayName( LangStringMapper.NAME.map( property.getPreferredNames() ) );
defaultProperty.setSemanticId( buildPropertyReferenceToGlobalReference( property ) );
Copy link
Contributor

Choose a reason for hiding this comment

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

Why propertyReference?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Could you please explain more, because in this method "buildPropertyReferenceToGlobalReference" we building GlobalReference, not property reference?

@BirgitBoss

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.

[BUG] SAMM-CLI aas generation: Mapping of Set Characteristics
4 participants