Skip to content

Instantly share code, notes, and snippets.

@Kerruba
Created July 12, 2018 17:52
Show Gist options
  • Select an option

  • Save Kerruba/c7eaa911c6e4c6cdd0ed1ba800ce67e9 to your computer and use it in GitHub Desktop.

Select an option

Save Kerruba/c7eaa911c6e4c6cdd0ed1ba800ce67e9 to your computer and use it in GitHub Desktop.

Revisions

  1. Kerruba created this gist Jul 12, 2018.
    252 changes: 252 additions & 0 deletions biosamples-json-schema.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,252 @@
    [{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "id": "http://www.ebi.ac.uk/biosamples/0.0.1/sample",
    "additionalProperties": false,
    "required": [
    "name",
    "accession"
    ],
    "type": "object",
    "properties": {
    "name": {
    "type": "string"
    },
    "accession": {
    "type": "string",
    "pattern": "^SAM(D|N|E([AG]?))[0-9]+$"
    },
    "domain": {
    "type": "string"
    },
    "release": {
    "type": "string",
    "format": "date-time" // https://stackoverflow.com/questions/47223815/in-jsonschema-the-format-value-should-be-set-as-full-date-or-date
    },
    "update": {
    "type": "string",
    "format": "date-time"
    },
    "characteristics": {
    "type": "object",
    "additionalProperties": {
    "type": "http://www.ebi.ac.uk/biosamples/0.0.1/characteristic"
    }
    },
    "relationships": {
    "type": "array",
    "items": {
    "type": "http://www.ebi.ac.uk/biosamples/0.0.1/relationship"
    }
    },
    "organization": {
    "type": "array",
    "items": {
    "type": "http://www.ebi.ac.uk/biosamples/0.0.1/organisation"
    }
    },
    "contact": {
    "type": "array",
    "items": {
    "type": "http://www.ebi.ac.uk/biosamples/0.0.1/contact"
    }
    },
    "publications": {
    "type": "array",
    "items": {
    "type": "http://www.ebi.ac.uk/biosamples/0.0.1/publication"
    }
    },
    "releaseDate": {
    "type": "string",
    "format": "date"
    },
    "updateDate": {
    "type": "string",
    "format": "date"
    },
    "_links": {
    "type": "object",
    "properties": {
    "self": {
    "type": "http://www.ebi.ac.uk/biosamples/0.0.1/_link"
    }
    },
    "additionalProperties": {
    "type": "http://www.ebi.ac.uk/biosamples/0.0.1/_link"
    }
    }
    }
    },
    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "$id": "http://www.ebi.ac.uk/biosamples/0.0.1/characteristic",
    "additionalProperties": false,
    "type": "object",
    "properties": {
    "text": {
    "type": "string"
    },
    "ontologyTerms": {
    "type": "array"
    },
    "unit": {
    "type": "string"
    }
    }
    },
    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "$id": "http://www.ebi.ac.uk/biosamples/0.0.1/relationship",
    "additionalProperties": false,
    "type": "object",
    "required": [
    "source",
    "type",
    "target"
    ],
    "properties": {
    "source": {
    "type": "string",
    "pattern": "^SAM(D|N|E([AG]?))[0-9]+$"

    },
    "type": {
    "type": "string"
    },
    "target": {
    "type": "string",
    "pattern": "^SAM(D|N|E([AG]?))[0-9]+$"
    }
    }
    },
    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "$id": "http://www.ebi.ac.uk/biosamples/0.0.1/organization",
    "additionalProperties": false,
    "type": "object",
    "properties": {
    "Name": {
    "type": "string"
    },
    "Role": {
    "type":"string"
    },
    "E-mail": {
    "type":"string"
    },
    "URL": {
    "type":"string"
    },
    "Address": {
    "type":"string"
    }
    }
    },
    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "$id": "http://www.ebi.ac.uk/biosamples/0.0.1/contact",
    "additionalProperties": false,
    "type": "object",
    "properties": {
    "FirstName": {
    "type": "string"
    },
    "LastName": {
    "type":"string"
    },
    "MidInitials": {
    "type":"string"
    },
    "Name": {
    "type":"string"
    },
    "Role": {
    "type":"string"
    },
    "E-mail": {
    "type":"string"
    },
    "Affiliation": {
    "type":"string"
    },
    "URL": {
    "type":"string"
    }
    }
    },
    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "$id": "http://www.ebi.ac.uk/biosamples/0.0.1/publication",
    "additionalProperties": false,
    "type": "object",
    "properties": {
    "doi": {
    "type": "string"
    },
    "pubmed_id": {
    "type":"string"
    }
    }
    },
    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "$id": "http://www.ebi.ac.uk/biosamples/0.0.1/externalReference",
    "additionalProperties": false,
    "type": "object",
    "required": [
    "url"
    ],
    "properties": {
    "url": {
    "type": "string"
    }
    }
    },
    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "$id": "http://www.ebi.ac.uk/biosamples/0.0.1/curation",
    "additionalProperties": false,
    "type": "object",
    "required": [
    "url"
    ],
    "properties": {
    "url": {
    "type": "string"
    }
    }
    },
    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "$id": "http://www.ebi.ac.uk/biosamples/0.0.1/curationLink",
    "additionalProperties": false,
    "type": "object",
    "required": [
    "url"
    ],
    "properties": {
    "url": {
    "type": "string"
    }
    }
    },
    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "$id": "http://www.ebi.ac.uk/biosamples/0.0.1/_link",
    "additionalProperties": {
    },
    "type": "object",
    "required": [
    "href"
    ],
    "properties": {
    "href": {
    "type": "string"
    },
    "templated": {
    "type": "boolean"
    }
    }

    }
    ]