-
Notifications
You must be signed in to change notification settings - Fork 15
SAMM2AASX Generator: wrong generated semanticId for Submodel #814
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
Open
e-filchenko-bosh
wants to merge
5
commits into
eclipse-esmf:main
Choose a base branch
from
bci-oss:bci-ossesmf-sdk/794-wrong-generated-semanticid
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
e337c02
fix unordered aspect after files load
e-filchenko-bosh d80eb5d
add test
e-filchenko-bosh 369d7e0
Merge branch 'main' into bci-ossesmf-sdk/794-wrong-generated-semanticid
atextor cab1215
delete deprecated property
e-filchenko-bosh 4fa71e3
Merge remote-tracking branch 'origin/bci-ossesmf-sdk/794-wrong-genera…
e-filchenko-bosh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
core/esmf-test-aspect-models/src/main/java/org/eclipse/esmf/test/OrderingTestAspect.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* Copyright (c) 2025 Robert Bosch Manufacturing Solutions GmbH | ||
* | ||
* See the AUTHORS file(s) distributed with this work for additional | ||
* information regarding authorship. | ||
* | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
* | ||
* SPDX-License-Identifier: MPL-2.0 | ||
*/ | ||
|
||
package org.eclipse.esmf.test; | ||
|
||
import org.apache.commons.text.CaseUtils; | ||
|
||
public enum OrderingTestAspect implements TestOrderingModel { | ||
ASPECT; | ||
|
||
@Override | ||
public String getName() { | ||
return CaseUtils.toCamelCase( toString().toLowerCase(), true, '_' ); | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
core/esmf-test-aspect-models/src/main/java/org/eclipse/esmf/test/TestOrderingModel.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* Copyright (c) 2025 Robert Bosch Manufacturing Solutions GmbH | ||
* | ||
* See the AUTHORS file(s) distributed with this work for additional | ||
* information regarding authorship. | ||
* | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
* | ||
* SPDX-License-Identifier: MPL-2.0 | ||
*/ | ||
|
||
package org.eclipse.esmf.test; | ||
|
||
import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn; | ||
|
||
public interface TestOrderingModel extends TestModel { | ||
String TEST_NAMESPACE = "urn:samm:org.eclipse.esmf.test.ordering:1.0.0#"; | ||
|
||
@Override | ||
default AspectModelUrn getUrn() { | ||
return AspectModelUrn.fromUrn( TEST_NAMESPACE + getName() ); | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
...odels/src/main/resources/valid/org.eclipse.esmf.test.ordering.dependency/1.0.0/Aspect.ttl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Copyright (c) 2025 Robert Bosch Manufacturing Solutions GmbH | ||
# | ||
# See the AUTHORS file(s) distributed with this work for additional | ||
# information regarding authorship. | ||
# | ||
# This Source Code Form is subject to the terms of the Mozilla Public | ||
# License, v. 2.0. If a copy of the MPL was not distributed with this | ||
# file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
# | ||
# SPDX-License-Identifier: MPL-2.0 | ||
|
||
@prefix samm: <urn:samm:org.eclipse.esmf.samm:meta-model:2.2.0#> . | ||
@prefix samm-c: <urn:samm:org.eclipse.esmf.samm:characteristic:2.2.0#> . | ||
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . | ||
|
||
@prefix : <urn:samm:org.eclipse.esmf.test.ordering.dependency:1.0.0#> . | ||
|
||
:Aspect a samm:Aspect ; | ||
samm:description "Test dependency aspect "@en ; | ||
samm:properties ( :test ) ; | ||
samm:operations ( ) ; | ||
samm:events ( ) . | ||
|
||
:test a samm:Property ; | ||
samm:name "test property" ; | ||
samm:characteristic :TestCharacteristic . | ||
|
||
:TestCharacteristic a samm:Characteristic ; | ||
samm:preferredName "Test Characteristic"@en ; | ||
samm:dataType xsd:short . |
23 changes: 23 additions & 0 deletions
23
...st-aspect-models/src/main/resources/valid/org.eclipse.esmf.test.ordering/1.0.0/Aspect.ttl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Copyright (c) 2025 Robert Bosch Manufacturing Solutions GmbH | ||
# | ||
# See the AUTHORS file(s) distributed with this work for additional | ||
# information regarding authorship. | ||
# | ||
# This Source Code Form is subject to the terms of the Mozilla Public | ||
# License, v. 2.0. If a copy of the MPL was not distributed with this | ||
# file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
# | ||
# SPDX-License-Identifier: MPL-2.0 | ||
|
||
@prefix samm: <urn:samm:org.eclipse.esmf.samm:meta-model:2.2.0#> . | ||
@prefix ref: <urn:samm:org.eclipse.esmf.test.ordering.dependency:1.0.0#> . | ||
|
||
@prefix : <urn:samm:org.eclipse.esmf.test.ordering:1.0.0#> . | ||
|
||
:Aspect a samm:Aspect ; | ||
samm:preferredName "Test Aspect"@en ; | ||
samm:description "This is a test description"@en ; | ||
samm:properties ( | ||
ref:test | ||
) ; | ||
samm:operations ( ) . |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this line, "samm:name" was removed in SAMM 2.0.0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First, my initial thought when I started investigating this issue was to fix this part of the code: AbstractInputHandler#expectedAspectName(). However, I encountered a problem. When we talk about expectedAspectName as a short name, it’s easy to compare it with the aspect name because our implementation has enough information for this type of name:
AspectModelUrnInputHandler → urn.getName()
GitHubUrlInputHandler → Extract the name from the URL
FileInputHandler → Extract the name from the file name
The problem arises when we try to compare it with the URN:
AspectModelUrnInputHandler → We already have the URN
GitHubUrlInputHandler → We can create the URN from the URL
FileInputHandler → In this case, we don’t have enough information about the URN, and we need to extract it from inside the file, if I’m not mistaken
That’s why I tried to decrease the chances of reproducing this issue by adding an order to the file upload process.
I will now try to enrich the context for FileInputHandler with the URN.