{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "$id": "http://www.w3id.org/biocompute/1.3.0/schemas/biocomputeobject.json",
    "type": "object",
    "title": "Base type for all BioCompute Objects",
    "description": "All BioCompute object types must adhear to this type in order to be compliant with BioCompute specification",
    "required": [
        "bco_id",
        "bco_spec_version",
        "checksum",
        "provenance_domain",
        "usability_domain",
        "description_domain",
        "execution_domain",
        "io_domain",
        "error_domain"
    ],
    "definitions": {
        "bco_id": {
            "type": "string",
            "description": "A unique identifier that should be applied to each BCO instance. IDs should never be reused",
            "examples": [
                "https://w3id.org/biocompute/examples/HCV1a.json"
            ]
        },
        "uri": {
            "type": "object",
            "description": "A Uniform Resource Identifer",
            "additionalProperties": false,
            "required": [
                "uri"
            ],
            "properties": {
                "filename": {
                    "type": "string"
                },
                "uri": {
                    "type": "string",
                    "format": "uri"
                },
                "access_time": {
                    "type": "string",
                    "format": "date-time"
                },
                "sha1_checksum": {
                    "type": "string",
                    "description": "value of sha1 checksum of file",
                    "pattern": "[A-Za-z0-9]+"
                }
            }
        }, 
        "contributor": {
            "type": "object",
            "description": "Contributor identifier and type of contribution (determined according to PAV ontology) is required",
            "required": [
                "contribution",
                "name"
            ],
            "additionalProperties": false,
            "properties": {
                "name": {
                    "type": "string",
                    "description": "Name of contributor",
                    "examples": [
                        "Charles Hadley King"
                    ]
                },
                "affiliation": {
                    "type": "string",
                    "description": "Organization the particular contributor is affiliated with",
                    "examples": [
                        "George Washington University"
                    ]
                },
                "email": {
                    "type": "string",
                    "description": "electronic means for identification and communication purposes",
                    "examples": [
                        "hadley_king@gwu.edu"
                    ],
                    "format": "email"
                },
                "contribution": {
                    "type": "array",
                    "description": "type of contribution determined according to PAV ontology",
                    "reference": "https://doi.org/10.1186/2041-1480-4-37",
                    "items": {
                        "type": "string",
                        "enum": [
                            "authoredBy",
                            "contributedBy",
                            "createdAt",
                            "createdBy",
                            "createdWith",
                            "curatedBy",
                            "derivedFrom",
                            "importedBy",
                            "importedFrom",
                            "providedBy",
                            "retrievedBy",
                            "retrievedFrom",
                            "sourceAccessedBy"
                        ]
                    }
                },
                "orcid": {
                    "type": "string",
                    "description": "Field to record author information. ORCID identifiers allow for the author to curate their information after submission. ORCID identifiers must be valid and must have the prefix ‘https://orcid.org/’",
                    "examples": [
                        "https://orcid.org/0000-0003-1409-4549"
                    ],
                    "format": "uri"
                }
            }
        }
    },
    "additionalProperties": false,
    "properties": {
        "bco_id": {
            "$ref": "#/definitions/bco_id",
            "readOnly": true
        },
        "bco_spec_version": {
            "type": "string",
            "description": "Version of the BCO specification used to define this document",
            "examples": [
                "https://w3id.org/biocompute/spec/v1.2"
            ],
            "readOnly": true,
            "format": "uri"
        },
        "checksum": {
            "type": "string",
            "description": "A string-type, read-only value, protecting the object from internal or external alterations without proper validation generated with a SHA-256 hash function.",
            "examples": [
                "5986B05969341343E77A95B4023600FC8FEF48B7E79F355E58B0B404A4F50995"
            ],
            "readOnly": true,
            "pattern": "^([A-Za-z0-9]+)$"
        },
        "provenance_domain": {
            "$ref": "provenance_domain.json"
        },
        "usability_domain": {
            "$ref": "usability_domain.json"
        },
        "extension_domain": {
            "properties": {
                "fhir_extension": {
                    "type": "array",
                    "items": {
                        "$ref": "extension_domain/fhir_extension.json"
                    }
                },
                "scm_extension": {
                    "$ref": "extension_domain/scm_extension.json"
                }
            }
        },
        "description_domain": {
            "$ref": "description_domain.json"
        },
        "execution_domain": {
            "$ref": "execution_domain.json"
        },
        "parametric_domain": {
            "$ref": "parametric_domain.json"
        },
        "io_domain": {
            "$ref": "io_domain.json"
        },
        "error_domain": {
            "$ref": "error_domain.json"
        }
    }
}
