{
    "additionalProperties": false,
    "definitions": {
        "asset": {
            "additionalProperties": false,
            "description": "Assets reflecting files in primary storage.",
            "properties": {
                "clip": {
                    "$ref": "#/definitions/segment",
                    "description": "Portion of source file to extract as this asset. Note that segment is relative to clip start."
                },
                "file": {
                    "description": "Relative path to file under '/nyu/stage/$directory'.",
                    "type": "string"
                },
                "id": {
                    "type": "integer"
                },
                "name": {
                    "type": "string"
                },
                "options": {
                    "description": "Additional transcode options to pass to ffmpeg.",
                    "items": {
                        "type": "string"
                    },
                    "type": "array"
                },
                "position": {
                    "anyOf": [
                        {
                            "$ref": "#/definitions/offset",
                            "description": "Start point only (end point inferred from length)."
                        },
                        {
                            "$ref": "#/definitions/segment"
                        },
                        {
                            "description": "Automatically postioned immediately following previous positioned asset.",
                            "enum": [
                                "auto"
                            ],
                            "type": "string"
                        }
                    ]
                },
                "release": {
                    "$ref": "#/definitions/release"
                },
                "replace": {
                    "description": "Original file staging path or asset id to replace.",
                    "type": [
                        "string",
                        "integer"
                    ]
                }
            },
            "title": "file",
            "type": "object"
        },
        "citation": {
            "additionalProperties": false,
            "description": "Publications/products corresponding to study volumes.",
            "properties": {
                "authors": {
                    "items": {
                        "type": "string"
                    },
                    "type": "array"
                },
                "head": {
                    "type": "string"
                },
                "title": {
                    "type": "string"
                },
                "url": {
                    "format": "uri",
                    "title": "URL or DOI",
                    "type": "string"
                },
                "year": {
                    "maximum": 2900,
                    "minimum": 1900,
                    "type": "integer"
                }
            },
            "required": [
                "head"
            ],
            "type": "object"
        },
        "container": {
            "additionalProperties": false,
            "description": "Organizational unit within volume containing related files (with common annotations), often corresponding to an individual data session (single visit/acquisition/participant/group/day).",
            "properties": {
                "assets": {
                    "description": "Attachment point of assets, which, in the case of timeseries data, should match asset.duration.",
                    "items": {
                        "$ref": "#/definitions/asset"
                    },
                    "type": "array"
                },
                "date": {
                    "$ref": "#/definitions/date"
                },
                "id": {
                    "type": "integer"
                },
                "key": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "records": {
                    "description": "Attachment of records to slots.",
                    "items": {
                        "$ref": "#/definitions/record"
                    },
                    "type": "array"
                },
                "release": {
                    "anyOf": [
                        {
                            "$ref": "#/definitions/release"
                        }
                    ],
                    "default": null,
                    "description": "Sharing/release permissions granted by participants on (portions of) contained data."
                },
                "top": {
                    "default": false,
                    "type": "boolean"
                }
            },
            "required": [
                "key"
            ],
            "title": "session or materials",
            "type": "object"
        },
        "date": {
            "pattern": "^[12][0-9]{3}-[01][0-9]-[0-3][0-9]$",
            "type": "string"
        },
        "link": {
            "additionalProperties": false,
            "description": "Link to externals resources/references.",
            "properties": {
                "head": {
                    "type": "string"
                },
                "url": {
                    "format": "uri",
                    "title": "URL or DOI",
                    "type": "string"
                }
            },
            "required": [
                "head",
                "url"
            ],
            "type": "object"
        },
        "numeric": {
            "pattern": "^[0-9]*(\\.[0-9]*)?$",
            "type": "string"
        },
        "offset": {
            "description": "Point in time in milliseconds or MM:SS.sss, used as endpoint for segment.  Null represents indeterminate value, usually representing +-Infinity as an endpoint.",
            "pattern": "^[-+]?([0-9]+:){0,2}[0-9]+(\\.[0-9]*)?$",
            "type": [
                "number",
                "string",
                "null"
            ]
        },
        "position": {
            "default": [
                null,
                null
            ]
        },
        "record": {
            "additionalProperties": false,
            "description": "Sets of metadata measurements organized into or applying to a single cohesive unit. These are assumed to be unique within a volume, such that two identical records are considered the same object.",
            "properties": {
                "ID": {
                    "type": "string"
                },
                "birth weight": {
                    "$ref": "#/definitions/numeric"
                },
                "birthdate": {
                    "$ref": "#/definitions/date"
                },
                "category": {
                    "description": "Types of records that are relevant for data organization.",
                    "enum": [
                        "participant",
                        "pilot",
                        "exclusion",
                        "condition",
                        "group",
                        "task",
                        "context"
                    ]
                },
                "country": {
                    "type": "string"
                },
                "description": {
                    "type": "string"
                },
                "disability": {
                    "type": "string"
                },
                "ethnicity": {
                    "enum": [
                        "Not Hispanic or Latino",
                        "Hispanic or Latino"
                    ],
                    "type": "string"
                },
                "gender": {
                    "enum": [
                        "Female",
                        "Male"
                    ],
                    "type": "string"
                },
                "gestational age": {
                    "$ref": "#/definitions/numeric"
                },
                "id": {
                    "type": "integer"
                },
                "info": {
                    "type": "string"
                },
                "key": {
                    "type": "string"
                },
                "language": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "positions": {
                    "items": {
                        "$ref": "#/definitions/segment"
                    },
                    "type": "array"
                },
                "pregnancy term": {
                    "enum": [
                        "Full term",
                        "Preterm"
                    ],
                    "type": "string"
                },
                "race": {
                    "enum": [
                        "American Indian or Alaska Native",
                        "Asian",
                        "Native Hawaiian or Other Pacific Islander",
                        "Black or African American",
                        "White",
                        "More than one",
                        "Unknown or not reported"
                    ],
                    "type": "string"
                },
                "reason": {
                    "enum": [
                        "Did not meet inclusion criteria",
                        "Procedural/experimenter error",
                        "Withdrew/fussy/tired",
                        "Outlier"
                    ],
                    "type": "string"
                },
                "setting": {
                    "enum": [
                        "Lab",
                        "Home",
                        "Classroom",
                        "Outdoor",
                        "Clinic"
                    ],
                    "type": "string"
                },
                "state": {
                    "enum": [
                        "AL",
                        "AK",
                        "AZ",
                        "AR",
                        "CA",
                        "CO",
                        "CT",
                        "DE",
                        "DC",
                        "FL",
                        "GA",
                        "HI",
                        "ID",
                        "IL",
                        "IN",
                        "IA",
                        "KS",
                        "KY",
                        "LA",
                        "ME",
                        "MT",
                        "NE",
                        "NV",
                        "NH",
                        "NJ",
                        "NM",
                        "NY",
                        "NC",
                        "ND",
                        "OH",
                        "OK",
                        "OR",
                        "MD",
                        "MA",
                        "MI",
                        "MN",
                        "MS",
                        "MO",
                        "PA",
                        "RI",
                        "SC",
                        "SD",
                        "TN",
                        "TX",
                        "UT",
                        "VT",
                        "VA",
                        "WA",
                        "WV",
                        "WI",
                        "WY"
                    ],
                    "type": "string"
                },
                "summary": {
                    "type": "string"
                }
            },
            "required": [
                "key",
                "category"
            ],
            "type": "object"
        },
        "release": {
            "description": "Levels at which participants or researchers may choose to share data.",
            "enum": [
                null,
                "PRIVATE",
                "SHARED",
                "EXCERPTS",
                "PUBLIC"
            ],
            "title": "sharing release level"
        },
        "segment": {
            "additionalItems": false,
            "default": [
                null,
                null
            ],
            "description": "Explicit range of time (within a container): an empty segment, a singleton point in time, or a start and end point.",
            "items": {
                "$ref": "#/definitions/offset"
            },
            "maxItems": 2,
            "type": "array"
        }
    },
    "description": "Basic organizational unit for data.",
    "properties": {
        "containers": {
            "description": "The first container is required and must have 'top' set.",
            "items": {
                "$ref": "#/definitions/container"
            },
            "minItems": 1,
            "type": "array"
        },
        "directory": {
            "default": "",
            "description": "Staging directory (normally within /nyu/stage) within which to find all asset files.",
            "title": "Asset base directory",
            "type": "string"
        },
        "name": {
            "type": "string"
        }
    },
    "required": [
        "name",
        "containers"
    ],
    "title": "Databrary Volume",
    "type": "object"
}