Open krwq opened 3 years ago
This might be a dup of https://github.com/Azure/opendigitaltwins-dtdl/issues/81
Yes, based on the way we've been thinking about this, this would be a dup of #81. Without going into all the details, we've been thinking about enabling semantic types at the field level in an Object. Something like this example:
{
"@type": "Object",
"fields": [
{
"@type": [ "Field", "Temperature" ],
"name": "temp",
"schema": "double",
"unit": "degreeCelsius"
},
{
"@type": [ "Field", "RelativeHumidity" ],
"name": "humidity",
"schema": "integer",
"unit": "percent"
}
]
}
Would an approach like this cover your use cases?
Yes I think so, cc: @colombod
as a side note: since all fields are under "fields" should "Field" type be implied?
Yes, we may be able to infer the "Field" type. That's one of the details that needs to be nailed down.
Could you enable being able to create multidimensional units? Our (https://github.com/dotnet/iot) LSM9DS1 sensor (embedded on SenseHat) and many other sensors return 3-dimensional units but currently using array or object with units is not possible.
I.e.: (object)
causes:
Array:
causes