{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://schema.humancellatlas.org/module/project/0.0.0/data_use_restriction",
  "description": "A term that may be associated with a data use restriction ontology term.",
  "additionalProperties": false,
  "required": [
    "ontology",
    "ontology_label"
  ],
  "title": "Data use restriction",
  "name": "data_use_restriction",
  "type": "object",
  "properties": {
    "describedBy": {
      "description": "The URL reference to the schema.",
      "type": "string",
      "pattern": "^(http|https)://schema.(.*?)humancellatlas.org/module/project/(([0-9]{1,}.[0-9]{1,}.[0-9]{1,})|([a-zA-Z]*?))/data_use_restriction"
    },
    "schema_version": {
      "description": "The version number of the schema in major.minor.patch format.",
      "type": "string",
      "pattern": "^[0-9]{1,}.[0-9]{1,}.[0-9]{1,}$",
      "example": "4.6.1"
    },
    "DUO_id": {
      "description": "Type of data use restrictions associated with the project.",
      "type": "string",
      "enum": [
        "DUO:0000004",
        "DUO:0000042",
        "DUO:0000042;DUO:0000046"
      ],
      "user_friendly": "Data use conditions ontology ID",
      "guidelines": "Must be one of: DUO:0000004, DUO:0000042, DUO:0000042;DUO:0000046",
      "example": "DUO:0000004"
    },
    "DUO_label": {
      "description": "Label corresponding to the data use restrictions ID associated with the project",
      "type": "string",
      "enum": [
        "no restriction",
        "general research use",
        "general research use;non-commercial use only"
      ],
      "user_friendly": "Data use conditions ontology label",
      "guidelines": "Must be one of: no restriction, general research use, general research use;non-commercial use only",
      "example": "no restriction"
    }
  },
  "allOf": [
    {
      "if": {
        "properties": {
          "ontology": {
            "const": "DUO:0000004"
          }
        }
      },
      "then": {
        "properties": {
          "ontology_label": {
            "const": "no restriction"
          }
        }
      }
    },
    {
      "if": {
        "properties": {
          "ontology": {
            "const": "DUO:0000042"
          }
        }
      },
      "then": {
        "properties": {
          "ontology_label": {
            "const": "general research use"
          }
        }
      }
    },
    {
      "if": {
        "properties": {
          "ontology": {
            "const": "DUO:0000042;DUO:0000046"
          }
        }
      },
      "then": {
        "properties": {
          "ontology_label": {
            "const": "general research use;non-commercial use only"
          }
        }
      }
    }
  ]
}
