Skip to content

Commit

Permalink
feat: Define JSON Schemas for ontology data release artifacts (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
nayib-jose-gloria authored Feb 14, 2024
1 parent e087eca commit b23894a
Show file tree
Hide file tree
Showing 9 changed files with 210 additions and 0 deletions.
76 changes: 76 additions & 0 deletions artifact-schemas/all_ontology_schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Valid Ontology Term JSON Schema",
"description": "Schema for file containing metadata for Ontology Terms accepted in dataset submissions to CZ CellXGene Data Portal.",
"type": "object",
"properties": {
"EFO": { "$ref": "#/definitions/ontologyCategory" },
"UBERON": { "$ref": "#/definitions/ontologyCategory" },
"CL": { "$ref": "#/definitions/ontologyCategory" },
"HANCESTRO": { "$ref": "#/definitions/ontologyCategory" },
"HsapDv": { "$ref": "#/definitions/ontologyCategory" },
"MmusDv": { "$ref": "#/definitions/ontologyCategory" },
"PATO": { "$ref": "#/definitions/ontologyCategory" },
"NCBITaxon": { "$ref": "#/definitions/ontologyCategory" },
"MONDO": { "$ref": "#/definitions/ontologyCategory" }
},
"additionalProperties": false,
"definitions": {
"ontologyCategory": {
"type": "object",
"patternProperties": {
"^(EFO|UBERON|CL|HANCESTRO|HsapDv|MmusDv|PATO|NCBITaxon|MONDO):[0-9]{7}$": {
"type": "object",
"properties": {
"label": {
"type": "string",
"description": "human-readable name for the ontology entry."
},
"deprecated": {
"type": "boolean",
"description": "Indicates whether the ontology entry is deprecated."
},
"ancestors": {
"type": "array",
"items": {
"type": "string",
"pattern": "^(EFO|UBERON|CL|HANCESTRO|HsapDv|MmusDv|PATO|NCBITaxon|MONDO):[0-9]{7}$",
"description": "List of ancestor IDs for the ontology entry."
},
"description": "An array of ancestor ontology terms that this term is a subclass of."
},
"comments": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 0,
"description": "Optional comments regarding the ontology entry from ontology curators."
},
"term_tracker": {
"type": "string",
"format": "uri",
"description": "Optional URL to track discussion around the term's history and changes."
},
"consider": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 0,
"description": "Suggests alternative IDs to consider in place of this ontology entry."
},
"replaced_by": {
"type": "string",
"pattern": "^(EFO|UBERON|CL|HANCESTRO|HsapDv|MmusDv|PATO|NCBITaxon|MONDO):[0-9]{7}$",
"description": "If deprecated, the ID of the ontology entry that should canonically replace this one."
}
},
"required": ["label", "deprecated", "ancestors"],
"additionalProperties": false,
}
},
"additionalProperties": false
}
}
}
12 changes: 12 additions & 0 deletions artifact-schemas/cell_class_list_schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Curated 'Cell Class' Ontology Terms Schema",
"description": "A schema for validating an array of CL ontology term IDs representing high-level 'Cell Classes', curated for CZ CellxGene use.",
"type": "array",
"items": {
"type": "string",
"pattern": "^CL:[0-9]{7}$"
},
"minItems": 1,
"uniqueItems": true
}
12 changes: 12 additions & 0 deletions artifact-schemas/cell_subclass_list_schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Curated 'Cell Subclass' Ontology Terms Schema",
"description": "A schema for validating an array of CL ontology term IDs representing high-level 'Cell Subclasses', curated for CZ CellxGene use.",
"type": "array",
"items": {
"type": "string",
"pattern": "^CL:[0-9]{7}$"
},
"minItems": 1,
"uniqueItems": true
}
17 changes: 17 additions & 0 deletions artifact-schemas/cell_type_descendants_schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Cell Type Ontology Descendants Schema",
"description": "A schema for mapping cell type ontology Terms to its descendant cell type ontology terms",
"type": "object",
"patternProperties": {
"^CL:[0-9]{7}$": {
"type": "array",
"items": {
"type": "string",
"pattern": "^CL:[0-9]{7}$"
},
"description": "An array of CL ontology term IDs that are subclasses of the key CL ontology term ID."
}
},
"additionalProperties": false
}
40 changes: 40 additions & 0 deletions artifact-schemas/ontology_info_schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Ontology Version and Source Schema",
"description": "A schema for the set of valid ontology reference files mapping to a CZ CellXGene Dataset Schema Version",
"type": "object",
"properties": {
"CL": { "$ref": "#/definitions/ontologyEntry" },
"EFO": { "$ref": "#/definitions/ontologyEntry" },
"HANCESTRO": { "$ref": "#/definitions/ontologyEntry" },
"HsapDv": { "$ref": "#/definitions/ontologyEntry" },
"MONDO": { "$ref": "#/definitions/ontologyEntry" },
"MmusDv": { "$ref": "#/definitions/ontologyEntry" },
"NCBITaxon": { "$ref": "#/definitions/ontologyEntry" },
"UBERON": { "$ref": "#/definitions/ontologyEntry" },
"PATO": { "$ref": "#/definitions/ontologyEntry" }
},
"additionalProperties": false,
"definitions": {
"ontologyEntry": {
"type": "object",
"properties": {
"version": {
"type": "string",
"description": "version of ontology canonical to this data release, as defined in its source repo"
},
"source": {
"type": "string",
"format": "uri",
"description": "Source to find and download canonical ontology version for this data release"
},
"filetype": {
"type": "string",
"description": "filetype used to build generated artifacts for this ontology data release"
}
},
"required": ["version", "source", "filetype"],
"additionalProperties": false
}
}
}
12 changes: 12 additions & 0 deletions artifact-schemas/organ_list_schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Curated 'Organ' Ontology Terms Schema",
"description": "A schema for validating an array of UBERON ontology term IDs representing 'Organ' ontology terms, curated for CZ CellxGene use.",
"type": "array",
"items": {
"type": "string",
"pattern": "^UBERON:[0-9]{7}$"
},
"minItems": 1,
"uniqueItems": true
}
12 changes: 12 additions & 0 deletions artifact-schemas/system_list_schema_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Curated 'System' Ontology Terms Schema",
"description": "A schema for validating an array of UBERON ontology term IDs representing organ 'System' ontology terms, curated for CZ CellxGene use.",
"type": "array",
"items": {
"type": "string",
"pattern": "^UBERON:[0-9]{7}$"
},
"minItems": 1,
"uniqueItems": true
}
17 changes: 17 additions & 0 deletions artifact-schemas/tissue_descendants_schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Tissue Ontology Descendants Schema",
"description": "A schema for mapping Tissue ontology terms to its descendant Tissue ontology terms",
"type": "object",
"patternProperties": {
"^UBERON:[0-9]{7}$": {
"type": "array",
"items": {
"type": "string",
"pattern": "^UBERON:[0-9]{7}$"
},
"description": "An array of UBERON ontology term IDs that are subclasses of the key UBERON ontology term ID."
}
},
"additionalProperties": false
}
12 changes: 12 additions & 0 deletions artifact-schemas/tissue_general_list_schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Curated 'Tissue General' Ontology Terms Schema",
"description": "A schema for validating an array of high-level UBERON ontology term IDs representing 'general tissue' ontology terms, curated for CZ CellxGene use.",
"type": "array",
"items": {
"type": "string",
"pattern": "^UBERON:[0-9]{7}$"
},
"minItems": 1,
"uniqueItems": true
}

0 comments on commit b23894a

Please sign in to comment.