Azure / opendigitaltwins-dtdl

Digital Twins Definition Language
Creative Commons Attribution 4.0 International
470 stars 160 forks source link

Unit is not defined #39

Closed alfirin closed 4 years ago

alfirin commented 4 years ago

Hello the data type Unit is not defined.

There are some exemples here and there but no specification. Please provide this.

Thanks a lot.

askpatrickw commented 4 years ago

I wonder if unit was replaced with displayUnit and the docs are just incorrectly including both.

Property Required Data type Limits Version rules Description
displayUnit optional string 1-64 chars mutable A localizable unit name for human display.
unit optional Unit   mutable The unit type of the telemetry.
askpatrickw commented 4 years ago

see also #23

askpatrickw commented 4 years ago

Actually... I'm going to change my opinion on this...

Since "C" is the common abbreviation in science for Celsius, then Unit would be C, but the displayUnit could then be:

{
  "en": "Celsius",
  "hr": Celzijus,
  "ar": "مئوية"
}

Where the first example is English, the second Croatian and the third is Arabic. So UNIT is going to dependent on your device data and the standard format for that unit in your industry\country\etc. Examples of Unit would be every kind of unit possible in science and industry which can be expressed using the support dataTypes of the DTDL.

briancr-ms commented 4 years ago

In an upcoming update we will clarify the unit property and the Unit type. I'll be interested to hear your feedback.

askpatrickw commented 4 years ago

Man when I worked at MSFT we had to provide the fix before closing bugs... so cushy nowadays. (that's a joke.) ;-)

Looking forward to hearing more.