/ lineA / clx_v0_1_schema.json
clx_v0_1_schema.json
  1  {
  2    "$schema": "https://json-schema.org/draft/2020-12/schema",
  3    "$id": "clx://construct-language/schema/clx-0.1",
  4    "title": "Construct Language Exchange (CLX) v0.1",
  5    "type": "object",
  6    "required": [
  7      "clx",
  8      "inventory",
  9      "construct"
 10    ],
 11    "properties": {
 12      "clx": {
 13        "type": "string",
 14        "const": "0.1"
 15      },
 16      "inventory": {
 17        "type": "object",
 18        "required": [
 19          "prime",
 20          "glyphs"
 21        ],
 22        "properties": {
 23          "prime": {
 24            "type": "integer",
 25            "const": 101
 26          },
 27          "glyphs": {
 28            "type": "array",
 29            "minItems": 101,
 30            "maxItems": 101,
 31            "items": {
 32              "type": "string",
 33              "pattern": "^G(0[1-9]|[1-9][0-9]|101)$"
 34            }
 35          },
 36          "seed_prime": {
 37            "type": "integer",
 38            "const": 29
 39          }
 40        },
 41        "additionalProperties": false
 42      },
 43      "construct": {
 44        "type": "object",
 45        "required": [
 46          "canvas",
 47          "instances",
 48          "closure",
 49          "integrity"
 50        ],
 51        "properties": {
 52          "canvas": {
 53            "type": "object",
 54            "required": [
 55              "w",
 56              "h",
 57              "grid"
 58            ],
 59            "properties": {
 60              "w": {
 61                "type": "integer",
 62                "minimum": 1,
 63                "maximum": 1024
 64              },
 65              "h": {
 66                "type": "integer",
 67                "minimum": 1,
 68                "maximum": 1024
 69              },
 70              "grid": {
 71                "type": "string",
 72                "enum": [
 73                  "int"
 74                ]
 75              }
 76            },
 77            "additionalProperties": false
 78          },
 79          "instances": {
 80            "type": "array",
 81            "minItems": 1,
 82            "items": {
 83              "type": "object",
 84              "required": [
 85                "id",
 86                "g",
 87                "x",
 88                "y",
 89                "rot",
 90                "ref",
 91                "s"
 92              ],
 93              "properties": {
 94                "id": {
 95                  "type": "string",
 96                  "pattern": "^i[0-9A-Za-z]{1,16}$"
 97                },
 98                "g": {
 99                  "type": "string",
100                  "pattern": "^G(0[1-9]|[1-9][0-9]|101)$"
101                },
102                "x": {
103                  "type": "integer",
104                  "minimum": 0,
105                  "maximum": 1023
106                },
107                "y": {
108                  "type": "integer",
109                  "minimum": 0,
110                  "maximum": 1023
111                },
112                "rot": {
113                  "type": "integer",
114                  "enum": [
115                    0,
116                    45,
117                    90,
118                    135,
119                    180,
120                    225,
121                    270,
122                    315
123                  ]
124                },
125                "ref": {
126                  "type": "string",
127                  "enum": [
128                    "none",
129                    "mirrorX"
130                  ]
131                },
132                "s": {
133                  "type": "number",
134                  "enum": [
135                    0.75,
136                    1.0,
137                    1.5
138                  ]
139                },
140                "z": {
141                  "type": "integer",
142                  "minimum": -128,
143                  "maximum": 127
144                },
145                "scope": {
146                  "type": "string",
147                  "pattern": "^i[0-9A-Za-z]{1,16}$"
148                },
149                "links": {
150                  "type": "array",
151                  "items": {
152                    "type": "object",
153                    "required": [
154                      "to",
155                      "t"
156                    ],
157                    "properties": {
158                      "to": {
159                        "type": "string",
160                        "pattern": "^i[0-9A-Za-z]{1,16}$"
161                      },
162                      "t": {
163                        "type": "string",
164                        "enum": [
165                          "edge",
166                          "morphism",
167                          "equivalence",
168                          "inclusion",
169                          "projection",
170                          "embedding",
171                          "dependency",
172                          "feedback",
173                          "alignment",
174                          "resonance",
175                          "separation",
176                          "coupling",
177                          "ordering",
178                          "bidirectional_flow",
179                          "constraint_link",
180                          "correlation"
181                        ]
182                      },
183                      "geom": {
184                        "type": "object",
185                        "properties": {
186                          "kind": {
187                            "type": "string",
188                            "enum": [
189                              "straight",
190                              "curved"
191                            ]
192                          },
193                          "via": {
194                            "type": "array",
195                            "items": {
196                              "type": "array",
197                              "minItems": 2,
198                              "maxItems": 2,
199                              "items": {
200                                "type": "integer"
201                              }
202                            },
203                            "maxItems": 4
204                          }
205                        },
206                        "additionalProperties": false
207                      }
208                    },
209                    "additionalProperties": false
210                  }
211                }
212              },
213              "additionalProperties": false
214            }
215          },
216          "closure": {
217            "type": "object",
218            "required": [
219              "instance_id",
220              "glyph"
221            ],
222            "properties": {
223              "instance_id": {
224                "type": "string",
225                "pattern": "^i[0-9A-Za-z]{1,16}$"
226              },
227              "glyph": {
228                "type": "string",
229                "const": "G29"
230              }
231            },
232            "additionalProperties": false
233          },
234          "integrity": {
235            "type": "object",
236            "required": [
237              "algo",
238              "crc16",
239              "capsule"
240            ],
241            "properties": {
242              "algo": {
243                "type": "string",
244                "const": "CRC-16/CCITT-FALSE"
245              },
246              "crc16": {
247                "type": "string",
248                "pattern": "^[0-9A-F]{4}$"
249              },
250              "capsule": {
251                "type": "object",
252                "required": [
253                  "glyph",
254                  "digits_base29",
255                  "markers"
256                ],
257                "properties": {
258                  "glyph": {
259                    "type": "string",
260                    "const": "G26"
261                  },
262                  "digits_base29": {
263                    "type": "array",
264                    "minItems": 4,
265                    "maxItems": 4,
266                    "items": {
267                      "type": "integer",
268                      "minimum": 0,
269                      "maximum": 28
270                    }
271                  },
272                  "markers": {
273                    "type": "array",
274                    "minItems": 4,
275                    "maxItems": 4,
276                    "items": {
277                      "type": "string",
278                      "pattern": "^G(0[1-9]|[1-9][0-9]|101)$"
279                    }
280                  },
281                  "duplicate_mirrored": {
282                    "type": "boolean",
283                    "const": true
284                  }
285                },
286                "additionalProperties": false
287              }
288            },
289            "additionalProperties": false
290          },
291          "meta": {
292            "type": "object",
293            "properties": {
294              "title": {
295                "type": "string"
296              },
297              "created_utc": {
298                "type": "string"
299              },
300              "notes": {
301                "type": "string"
302              }
303            },
304            "additionalProperties": false
305          }
306        },
307        "additionalProperties": false
308      }
309    },
310    "additionalProperties": false
311  }