{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://hellodoggo.ai/non-human-intelligence/schemas/component-rights-v1.json",
  "title": "Hello Doggo component rights v1",
  "description": "component-rights.json: the rights of each part of the published work, restated from the records: the source poems' own rights, the CC0 dedication of what Hello Doggo owns or controls, the media it covers and the exceptions it doesn't.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema_version",
    "sources",
    "controlled_contributions",
    "asset_ids",
    "excluded",
    "note",
    "canonical_origin",
    "canonical_url"
  ],
  "properties": {
    "schema_version": {
      "const": 1
    },
    "sources": {
      "type": "array",
      "description": "Every source poem, as sources.jsonl has it (without its epigraph), with its rights basis.",
      "items": {
        "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",
          "rights_basis",
          "license"
        ],
        "properties": {
          "schema_version": {
            "const": 1
          },
          "id": {
            "$ref": "https://hellodoggo.ai/non-human-intelligence/schemas/source-v1.json#/$defs/basis/properties/id"
          },
          "title": {
            "$ref": "https://hellodoggo.ai/non-human-intelligence/schemas/source-v1.json#/$defs/basis/properties/title"
          },
          "author": {
            "$ref": "https://hellodoggo.ai/non-human-intelligence/schemas/source-v1.json#/$defs/basis/properties/author"
          },
          "source_edition": {
            "$ref": "https://hellodoggo.ai/non-human-intelligence/schemas/source-v1.json#/$defs/basis/properties/source_edition"
          },
          "source_url": {
            "$ref": "https://hellodoggo.ai/non-human-intelligence/schemas/source-v1.json#/$defs/basis/properties/source_url"
          },
          "rights_sentence": {
            "$ref": "https://hellodoggo.ai/non-human-intelligence/schemas/source-v1.json#/$defs/basis/properties/rights_sentence"
          },
          "provenance_note": {
            "$ref": "https://hellodoggo.ai/non-human-intelligence/schemas/source-v1.json#/$defs/basis/properties/provenance_note"
          },
          "rights_profile_id": {
            "$ref": "https://hellodoggo.ai/non-human-intelligence/schemas/source-v1.json#/$defs/basis/properties/rights_profile_id"
          },
          "still_in_copyright": {
            "$ref": "https://hellodoggo.ai/non-human-intelligence/schemas/source-v1.json#/$defs/basis/properties/still_in_copyright"
          },
          "authored_by_hello_doggo": {
            "$ref": "https://hellodoggo.ai/non-human-intelligence/schemas/source-v1.json#/$defs/basis/properties/authored_by_hello_doggo"
          },
          "inherit_hello_doggo_cc0": {
            "$ref": "https://hellodoggo.ai/non-human-intelligence/schemas/source-v1.json#/$defs/basis/properties/inherit_hello_doggo_cc0"
          },
          "rights_basis": {
            "description": "The poem's own public-domain status (rights_profile_id, still_in_copyright): no license from Hello Doggo.",
            "const": "public-domain"
          },
          "license": {
            "description": "No license: none is needed or given.",
            "const": null
          }
        }
      }
    },
    "controlled_contributions": {
      "type": "object",
      "description": "The CC0 dedication of everything Hello Doggo owns or controls: music, recordings, artwork and writing, but for what excluded names (its printed artworks among them).",
      "additionalProperties": false,
      "required": [
        "license",
        "permissions_url",
        "scope",
        "component_types",
        "source_components_inherit_this_license",
        "asset_specific_exceptions_control"
      ],
      "properties": {
        "license": {
          "const": "CC0-1.0"
        },
        "permissions_url": {
          "type": "string",
          "description": "permissions.json: the grant in full.",
          "format": "uri"
        },
        "scope": {
          "type": "string",
          "minLength": 1
        },
        "component_types": {
          "type": "array",
          "description": "What Hello Doggo's own contributions are.",
          "minItems": 1,
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "source_components_inherit_this_license": {
          "description": "The source poems keep their own rights.",
          "const": false
        },
        "asset_specific_exceptions_control": {
          "description": "Where an exception (excluded) names a file, it governs that file.",
          "const": true
        }
      }
    },
    "asset_ids": {
      "type": "array",
      "description": "Every media file the records name (recordings, narrations, hooks, stories, covers, release ZIPs), by its ID in manifest.json's assets.",
      "uniqueItems": true,
      "items": {
        "type": "string",
        "pattern": "^asset:asset-[0-9a-f]{20}$"
      }
    },
    "excluded": {
      "type": "array",
      "description": "What the CC0 dedication doesn't cover, as permissions.json's asset_specific_exceptions name it.",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "title",
          "url",
          "covered_by_this_grant",
          "note",
          "components",
          "details_url"
        ],
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1
          },
          "title": {
            "type": "string",
            "minLength": 1
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "covered_by_this_grant": {
            "const": false
          },
          "note": {
            "type": "string",
            "minLength": 1
          },
          "components": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "title",
                "rights_holder",
                "license"
              ],
              "properties": {
                "title": {
                  "type": "string",
                  "minLength": 1
                },
                "rights_holder": {
                  "type": "string",
                  "minLength": 1
                },
                "license": {
                  "type": "string",
                  "description": "An SPDX identifier, or NOASSERTION.",
                  "minLength": 1
                },
                "license_url": {
                  "type": "string",
                  "format": "uri"
                },
                "source_url": {
                  "type": "string",
                  "format": "uri"
                },
                "note": {
                  "type": "string",
                  "minLength": 1
                }
              }
            }
          },
          "details_url": {
            "type": "string",
            "format": "uri"
          }
        }
      }
    },
    "note": {
      "type": "string",
      "minLength": 1
    },
    "canonical_origin": {
      "const": "https://hellodoggo.ai"
    },
    "canonical_url": {
      "const": "https://hellodoggo.ai/non-human-intelligence/component-rights.json"
    }
  }
}
