{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://gxplex.com/api/v1/schema/timemap-index.json",
  "title": "Per-row TimeMap index entry document",
  "description": "The document served at /api/v1/timemap-index.json. Items are carried under `items`.",
  "type": "object",
  "allOf": [
    {
      "$ref": "https://gxplex.com/api/v1/schema/envelope.json"
    }
  ],
  "properties": {
    "collection": {
      "const": "timemap-index"
    },
    "items": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/item"
      },
      "description": "Every per-row timemap index entry this document carries."
    }
  },
  "required": [
    "items"
  ],
  "additionalProperties": true,
  "$defs": {
    "item": {
      "type": "object",
      "title": "Per-row TimeMap index entry",
      "description": "One tracked row's TimeMap addresses and the counts behind them. In these per-row TimeMaps a memento is a third party's capture this record held on an observation, and an observation is not a memento. The corpus-level counts ride in the envelope, each with its population. The envelope's `address_timemaps` counts a second family, one TimeMap per address an observation recorded as the address that answered, whose memento lines are this record's own observations: each a reading, not a copy of the document.",
      "properties": {
        "id": {
          "type": "string",
          "description": "The tracked row."
        },
        "timemap": {
          "type": "string",
          "description": "The row's TimeMap as JSON."
        },
        "timemap_link_format": {
          "type": "string",
          "description": "The row's TimeMap as link-format text, carrying the published mementos only."
        },
        "mementos_held": {
          "type": "integer",
          "description": "Captures this record held on an observation of the row."
        },
        "mementos_published": {
          "type": "integer",
          "description": "Of those, the ones whose address is published."
        },
        "mementos_withheld": {
          "type": "integer",
          "description": "Of those, the ones whose address is withheld; `mementos_published` and this sum to `mementos_held`."
        },
        "observations": {
          "type": "integer",
          "description": "Observations of the row."
        },
        "observations_with_digest": {
          "type": "integer",
          "description": "Of those, the ones recording a digest."
        }
      },
      "required": [
        "id",
        "timemap",
        "timemap_link_format",
        "mementos_held",
        "mementos_published",
        "mementos_withheld",
        "observations",
        "observations_with_digest"
      ],
      "additionalProperties": true
    }
  }
}
