{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "title": "Inventory Manager Analysis Schema",
    "description": "The shape of the analysis object generated within Inventory Manager for a successfully parsed metadata document. Content within this object is related to the quality of the content of specific metadata fields, which can be used downstream to determine whether or not a given document should be accepted into another service, such as the OneStop search platform.",
    "type": "object",
    "properties": {
        "identification": {
            "description": "Assessment of the identifying elements of the metadata.",
            "type": "object",
            "properties": {
                "fileIdentifier": {
                    "type": "object",
                    "properties": {
                        "exists": {
                            "type": "boolean"
                        },
                        "fileIdentifierString": {
                            "type": [
                                "string"
                            ]
                        }
                    },
                    "required": [
                        "exists"
                    ],
                    "additionalProperties": false
                },
                "doi": {
                    "type": "object",
                    "properties": {
                        "exists": {
                            "type": "boolean"
                        },
                        "doiString": {
                            "type": [
                                "string"
                            ]
                        }
                    },
                    "required": [
                        "exists"
                    ],
                    "additionalProperties": false
                },
                "parentIdentifier": {
                    "type": "object",
                    "properties": {
                        "exists": {
                            "type": "boolean"
                        },
                        "parentIdentifierString": {
                            "type": [
                                "string"
                            ]
                        }
                    },
                    "required": [
                        "exists"
                    ],
                    "additionalProperties": false
                },
                "hierarchyLevelName": {
                    "type": "object",
                    "properties": {
                        "exists": {
                            "type": "boolean"
                        },
                        "matchesIdentifiers": {
                            "description": "Resolves to true if 'granule' specified as hierarchy level and both fileId & parentId provided OR if no hierarchy level specified.",
                            "type": "boolean"
                        }
                    },
                    "required": [
                        "exists",
                        "matchesIdentifiers"
                    ],
                    "additionalProperties": false
                }
            },
            "additionalProperties": false
        },
        "temporalBounding": {
            "description": "Assessment of the temporal bounding in the metadata.",
            "type": "object",
            "properties": {
                "begin": {
                    "$ref": "#/definitions/dateInfo"
                },
                "end": {
                    "$ref": "#/definitions/dateInfo"
                },
                "instant": {
                    "$ref": "#/definitions/dateInfo"
                },
                "range": {
                    "type": "object",
                    "properties": {
                        "descriptor": {
                            "enum": [
                                "BOUNDED",
                                "INSTANT",
                                "INVALID",
                                "ONGOING",
                                "UNDEFINED"
                            ]
                        },
                        "beginLTEEnd": {
                            "enum": [
                                true,
                                false,
                                "UNDEFINED"
                            ]
                        }
                    },
                    "additionalProperties": false,
                    "required": [
                        "descriptor",
                        "beginLTEEnd"
                    ]
                }
            },
            "required": [
                "begin",
                "end",
                "instant",
                "range"
            ],
            "additionalProperties": false
        },
        "spatialBounding": {
            "description": "Assessment of the spatial bounding in the metadata.",
            "type": "object",
            "properties": {
                "exists": {
                    "type": "boolean"
                }
            },
            "required": [
                "exists"
            ],
            "additionalProperties": false
        },
        "titles": {
            "description": "Assessment of the titles in the metadata.",
            "type": "object",
            "properties": {
                "title": {
                    "type": "object",
                    "properties": {
                        "exists": {
                            "type": "boolean"
                        },
                        "characters": {
                            "type": "integer"
                        }
                    },
                    "required": [
                        "exists",
                        "characters"
                    ],
                    "additionalProperties": false
                },
                "alternateTitle": {
                    "type": "object",
                    "properties": {
                        "exists": {
                            "type": "boolean"
                        },
                        "characters": {
                            "type": "integer"
                        }
                    },
                    "required": [
                        "exists",
                        "characters"
                    ],
                    "additionalProperties": false
                }
            },
            "required": [
                "title",
                "alternateTitle"
            ],
            "additionalProperties": false
        },
        "description": {
            "description": "Assessment of the description in the metadata.",
            "type": "object",
            "properties": {
                "exists": {
                    "type": "boolean"
                },
                "characters": {
                    "type": "integer"
                }
            },
            "required": [
                "exists",
                "characters"
            ],
            "additionalProperties": false
        },
        "thumbnail": {
            "description": "Assessment of the thumbnail information in the metadata.",
            "type": "object",
            "properties": {
                "exists": {
                    "type": "boolean"
                }
            },
            "required": [
                "exists"
            ],
            "additionalProperties": false
        },
        "dataAccess": {
            "description": "Assessment of the data access elements in the metadata.",
            "type": "object",
            "properties": {
                "exists": {
                    "type": "boolean"
                }
            },
            "required": [
                "exists"
            ],
            "additionalProperties": false
        }
    },
    "additionalProperties": false,
    "definitions": {
        "dateInfo": {
            "type": "object",
            "properties": {
                "exists": {
                    "type": "boolean"
                },
                "precision": {
                    "enum": [
                        "Years",
                        "Days",
                        "Nanos",
                        "UNDEFINED",
                        "INVALID"
                    ]
                },
                "validSearchFormat": {
                    "enum": [
                        true,
                        false,
                        "UNDEFINED"
                    ]
                },
                "zoneSpecified": {
                    "type": "string"
                },
                "utcDateTimeString": {
                    "type": "string"
                }
            },
            "additionalProperties": false,
            "required": [
                "exists",
                "precision",
                "validSearchFormat",
                "zoneSpecified",
                "utcDateTimeString"
            ]
        }
    }
}