{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://gxplex.com/api/v1/schema/citations.json",
  "title": "Citation edge document",
  "description": "The document served at /api/v1/citations.json. Items are carried under `edges`.",
  "type": "object",
  "allOf": [
    {
      "$ref": "https://gxplex.com/api/v1/schema/envelope.json"
    }
  ],
  "properties": {
    "collection": {
      "const": "citations"
    },
    "edges": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/item"
      },
      "description": "Every citation edge this document carries."
    }
  },
  "required": [
    "edges"
  ],
  "additionalProperties": true,
  "$defs": {
    "item": {
      "type": "object",
      "title": "Citation edge",
      "description": "The retained text of one tracked document contained a form another is published under. States nothing about the relationship between their requirements, or the manner of the citation.",
      "properties": {
        "licence_class": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "open",
            "restricted",
            "unknown",
            null
          ],
          "description": "What this archive recorded of the terms the source states. Null where no reading exists for this object. See `rights` on the envelope."
        },
        "text_retained": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "Whether normalised prose of the document is held here for a quotation to be checked against. Held, never served. Null where no reading exists."
        },
        "quote_allowed": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "Whether a quotation from the document appears in this record's own published output. A fact about this record's handling, not a reading of what the publisher permits, and not a grant. Null where no reading exists."
        },
        "snapshot_available": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "Whether a retained snapshot of an observed retrieval is still held here for a digest to be re-checked against. No snapshot is served. Null where no reading exists."
        },
        "rights_of": {
          "type": [
            "string",
            "null"
          ],
          "description": "The tracked entry id the four fields above are the rights OF. Null where the object names no entry."
        },
        "rights_unresolved": {
          "type": [
            "string",
            "null"
          ],
          "description": "Present only where the four fields are null, naming which absence it is: an id this record does not hold, or an object that names no entry."
        },
        "from": {
          "type": "string",
          "description": "The document whose retained text carried the form."
        },
        "to": {
          "type": "string",
          "description": "The document published under that form."
        },
        "designator": {
          "type": "string",
          "description": "The published form that was matched, verbatim."
        },
        "quote": {
          "type": "string",
          "description": "The span the form was found in, verbatim, under the envelope word ceiling. Present only where the licence class this record records for the source text is open."
        },
        "citation_url": {
          "type": "string",
          "description": "The address the citing text was read at."
        },
        "source_snapshot": {
          "type": "string",
          "description": "The retained snapshot the span came from."
        },
        "observed_date": {
          "type": "string",
          "format": "date",
          "description": "The day the retained text was observed."
        },
        "printed_in_reference_list": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "object"
          },
          "description": "Each place the citing row's latest text read at the reference-lists endpoint prints this designator inside an entry of a reference list it heads and marks as its own: `content_hash` and `source_snapshot` (the text), `heading` and `number` (the list's heading and section number, as printed), `entry` (the entry's marker, as printed), `at` (the offset of the form) and the list's clause `anchor` and `anchor_state`. An edge with a placement and no other source in the text scan was added to the graph from the list. Empty where that text places it in no list read; null where no text of the citing row was read there, which is not a reading of none."
        }
      },
      "required": [
        "from",
        "to",
        "designator",
        "citation_url",
        "licence_class",
        "text_retained",
        "quote_allowed",
        "snapshot_available",
        "rights_of"
      ],
      "additionalProperties": true
    }
  }
}
