Permalink
Switch branches/tags
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
186 lines (185 sloc) 8.16 KB
{
"$schema": "http://json-schema.org/schema",
"title": "Worm tracker Commons Object Notation (WCON)",
"description": "A text-based data interchange format for *C. elegans* trackers. It is a constrained subset of JSON. It is designed to be both human and machine readable and to facilitate data exchange and inter-operability for worm tracking data that is independent of platform and the language used for implementation.",
"type": "object",
"required": ["units", "data"],
"additionalProperties": true,
"patternProperties" : {
"^@.*": {
"title": "Custom Feature Type 1",
"description": "Top-Level Custom Feature"
}
},
"properties": {
"files": {
"type": "object",
"description": "For very long tracking experiments, it may be convenient to split a single experiment across multiple WCON files. To make it easier to reconstruct tracks across files, we support a 'files' object.",
"properties": {
"current": {"type":"string"},
"prev": {"oneOf": [
{"type": "null"},
{"type":"string"},
{"type": "array", "items": {"type":"string", "minLength":1}}
]},
"next": {"oneOf": [
{"type": "null"},
{"type":"string"},
{"type": "array", "items": {"type":"string", "minLength":1}}
]}
},
"additionalProperties": false,
"required": ["current"]
},
"units": {
"type": "object",
"description": "Defines the dimensions (temporal, spatial, etc) of the experiment.",
"required": ["t", "x", "y"],
"properties": {
"t": {"type":"string"},
"x": {"type":"string"},
"y": {"type":"string"}
},
"additionalProperties":{
"type": "string"
}
},
"metadata": {
"type": "object",
"description": "Information about experimental conditions and software versions; critical for reproducibility across labs.",
"properties": {
"id": {"type": "string"},
"lab": {"type": "object"},
"who": { "$ref": "#/definitions/string_or_array_of_strings" },
"timestamp": {"type": "string", "format":"date-time"},
"temperature": {"type": "number"},
"humidity": {"type": "number"},
"arena": {
"type": "object",
"properties":{
"style": {"type": "string", "default":"petri"},
"size": {"oneOf":[ {"type": "number"}, {"type": "array", "minItems":2, "items": {"type":"string"} }] },
"orientation": {"type": "string"}
}
},
"food": {"type": "string"},
"media": {"type": "string"},
"sex": {"type": "string", "enum": ["hermaphrodite", "male"]},
"stage": {"type": "string", "enum": ["L1", "L2", "L3", "L4", "adult", "dauer"]},
"age": {"type": "number"},
"strain": {"type": "string"},
"protocol": { "$ref": "#/definitions/string_or_array_of_strings" },
"interpolate": {"oneOf":[
{ "$ref": "#/definitions/interpolate_metadata" },
{ "type": "array", "items": {"$ref": "#/definitions/interpolate_metadata"} }
]},
"software": {
"oneOf": [
{ "$ref": "#/definitions/software_metadata" },
{
"type": "array",
"items": { "$ref": "#/definitions/software_metadata" }
}
]
}
},
"additionalProperties": true
},
"data": {"oneOf":[
{ "$ref": "#/definitions/data_record" },
{ "type":"array", "items":{ "$ref": "#/definitions/data_record" } }
]}
},
"definitions": {
"nullable_number": {"oneOf":[{"type":"number"}, {"type":"null"}]},
"array_of_numbers": {"type":"array", "items":{"$ref": "#/definitions/nullable_number"}},
"array_of_numbers_or_arrays": {"oneOf":[
{"$ref": "#/definitions/array_of_numbers"},
{"type":"array", "items":{"$ref": "#/definitions/array_of_numbers"}}
]},
"array_or_number": {
"oneOf": [
{"$ref": "#/definitions/nullable_number"},
{"type":"array", "items":{"$ref": "#/definitions/nullable_number"}}
]
},
"string_or_array_of_strings": {
"oneOf": [
{"type": "string"},
{"type": "array", "items": {"type":"string"}}
]
},
"software_metadata": {
"type": "object",
"properties": {
"tracker": {
"type": "object",
"properties": {
"name": {"type": "string"},
"version": {
"description": "Supports semantic versioning (MAJOR.MINOR.PATCH) (http://semver.org/), written as a string, or any other string.",
"type": "string"
}
}
},
"featureID": {
"description": "i.e. the lab strain designation followed by an optional suffix (e.g. '@OMG')",
"type":"string"
},
"settings": {}
}
},
"interpolate_metadata": {
"type": "object",
"properties": {
"method": {"type": "string"},
"values": {"$ref": "#/definitions/string_or_array_of_strings"}
}
},
"pixel_walk_record": {
"type": "object",
"properties": {
"px": {"type": "array", "minItems": 3, "items": { "type":"number" }},
"n": { "oneOf":[ {"type": "number"}, {"type":"array", "minItems":2, "items":{"type":"number"}} ] },
"4": { "type": "string" }
}
},
"data_record": {
"type":"object",
"properties": {
"id": { "type":"string" },
"t": { "$ref": "#/definitions/array_of_numbers" },
"ox": { "$ref": "#/definitions/array_of_numbers" },
"oy": { "$ref": "#/definitions/array_of_numbers" },
"cx": { "$ref": "#/definitions/array_of_numbers" },
"cy": { "$ref": "#/definitions/array_of_numbers" },
"x": { "$ref": "#/definitions/array_of_numbers_or_arrays" },
"y": { "$ref": "#/definitions/array_of_numbers_or_arrays" },
"px": { "$ref": "#/definitions/array_of_numbers_or_arrays"},
"py": { "$ref": "#/definitions/array_of_numbers_or_arrays"},
"ptail": { "$ref": "#/definitions/array_or_number"},
"walk": {"type":"array", "items":{"$ref":"#/definitions/pixel_walk_record"}},
"head": {
"oneOf": [
{"oneOf": [{"type":"null"},{"type":"string", "enum":["L","R","?"]}]},
{"type":"array", "items":{"oneOf": [{"type":"null"},{"type":"string", "enum":["L","R","?"]}]}}
]
},
"ventral": {
"oneOf": [
{"oneOf": [{"type":"null"},{"type":"string", "enum":["CW","CCW","?"]}]},
{"type":"array", "items":{"oneOf": [{"type":"null"},{"type":"string", "enum":["CW","CCW","?"]}]}}
]
}
},
"patternProperties" : {
"^@.*": {
"title": "Custom Feature Type 2",
"description": "Data Array Time Series Custom Feature"
}
},
"additionalProperties": true,
"required": ["id", "t", "x", "y"]
}
}
}