From 0043b28decef6cc6a2d41614bf589c2fefd4922b Mon Sep 17 00:00:00 2001 From: Ash Beitz <8304894+ashbeitz@users.noreply.github.com> Date: Fri, 10 May 2024 10:52:33 -0700 Subject: [PATCH] Digital Twin Graph --- .../digital_twin_graph/.accepted_words.txt | 1 + .../modules/digital_twin_graph/README.md | 11 ++++++++ .../diagrams/digital_twin_graph_component.svg | 28 ++++--------------- .../diagrams/find_sequence.puml | 8 ++++-- .../diagrams/find_sequence.svg | 18 ++++++------ .../diagrams/get_sequence.puml | 5 ++-- .../diagrams/get_sequence.svg | 15 +++++----- .../diagrams/invoke_sequence.puml | 3 +- .../diagrams/invoke_sequence.svg | 13 +++++---- .../diagrams/set_sequence.puml | 5 ++-- .../diagrams/set_sequence.svg | 15 +++++----- 11 files changed, 63 insertions(+), 59 deletions(-) diff --git a/docs/design/modules/digital_twin_graph/.accepted_words.txt b/docs/design/modules/digital_twin_graph/.accepted_words.txt index 1b44e566..25fc9579 100644 --- a/docs/design/modules/digital_twin_graph/.accepted_words.txt +++ b/docs/design/modules/digital_twin_graph/.accepted_words.txt @@ -1,6 +1,7 @@ Agemo App com +DTDL freyja Freyja github diff --git a/docs/design/modules/digital_twin_graph/README.md b/docs/design/modules/digital_twin_graph/README.md index 7eb63792..27f47c87 100644 --- a/docs/design/modules/digital_twin_graph/README.md +++ b/docs/design/modules/digital_twin_graph/README.md @@ -2,6 +2,7 @@ - [Introduction](#introduction) - [Architecture](#architecture) +- [Identifiers](#identifiers) - [Operations](#operations) ## Introduction @@ -33,6 +34,16 @@ The Managed Subscriber Service is an optional service that provides integration ![Component Diagram](diagrams/digital_twin_graph_component.svg) +## Identifiers + +The Digital Twin Graph will use a variety of identifiers. We will discuss the purpose of each. + +The provider ID is the identifier for a Digital Twin Provider. + +The model ID is the identifier for a DTDL fragment. It is expressed as a [DTMI](https://github.com/Azure/opendigitaltwins-dtdl/blob/master/DTDL/v3/DTDL.v3.md#digital-twin-model-identifier). + +The instance ID is the identifier for a digital twin entity. A digital twin may be decomposed into digital twin entities. Each digital twin entity is defined by a fragment of the digital twin's model (specified in DTDL). + ## Operations The Digital Twin Graph Service will support four operations: diff --git a/docs/design/modules/digital_twin_graph/diagrams/digital_twin_graph_component.svg b/docs/design/modules/digital_twin_graph/diagrams/digital_twin_graph_component.svg index 80585b63..a4117dcd 100644 --- a/docs/design/modules/digital_twin_graph/diagrams/digital_twin_graph_component.svg +++ b/docs/design/modules/digital_twin_graph/diagrams/digital_twin_graph_component.svg @@ -1,24 +1,5 @@ -Digital Twin App ServerDigital Twin Graph ServiceDigital Twin Registry ServiceInvehicle Digital Twin ServiceManaged Subscribe ServiceDigital Twin ProviderDigital Twin ConsumerDigital Twin Graph InterfaceRespond InterfaceDigital Twin Registry InterfaceInvehicle Digital Twin InterfaceManaged Subscribe InterfaceRequest InterfaceRegisterFind/Get/Set/InvokeFindByModelIdAskAnswerDigital Twin App ServerDigital Twin Graph ServiceDigital Twin Registry ServiceInvehicle Digital Twin ServiceManaged Subscribe ServiceDigital Twin ProviderDigital Twin ConsumerDigital Twin Graph InterfaceRespond InterfaceDigital Twin Registry InterfaceInvehicle Digital Twin InterfaceManaged Subscribe InterfaceRequest InterfaceRegisterFind/Get/Set/InvokeFindByModelIdAskAnswer \ No newline at end of file diff --git a/docs/design/modules/digital_twin_graph/diagrams/find_sequence.puml b/docs/design/modules/digital_twin_graph/diagrams/find_sequence.puml index 08040588..5698638f 100644 --- a/docs/design/modules/digital_twin_graph/diagrams/find_sequence.puml +++ b/docs/design/modules/digital_twin_graph/diagrams/find_sequence.puml @@ -13,18 +13,20 @@ DIGITAL_TWIN_GRAPH -> DIGITAL_TWIN_REGISTRY: FindByModeld(model_id: "dtmi:sdv:se DIGITAL_TWIN_GRAPH <- DIGITAL_TWIN_REGISTRY: FindByModelId - response note left - list of EndpointInfo + list of EntityAcessInfo [ { - model_id : "dtmi:sdv:seat;1" + provider_id: "vehicle-core" + model_id: "dtmi:sdv:seat;1" instance_id: "front left seat" protocol: "grpc" operations: ["get", "invoke"] uri: Digital Twin Provider's uri }, { - model_id : "dtmi:sdv:seat;1" + provider_id: "vehicle-core" + model_id: "dtmi:sdv:seat;1" instance_id: "front right seat" protocol: "grpc" operations: ["get", "invoke"] diff --git a/docs/design/modules/digital_twin_graph/diagrams/find_sequence.svg b/docs/design/modules/digital_twin_graph/diagrams/find_sequence.svg index 8b4f2678..9e5ba178 100644 --- a/docs/design/modules/digital_twin_graph/diagrams/find_sequence.svg +++ b/docs/design/modules/digital_twin_graph/diagrams/find_sequence.svg @@ -1,6 +1,5 @@ -Digital Twin ConsumerDigital Twin ConsumerDigital Twin GraphDigital Twin GraphDigital Twin RegistryDigital Twin RegistryDigital Twin ProviderDigital Twin Provider1Find(model_id: "dtmi:sdv:seat;1") - request2FindByModeld(model_id: "dtmi:sdv:seat;1") - request3FindByModelId - responselist of EndpointInfo[{model_id : "dtmi:sdv:seat;1"instance_id: "front left seat"protocol: "grpc"operations: ["get", "invoke"]uri: Digital Twin Provider's uri},{model_id : "dtmi:sdv:seat;1"instance_id: "front right seat"protocol: "grpc"operations: ["get", "invoke"]uri: Digital Twin Provider's uri}]loop[Iterate over the results from the FindByModelId call]4Ask(respond_uri: respond uri for Digital Twin Graph, ask_id: "1", payload: {instance_id: "front left seat", operation: "get" })5Answer(ask_id: "1", payload: instance value as JSON-LD string)6Find - responselist of instance values as JSON-LD string[{"@context": [ "dtmi:dtdl:context;3", "dtmi:sdv:context;1"]"@id": "front left seat","@type": "dtmi:sdv:seat;1","seat_massager": [{"@id": "front left seat massager"}]},{"@context": [ "dtmi:dtdl:context;3", "dtmi:sdv:context;1"]"@id": "front right seat","@type": "dtmi:sdv:seat;1","seat_massager": [{"@id": "front right seat massager"}]}] \ No newline at end of file diff --git a/docs/design/modules/digital_twin_graph/diagrams/get_sequence.puml b/docs/design/modules/digital_twin_graph/diagrams/get_sequence.puml index fa275fb5..319d021f 100644 --- a/docs/design/modules/digital_twin_graph/diagrams/get_sequence.puml +++ b/docs/design/modules/digital_twin_graph/diagrams/get_sequence.puml @@ -12,14 +12,15 @@ CONSUMER -> DIGITAL_TWIN_GRAPH: Get(instance_id: "the vehicle", member_path: "ve DIGITAL_TWIN_GRAPH -> DIGITAL_TWIN_REGISTRY: FindByInstanceId(instance_id: "the vehicle") - request DIGITAL_TWIN_GRAPH <- DIGITAL_TWIN_REGISTRY: FindByInstanceId - response note left - list of EndpointInfo + list of EntityAccessInfo [ { + provider_id: "vehicle-core" model_id : "dtmi:sdv:vehicle;1" instance_id: "the vehicle" protocol: "grpc" - operations: ["Get"] + operations: ["get"] uri: Digital Twin Provider's uri } ] diff --git a/docs/design/modules/digital_twin_graph/diagrams/get_sequence.svg b/docs/design/modules/digital_twin_graph/diagrams/get_sequence.svg index e77425e0..4f7c6bb6 100644 --- a/docs/design/modules/digital_twin_graph/diagrams/get_sequence.svg +++ b/docs/design/modules/digital_twin_graph/diagrams/get_sequence.svg @@ -1,6 +1,5 @@ -Digital Twin ConsumerDigital Twin ConsumerDigital Twin GraphDigital Twin GraphDigital Twin RegistryDigital Twin RegistryDigital Twin ProviderDigital Twin Provider1Get(instance_id: "the vehicle", member_path: "vehicle_identification") - request2FindByInstanceId(instance_id: "the vehicle") - request3FindByInstanceId - responselist of EndpointInfo[{model_id : "dtmi:sdv:vehicle;1"instance_id: "the vehicle"protocol: "grpc"operations: ["Get"]uri: Digital Twin Provider's uri}]4Ask(respond_uri: respond uri for Digital Twin Graph, ask_id: "3", payload: {instance_id: "the vehicle", operation: "get", member_path: "vehicle_identification"})5Answer(ask_id: "3", payload: instance value as JSON-LD string)6Get - responseinstance value as JSON-LD string{"@context": [ "dtmi:dtdl:context;3", "dtmi:sdv:context;1"]"@type": "dtmi:sdv:vehicle:vehicle_identification;1","vehicle_identification": [{"vin": "1HGCM82633A123456"}]} \ No newline at end of file diff --git a/docs/design/modules/digital_twin_graph/diagrams/invoke_sequence.puml b/docs/design/modules/digital_twin_graph/diagrams/invoke_sequence.puml index 88159fa0..2ece82ea 100644 --- a/docs/design/modules/digital_twin_graph/diagrams/invoke_sequence.puml +++ b/docs/design/modules/digital_twin_graph/diagrams/invoke_sequence.puml @@ -12,10 +12,11 @@ CONSUMER -> DIGITAL_TWIN_GRAPH: Invoke(instance_id: "front left seat massager", DIGITAL_TWIN_GRAPH -> DIGITAL_TWIN_REGISTRY: FindByInstanceId(id: "front left seat massager") - request DIGITAL_TWIN_GRAPH <- DIGITAL_TWIN_REGISTRY: FindByInstanceId - response note left - list of EndpointInfo + list of EntityAccessInfo [ { + provider_id: "vehicle-core" model_id : "dtmi:sdv:premium_airbag_seat_massager;1" instance_id: "front left seat massager" protocol: "grpc" diff --git a/docs/design/modules/digital_twin_graph/diagrams/invoke_sequence.svg b/docs/design/modules/digital_twin_graph/diagrams/invoke_sequence.svg index 37aa956f..223ad054 100644 --- a/docs/design/modules/digital_twin_graph/diagrams/invoke_sequence.svg +++ b/docs/design/modules/digital_twin_graph/diagrams/invoke_sequence.svg @@ -1,6 +1,5 @@ -Digital Twin ConsumerDigital Twin ConsumerDigital Twin GraphDigital Twin GraphDigital Twin RegistryDigital Twin RegistryDigital Twin ProviderDigital Twin Provider1Invoke(instance_id: "front left seat massager", member_path: "perform_step", request_payload: request payload as JSON-LD string) - request2FindByInstanceId(id: "front left seat massager") - request3FindByInstanceId - responselist of EndpointInfo[{model_id : "dtmi:sdv:premium_airbag_seat_massager;1"instance_id: "front left seat massager"protocol: "grpc"operations: ["get", "invoke"]uri: Digital Twin Provider's uri}]4Ask(respond_uri: respond uri for Digital Twin Graph, ask_id: "5", payload: {instance_id: "front left seat massager", operation: "invoke", member_path: "perform_step", payload: the request payload as JSON-LD string})5Answer(ask_id: "5", payload: response payload as JSON-LD string)6Invoke - responseresponse payload as JSON-LD string \ No newline at end of file diff --git a/docs/design/modules/digital_twin_graph/diagrams/set_sequence.puml b/docs/design/modules/digital_twin_graph/diagrams/set_sequence.puml index 39353361..6393c443 100644 --- a/docs/design/modules/digital_twin_graph/diagrams/set_sequence.puml +++ b/docs/design/modules/digital_twin_graph/diagrams/set_sequence.puml @@ -12,14 +12,15 @@ CONSUMER -> DIGITAL_TWIN_GRAPH: Set(instance_id: "the vehicle", member_path: "ve DIGITAL_TWIN_GRAPH -> DIGITAL_TWIN_REGISTRY: FindByInstanceId(instance_id: "the vehicle") - request DIGITAL_TWIN_GRAPH <- DIGITAL_TWIN_REGISTRY: FindByInstanceId - response note left - list of EndpointInfo + list of EntityAccessInfo [ { + provider_id: "vehicle-core" model_id : "dtmi:sdv:vehicle;1" instance_id: "the vehicle" protocol: "grpc" - operations: ["Get"] + operations: ["get"] uri: Digital Twin Provider's uri } ] diff --git a/docs/design/modules/digital_twin_graph/diagrams/set_sequence.svg b/docs/design/modules/digital_twin_graph/diagrams/set_sequence.svg index 68dd9b8e..8a46a65e 100644 --- a/docs/design/modules/digital_twin_graph/diagrams/set_sequence.svg +++ b/docs/design/modules/digital_twin_graph/diagrams/set_sequence.svg @@ -1,6 +1,5 @@ -Digital Twin ConsumerDigital Twin ConsumerDigital Twin GraphDigital Twin GraphDigital Twin RegistryDigital Twin RegistryDigital Twin ProviderDigital Twin Provider1Set(instance_id: "the vehicle", member_path: "vehicle_identification/vin", value: value as JSON-LD string) - request2FindByInstanceId(instance_id: "the vehicle") - request3FindByInstanceId - responselist of EndpointInfo[{model_id : "dtmi:sdv:vehicle;1"instance_id: "the vehicle"protocol: "grpc"operations: ["Get"]uri: Digital Twin Provider's uri}]4Ask(respond_uri: respond uri for Digital Twin Graph, ask_id: "4", payload: {instance_id: "the vehicle", operation: "set", member_path: "vehicle_identification/vin", payload: the value as JSON-LD string})5Answer(ask_id: "4", payload: "")6Set - response \ No newline at end of file