{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "Codex Instance Schema",
    "description": "Codex Instance Schema",
    "type": "object",
    "additionalProperties": false,
    "properties": {
        "id": {
            "type": "string",
            "description": "the ID of the original record within its own database: since these come from various sources they may take different forms, e.g. integer, UUID"
        },
        "title": {
            "type": "string",
            "description": "the primary title (or label) associated with the resource"
        },
        "altTitle": {
            "type": "string",
            "description": "an alternative title for the resource. (e.g. original language version title of a movie)"
        },
        "series": {
            "type": "string",
            "description": "a series title associated with the resource (e.g. Harry Potter)"
        },
        "contributor": {
            "type": "array",
            "description": "list of contributors to the resource",
            "items": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                    "type": {
                        "type": "string",
                        "description": "type of contributor to the resource"
                    },
                    "name": {
                        "type": "string",
                        "description": "name of contributor to the resource"
                    }
                }
            },
            "additionalItems": true,
            "_uniqueItems": true
        },
        "subject": {
            "type": "array",
            "description": "list of subjects this resource belongs to",
            "items": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                    "type": {
                        "type": "string",
                        "description": "type of subject"
                    },
                    "name": {
                        "type": "string",
                        "description": "name of subject"
                    }
                }
            },
            "additionalItems": true,
            "_uniqueItems": true
        },
        "publisher": {
            "type": "string",
            "description": "name of publisher of the resource"
        },
        "date": {
            "type": "string",
            "description": "the date of publication of the resource"
        },
        "type": {
            "type": "string",
            "description": "content type of the resource",
            "enum": [
                "audio",
                "audiobooks",
                "books",
                "bookseries",
                "databases",
                "ebooks",
                "kits",
                "maps",
                "music",
                "newspapers",
                "newsletters",
                "periodicals",
                "posters",
                "reports",
                "proceedings",
                "thesisanddissertation",
                "unspecified",
                "video",
                "webresources"
            ]
        },
        "format": {
            "type": "string",
            "description": "format of the resource"
        },
        "identifier": {
            "type": "array",
            "items": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                    "value": {
                        "type": "string",
                        "description": "identifier type : e.g. ISSN"
                    },
                    "type": {
                        "type": "string",
                        "description": "identifier value"
                    }
                }
            },
            "additionalItems": true,
            "_uniqueItems": true,
            "description": "an extensible set of name-value pairs of identifiers associated with the resource"
        },
        "source": {
            "type": "string",
            "description": "a label indicating the source of the recent, e.g. kb, local"
        },
        "language": {
            "type": "array",
            "description": "the set of languages used by the resource",
            "items": {
                "type": "string"
            }
        },
        "rights": {
            "type": "string",
            "description": "access rights associated with the resource"
        },
        "version": {
            "type": "string",
            "description": "version of the resource"
        },
        "lastModified": {
            "type": "string",
            "description": "date/time when this resource was last modified"
        }
    },
    "required": [
        "id",
        "title",
        "type",
        "source"
    ]
}