{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://aptatlas.org/data/pathway_coverage.schema.json",
  "title": "Pathway coverage",
  "description": "Per-pathway coverage percentages.",
  "type": "object",
  "required": [
    "schema",
    "name",
    "title",
    "version",
    "last_updated",
    "licence",
    "licence_url",
    "citation",
    "archive_doi",
    "third_party",
    "data"
  ],
  "additionalProperties": false,
  "properties": {
    "schema": {
      "type": "string",
      "description": "URL of this schema for this release"
    },
    "name": {
      "const": "pathway_coverage"
    },
    "title": {
      "type": "string"
    },
    "version": {
      "type": "string",
      "pattern": "^\\d+\\.\\d+$",
      "description": "APT release"
    },
    "last_updated": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
    },
    "licence": {
      "const": "CC-BY-4.0"
    },
    "licence_url": {
      "type": "string"
    },
    "citation": {
      "type": "string"
    },
    "archive_doi": {
      "type": "string"
    },
    "third_party": {
      "type": "array",
      "description": "Sources this file draws on that carry their own licence.",
      "items": {
        "type": "object",
        "required": [
          "name",
          "licence",
          "url",
          "relationship",
          "note"
        ],
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string"
          },
          "licence": {
            "type": "string",
            "description": "SPDX identifier"
          },
          "url": {
            "type": "string"
          },
          "relationship": {
            "enum": [
              "source",
              "derived"
            ]
          },
          "note": {
            "type": "string"
          },
          "fields": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "JSONPath, relative to data, of fields derived from this source"
          },
          "fields_derived_in_part": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "JSONPath, relative to data, of fields computed partly from the fields above"
          }
        }
      }
    },
    "data": {
      "type": "object",
      "properties": {
        "schema_version": {
          "type": "integer"
        },
        "note": {
          "type": "string"
        },
        "denominator": {
          "type": "string"
        },
        "platform_ids": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "single": {
          "type": "object",
          "additionalProperties": {
            "type": "object",
            "additionalProperties": {
              "type": "number"
            }
          }
        },
        "pair": {
          "type": "object",
          "additionalProperties": {
            "type": "object",
            "additionalProperties": {
              "type": "number"
            }
          }
        }
      },
      "required": [
        "schema_version",
        "note",
        "denominator",
        "platform_ids",
        "single",
        "pair"
      ],
      "additionalProperties": false
    }
  }
}
