eclipse-aaspe / package-explorer

AASX Package Explorer
Other
55 stars 20 forks source link

Show display names instead of IDs #8

Open WelliSolutions opened 8 months ago

WelliSolutions commented 8 months ago

Is your feature request related to a problem? Please describe. When opening AASX files that were machine-generated, the IDs are generated as well. Such IDs are human-readable, but they are not meaningful. A picture may be worth more than words:

AASX file with generated IDs

Many AASX files seem to be hand-made, i.e. created by humans in Package Explorer. They craft the IDs in a way that they make sense for humans. An example is

AASX file with hand-crafted IDs

The problem is: this will not last very long. You can't e.g. have a second AAS in the same AASX file, which also has a "Nameplate" submodel, simply because the ID already exists and it no longer unique.

Describe the solution you'd like Instead of showing IDs, my suggestion would be to display the "displayName" in the tree for better navigation.

Show displayName instead

Describe alternatives you've considered I have considered generating IDs that carry meaningful information, e.g. "Nameplate_1", but there are too many different cases and names to be generated.

Additional context Can't think of more context.

BirgitBoss commented 8 months ago

The idShort are defined within the submodel templates that guided the creation of a Submodel (instance). These idShort names are typically generated or directly copied from the concept definition, the concept description being either a Concept Description within the AAS itself, within ECLASS or e.g. in a SAMM model.

See also Table 2 "Elements with Allowed Identifying Values" within IDTA-01001-3- how to choose the idShort and the display name,

Which use case do you have that generates arbitrary idShort names?

WelliSolutions commented 8 months ago

Thanks for pointing me to table 2 of the specification.

So we have two problems here.

  1. if the submodel is not defined by a template and
  2. if the submodel is defined by a template

If the submodel is not defined, I can create a custom ID, like I did in the example above. The tree displayed by Package Explorer is not helpful then. It would be more helpful if it displayed the displayName. Displaying a display name sounds reasonable from the wording.

In the second case, let's assume that the IDs are copied from a concept definition. If I have 2 AAS inside one AASX file and both AAS shall have the same concept, e.g. Nameplate. How is the ID conflict resolved then?

BirgitBoss commented 2 weeks ago

There are not conflicts if the idShort of two submodels within the same AAS are identical. There is only a conflict if the Submodel/id is identical.

BirgitBoss commented 2 weeks ago

This feature is more complicated because the display name can be provided in several languages. So you need a configuration parameter which language you prefer. Then you need a strategy what to do if your preferred language is not available a.s.o.

The display name is just optional and in many submodels no display is available (again, it could be taken from the concept description if available)

I personally do not think that idShort will be generated (except for SML if they would or will be allowed). If you generate Submodels then you always have some kind of Submodel Template in mind. Otherwise you cannot generate a Submodel but just edit it manually. What can be generated is the id of submodels and AASs. This is also what the aasx package explorer is doing.