Extractor Format
schemas/device-model.schema.json
Source file coverage
Path:
schemas/device-model.schema.json
Lines:
246
Non-empty lines:
246
Non-empty lines covered with requirements:
206 / 246 (83.7%)
Functions:
0
Functions covered by requirements:
0 / 0 (0.0%)
1
{
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
  "$id": "urn:syntol:extractor-format:schema:device-model:1",
4
  "title": "Extractor device model",
5
  "description": "Nominal construction, supported labware and maximum capabilities shared by devices of one model",
6
  "$comment": "Semantic validation must additionally check uniqueness of heater ids, motor axis codes and seat indexes; existence and type of registry UID and heater_id references; and minimum <= maximum for every range.",
7
  "type": "object",
8
  "required": [
9
    "schema",
10
    "revision",
11
    "uid",
12
    "title",
13
    "part_number",
14
    "description",
15
    "supported_sleeves",
16
    "supported_plates",
17
    "heaters",
18
    "motors",
19
    "seats",
20
    "capabilities"
21
  ],
22
  "properties": {
23
    "schema": {
24
      "type": "object",
25
      "required": [ "name", "revision" ],
26
      "properties": {
27
        "name": {
28
          "const": "syntol.extractor.device-model"
29
        },
30
        "revision": {
31
          "const": 1
32
        }
33
      },
34
      "additionalProperties": false
35
    },
36
    "revision": {
37
      "type": "integer",
38
      "minimum": 1
39
    },
40
    "uid": {
41
      "x-format": "uuid",
42
      "type": "string"
43
    },
44
    "title": {
45
      "type": "string",
46
      "maxLength": 200,
47
      "minLength": 1
48
    },
49
    "part_number": {
50
      "type": "string",
51
      "maxLength": 100,
52
      "minLength": 1
53
    },
54
    "description": {
55
      "type": "string",
56
      "maxLength": 500,
57
      "minLength": 1
58
    },
59
    "supported_sleeves": {
60
      "type": "array",
61
      "minItems": 1,
62
      "uniqueItems": true,
63
      "items": {
64
        "$ref": "#/definitions/uid"
65
      }
66
    },
67
    "supported_plates": {
68
      "type": "array",
69
      "minItems": 1,
70
      "uniqueItems": true,
71
      "items": {
72
        "$ref": "#/definitions/uid"
73
      }
74
    },
75
    "heaters": {
76
      "type": "array",
77
      "uniqueItems": true,
78
      "items": {
79
        "$ref": "#/definitions/heater"
80
      }
81
    },
82
    "motors": {
83
      "type": "array",
84
      "minItems": 1,
85
      "uniqueItems": true,
86
      "items": {
87
        "$ref": "#/definitions/motor"
88
      }
89
    },
90
    "seats": {
91
      "type": "array",
92
      "maxItems": 5,
93
      "minItems": 1,
94
      "uniqueItems": true,
95
      "items": {
96
        "$ref": "#/definitions/seat"
97
      }
98
    },
99
    "capabilities": {
100
      "type": "array",
101
      "minItems": 1,
102
      "uniqueItems": true,
103
      "items": {
104
        "$ref": "#/definitions/device_capability"
105
      }
106
    },
107
    "extensions": {
108
      "$ref": "#/definitions/extensions"
109
    }
110
  },
111
  "additionalProperties": false,
112
  "definitions": {
113
    "uid": {
114
      "x-format": "uuid",
115
      "type": "string"
116
    },
117
    "local_id": {
118
      "type": "string",
119
      "pattern": "^[a-z][a-z0-9]*(?:[._-][a-z0-9]+)*$",
120
      "maxLength": 100
121
    },
122
    "numeric_range": {
123
      "type": "object",
124
      "required": [ "minimum", "maximum" ],
125
      "properties": {
126
        "minimum": {
127
          "type": "number"
128
        },
129
        "maximum": {
130
          "type": "number"
131
        }
132
      },
133
      "additionalProperties": false
134
    },
135
    "heater": {
136
      "type": "object",
137
      "required": [ "id", "temperature" ],
138
      "properties": {
139
        "id": {
140
          "$ref": "#/definitions/local_id"
141
        },
142
        "temperature": {
143
          "$ref": "#/definitions/numeric_range"
144
        }
145
      },
146
      "additionalProperties": false
147
    },
148
    "motor": {
149
      "type": "object",
150
      "required": [ "axis", "name", "microstep", "coordinate", "speed" ],
151
      "properties": {
152
        "axis": {
153
          "type": "string",
154
          "pattern": "^[A-Za-z]$"
155
        },
156
        "name": {
157
          "type": "string",
158
          "minLength": 1
159
        },
160
        "microstep": {
161
          "type": "integer",
162
          "minimum": 1
163
        },
164
        "coordinate": {
165
          "$ref": "#/definitions/numeric_range"
166
        },
167
        "speed": {
168
          "$ref": "#/definitions/numeric_range"
169
        }
170
      },
171
      "additionalProperties": false
172
    },
173
    "seat_capability": {
174
      "const": "heating"
175
    },
176
    "seat": {
177
      "type": "object",
178
      "if": {
179
        "required": [ "capabilities" ],
180
        "properties": {
181
          "capabilities": {
182
            "contains": {
183
              "const": "heating"
184
            }
185
          }
186
        }
187
      },
188
      "then": {
189
        "required": [ "heater_id" ]
190
      },
191
      "else": {
192
        "not": {
193
          "required": [ "heater_id" ]
194
        }
195
      },
196
      "required": [ "index", "coordinate", "capabilities" ],
197
      "properties": {
198
        "index": {
199
          "type": "integer",
200
          "maximum": 5,
201
          "minimum": 1
202
        },
203
        "coordinate": {
204
          "type": "number"
205
        },
206
        "capabilities": {
207
          "type": "array",
208
          "uniqueItems": true,
209
          "items": {
210
            "$ref": "#/definitions/seat_capability"
211
          }
212
        },
213
        "heater_id": {
214
          "$ref": "#/definitions/local_id"
215
        }
216
      },
217
      "additionalProperties": false
218
    },
219
    "device_capability": {
220
      "enum": [
221
        "motion_absolute",
222
        "homing",
223
        "mixing_time",
224
        "mixing_cycles",
225
        "motion_configuration",
226
        "temperature_control",
227
        "temperature_wait",
228
        "sleeves_detection",
229
        "offsets_configurations",
230
        "plate_detection",
231
        "uv_sterilization",
232
        "status_leds",
233
        "notify_beeper",
234
        "safety_interlocks",
235
        "power_management"
236
      ]
237
    },
238
    "extensions": {
239
      "type": "object",
240
      "propertyNames": {
241
        "pattern": "^[a-z][a-z0-9]*(?:[._-][a-z0-9]+)+$"
242
      },
243
      "additionalProperties": true
244
    }
245
  }
246
}