{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Common definitions for BEAT",
  "description": "This schema defines common properties of a BEAT objects",

  "definitions": {

    "reference": {
      "type": "string",
      "pattern": "^[a-zA-Z_][a-zA-Z0-9_-]*/[a-zA-Z0-9_-]+/[0-9]+$"
    },

    "basetype": {
      "type": "string",
      "enum": [
        "int8",
        "int16",
        "int32",
        "int64",
        "uint8",
        "uint16",
        "uint32",
        "uint64",
        "float32",
        "float64",
        "complex64",
        "complex128",
        "bool",
        "string"
      ]
    },

    "value": {
      "oneOf": [
        { "type": "string" },
        { "type": "number" },
        { "type": "boolean" }
      ]
    },

    "description": {
      "type": "string",
      "maxLength": 100
    },

    "language": {

      "type": "string",
      "enum": [
        "unknown",
        "python",
        "cxx",
        "matlab",
        "r"
      ]

    },

    "uses": {
      "type": "object",
      "patternProperties": {
        "^[a-zA-Z_][a-zA-Z0-9_]*$": {
          "$ref": "#/definitions/reference"
        },
        "uniqueItems": true,
        "additionalProperties": false
      }
    },

    "version": {
      "type": "number",
      "multipleOf": 1.0,
      "minimum": 1.0
    }

  }

}
