Skip to content

Commit

Permalink
Merge pull request #96 from HumanCellAtlas/analysis_validation
Browse files Browse the repository at this point in the history
Revised analysis.json so it becomes valid json
  • Loading branch information
daniwelter authored Dec 13, 2017
2 parents 14d8fd2 + e4d3762 commit 1c26aab
Show file tree
Hide file tree
Showing 2 changed files with 130 additions and 99 deletions.
227 changes: 129 additions & 98 deletions json_schema/analysis.json
Original file line number Diff line number Diff line change
@@ -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."
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/simple_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 1c26aab

Please sign in to comment.