predis-h2020 / metadata

0 stars 0 forks source link

Measure units #15

Open leonewashoe opened 1 year ago

leonewashoe commented 1 year ago

Maybe we should think to a way to standardized the measure unit, in order to be sure to have consistency between similar quantities. What about defining a json schema for the measure unit?

gdmiron commented 1 year ago

something like this?

{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "Measure Unit",
  "type": "object",
  "required": ["symbol", "name"],
  "properties": {
    "symbol": {
      "type": "string"
    },
    "name": {
      "type": "string"
    }
  }
}

to validate

{
  "symbol": "m",
  "name": "meter"
}
leonewashoe commented 1 year ago

What about this? with enums, we can ensure compatibility between the same quantities and define a convention.

{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "Measure Unit",
  "type": "object",
  "required": ["quantity", "unit"],
  "properties": {
    "quantity": {
          "type": "string",
          "enum": [
              "length",
              "temperature"
          ]
    },
    "unit": {
          "type": "string",
          "enum": [
              "m",
              "°C"
          ]
    }
  }
}
joergfunger commented 1 year ago

Maybe we should have a look at already existing standards for the units. Interesting links might be UCUM there are even microservices for conversion. They also have a validation microservice, which allows to validate a certain unit. Haven't used that myself, but it would be possible integrate that check in a validation step. But that would require to solve the issue first how to integrate the existing workflows in actions that do all that stuff.