{
  "$id": "https://schemas.opendd.eu/xtdunit.1.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "xtd Unit Schema",
  "description": "According to SS-EN ISO 12006-3:2022",
  "allOf": [
    {
      "$ref": "/xtdroot.1.schema.json"
    },
    {
      "$ref": "/xtdobject.1.schema.json"
    },
    {
      "$ref": "/xtdconcept.1.schema.json"
    },
    {
      "$ref": "#/$defs/Unit"
    }
  ],
  "$defs": {
    "Unit": {
      "type": "object",
      "properties": {
        "Dimension": {
          "description": "Dimension of the unit.",
          "$ref": "/opendd-entityref.1.schema.json"
        },
        "Symbol": {
          "description": "Optional symbol denominating the unit.",
          "$ref": "/xtdmultilanguagetext.1.schema.json"
        },
        "Coefficient": {
          "description": "Proportionality factor. See ISO 80000-1:2009, 3.12.",
          "$ref": "/xtdrational.1.schema.json"
        },
        "Scale": {
          "description": "Specifies whether the scale of a unit is linear or logarithmic.",
          "$ref": "#/$defs/xtdUnitScaleEnum"
        },
        "Base": {
          "description": "Allows to introduce irrational numbers.",
          "$ref": "#/$defs/xtdUnitScaleEnum"
        },
        "Offset": {
          "description": "Offset of origins.",
          "$ref": "/xtdrational.1.schema.json"
        }
      },
      "required": [
        "Dimension",
        "Coefficient",
        "Scale",
        "Base",
        "Offset"
      ]
    },
    "xtdUnitScaleEnum": {
      "title": "xtd Unit Scale Enum Schema",
      "description": "xtdUnitScaleEnum is an enumeration type which specifies whether a unit is of linear or logarithmic scale.",
      "type": "string",
      "enum": [
        "XTD_LINEAR",
        "XTD_LOGARITHMIC"
      ]
    },
    "xtdUnitBaseEnum": {
      "title": "xtd Unit Base Enum Schema",
      "description": "xtdUnitBaseEnum is an enumeration type giving the list of possible conversion bases, either linear or logarithmic. This list allows to use irrational values as bases.",
      "type": "string",
      "enum": [
        "XTD_ONE",
        "XTD_TWO",
        "XTD_E",
        "XTD_PI",
        "XTD_TEN"
      ]
    }
  }
}
