{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "CMOA Provenance Standard Record",
    "description": "A description of the history of transfers of ownership and custody of artwork, using the CMOA Provenance Standard.",
    "type": "array",
    "_uniqueItems": true,
    "minItems": 1,
    "items": {
        "$ref": "#/definitions/period"
    },
    "definitions": {
        "period": {
            "type": "object",
            "properties": {
                "period_certainty": {
                    "title": "Period Certainty",
                    "description": "Are you certain that this period is correct in its entirety?",
                    "type": "boolean",
                    "default": "true"
                },
                "acquisition_method": {
                    "title": "Acquisition Method",
                    "description": "A URI referencing a method from a controlled vocabulary describing the way in which the work changed hands.",
                    "example": "acq:sale",
                    "$ref": "#/definitions/uri"
                },
                "owner": {
                    "title": "Owner",
                    "description": "The acquiring party.",
                    "$ref": "#/definitions/person"
                },
                "event": {
                    "title": "Named Event",
                    "description": "An explicit reference to the event in which this work changed hands",
                    "example": "acq:sale",
                    "$ref": "#/definitions/name"
                },
                "sellers_agent": {
                    "title": "Seller's Agent",
                    "description": "A party who assisted the party who was relinquishing the object.",
                    "$ref": "#/definitions/person"
                },
                "purchasing_agent": {
                    "title": "Purchasing Agent",
                    "description": "A party who assisted the party who was acquiring the object.",
                    "$ref": "#/definitions/person"
                },
                "transfer_location": {
                    "title": "Location of Transfer",
                    "description": "The explicit place where the transfer event took place.",
                    "properties": {
                        "place": {
                            "$ref": "#/definitions/place"
                        }
                    },
                    "additionalProperties": false
                },
                "timespan": {
                    "title": "Transfer Dates",
                    "description": "The dates when the transfer event took place, and optionally the dates when the acquiring party relinquished the object.",
                    "properties": {
                        "botb": {
                            "title": "Begin of the Begin",
                            "description": "The earliest possible moment the acquisition event could have taken place.",
                            "$ref": "#/definitions/edtf"
                        },
                        "eotb": {
                            "title": "End of the Begin",
                            "description": "The latest possible moment when the acquisition event could have taken place.",
                            "$ref": "#/definitions/edtf"
                        },
                        "bote": {
                            "title": "Begin of the End",
                            "description": "The earliest possible moment when the relinquishing event could have taken place.",
                            "$ref": "#/definitions/edtf"
                        },
                        "eote": {
                            "title": "End of the End",
                            "description": "The latest possible moment when the relinquishing event could have taken place.",
                            "$ref": "#/definitions/edtf"
                        },
                        "in": {
                            "title": "On this Date",
                            "description": "Used for single-day events, when the BOTB and EOTE are the same date.",
                            "$ref": "#/definitions/edtf"
                        },
                        "begin": {
                            "title": "Begin Date",
                            "description": "The date the acquisition event took place\u2014used when the BOTB and EOTB are the same date.",
                            "$ref": "#/definitions/edtf"
                        },
                        "end": {
                            "title": "End Date",
                            "description": "The date the relinquishing event took place\u2014used when the EOTB and EOTE are the same date.",
                            "$ref": "#/definitions/edtf"
                        }
                    },
                    "additionalProperties": false
                },
                "stock_number": {
                    "title": "Stock or Lot Number",
                    "description": "A identification number given to the object as part of the transaction",
                    "type": "string"
                },
                "purchase": {
                    "oneOf": [
                        {
                            "properties": {
                                "value": {
                                    "title": "Purchase Value",
                                    "description": "The numeric value of the transaction",
                                    "type": "string"
                                },
                                "currency_symbol": {
                                    "title": "Currency Unit",
                                    "description": "The symbol used to indicate the currency the transaction was denominated in",
                                    "type": "string"
                                }
                            },
                            "additionalProperties": false
                        },
                        {
                            "properties": {
                                "string": {
                                    "title": "Currency Text",
                                    "description": "The abount of the purchase price as text",
                                    "type": "string"
                                }
                            },
                            "additionalProperties": false
                        }
                    ]
                },
                "footnote": {
                    "title": "Footnote",
                    "description": "An free text field with additional information about the transaction",
                    "type": "string"
                },
                "citations": {
                    "type": "array",
                    "items": {
                        "title": "Citation",
                        "description": "A bibliographical reference to a primary source that documents the transaction",
                        "type": "string"
                    }
                },
                "direct_transfer": {
                    "title": "Direct Tranfer?",
                    "description": "Did the transaction directly pass to the acquiring party from the previous period?",
                    "type": "boolean",
                    "default": "false"
                },
                "text": {
                    "title": "Provenance Text",
                    "description": "The original, unparsed textual representation of this period",
                    "type": "string"
                }
            },
            "required": [
                "period_certainty",
                "acquisition_method",
                "timespan",
                "direct_transfer",
                "text"
            ],
            "additionalProperties": false
        },
        "uri": {
            "oneOf": [
                {
                    "type": "string",
                    "pattern": "^\\S+:\\S+$"
                }
            ]
        },
        "edtf": {
            "type": "string",
            "pattern": "^\\d{2}[\\d\\?ux]{2}[\\?|~]?(?:-[01\\?ux][\\d\\?ux][\\?|~]?(?:-[0123\\?ux][\\d\\?ux][\\?|~]?)?)?$",
            "default": "uuuu-uu-uu"
        },
        "person": {
            "properties": {
                "name": {
                    "$ref": "#/definitions/name"
                },
                "place": {
                    "$ref": "#/definitions/place"
                },
                "birth": {
                    "title": "Birth or Founding Year",
                    "description": "The first year the party was in existance",
                    "$ref": "#/definitions/edtf"
                },
                "death": {
                    "title": "Death or Dissolusion Year",
                    "description": "The last year the party was in existance",
                    "$ref": "#/definitions/edtf"
                },
                "relationship": {
                    "title": "Familial Relationship",
                    "description": "A party related to the named party.  (Note that the relationship type describes the relationship from the point of view of the this party.  So 'son' means that this party was the father of the named party. ",
                    "properties": {
                        "name": {
                            "$ref": "#/definitions/name"
                        },
                        "type": {
                            "type": "string",
                            "enum": [
                                "brother",
                                "sister",
                                "sibling",
                                "mother",
                                "father",
                                "parent",
                                "son",
                                "daughter",
                                "child",
                                "grandchild",
                                "grandparent",
                                "nephew",
                                "niece",
                                "uncle",
                                "aunt",
                                "husband",
                                "wife",
                                "spouse",
                                "relative"
                            ]
                        }
                    },
                    "required": [
                        "name",
                        "type"
                    ],
                    "additionalProperties": false
                },
                "clause": {
                    "enum": [
                        "the artist"
                    ]
                }
            },
            "additionalProperties": false
        },
        "place": {
            "$ref": "#/definitions/name"
        },
        "name": {
            "properties": {
                "token": {
                    "title": "ID Token",
                    "description": "(For internal use only)",
                    "type": "string",
                    "pattern": "^\\$\\w+$"
                },
                "string": {
                    "title": "Name Value",
                    "description": "The textual representation of this name",
                    "type": "string"
                },
                "uri": {
                    "title": "Linked Data URI",
                    "description": "an explicit link to a URI in an authority file for this name",
                    "oneOf": [
                        {
                            "$ref": "#/definitions/uri"
                        },
                        {
                            "type": "null"
                        }
                    ]
                },
                "certainty": {
                    "title": "Certainty",
                    "description": "Is this named certain?",
                    "type": "boolean",
                    "default": true
                }
            },
            "required": [
                "string",
                "certainty",
                "uri"
            ],
            "additionalProperties": false
        }
    }
}