{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://gpuatlas.top/data/article.schema.json",
  "title": "GPU Atlas public article",
  "description": "Current published article. Unknown dates are null. Source retrieval time is not publication time. No measured hardware results are implied.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema_version",
    "id",
    "url",
    "title",
    "summary",
    "language",
    "category",
    "topics",
    "published_at",
    "modified_at",
    "evidence",
    "representations",
    "body_text",
    "sources",
    "revision_note"
  ],
  "properties": {
    "schema_version": {
      "const": "1.0"
    },
    "id": {
      "type": "string",
      "pattern": "^T-[a-f0-9]{12}$"
    },
    "url": {
      "type": "string",
      "format": "uri"
    },
    "title": {
      "type": "string",
      "minLength": 1
    },
    "summary": {
      "type": "string",
      "minLength": 1
    },
    "language": {
      "const": "zh-Hans"
    },
    "category": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "name",
        "url"
      ],
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^c-[0-9]+$"
        },
        "name": {
          "type": "string",
          "minLength": 1
        },
        "url": {
          "type": "string",
          "format": "uri"
        }
      }
    },
    "topics": {
      "type": "array",
      "uniqueItems": true,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "kind",
          "url"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^(gpu|model|framework|task)-[a-f0-9]{10}$"
          },
          "name": {
            "type": "string",
            "minLength": 1
          },
          "kind": {
            "enum": [
              "gpu",
              "model",
              "framework",
              "task"
            ]
          },
          "description": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          }
        }
      }
    },
    "published_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "modified_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "evidence": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "type",
        "hardware_tested",
        "note"
      ],
      "properties": {
        "type": {
          "const": "documentation_and_conditional_estimates"
        },
        "hardware_tested": {
          "const": false
        },
        "note": {
          "type": "string",
          "minLength": 1
        }
      }
    },
    "representations": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "html",
        "json",
        "markdown"
      ],
      "properties": {
        "html": {
          "type": "string",
          "format": "uri"
        },
        "json": {
          "type": "string",
          "format": "uri"
        },
        "markdown": {
          "type": "string",
          "format": "uri"
        }
      }
    },
    "body_text": {
      "type": "string",
      "minLength": 1
    },
    "sources": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "url"
        ],
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "retrieved_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      }
    },
    "revision_note": {
      "type": "string"
    }
  }
}
