[BUG] AASX2SAMM generator should generate valid aspect model: naming convention violated #676
Labels
acknowledged
Has been viewed by one of the maintainers and is ready for further work, discussion or other steps.
bug
Something isn't working
Problem
(aas <aas file> to aspect).
In AASX there is no naming convention requesting that property names start with small letters. And also some special characters like underscore and hyphen are allowed.
Up to now the idShort of AAS Submodel elements are used as property names. Example:
This leads to an invalid SAMM model (see https://eclipse-esmf.github.io/samm-specification/snapshot/namespaces.html#aspect-model-element-identifiers-definition:
See https://admin-shell-io.github.io/aas-specs-antora/IDTA-01001/v3.1/spec-metamodel/common.html#referable-attributes for allowed idShorts (the hyphen will be new with V3.1)
Constraint AASd-002: [idShort](https://admin-shell-io.github.io/aas-specs-antora/IDTA-01001/v3.1/spec-metamodel/common.html#Referable) of [Referable](https://admin-shell-io.github.io/aas-specs-antora/IDTA-01001/v3.1/spec-metamodel/common.html#Referable)s shall only feature letters, digits, hyphen ("-") and underscore ("_"); starting mandatory with a letter, and not ending with a hyphen, i.e. ^[a-zA-Z][a-zA-Z0-9_-]*[a-zA-Z0-9_]+$.
Solution
Example:
AnExample-for_naming_ ==> anExampleForNaming
Ensure that names are still unqiue (e.g three idShorts
AnExample-for_naming_
AnExample-for_naming
andanExampleForNaming
may lead to same SAMM name, in this case add for example number to namesThe text was updated successfully, but these errors were encountered: