diff --git a/json_schema/analysis.json b/json_schema/analysis.json index 52c7315b2..7cc635681 100644 --- a/json_schema/analysis.json +++ b/json_schema/analysis.json @@ -1,154 +1,185 @@ { - "title": "analysis", + "title": "analysis", "required": [ - "timestamp_start_utc", - "timestamp_stop_utc", - "computational_method", - "input_bundles", - "reference_bundle", - "analysis_id", - "analysis_run_type", - "metadata_schema", - "tasks", - "inputs", - "outputs" - ], - "additionalProperties": true, + "timestamp_start_utc", + "timestamp_stop_utc", + "computational_method", + "input_bundles", + "reference_bundle", + "analysis_id", + "analysis_run_type", + "metadata_schema", + "tasks", + "inputs", + "outputs", + "core" + ], + "additionalProperties": true, "definitions": { "task": { - "additionalProperties": false, + "additionalProperties": false, "required": [ - "name", - "start_time", - "stop_time", - "log", - "disk_size", - "docker_image", - "cpus", - "memory", + "name", + "start_time", + "stop_time", + "log", + "disk_size", + "docker_image", + "cpus", + "memory", "zone" - ], - "type": "object", + ], + "type": "object", "properties": { - "disk_size": "string", - "name": "string", - "zone": "string", - "log_err": "uri", - "start_time": "date-time", - "cpus": "int", - "log_out": "uri", - "stop_time": "date-time", - "memory": "string", - "docker_image": "string" + "disk_size": { + "type" : "string" + }, + "name": { + "type" : "string" + }, + "zone": { + "type" : "string" + }, + "log_err": { + "type" : "string" + }, + "start_time":{ + "type": "string", + "format": "date-time" + }, + "cpus": { + "type" : "integer" + }, + "log_out":{ + "type" : "string" + }, + "stop_time": { + "type": "string", + "format": "date-time" + }, + "memory":{ + "type" : "string" + }, + "docker_image":{ + "type" : "string" + } } - }, + }, "parameter": { - "additionalProperties": false, + "additionalProperties": false, "required": [ - "name", + "name", "value" - ], - "type": "object", + ], + "type": "object", "properties": { - "checksum": "string", - "name": "string", - "value": "string" + "checksum": { + "type" : "string" + }, + "name": { + "type" : "string" + }, + "value": { + "type" : "string" + } } - }, + }, "file": { - "additionalProperties": false, + "additionalProperties": false, "required": [ - "checksum", - "file_path", + "checksum", + "file_path", "format" - ], - "type": "object", + ], + "type": "object", "properties": { - "checksum": "string", - "file_path": "uri", - "format": "string" + "checksum": { + "type" : "string" + }, + "file_path": { + "type" : "string" + }, + "format": { + "type" : "string" + } } } - }, - "$schema": "http://json-schema.org/draft-04/schema#", - "type": "object", + }, + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", "properties": { "inputs": { "items": { - "type": { - "$ref": "https://raw.githubusercontent.com/HumanCellAtlas/metadata-schema/4.4.0/json_schema/analysis.json#/definitions/parameter" - } - }, - "type": "array", + "$ref": "https://raw.githubusercontent.com/HumanCellAtlas/metadata-schema/4.4.0/json_schema/analysis.json#/definitions/parameter" + }, + "type": "array", "description": "Input parameters used in the pipeline run, these can be files or string values (settings)." - }, + }, "reference_bundle": { - "type": "uri", + "type": "string", "description": "Bundle containing the reference used in running the pipeline." - }, + }, "tasks": { "items": { - "type": { - "$ref": "https://raw.githubusercontent.com/HumanCellAtlas/metadata-schema/4.4.0/json_schema/analysis.json#/definitions/task" - } - }, - "type": "array", + "$ref": "https://raw.githubusercontent.com/HumanCellAtlas/metadata-schema/4.4.0/json_schema/analysis.json#/definitions/task" + }, + "type": "array", "description": "Descriptions of tasks in the workflow." - }, + }, "description": { - "type": "string", + "type": "string", "description": "A general description of the analysis." - }, + }, "timestamp_stop_utc": { - "type": "date-time", + "type": "string", + "format": "date-time", "description": "Terminal stop time of the full pipeline." - }, + }, "input_bundles": { "items": { - "type": "uri" - }, - "type": "array", + "type": "string" + }, + "type": "array", "description": "The input bundles used in this analysis run." - }, + }, "outputs": { "items": { - "type": { - "$ref": "https://raw.githubusercontent.com/HumanCellAtlas/metadata-schema/4.4.0/json_schema/analysis.json#/definitions/file" - } - }, - "type": "array", + "$ref": "https://raw.githubusercontent.com/HumanCellAtlas/metadata-schema/4.4.0/json_schema/analysis.json#/definitions/file" + }, + "type": "array", "description": "Output generated by the pipeline run." - }, + }, "analysis_id": { - "type": "number", + "type": "string", "description": "A unique ID for this analysis." - }, + }, "computational_method": { - "type": "uri", + "type": "string", "description": "A URI to a versioned workflow and versioned execution environment in a GA4GH-compliant repository." - }, + }, "timestamp_start_utc": { - "type": "date-time", + "type": "string", + "format": "date-time", "description": "Initial start time of the full pipeline." - }, + }, "core": { - "description": "Type and schema for this object.", + "description": "Type and schema for this object.", "$ref": "https://raw.githubusercontent.com/HumanCellAtlas/metadata-schema/4.4.0/json_schema/core.json" - }, + }, "analysis_run_type": { "enum": [ - "run", + "run", "copy-forward" - ], - "type": "string", + ], + "type": "string", "description": "Indicator of whether the analysis actually ran or was just copied forward as an optimization." - }, + }, "metadata_schema": { - "type": "string", + "type": "string", "description": "The version of the metadata schemas used for the json files." - }, + }, "name": { - "type": "string", + "type": "string", "description": "A short, descriptive name for the analysis that need not be unique." } } diff --git a/src/simple_test.py b/src/simple_test.py index c9149a089..da5af88b1 100644 --- a/src/simple_test.py +++ b/src/simple_test.py @@ -8,7 +8,7 @@ """ # a*.json skipped for now -schemas = glob.glob('../json_schema/' +"[b-z]*.json") +schemas = glob.glob('../json_schema/' +"[a-z]*.json") for s in schemas: print("Checking whether %s is a valid json schema" % s)