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

[BUG] AASX2SAMM generator should generate valid aspect model: naming convention violated #676

Open
BirgitBoss opened this issue Nov 8, 2024 · 0 comments
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

Comments

@BirgitBoss
Copy link
Contributor

BirgitBoss commented Nov 8, 2024

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:


:DigitalNameplate a samm:Aspect ;
   samm:description "Contains the nameplate information attached to the product"@en ;
   samm:see <https://admin-shell.io/idta/SubmodelTemplate/DigitalNameplate/2/0> ;
   samm:properties (
      :URIOfTheProduct
      :SerialNumber
      :YearOfConstruction
      :DateOfManufacture



This leads to an invalid SAMM model (see https://eclipse-esmf.github.io/samm-specification/snapshot/namespaces.html#aspect-model-element-identifiers-definition:

element-name — The name of the element:

    For Aspects, Entities and Characteristics, the name must be given in [UpperCamelCase](https://en.wikipedia.org/wiki/Camel_case)

    For Properties, Operations and Units, the name must be given in [lowerCamelCase](https://en.wikipedia.org/wiki/Camel_case)

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

  • convert idShort to valid SAMM names
    Example: AnExample-for_naming_ ==> anExampleForNaming
    Ensure that names are still unqiue (e.g three idShorts AnExample-for_naming_ AnExample-for_naming and anExampleForNaming may lead to same SAMM name, in this case add for example number to names
  • add original idShort as payload name (very important to ensure that Value-Only-Format in JSON format is identical)
@BirgitBoss BirgitBoss added the bug Something isn't working label Nov 8, 2024
@chris-volk chris-volk added the acknowledged Has been viewed by one of the maintainers and is ready for further work, discussion or other steps. label Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

2 participants