{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://hellodoggo.ai/non-human-intelligence/schemas/source-v1.json",
  "title": "Hello Doggo source poem v1",
  "description": "One line of sources.jsonl: one poem by another poet that a song sets, a narration reads or a song names as its inspiration, with its edition, provenance and rights.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema_version",
    "id",
    "title",
    "author",
    "source_edition",
    "source_url",
    "rights_sentence",
    "provenance_note",
    "rights_profile_id",
    "still_in_copyright",
    "authored_by_hello_doggo",
    "inherit_hello_doggo_cc0"
  ],
  "properties": {
    "schema_version": {
      "const": 1
    },
    "id": {
      "$ref": "#/$defs/basis/properties/id"
    },
    "title": {
      "$ref": "#/$defs/basis/properties/title"
    },
    "author": {
      "$ref": "#/$defs/basis/properties/author"
    },
    "source_edition": {
      "$ref": "#/$defs/basis/properties/source_edition"
    },
    "source_url": {
      "$ref": "#/$defs/basis/properties/source_url"
    },
    "rights_sentence": {
      "$ref": "#/$defs/basis/properties/rights_sentence"
    },
    "provenance_note": {
      "$ref": "#/$defs/basis/properties/provenance_note"
    },
    "rights_profile_id": {
      "$ref": "#/$defs/basis/properties/rights_profile_id"
    },
    "still_in_copyright": {
      "$ref": "#/$defs/basis/properties/still_in_copyright"
    },
    "authored_by_hello_doggo": {
      "$ref": "#/$defs/basis/properties/authored_by_hello_doggo"
    },
    "inherit_hello_doggo_cc0": {
      "$ref": "#/$defs/basis/properties/inherit_hello_doggo_cc0"
    },
    "epigraph": {
      "$ref": "#/$defs/epigraph"
    },
    "of_note": {
      "$ref": "#/$defs/of_note"
    }
  },
  "$defs": {
    "basis": {
      "type": "object",
      "description": "A source poem's fields, as sources.jsonl, component-rights.json and the corpus's source_basis give them.",
      "additionalProperties": false,
      "required": [
        "id",
        "title",
        "author",
        "source_edition",
        "source_url",
        "rights_sentence",
        "provenance_note",
        "rights_profile_id",
        "still_in_copyright",
        "authored_by_hello_doggo",
        "inherit_hello_doggo_cc0"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "The poem's stable ID. Its text is the corpus.jsonl record whose owner_id is this ID; a recording that sets or reads it names it as source_poem_id in its manifest; a song it inspired names it in inspired_by.poem_id.",
          "pattern": "^poem:[a-z0-9-]+$"
        },
        "title": {
          "type": "string",
          "description": "The poem's title.",
          "minLength": 1
        },
        "author": {
          "type": "string",
          "description": "The poet: the catalog's poet for the poem's settings and narration.",
          "minLength": 1
        },
        "source_edition": {
          "type": "string",
          "description": "The edition the text was taken from.",
          "minLength": 1
        },
        "source_url": {
          "type": "string",
          "description": "Where that edition can be read.",
          "format": "uri"
        },
        "rights_sentence": {
          "type": "string",
          "description": "The poem's rights in words, as its page states them.",
          "minLength": 1
        },
        "provenance_note": {
          "type": "string",
          "description": "Where and when the poem was first published, and where the text comes from.",
          "minLength": 1
        },
        "rights_profile_id": {
          "description": "Every source poem is \"public-domain\": public domain in the United States. Plain public domain (still_in_copyright null): the owner's copyright research found no country where the poem is still in copyright. Otherwise still_in_copyright names the few countries where it is, and until when.",
          "const": "public-domain"
        },
        "still_in_copyright": {
          "type": [
            "object",
            "null"
          ],
          "description": "Where the poem is still in copyright, and until when (the owner's copyright research, as its rights_sentence says it). null: plain public domain, no country found where the poem is still in copyright. Never any other country data.",
          "additionalProperties": false,
          "required": [
            "countries",
            "through_year"
          ],
          "properties": {
            "countries": {
              "type": "array",
              "description": "The countries where the poem is still in copyright, as ISO 3166-1 alpha-2 codes (IT Italy, PE Peru, UY Uruguay, GB the United Kingdom).",
              "minItems": 1,
              "uniqueItems": true,
              "items": {
                "type": "string",
                "pattern": "^[A-Z]{2}$"
              }
            },
            "through_year": {
              "type": "integer",
              "description": "The last year the poem is in copyright in those countries: public domain there from 1 January of the year after.",
              "minimum": 2026
            }
          }
        },
        "authored_by_hello_doggo": {
          "description": "Hello Doggo didn't write it.",
          "const": false
        },
        "inherit_hello_doggo_cc0": {
          "description": "Hello Doggo's CC0 dedication doesn't cover the poem: its own rights apply.",
          "const": false
        }
      }
    },
    "epigraph": {
      "type": "object",
      "description": "The poem's epigraph, where it has one.",
      "additionalProperties": false,
      "required": [
        "citation",
        "original_language",
        "translation",
        "note"
      ],
      "properties": {
        "citation": {
          "type": "string",
          "description": "Where the epigraph is from.",
          "minLength": 1
        },
        "original_language": {
          "type": "string",
          "description": "The epigraph's language as the poem prints it.",
          "minLength": 1
        },
        "translation": {
          "type": "object",
          "description": "The translation the poem's page shows in a note below the poem: supporting text with its own ID and fingerprint, not part of the poem's text.",
          "additionalProperties": false,
          "required": [
            "id",
            "kind",
            "language",
            "text",
            "sha256"
          ],
          "properties": {
            "id": {
              "type": "string",
              "pattern": "^text:epigraph-translation:[a-z0-9-]+$"
            },
            "kind": {
              "const": "epigraph-translation"
            },
            "language": {
              "type": "string",
              "pattern": "^[a-z]{2,3}(-[A-Za-z0-9]{2,8})*$"
            },
            "text": {
              "type": "string",
              "minLength": 1
            },
            "sha256": {
              "type": "string",
              "description": "SHA-256 of text's UTF-8 bytes.",
              "pattern": "^[a-f0-9]{64}$"
            }
          }
        },
        "note": {
          "type": "string",
          "minLength": 1
        }
      }
    },
    "of_note": {
      "type": "object",
      "description": "The poem's note, where it has one: what its page shows below it as “Of note”. Hello Doggo’s own words, CC0; not part of the poem's text.",
      "additionalProperties": false,
      "required": [
        "text",
        "sources",
        "about"
      ],
      "properties": {
        "text": {
          "type": "string",
          "description": "The note, one paragraph, its titles as plain text.",
          "minLength": 1
        },
        "sources": {
          "type": "array",
          "description": "Where its facts come from: addresses of the sources.",
          "minItems": 1,
          "items": {
            "type": "string",
            "format": "uri"
          }
        },
        "about": {
          "type": "string",
          "minLength": 1
        }
      }
    }
  }
}
