Commit 14b46b15 authored by Samuel GAIST's avatar Samuel GAIST
Browse files

[schema][toolchain] Refactored for v2 version

This moves out common definitions in a separate file. This
patch also updates the experiment and execution schema to
reflect that.
parent 63f82bfd
......@@ -31,7 +31,7 @@
"path": { "$ref": "#/definitions/cache_path" },
"hash": { "$ref": "#/definitions/hash" },
"channel": { "$ref": "../database/1.json#/definitions/identifier" },
"endpoint": { "$ref": "../toolchain/1.json#/definitions/identifier" }
"endpoint": { "$ref": "../toolchain/common.json#/definitions/identifier" }
},
"required": [
"path",
......@@ -50,11 +50,11 @@
},
"protocol": { "$ref": "../database/1.json#/definitions/protocol_name" },
"set": { "$ref": "../database/1.json#/definitions/identifier" },
"output": { "$ref": "../toolchain/1.json#/definitions/identifier" },
"output": { "$ref": "../toolchain/common.json#/definitions/identifier" },
"channel": { "$ref": "../database/1.json#/definitions/identifier" },
"path": { "$ref": "#/definitions/db_cache_path" },
"hash": { "$ref": "#/definitions/hash" },
"endpoint": { "$ref": "../toolchain/1.json#/definitions/identifier" }
"endpoint": { "$ref": "../toolchain/common.json#/definitions/identifier" }
},
"required": [
"database",
......@@ -82,7 +82,7 @@
"path": { "$ref": "#/definitions/cache_path" },
"hash": { "$ref": "#/definitions/hash" },
"channel": { "$ref": "../database/1.json#/definitions/identifier" },
"endpoint": { "$ref": "../toolchain/1.json#/definitions/identifier" }
"endpoint": { "$ref": "../toolchain/common.json#/definitions/identifier" }
},
"required": [
"path",
......
......@@ -115,7 +115,7 @@
"type": "object",
"patternProperties": {
"^[a-zA-Z_][a-zA-Z0-9_]*$": {
"$ref": "../toolchain/1.json#/definitions/identifier"
"$ref": "../toolchain/common.json#/definitions/identifier"
}
},
"minProperties": 1,
......
......@@ -9,28 +9,26 @@
"description": { "$ref": "../common/1.json#/definitions/description" },
"datasets": {
"type": "array",
"uniqueItems": true,
"items": { "$ref": "#/definitions/dataset" }
"datasets" : {
"$ref": "common.json#/definitions/datasets"
},
"blocks": {
"type": "array",
"uniqueItems": true,
"items": { "$ref": "#/definitions/block" }
"$ref": "common.json#/definitions/blocks"
},
"analyzers": {
"loops": {
"type": "array",
"uniqueItems": true,
"items": { "$ref": "#/definitions/analyzer" }
"items": { "$ref": "#/definitions/loop" }
},
"connections": {
"type": "array",
"uniqueItems": true,
"items": { "$ref": "#/definitions/connection" }
"analyzers" : {
"$ref": "common.json#/definitions/analyzers"
},
"connections" : {
"$ref": "common.json#/definitions/connections"
},
"representation": {
......@@ -40,13 +38,13 @@
"properties": {
"connections": {
"$ref": "#/definitions/representation/connections"
"$ref": "common.json#/definitions/representation/connection_list"
},
"blocks": {
"$ref": "#/definitions/representation/blocks"
"$ref": "common.json#/definitions/representation/block_list"
},
"channel_colors": {
"$ref": "#/definitions/representation/channel_colors"
"$ref": "common.json#/definitions/representation/channel_colors"
}
},
......@@ -73,142 +71,5 @@
"representation"
],
"additionalProperties": false,
"definitions": {
"identifier": {
"type": "string",
"pattern": "^[a-zA-Z_][a-zA-Z0-9_-]*$"
},
"dataset": {
"type": "object",
"properties": {
"name": { "$ref": "../database/1.json#/definitions/identifier" },
"outputs": {
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": { "$ref": "../database/1.json#/definitions/identifier" }
}
},
"required": ["name", "outputs"],
"additionalProperties": false
},
"block": {
"type": "object",
"properties": {
"name": { "$ref": "#/definitions/identifier" },
"synchronized_channel": {
"$ref": "../database/1.json#/definitions/identifier"
},
"inputs": {
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": { "$ref": "#/definitions/identifier" }
},
"outputs": {
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": { "$ref": "#/definitions/identifier" }
}
},
"required": ["name", "synchronized_channel", "inputs", "outputs"],
"additionalProperties": false
},
"analyzer": {
"type": "object",
"properties": {
"name": { "$ref": "#/definitions/identifier" },
"synchronized_channel": {
"$ref": "../database/1.json#/definitions/identifier"
},
"inputs": {
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": { "$ref": "#/definitions/identifier" }
}
},
"required": ["name", "synchronized_channel", "inputs"],
"additionalProperties": false
},
"endpoint": {
"type": "string",
"pattern": "^[a-zA-Z_][a-zA-Z0-9_-]*.[a-zA-Z_][a-zA-Z0-9_-]*$"
},
"connection": {
"type": "object",
"properties": {
"from": { "$ref": "#/definitions/endpoint" },
"to": { "$ref": "#/definitions/endpoint" },
"channel": { "$ref": "#/definitions/identifier" }
},
"required": ["from", "to", "channel"],
"additionalProperties": false,
"definitions": {
}
},
"representation": {
"connections": {
"type": "object",
"patternProperties": {
"^[a-zA-Z_][a-zA-Z0-9_-]*.[a-zA-Z_][a-zA-Z0-9_-]*/[a-zA-Z_][a-zA-Z0-9_-]*.[a-zA-Z_][a-zA-Z0-9_-]*$": {
"type": "array",
"items": {
"type": "object",
"properties": {
"col": { "type": "integer" },
"row": { "type": "integer" }
},
"required": [ "col", "row" ],
"additionalProperties": false
}
}
},
"additionalProperties": false
},
"blocks": {
"type": "object",
"patternProperties": {
"^[a-zA-Z_][a-zA-Z0-9_-]*$": {
"type": "object",
"properties": {
"col": { "type": "integer" },
"row": { "type": "integer" },
"width": { "type": "integer" },
"height": { "type": "integer" }
},
"required": [ "col", "row", "width", "height" ],
"additionalProperties": false
}
},
"additionalProperties": false
},
"channel_colors": {
"type": "object",
"patternProperties": {
"^[a-zA-Z_][a-zA-Z0-9_-]*$": {
"type": "string",
"pattern": "^#[0-9a-fA-F]{6}$"
}
},
"additionalProperties": false
}
}
}
"additionalProperties": false
}
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Toolchain v2 descriptor",
"description": "This schema defines the properties of a toolchain",
"type": "object",
"properties": {
"description": { "$ref": "../common/1.json#/definitions/description" },
"datasets" : {
"$ref": "common.json#/definitions/datasets"
},
"blocks": {
"$ref": "common.json#/definitions/blocks"
},
"loops": {
"type": "array",
"uniqueItems": true,
"items": { "$ref": "#/definitions/loop" }
},
"analyzers" : {
"$ref": "common.json#/definitions/analyzers"
},
"connections" : {
"$ref": "common.json#/definitions/connections"
},
"loop_connections": {
"type": "array",
"uniqueItems": true,
"items": { "$ref": "#/definitions/loop_connection" }
},
"representation": {
"type": "object",
"properties": {
"connections": {
"$ref": "common.json#/definitions/representation/connection_list"
},
"loop_connections": {
"$ref": "common.json#/definitions/representation/connection_list"
},
"blocks": {
"$ref": "common.json#/definitions/representation/block_list"
},
"channel_colors": {
"$ref": "common.json#/definitions/representation/channel_colors"
}
},
"required": [
"connections",
"blocks",
"channel_colors"
],
"additionalProperties": false
},
"schema_version": { "$ref": "../common/1.json#/definitions/version" }
},
"required": [
"datasets",
"blocks",
"analyzers",
"connections",
"representation"
],
"additionalProperties": false,
"definitions": {
"loop": {
"type": "object",
"properties": {
"name": { "$ref": "common.json#/definitions/identifier" },
"synchronized_channel": {
"$ref": "../database/1.json#/definitions/identifier"
},
"inputs": {
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": { "$ref": "common.json#/definitions/identifier" }
}
},
"required": ["name", "synchronized_channel", "inputs"],
"additionalProperties": false
},
"loop_connection": {
"type": "object",
"properties": {
"from": { "$ref": "common.json#/definitions/endpoint" },
"to": { "$ref": "common.json#/definitions/endpoint" }
},
"required": ["from", "to"],
"additionalProperties": false,
"definitions": {
}
}
}
}
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Toolchain common components descriptor",
"description": "This schema defines the components used in one or more versions of a Toolchain",
"definitions": {
"identifier": {
"type": "string",
"pattern": "^[a-zA-Z_][a-zA-Z0-9_-]*$"
},
"endpoint": {
"type": "string",
"pattern": "^[a-zA-Z_][a-zA-Z0-9_-]*.[a-zA-Z_][a-zA-Z0-9_-]*$"
},
"io_array": {
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": {
"$ref": "#/definitions/identifier"
}
},
"dataset": {
"type": "object",
"properties": {
"name": {
"$ref": "../database/1.json#/definitions/identifier"
},
"outputs": {
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": {
"$ref": "../database/1.json#/definitions/identifier"
}
}
},
"required": [
"name",
"outputs"
],
"additionalProperties": false
},
"datasets": {
"type": "array",
"uniqueItems": true,
"items": {
"$ref": "#/definitions/dataset"
}
},
"block": {
"type": "object",
"properties": {
"name": {
"$ref": "#/definitions/identifier"
},
"synchronized_channel": {
"$ref": "../database/1.json#/definitions/identifier"
},
"inputs": {
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": {
"$ref": "#/definitions/identifier"
}
},
"outputs": {
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": {
"$ref": "#/definitions/identifier"
}
}
},
"required": [
"name",
"synchronized_channel",
"inputs",
"outputs"
],
"additionalProperties": false
},
"blocks": {
"type": "array",
"uniqueItems": true,
"items": {
"$ref": "#/definitions/block"
}
},
"analyzer": {
"type": "object",
"properties": {
"name": {
"$ref": "#/definitions/identifier"
},
"synchronized_channel": {
"$ref": "../database/1.json#/definitions/identifier"
},
"inputs": {
"$ref": "#/definitions/io_array"
}
},
"required": [
"name",
"synchronized_channel",
"inputs"
],
"additionalProperties": false
},
"analyzers": {
"type": "array",
"uniqueItems": true,
"items": {
"$ref": "#/definitions/analyzer"
}
},
"connection": {
"type": "object",
"properties": {
"from": {
"$ref": "#/definitions/endpoint"
},
"to": {
"$ref": "#/definitions/endpoint"
},
"channel": {
"$ref": "#/definitions/identifier"
}
},
"required": [
"from",
"to",
"channel"
],
"additionalProperties": false
},
"connections": {
"type": "array",
"uniqueItems": true,
"items": {
"$ref": "#/definitions/connection"
}
},
"representation": {
"connection_list": {
"type": "object",
"patternProperties": {
"^[a-zA-Z_][a-zA-Z0-9_-]*.[a-zA-Z_][a-zA-Z0-9_-]*/[a-zA-Z_][a-zA-Z0-9_-]*.[a-zA-Z_][a-zA-Z0-9_-]*$": {
"type": "array",
"items": {
"type": "object",
"properties": {
"col": {
"type": "integer"
},
"row": {
"type": "integer"
}
},
"required": [
"col",
"row"
],
"additionalProperties": false
}
}
},
"additionalProperties": false
},
"block_list": {
"type": "object",
"patternProperties": {
"^[a-zA-Z_][a-zA-Z0-9_-]*$": {
"type": "object",
"properties": {
"col": {
"type": "integer"
},
"row": {
"type": "integer"
},
"width": {
"type": "integer"
},
"height": {
"type": "integer"
}
},
"required": [
"col",
"row",
"width",
"height"
],
"additionalProperties": false
}
},
"additionalProperties": false
},
"channel_colors": {
"type": "object",
"patternProperties": {
"^[a-zA-Z_][a-zA-Z0-9_-]*$": {
"type": "string",
"pattern": "^#[0-9a-fA-F]{6}$"
}
},
"additionalProperties": false
}
}
}
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment