{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://mariuscomper.uk/cunoastere-deschisa/catalog.schema.json",
  "title": "Open knowledge Romania catalogue",
  "type": "object",
  "required": [
    "schemaVersion",
    "resources"
  ],
  "properties": {
    "schemaVersion": {
      "type": "string"
    },
    "resources": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/resource"
      }
    }
  },
  "$defs": {
    "resource": {
      "type": "object",
      "required": [
        "id",
        "title",
        "description",
        "url",
        "rights",
        "limitations",
        "sourceStatus",
        "editorialReviewDate",
        "topics",
        "accessPoints"
      ],
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^[a-z0-9-]+$"
        },
        "title": {
          "type": "object",
          "required": [
            "ro",
            "en"
          ],
          "properties": {
            "ro": {
              "type": "string"
            },
            "en": {
              "type": "string"
            }
          }
        },
        "description": {
          "type": "object",
          "required": [
            "ro",
            "en"
          ],
          "properties": {
            "ro": {
              "type": "string"
            },
            "en": {
              "type": "string"
            }
          }
        },
        "limitations": {
          "type": "object",
          "required": [
            "ro",
            "en"
          ],
          "properties": {
            "ro": {
              "type": "string"
            },
            "en": {
              "type": "string"
            }
          }
        },
        "verificationNote": {
          "type": "object",
          "required": [
            "ro",
            "en"
          ],
          "properties": {
            "ro": {
              "type": "string"
            },
            "en": {
              "type": "string"
            }
          }
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "rights": {
          "enum": [
            "explicit",
            "varies",
            "restricted",
            "unknown"
          ]
        },
        "license": {
          "type": [
            "string",
            "null"
          ]
        },
        "licenseUrl": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri"
        },
        "api": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "sourceStatus": {
          "enum": [
            "verified-direct",
            "official-link-unverified"
          ]
        },
        "editorialReviewDate": {
          "type": "string",
          "format": "date"
        },
        "lastDatasetUpdate": {
          "type": [
            "string",
            "null"
          ]
        },
        "technicalAudit": {
          "type": [
            "string",
            "null"
          ]
        },
        "topics": {
          "type": "array",
          "items": {
            "enum": [
              "health",
              "living",
              "economy",
              "justice",
              "education",
              "population",
              "environment",
              "transport",
              "spending",
              "geography",
              "research",
              "language",
              "heritage",
              "legislation",
              "standards",
              "elections"
            ]
          }
        },
        "accessPoints": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "url",
              "kind",
              "label",
              "check"
            ],
            "properties": {
              "url": {
                "type": "string",
                "format": "uri"
              },
              "kind": {
                "enum": [
                  "api",
                  "browser",
                  "download"
                ]
              },
              "label": {
                "type": "object",
                "required": [
                  "ro",
                  "en"
                ],
                "properties": {
                  "ro": {
                    "type": "string"
                  },
                  "en": {
                    "type": "string"
                  }
                }
              },
              "testedAt": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date"
              },
              "check": {
                "enum": [
                  "sample-inspected",
                  "documentation-only"
                ]
              }
            }
          }
        },
        "related": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    }
  }
}