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

Best approach for updating 'extends'-references when updating model version #164

Open
mwdhont-auge opened this issue Apr 4, 2023 · 1 comment

Comments

@mwdhont-auge
Copy link

Hi,

What's the best approach to update the version number of the 'extends'-references when the mother class updated?

For example, a the following building-class extends from the following 2 classes:

{
    "@id": "dtmi:org:auge:Building;1",
    "@type": "Interface",
    "description": {
      "en": "Aug.e version of building."
    },
    "displayName": "Building",
    "@context": "dtmi:dtdl:context;2",
    "extends" : [
      "dtmi:org:w3id:rec:Building;1",
      "dtmi:org:auge:Space;**1**"
  ]
  }

When you decide to update the "dtmi:org:auge:Space;1"-class to version number 2, it can become cumbersome to update all references of version 1 to version 2, i.e.,

{
"@id": "dtmi:org:auge:Building;1",
"@type": "Interface",
"description": {
"en": "Aug.e version of building."
},
"displayName": "Building",
"@context": "dtmi:dtdl:context;2",
"extends" : [
"dtmi:org:w3id:rec:Building;1",
"dtmi:org:auge:Space;2"
]
}


Questions:
1. Are there any best practices, tools, guideline available for this operation?
2. Should the version number of the extending class, in this case "dtmi:org:auge:Building;1", also be increased to "dtmi:org:auge:Building;2"?

Michiel
@jrdouceur
Copy link
Collaborator

Hi Michiel,

I don't have an especially good answer to your first question. We have done some preliminary thinking about tools and systems for managing model ontologies, part of which would be facilitating revisions to an entire ontology in a consistent way. Unfortunately, this has not been a high enough relative priority to drive the design and development work that would be needed to produce a usable tool or system.

We do have a (not yet released) tool for supporting the upgrade of models from DTDL v2 to DTDL v3, and this tool also consistently increases the version numbers of all identifiers in the set of models being upgraded. We are considering releasing this tool as part of the GA of DTDL v3 and the next model parser, but it does not support generalized re-versioning of models, only the particular case of DTDL language-version upgrade.

Your second question is easier. The short answer is yes. The somewhat longer answer is: Each identifier must have no more than one definition, and since the definition of dtmi:org:auge:Building;1 includes an explicit reference to dtmi:org:auge:Space;1, it cannot also have a definition in which this is replaced by an explicit reference to dtmi:org:auge:Space;2. So, it is necessary to provide a new identifier for this revised definition, and an intuitive choice for the new identifier is one that matches the old identifier except for an increased version number suffix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants