Closed samubura closed 1 year ago
DTDL v2 supports a percent unit (used with the RelativeHumidity semantic type). Our approach for semantic types (more specifically quantitative types for expressing measurements) has been to use the semantic type to express what the element is measuring (temperature, humidity, etc.) and to use the unit to express the units the measurement is in. Is the quantitative type you're measuring not represented in the set in DTDL v2 (certainly possible since there are many things to measure and DTDL only includes some types)?
Yeah I wanted to have a property representing the percentage of the battery charge of a device, I understand your approach though and it makes total sense but some "universal" types like this could be a great addition in the future.
closing as a dupe of #140
I feel that having a percentage semantic type would be beneficial for a lot of implementations. It should be fairly easy to add and can protect integer fields from being misinterpreted when doing computation. (e.g. a percentage should always be >=0 and <=100)