{
  "$ref": "#/definitions/DtAnalysesWpcaDefinition",
  "definitions": {
    "DtAnalysesWpcaDefinition": {
      "type": "object",
      "properties": {
        "lo_limit": {
          "type": "number",
          "minimum": 0,
          "maximum": 1,
          "description": "Minimum weighted attendance share (0–1) for a person to be included in the global PCA result. Persons below this threshold are computed but marked included=false."
        },
        "lo_limit_time": {
          "type": "number",
          "minimum": 0,
          "maximum": 1,
          "description": "Minimum weighted attendance share for time-interval projections. Defaults to lo_limit if omitted."
        },
        "yes_options": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Vote option values that encode to +1. E.g. ['yes']."
        },
        "no_options": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Vote option values that encode to -1. E.g. ['no', 'abstain']."
        },
        "absent_options": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Vote option values that encode to NA (excluded from weight calculations). E.g. ['absent', 'before oath']."
        },
        "rotate": {
          "type": "object",
          "properties": {
            "voter_id": {
              "type": [
                "string",
                "number"
              ],
              "description": "The voter_id of the reference person used to orient PCA axes."
            },
            "dims": {
              "type": "array",
              "items": {
                "type": "number",
                "enum": [
                  1,
                  -1
                ]
              },
              "description": "Sign (+1 or -1) for each of the first n dimensions. If the reference person's coordinate in that dimension has the opposite sign, the whole axis is flipped."
            }
          },
          "required": [
            "voter_id",
            "dims"
          ],
          "additionalProperties": false,
          "description": "Reference person for orienting PCA axes so results are comparable across runs."
        },
        "time_interval": {
          "anyOf": [
            {
              "anyOf": [
                {
                  "not": {}
                },
                {
                  "type": "string",
                  "enum": [
                    "half-year",
                    "quarter",
                    "year"
                  ]
                }
              ]
            },
            {
              "type": "null"
            }
          ],
          "description": "Size of time windows for rolling projections using the global eigenbasis. Null or omitted means no time-interval output."
        },
        "since": {
          "anyOf": [
            {
              "anyOf": [
                {
                  "not": {}
                },
                {
                  "type": "string",
                  "format": "date"
                }
              ]
            },
            {
              "type": "null"
            }
          ],
          "description": "ISO 8601 date (YYYY-MM-DD). Only vote events on or after this date are included. Null/omitted = no lower bound."
        },
        "until": {
          "anyOf": [
            {
              "anyOf": [
                {
                  "not": {}
                },
                {
                  "type": "string",
                  "format": "date"
                }
              ]
            },
            {
              "type": "null"
            }
          ],
          "description": "ISO 8601 date (YYYY-MM-DD). Only vote events on or before this date are included. Null/omitted = no upper bound."
        },
        "n_dims": {
          "type": "integer",
          "minimum": 1,
          "maximum": 20,
          "description": "Number of PCA dimensions to retain in the output. Defaults to 3."
        },
        "extras": {
          "type": "object",
          "additionalProperties": {},
          "description": "Additional metadata fields not covered by the core schema."
        }
      },
      "required": [
        "lo_limit",
        "yes_options",
        "no_options",
        "absent_options"
      ],
      "additionalProperties": false
    }
  },
  "$schema": "http://json-schema.org/draft-07/schema#"
}