forked from JeremyBloom/MOSDEX-Reference-Architecture
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMOSDEXSchemaV2-0.json
139 lines (125 loc) · 4.46 KB
/
MOSDEXSchemaV2-0.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
{
"$schema": "http://json-schema.org/draft-04/schema#",
"$id": "https://github.com/JeremyBloom/Optimization-Data-Exchange/blob/master/MOSDEX-2.0/MOSDEXSchemaV2-0.json",
"definitions": {
"Module": {
"title": "Module",
"description": "The syntax of a MOSDEX Module",
"type": "object",
"properties": {
"NAME": {"type": "string"},
"CLASS": {"type": "string"},
"KIND": {"type": "string"},
"STAGE": {"type": "integer", "minimum": 0},
"HEADING": {"$ref": "#/definitions/Heading"},
"SOLVER_PARAMETERS": {"$ref": "#/definitions/SolverParameters"},
"PATHS": {"type": "object", "additionalProperties": {"$ref": "#/definitions/ArrayOfStrings"}},
"FOR_EACH": {"$ref": "#/definitions/ForEach"},
"TABLES": {"type": "array", "items": {"$ref": "#/definitions/Table"}, "minItems": 1}
},
"additionalProperties": true,
"required": ["NAME","CLASS", "HEADING", "TABLES"]
},
"ArrayOfStrings": {
"title": "ArrayOfStrings",
"oneOf": [
{"type": "string"},
{"type": "array", "items": {"type": "string"}}
]
},
"Heading": {
"title": "Heading",
"type": "object",
"properties": {
"DESCRIPTION": {"$ref": "#/definitions/ArrayOfStrings"},
"VERSION": {"$ref": "#/definitions/ArrayOfStrings"},
"REFERENCE": {"$ref": "#/definitions/ArrayOfStrings"},
"AUTHOR": {"$ref": "#/definitions/ArrayOfStrings"},
"NOTICES": {"$ref": "#/definitions/ArrayOfStrings"},
"MATH": {"$ref": "#/definitions/ArrayOfStrings"}
},
"required": ["DESCRIPTION"],
"additionalProperties": {"$ref": "#/definitions/ArrayOfStrings"}
},
"SolverParameters": {
"title": "SolverParameters",
"type": "object",
"additionalProperties": {"type": "object"}
},
"ForEach": {
"title": "ForEach",
"description": "For each record with field name in table",
"type": "object",
"additionalProperties": {"type": "string"}
},
"Table": {
"title": "Table",
"description": "The syntax of a MOSDEX general table object",
"type": "object",
"properties": {
"NAME": {"type": "string"},
"CLASS": {"type": "string"},
"KIND" : {"type": "string"},
"HEADING": {"$ref": "#/definitions/Heading"},
"SCHEMA": {"$ref": "#/definitions/Schema"},
"INSTANCE": {"$ref": "#/definitions/Instance"},
"QUERY": {"$ref": "#/definitions/Query"},
"INITIALIZE": {"$ref": "#/definitions/Query"},
"APPEND": {"$ref": "#/definitions/Query"},
"REVISE": {"$ref": "#/definitions/Query"}
},
"required": ["NAME","CLASS", "KIND"],
"oneOf": [
{"required": ["INSTANCE"]},
{"required": ["QUERY"]},
{"required": ["INITIALIZE", "APPEND"]},
{"required": ["INITIALIZE", "REVISE"]}
],
"dependencies": {
"INSTANCE": ["SCHEMA"]
},
"additionalProperties": true
},
"Schema": {
"title": "Schema",
"type": "object",
"properties": {
"FIELDS": {"type": "array", "items": {"type": "string"}, "uniqueItmes": true},
"TYPES": {"type": "array", "items": {"type": "string"}}
},
"required": ["FIELDS", "TYPES"],
"additionalProperties": {"$ref": "#/definitions/ArrayOfStrings"}
},
"Instance": {
"title": "Instance",
"type": "array",
"items": {"$ref": "#/definitions/Record"}
},
"Record": {
"title": "Record",
"type": "array",
"items": {"type": ["string","number", "null"]}
},
"Query": {
"title": "Query",
"type": "object",
"additionalProperties": {"$ref": "#/definitions/Predicate"}
},
"Predicate": {
"title": "Predicate",
"oneOf": [
{"$ref": "#/definitions/ArrayOfStrings"},
{"$ref": "#/definitions/Query"}
]
}
},
"title": "MOSDEXFile",
"description": "The syntax of MOSDEX: Mathematical Optimization Solver Data EXchange, v 2-0. Copyright © 2022 Jeremy A. Bloom",
"type": "object",
"properties": {
"SYNTAX": {"type": "string", "format": "uri"},
"MODULES": {"type": "array","items": {"$ref": "#/definitions/Module" }, "minItems": 1}
},
"required": ["SYNTAX", "MODULES"],
"additionalProperties": true
}