I am currently writing my final thesis for a technical high school and chose to use Azure Digital Twins as a way to represent machines (with nested sensors). I want to use components inside my machines for these sensors. Now my problem is, that I can not figure out how to create a machine (digital-twin) with a nested sensor(digital-twin as a component). It would be of great help if you could provide a .net core code sample or a command for the "digital-twins-samples" client that shows a way to create this nesting.
//Machine
{
"@id": "dtmi:mysample:DigitalTwins:MoldMachine;1",
"@type": "Interface",
"displayName": "MoldMachine",
"@context": "dtmi:dtdl:context;2",
"extends": "dtmi:mysample:DigitalTwins:Machine;1",
"contents": [
{
"@type": "Component",
"name": "TemperatureSensor",
"schema": "dtmi:virtualfactory:DigitalTwins:TemperatureSensor;1"
}
]
}
//Sensor
{
"@context": "dtmi:dtdl:context;2",
"@type": "Interface",
"@id": "dtmi:mysample:DigitalTwins:TemperatureSensor;1",
"contents": [
{
"@type": ["Telemetry", "Temperature"],
"schema": "double",
"unit": "degreeCelsius",
"name":"TemperatureTelemetry"
},
{
"@type": "Property",
"schema": "double",
"name":"TemperatureProperty"
}
]
}