{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/wikimedia/json-schema/wikimedia-wikidata-article-schema.json",
  "title": "wikidata_article",
  "x-generated": "2026-11-08",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/wikimedia-wikidata-api-openapi.yml#/components/schemas/wikidata_article",
  "type": "object",
  "required": [
    "name",
    "identifier",
    "url",
    "protection",
    "redirects",
    "license"
  ],
  "properties": {
    "name": {
      "type": "string",
      "description": "Wikidata item identifier (Q-number, e.g. Q42), or property identifier (P-number, e.g. P31)"
    },
    "identifier": {
      "type": "integer",
      "format": "uuid",
      "description": "unique numeric identifier of the article"
    },
    "date_created": {
      "type": "string",
      "format": "date-time",
      "description": "ISO 8601 timestamp of when the article was first created"
    },
    "date_modified": {
      "type": "string",
      "format": "date-time",
      "description": "ISO 8601 timestamp of when the article was last modified"
    },
    "date_previously_modified": {
      "type": "string",
      "format": "date-time",
      "description": "Timestamp of the before-last revision in RFC3339 format"
    },
    "protection": {
      "$ref": "#/$defs/protection"
    },
    "url": {
      "type": "string",
      "format": "uri",
      "description": "URL to the article"
    },
    "namespace": {
      "$ref": "#/$defs/article_namespace"
    },
    "is_part_of": {
      "$ref": "#/$defs/project"
    },
    "entity": {
      "$ref": "#/$defs/wikidata_entity"
    },
    "visibility": {
      "$ref": "#/$defs/visibility"
    },
    "license": {
      "$ref": "#/$defs/license"
    },
    "event": {
      "$ref": "#/$defs/event"
    }
  },
  "$defs": {
    "article_namespace": {
      "type": "object",
      "properties": {
        "identifier": {
          "type": "number"
        }
      }
    },
    "event": {
      "type": "object",
      "properties": {
        "identifier": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "enum": [
            "update",
            "delete"
          ]
        },
        "date_created": {
          "type": "string"
        }
      }
    },
    "language": {
      "type": "object",
      "properties": {
        "identifier": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "alternate_name": {
          "type": "string"
        },
        "direction": {
          "type": "string"
        }
      }
    },
    "license": {
      "type": "object",
      "properties": {
        "identifier": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "project": {
      "type": "object",
      "properties": {
        "identifier": {
          "type": "string"
        },
        "code": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "url": {
          "type": "string"
        },
        "in_language": {
          "$ref": "#/$defs/language"
        }
      }
    },
    "protection": {
      "type": "object",
      "properties": {
        "expiry": {
          "type": "string",
          "enum": [
            "infinite",
            "indefinite",
            "infinity",
            "never"
          ]
        },
        "level": {
          "type": "string"
        },
        "type": {
          "type": "string"
        }
      }
    },
    "visibility": {
      "type": "object",
      "properties": {
        "comment": {
          "type": "boolean"
        },
        "text": {
          "type": "boolean"
        },
        "user": {
          "type": "boolean"
        }
      }
    },
    "wikidata_entity": {
      "type": "object",
      "required": [
        "identifier",
        "type"
      ],
      "properties": {
        "identifier": {
          "type": "string",
          "description": "Wikidata item identifier (Q-number, e.g. Q42), or property identifier (P-number, e.g. P31)"
        },
        "type": {
          "type": "string",
          "enum": [
            "item",
            "property"
          ],
          "description": "The type of entity, either \"item\" or \"property\""
        },
        "labels": {
          "$ref": "#/$defs/wikidata_labels"
        },
        "descriptions": {
          "type": "object",
          "description": "Key-value pairs with descriptions in different languages"
        },
        "aliases": {
          "type": "object",
          "description": "Key-value pairs with aliases in different languages. Every language may have multiple aliases"
        },
        "statements": {
          "$ref": "#/$defs/wikidata_statements"
        },
        "sitelinks": {
          "$ref": "#/$defs/wikidata_sitelinks"
        }
      }
    },
    "wikidata_entity_property": {
      "type": "object",
      "required": [
        "identifier",
        "data_type"
      ],
      "properties": {
        "identifier": {
          "type": "string",
          "description": "Wikidata Property identifier (P-number, e.g. P31)."
        },
        "data_type": {
          "type": "string",
          "description": "The expected data type of the value for this property, e.g. time, quantity, wikibase-item, url, string. The actual data type of the value for this property is found in statements.PID.property.value.type"
        },
        "labels": {
          "type": "object",
          "description": "Key-value pairs with property labels in different languages"
        }
      }
    },
    "wikidata_entity_qualifier": {
      "type": "object",
      "description": "Qualifier further describing or refining the value of a property in a statement",
      "required": [
        "property",
        "value"
      ],
      "properties": {
        "property": {
          "$ref": "#/$defs/wikidata_entity_property"
        },
        "value": {
          "$ref": "#/$defs/wikidata_entity_value"
        }
      }
    },
    "wikidata_entity_reference_part": {
      "type": "object",
      "required": [
        "property",
        "value"
      ],
      "properties": {
        "property": {
          "description": "The property this reference part refers to. Has the same substructure as statements.PID.property",
          "$ref": "#/$defs/wikidata_entity_property"
        },
        "value": {
          "description": "The value of the reference part. Has the same substructure as statements.PROPERTYID.value",
          "$ref": "#/$defs/wikidata_entity_value"
        }
      }
    },
    "wikidata_entity_statement_reference": {
      "type": "object",
      "description": "Reference supporting a Wikidata statement",
      "required": [
        "identifier",
        "parts"
      ],
      "properties": {
        "identifier": {
          "type": "string",
          "description": "unique identifier for the reference"
        },
        "parts": {
          "type": "array",
          "description": "Parts that make up this reference",
          "items": {
            "$ref": "#/$defs/wikidata_entity_reference_part"
          }
        }
      }
    },
    "wikidata_entity_value": {
      "type": "object",
      "description": "This object represents the actual value in a statement or qualifier",
      "required": [
        "type",
        "labels"
      ],
      "properties": {
        "content": {
          "type": "string",
          "description": "String representation of the value. If the value is too complex to represent as a string or integer, this will be replaced by statements.PID.value.content_data"
        },
        "type": {
          "type": "string",
          "description": "The actual data type of the value for this property. Should match statements.PID.property.data_type, but might not."
        },
        "content_data": {
          "type": "object",
          "description": "An object holding the representation of the value. If the value can be represented simply as a string or integer, this will be replaced by statements.PID.value.content"
        },
        "labels": {
          "$ref": "#/$defs/wikidata_labels"
        }
      }
    },
    "wikidata_labels": {
      "type": "object",
      "description": "key-value pairs with labels in different languages"
    },
    "wikidata_sitelinks": {
      "type": "object",
      "description": "Mapping of this Wikidata item to other Wikimedia project site URLs",
      "required": [
        "title",
        "badges",
        "url"
      ],
      "properties": {
        "title": {
          "type": "string",
          "description": "Title of the linked page"
        },
        "badges": {
          "type": "array",
          "description": "Badge identifiers for this sitelink"
        },
        "url": {
          "type": "string",
          "format": "uri",
          "description": "URL to the linked page"
        }
      }
    },
    "wikidata_statement": {
      "type": "object",
      "description": "Statement connecting a value to a Wikidata entity through a property. Each statement corresponds to a single claim on the Wikidata entity, and includes the value of the claim and metadata about the claim such as references, qualifiers, and ranks",
      "required": [
        "identifier",
        "rank",
        "property",
        "value",
        "qualifiers",
        "references"
      ],
      "properties": {
        "identifier": {
          "type": "string",
          "format": "uuid",
          "description": "Unique identifier for the statement"
        },
        "rank": {
          "type": "string",
          "description": "Rank of the statement among other similar statements. Possible values are normal, preferred, and deprecated",
          "enum": [
            "normal",
            "preferred",
            "deprecated"
          ]
        },
        "property": {
          "$ref": "#/$defs/wikidata_entity_property"
        },
        "value": {
          "$ref": "#/$defs/wikidata_entity_value"
        },
        "qualifiers": {
          "$ref": "#/$defs/wikidata_entity_qualifier"
        },
        "references": {
          "$ref": "#/$defs/wikidata_entity_statement_reference"
        }
      }
    },
    "wikidata_statements": {
      "type": "array",
      "description": "Array of statement objects for this property",
      "items": {
        "$ref": "#/$defs/wikidata_statement"
      }
    }
  }
}