{
    "$id": "atomic_vector_list/v1.json",
    "$schema": "http://json-schema.org/draft-07/schema",
    "_attributes": {
        "format": "text/csv",
        "restore": {
            "R": "alabaster.base::loadAtomicVector",
            "python": "dolomite_base.load_atomic_vector"
        }
    },
    "additionalProperties": false,
    "description": "Vector of atomic values, stored in a CSV file (see [here](https://github.com/ArtifactDB/takane/blob/master/docs/specifications/atomic_vector/v1.md) for a detailed specification). If the vector is unnamed, the file should have a single column containing the vector elements. If the vector is named, the file should contain two columns; the first (string) column contains the names of the vector elements and the second column contains the vector elements themselves.",
    "properties": {
        "$schema": {
            "description": "The schema to use.",
            "type": "string"
        },
        "atomic_vector": {
            "additionalProperties": false,
            "allOf": [
                {
                    "if": {
                        "not": {
                            "properties": {
                                "type": {
                                    "const": "string"
                                }
                            }
                        }
                    },
                    "then": {
                        "not": {
                            "required": [
                                "format"
                            ]
                        }
                    }
                }
            ],
            "properties": {
                "compression": {
                    "description": "Type of compression applied to the file.",
                    "enum": [
                        "none",
                        "gzip",
                        "bzip2"
                    ],
                    "type": "string"
                },
                "format": {
                    "description": "Formatting constraints for string types.\n\n- Dates are strings consisting of integers and dashes, following the `YYYY-MM-DD` format.\n- Date-times are strings following RFC 3339 Section 5.6, i.e., the Internet Date/Time format.",
                    "enum": [
                        "date",
                        "date-time"
                    ],
                    "type": "string"
                },
                "length": {
                    "description": "Length of the vector.",
                    "minimum": 0,
                    "type": "integer"
                },
                "names": {
                    "default": false,
                    "description": "Whether the vector contains names.",
                    "type": "boolean"
                },
                "type": {
                    "description": "Type of the vector.",
                    "enum": [
                        "integer",
                        "number",
                        "string",
                        "boolean"
                    ]
                }
            },
            "required": [
                "compression",
                "length",
                "type"
            ],
            "type": "object"
        },
        "is_child": {
            "default": false,
            "description": "Is this a child document, only to be interpreted in the context of the parent document from which it is linked? This may have implications for search and metadata requirements.",
            "type": "boolean"
        },
        "md5sum": {
            "description": "MD5 checksum for the file.",
            "type": "string"
        },
        "path": {
            "description": "Path to the file in the project directory.",
            "type": "string"
        }
    },
    "required": [
        "$schema",
        "atomic_vector",
        "md5sum",
        "path"
    ],
    "title": "Atomic vector",
    "type": "object"
}
