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

bugfix: SAMM-CLI aas generation: ConceptDescription idShort based on … #471

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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( ID_PREFIX + 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 @@ -289,15 +289,17 @@ void testGenerateAasxFromAspectModelWithEnumeration() throws IOException, Deseri

assertEquals( 2, env.getConceptDescriptions().size() );

final DataSpecificationIec61360 dataSpecificationContent = (DataSpecificationIec61360) env.getConceptDescriptions().stream()
.filter( conceptDescription -> conceptDescription.getIdShort().equals( "TestEnumeration" ) )
.findFirst()
.get()
.getEmbeddedDataSpecifications()
.stream()
.findFirst()
.get()
.getDataSpecificationContent();
final DataSpecificationIec61360 dataSpecificationContent =
(DataSpecificationIec61360)
env.getConceptDescriptions().stream()
.filter( x -> x.getIdShort().equals( "id_testProperty" ) )
.findFirst()
.get()
.getEmbeddedDataSpecifications()
.stream()
.findFirst()
.get()
.getDataSpecificationContent();
assertEquals( 3, dataSpecificationContent.getValueList().getValueReferencePairs().size() );

assertEquals( 1, env.getSubmodels().size() );
Expand Down
Loading