forked from Glysade/DataFxns
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathglysade.datafxndef.schema.json
643 lines (643 loc) · 17.9 KB
/
glysade.datafxndef.schema.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://glysade.com/datafxndef.schema.json",
"title": "Glysade Data Function Definition",
"description": "Schema for the Glysade data function YAML file",
"type": "object",
"definitions": {
"request":{
"type": "object",
"properties": {
"id": {
"type": "string"
},
"dataType": {
"type": "string",
"enum": [
"boolean",
"string",
"binary",
"integer",
"float",
"list(string)",
"list(integer)",
"list(float)"
]
},
"contentType": {
"type": "string"
},
"data": {
"type": [ "boolean", "integer", "double", "string", "array" ]
},
"selectorType": {
"type": "string",
"enum": [ "column", "table" ]
},
"field": {
"type": "string",
"enum": [ "structure", "atomSelection", "bondSelection" ]
}
},
"required": [
"id", "dataType"
]
},
"validationRule": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"numeric",
"oneOrMoreRequired",
"oneRequired",
"range",
"required",
"structure"
]
},
"message": {
"type": "string",
"description": "Optional message to display if validation fails, overrides the default message"
},
"min": {
"type": "number",
"description": "Optional minimum value if validation rule type is 'range'"
},
"max": {
"type": "number",
"description": "Optional minimum value if validation rule type is 'range'"
}
},
"required": [
"type"
]
},
"sequenceTextAreaFileType": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Displayed text for sequence text area file type",
"enum": ["Genbank", "FASTA", "Sequence string"]
},
"contentType": {
"type": "string",
"description": "Content type for sequence text area file type",
"enum": ["chemical/x-genbank", "chemical/x-fasta", "chemical/x-sequence"]
}
},
"required": ["name", "contentType"]
},
"control": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"type": {
"type": "string",
"enum": [
"checkbox",
"columnselect",
"file",
"hidden",
"molecule",
"radiogroup",
"select",
"sequencetextarea",
"sketcher",
"text",
"textarea"
]
},
"tooltip": {
"type": "string"
},
"validationRules": {
"type": "array",
"items": { "$ref": "#/definitions/validationRule" }
}
},
"required": [
"id",
"type"
]
},
"labelControl": {
"allOf": [
{
"$ref": "#/definitions/control"
},
{
"type": "object",
"properties": {
"label": {
"type": "string",
"description": "Label that describes the field in the UI"
}
},
"required": ["label"]
}
]
},
"checkBoxControl": {
"allOf": [
{
"$ref": "#/definitions/labelControl"
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [ "checkbox" ]
}
}
}
]
},
"columnSelectFilter": {
"type": "object",
"properties": {
"dataType": {
"oneOf": [
{
"type": "array",
"items": {
"type": "string",
"enum": ["binary", "bool", "double", "decimal", "float", "int", "long", "string"]
}
},
{
"type": "string",
"enum": ["binary", "bool", "double", "decimal", "float", "int", "long", "string"]
}
]
},
"contentType": {
"oneOf": [
{ "type": "array", "items": "string" },
{ "type": "string" }
]
}
},
"required": ["dataType"]
},
"columnSelectControl": {
"allOf": [
{
"$ref": "#/definitions/labelControl"
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [ "columnselect" ]
},
"filters": {
"type": "array",
"items": { "$ref": "#/definitions/columnSelectFilter" },
"description": "Optional set of filters that can reduce the columns displayed in the select box by data type and/or content type"
},
"multi": {
"type": "boolean",
"description": "Optional boolean when true allows users to select multiple columns"
}
}
}
]
},
"fileType": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Description of the file type"
},
"contentType": {
"type": "string",
"description": "Optional content type for the file type"
},
"extension": {
"type": "string",
"description": "Extension for the file type must of the format *.smi, *.txt etc."
}
},
"required": ["name", "extension"]
},
"fileControl": {
"allOf": [
{
"$ref": "#/definitions/labelControl"
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [ "file" ]
},
"fileTypes": {
"type": "array",
"items": { "$ref": "#/definitions/fileType" },
"description": "Optional array of allowed file types"
},
"mode": {
"type": "string",
"enum": ["contents", "path"],
"description": "Optional mode. Setting mode to 'contents' means the contents of the file are provided to the data function, 'path' means the path to the file or folder is provided to the data function. If not defined the default is 'contents'."
},
"pathType": {
"type": "string",
"enum": ["file", "folder"],
"description": "Optional pathType. Setting pathType top 'file' means a path to a file must be chosen. 'folder' means the path to a directory or folder must be chosen. If not defined the default is 'file'"
}
}
}
]
},
"hiddenControl": {
"allOf": [
{
"$ref": "#/definitions/control"
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [ "hidden" ]
}
}
}
]
},
"moleculeControl": {
"allOf": [
{
"$ref": "#/definitions/labelControl"
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [ "molecule" ]
},
"molTypes": {
"type": "array",
"items": { "$ref": "#/definitions/fileType" },
"description": "Optional array of allowed molecule types"
},
"tabs": {
"type": "array",
"items": {
"type": "string",
"enum": ["sketcher", "paste", "file"]
}
},
"sketcherContentType": {
"type": "string",
"description": "Optional content type for molecule retrieved from the sketcher tab of the molecule control. If not defined, default is 'chemical/x-mdl-molfile'."
}
},
"required": ["molTypes"]
}
]
},
"selectItem": {
"type": "object",
"properties": {
"text": {
"type": "string",
"description": "Text displayed to the user in the select/radio UI control"
},
"value": {
"type": ["string", "integer", "double" ],
"description": "Value for the selected item in the select/radio UI control"
}
},
"required": ["text", "value"]
},
"radioGroupControl": {
"allOf": [
{
"$ref": "#/definitions/labelControl"
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [ "radiogroup" ]
},
"radios": {
"type": "array",
"items": { "$ref": "#/definitions/selectItem" }
}
},
"required": ["radios"]
}
]
},
"selectControl": {
"allOf": [
{
"$ref": "#/definitions/labelControl"
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [ "select" ]
},
"multi": {
"type": "boolean"
},
"options": {
"type": "array",
"items": { "$ref": "#/definitions/selectItem" }
}
},
"required": ["options"]
}
]
},
"sequenceTextAreaControl": {
"allOf": [
{
"$ref": "#/definitions/labelControl"
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [ "sequencetextarea" ]
},
"height": {
"type": "integer"
},
"fileTypes": {
"type": "array",
"items": { "$ref": "#/definitions/sequenceTextAreaFileType" },
"description": "Allowed sequence file formats. The contentType in the request should be set to one of the contentTypes defined in this list.",
"minItems": 1
}
},
"required": ["fileTypes"]
}
]
},
"sketcherControl": {
"allOf": [
{
"$ref": "#/definitions/labelControl"
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [ "sketcher"]
}
}
}
]
},
"textControl": {
"allOf": [
{
"$ref": "#/definitions/labelControl"
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [ "text" ]
}
}
}
]
},
"textAreaControl": {
"allOf": [
{
"$ref": "#/definitions/labelControl"
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [ "textarea" ]
},
"height": {
"type": "integer"
}
}
}
]
},
"inputField": {
"type": "object",
"properties": {
"control": {
"anyOf": [
{ "$ref": "#/definitions/checkBoxControl" },
{ "$ref": "#/definitions/columnSelectControl" },
{ "$ref": "#/definitions/fileControl" },
{ "$ref": "#/definitions/hiddenControl" },
{ "$ref": "#/definitions/moleculeControl" },
{ "$ref": "#/definitions/radioGroupControl" },
{ "$ref": "#/definitions/selectControl" },
{ "$ref": "#/definitions/sequenceTextAreaControl" },
{ "$ref": "#/definitions/sketcherControl" },
{ "$ref": "#/definitions/textControl" },
{ "$ref": "#/definitions/textAreaControl" }
]
},
"request": {
"oneOf": [
{
"type": "array",
"items": {
"$ref": "#/definitions/request"
}
},
{
"$ref": "#/definitions/request"
}
]
}
},
"required": [ "control", "request" ]
},
"outputField": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Optional output field name. If not defined the output field name will be taken from the source of the output field."
},
"id": {
"type": "string",
"description": "Column, table or input field request ID"
},
"source": {
"type": "string",
"enum": ["column", "table", "inputField"]
},
"type": {
"type": "string",
"enum": ["default", "molecule", "sequence", "filter"]
}
},
"required": [ "id", "source", "type" ]
},
"tag": {
"type": "object",
"properties": {
"text": {
"type": "string",
"description": "Text displayed in the tag"
},
"color": {
"type": "string",
"description": "Optional color for the tag"
}
},
"required": ["text"]
}
},
"properties": {
"id": {
"description": "The unique identifier for a data function definition (should be an UUID)",
"type": "string"
},
"name": {
"description": "Human readable name for the data function",
"type": "string"
},
"description": {
"description": "Human readable description for the data function",
"type": "string"
},
"category": {
"description": "Dot separated list of strings used to create tree-like structure of data function definitions e.g chemistry.2D.structure",
"type": "string"
},
"serviceName": {
"description": "Unique service name for the data function, no spaces are allowed",
"type": "string"
},
"executorId": {
"description": "Type of executor used to execute the data function",
"type": "string",
"enum": [
"Glysade.CPythonDataFxn",
"Glysade.CSharpDataFxn",
"Glysade.PipelinePilotDataFxn",
"Glysade.KnimeDataFxn"
]
},
"serviceUri": {
"description": "Service URI description",
"type": "string"
},
"version": {
"description": "Version number for the data function definition in the format major.minor.revision e.g. 1.2.0",
"type": "string"
},
"script": {
"description": "Optional Python script executed by data functions that have the executorId = Glysade.CPythonDataFxn",
"type": "string"
},
"ironPython": {
"description": "Optional IronPython script executed by the data function after execution used to configure Spotfire visuals",
"type": "string"
},
"allowedClients": {
"description": "Optional array defining whether the data function can execute on the 'Analyst' or 'WebPlayer' Spotfire environments. If not defined the default is both.",
"type": "array",
"items": {
"type": "string",
"enum": ["Analyst", "WebPlayer"]
},
"minItems": 1,
"maxItems": 2
},
"limitBy": {
"description": "Optional value defining the limit by behavior of the data function. If not defined the default is 'none'.",
"type": "string",
"enum": [
"none",
"filteredRows",
"markedRows",
"both"
]
},
"maximumOutputColumns": {
"description": "Optional value defining the maximum number of columns generated by the data function. If not defined the default is 10.",
"type": "integer",
"default" : 10
},
"maximumOutputTables": {
"description": "Optional value defining the maximum number of data tables generated by the data function. If not defined the default is 1.",
"type": "number",
"default" : 1
},
"updateBehavior": {
"description": "Optional value defining whether the data function updates automatically when data table data changes or manually. If not defined, the default is 'automatic'.",
"type": "string",
"enum": [ "automatic", "manual" ]
},
"chemistryFunction": {
"description": "Optional boolean representing whether this data function definition replaces a legacy chemistry data function. If not defined the default is false.",
"type": "boolean"
},
"tkid": {
"description": "Optional string representing whether the ID of the chemistry toolkit used in the replacement of a legacy chemistry data function.",
"type": "string"
},
"assembly": {
"description": "Optional value representing the assembly where Glysade.CSharpDataFxn are run",
"type": "string"
},
"inputFields": {
"type": "array",
"items": { "$ref": "#/definitions/inputField" },
"description": "Input fields defining expected data function input and UI"
},
"outputFields": {
"type": "array",
"items": { "$ref": "#/definitions/outputField" },
"description": "Optional output field defining expected data function result UI"
},
"tags": {
"type": "array",
"items": { "$ref": "#/definitions/tag" },
"description": "Colored tags that can be used to further categorize data function definitions"
},
"demoUrl": {
"description": "Optional URL for a demo video for the data function",
"type": "string"
}
},
"required": [
"id",
"name",
"description",
"category",
"serviceName",
"executorId",
"serviceUri",
"version",
"inputFields"
]
}