{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Dated official facts for agents — Portugal (v0.2)",
  "type": "object",
  "required": [
    "dataset",
    "version",
    "status",
    "license",
    "count",
    "facts",
    "disclaimer_pt",
    "disclaimer_en"
  ],
  "properties": {
    "count": {
      "type": "integer"
    },
    "facts": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "id",
          "category",
          "fact_pt",
          "fact_en",
          "source",
          "verified_on",
          "fetched_at",
          "evidence_quote",
          "valid_until",
          "status"
        ],
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^pt-[a-z0-9-]+$"
          },
          "category": {
            "enum": [
              "transport",
              "public_service",
              "holiday",
              "time"
            ]
          },
          "fact_pt": {
            "type": "string",
            "minLength": 10
          },
          "fact_en": {
            "type": "string",
            "minLength": 10
          },
          "source": {
            "type": "object",
            "required": [
              "publisher",
              "url"
            ],
            "additionalProperties": false,
            "properties": {
              "publisher": {
                "type": "string"
              },
              "url": {
                "type": "string",
                "pattern": "^https://"
              }
            }
          },
          "verified_on": {
            "type": "string",
            "format": "date"
          },
          "fetched_at": {
            "type": "string",
            "format": "date-time"
          },
          "evidence_quote": {
            "type": "string",
            "minLength": 15,
            "description": "verbatim excerpt of the source that supports the fact"
          },
          "valid_until": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "status": {
            "enum": [
              "draft-unpublished",
              "published",
              "to-review"
            ]
          },
          "derived": {
            "type": "object",
            "required": [
              "from",
              "method"
            ],
            "additionalProperties": false,
            "properties": {
              "from": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              "method": {
                "type": "string"
              }
            }
          },
          "note_pt": {
            "type": "string"
          }
        }
      }
    }
  }
}
