{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "description": "Sample base schema",
    "properties": {
        "alias": {
            "description": "An unique identifier in a submission.",
            "minLength": 1,
            "type": "string"
        },
        "attributes": {
            "description": "Attributes for describing a sample.",
            "patternProperties": {
                "^.*$": {
                    "items": {
                        "properties": {
                            "terms": {
                                "items": {
                                    "properties": {
                                        "url": {
                                            "_format": "uri",
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "url"
                                    ],
                                    "type": "object"
                                },
                                "type": "array"
                            },
                            "units": {
                                "minLength": 1,
                                "type": "string"
                            },
                            "value": {
                                "minLength": 1,
                                "type": "string"
                            }
                        },
                        "required": [
                            "value"
                        ]
                    },
                    "minItems": 1,
                    "type": "array"
                }
            },
            "properties": {},
            "type": "object"
        },
        "description": {
            "description": "More extensive free-form description.",
            "minLength": 1,
            "type": "string"
        },
        "releaseDate": {
            "_format": "date",
            "type": "string"
        },
        "sampleRelationships": {
            "items": {
                "oneOf": [
                    {
                        "required": [
                            "alias",
                            "team",
                            "nature"
                        ]
                    },
                    {
                        "required": [
                            "accession",
                            "nature"
                        ]
                    }
                ],
                "properties": {
                    "accession": {
                        "minLength": 1,
                        "type": "string"
                    },
                    "alias": {
                        "minLength": 1,
                        "type": "string"
                    },
                    "nature": {
                        "enum": [
                            "derived from",
                            "child of",
                            "same as",
                            "recurated from"
                        ],
                        "type": "string"
                    },
                    "team": {
                        "minLength": 1,
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "type": "array"
        },
        "taxonomy": {
            "properties": {
                "taxonId": {
                    "type": "integer"
                },
                "taxonName": {
                    "minLength": 1,
                    "type": "string"
                }
            },
            "required": [
                "taxonId"
            ],
            "type": "object"
        },
        "title": {
            "description": "Title of the sample.",
            "minLength": 1,
            "type": "string"
        }
    },
    "required": [
        "alias",
        "taxonomy",
        "releaseDate"
    ],
    "title": "A Sample Schema",
    "type": "object"
}