Skip to content

Commit

Permalink
bugfix: SAMM-CLI aas generation: ConceptDescription idShort based on …
Browse files Browse the repository at this point in the history
…property name

Changes:

- Provide id_short of Property name to ConceptDescription;
- Provide Property displayName to ConceptDescription;
- Fix tests.

Fixes eclipse-esmf#457
  • Loading branch information
Yauhenikapl committed Nov 24, 2023
1 parent ae63e63 commit 4be18c6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -358,13 +358,12 @@ private void createConceptDescription( final Property property, final Context co
if ( property.getCharacteristic().isEmpty() ) {
return;
}
final Characteristic characteristic = property.getCharacteristic().get();
// check if the concept description is already created. If not create a new one.
if ( !context.hasEnvironmentConceptDescription( property.getAspectModelUrn().toString() ) ) {
final ConceptDescription conceptDescription =
new DefaultConceptDescription.Builder()
.idShort( characteristic.getName() )
.displayName( LangStringMapper.NAME.map( characteristic.getPreferredNames() ) )
.idShort( property.getName() )
.displayName( LangStringMapper.NAME.map( property.getPreferredNames() ) )
.embeddedDataSpecifications( extractEmbeddedDataSpecification( property ) )
.id( DEFAULT_MAPPER.determineIdentifierFor( property ) )
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ void testGenerateAasxFromAspectModelWithEnumeration() throws IOException, Deseri
assertEquals( 2, env.getConceptDescriptions().size() );

final DataSpecificationIec61360 dataSpecificationContent = (DataSpecificationIec61360) env.getConceptDescriptions().stream()
.filter( conceptDescription -> conceptDescription.getIdShort().equals( "TestEnumeration" ) )
.filter( conceptDescription -> conceptDescription.getIdShort().equals( "testProperty" ) )
.findFirst()
.get()
.getEmbeddedDataSpecifications()
Expand Down

0 comments on commit 4be18c6

Please sign in to comment.