-
Notifications
You must be signed in to change notification settings - Fork 164
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
relationships should support multiple targets and/or multiple versions #133
Comments
Hi @uriel-kluk Can you use two relationships? one for each version /c @cschormann |
Thanks, Rido,
The challenge is when you migrate models and break the relationships.
Assume you have a Gateway that targets leaf devices. (in some cases, 1000s as in LoRa gateways).
Then, during the lifecycle of the leaf devices, the model changes.
But we cannot migrate unless we update models on all the devices (this could require OTA) and the gateway at once.
The options we are evaluating as workarounds:
1. Multiple relationships as you mentioned, but now we need different queries
2. Create a base atomic model with the relationship to extend the leaf devices.
3. Do not include the target in the relationship.
Something we would like to suggest is for ADT to support a Target with multiple versions:
{
***@***.***": "dtmi:MeshSystems:core:gateway;1",
***@***.***": "Interface",
***@***.***": "dtmi:dtdl:context;2",
"extends": "dtmi:MeshSystems:core:device;1",
"displayName": "Gateway",
"contents": [
{
***@***.***": "Relationship",
"name": "contains",
"target": "dtmi:MeshSystems:core:device;*",
"properties": [
{
***@***.***": "Property",
"name": "rssi",
"schema": "integer"
},
{
***@***.***": "Property",
"name": "eventType",
"schema": "string"
}
]
}
]
}
From: Rido ***@***.***>
Sent: Friday, January 27, 2023 9:30 AM
To: Azure/opendigitaltwins-dtdl ***@***.***>
Cc: Uriel Kluk ***@***.***>; Mention ***@***.***>
Subject: Re: [Azure/opendigitaltwins-dtdl] relationships should support multiple targets and/or multiple versions (Issue #133)
Hi @uriel-kluk<https://github.com/uriel-kluk>
Can you use two relationships? one for each version
/c @cschormann<https://github.com/cschormann>
—
Reply to this email directly, view it on GitHub<#133 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AJ2NCAYMNJQAKKQ32QIMHR3WUPSY5ANCNFSM6AAAAAAQTFZ7YY>.
You are receiving this because you were mentioned.Message ID: ***@***.******@***.***>>
|
+1 on this We have multiple OWL ontologies where the same relationship name is used with multiple targets to enforce specific hierarchies. We convert them to DTDL, but we currently have to ignore these targets because of this limitation. Here's an example of how we represent this in OWL (TTL)
the hasPart relationship should ideally be defined like this, which isn't possible
We've considered the proposed workaround as well (multiple relationship names, creating an abstract class like ArchBridgePart), but as these ontologies are also used by other applications (RDF based), we don't want to adapt the ontologies to the limitations of DTDL. In addition, we're generating about 10000 DTDL models and it would blow up the size significantly (and it would add even more complexity to our internal OWL2DTDL implementation). Our current workaround would be to store the targets in the comment and read those in the client (so not enforcing them in ADT). But this isn't really a sustainable workaround. |
As it happens, ADT ignores the version suffix of Relationship targets. So, if your model specifies:
Then the target of any Relationship instances can have type If you are using DTDL v3, you can omit the version suffix from the target property value, which will make the matching semantics a bit clearer:
|
Example
As an ontology designer, I would like space to host different devices
"target": "dtmi:MeshSystems:core:device;*"
Instead of the wildcard
*
the version could be omitted, this is just an idea.or
"target": ["dtmi:MeshSystems:core:device;1", "dtmi:MeshSystems:core:device;2"]
The text was updated successfully, but these errors were encountered: