@graph-ir/core 0.2.0 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/README.md +14 -2
  2. package/dist/canonical-types-2.d.ts +207 -0
  3. package/dist/canonical-types-2.d.ts.map +1 -0
  4. package/dist/canonical-types-2.js +3 -0
  5. package/dist/canonical-types-2.js.map +1 -0
  6. package/dist/canonical-types.d.ts +332 -0
  7. package/dist/canonical-types.d.ts.map +1 -0
  8. package/dist/canonical-types.js +3 -0
  9. package/dist/canonical-types.js.map +1 -0
  10. package/dist/generation/id-generator.d.ts.map +1 -1
  11. package/dist/generation/id-generator.js +16 -10
  12. package/dist/generation/id-generator.js.map +1 -1
  13. package/dist/index.d.ts +2 -1
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.js +1 -0
  16. package/dist/index.js.map +1 -1
  17. package/dist/output/types.d.ts.map +1 -1
  18. package/dist/schemas/graph-ir-2.0.schema.json +416 -0
  19. package/dist/schemas/graph-ir.schema.json +1684 -228
  20. package/dist/skills/diff.d.ts +4 -0
  21. package/dist/skills/diff.d.ts.map +1 -1
  22. package/dist/skills/diff.js +93 -11
  23. package/dist/skills/diff.js.map +1 -1
  24. package/dist/skills/migrate.d.ts +48 -19
  25. package/dist/skills/migrate.d.ts.map +1 -1
  26. package/dist/skills/migrate.js +482 -239
  27. package/dist/skills/migrate.js.map +1 -1
  28. package/dist/skills/visualize.d.ts.map +1 -1
  29. package/dist/skills/visualize.js +33 -5
  30. package/dist/skills/visualize.js.map +1 -1
  31. package/dist/testing/diff.d.ts +1 -1
  32. package/dist/testing/diff.d.ts.map +1 -1
  33. package/dist/testing/diff.js +52 -19
  34. package/dist/testing/diff.js.map +1 -1
  35. package/dist/types.d.ts +13 -214
  36. package/dist/types.d.ts.map +1 -1
  37. package/dist/types.js +3 -2
  38. package/dist/types.js.map +1 -1
  39. package/dist/validation/ir-validator.d.ts +35 -44
  40. package/dist/validation/ir-validator.d.ts.map +1 -1
  41. package/dist/validation/ir-validator.js +735 -288
  42. package/dist/validation/ir-validator.js.map +1 -1
  43. package/dist/validation/validator.d.ts.map +1 -1
  44. package/package.json +9 -4
  45. package/specification.json +13 -0
@@ -1,121 +1,215 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://graph-ir.dev/schemas/graph-ir.schema.json",
4
- "title": "Graph-IR",
5
- "description": "Graph Intermediate Representation schema",
3
+ "$id": "https://graph-ir.dev/schemas/3.0/graph-ir.schema.json",
4
+ "title": "GraphIR authored graph",
5
+ "description": "Canonical authored GraphIR schema 3.0.0",
6
6
  "type": "object",
7
- "required": ["version", "id", "nodes", "edges"],
7
+ "additionalProperties": false,
8
+ "required": [
9
+ "version",
10
+ "id",
11
+ "nodes",
12
+ "edges"
13
+ ],
8
14
  "properties": {
9
15
  "version": {
10
- "type": "string",
11
- "description": "Schema version for migration support",
12
- "pattern": "^\\d+\\.\\d+\\.\\d+$"
16
+ "const": "3.0.0"
13
17
  },
14
18
  "id": {
15
- "type": "string",
16
- "description": "Unique identifier for this graph",
17
- "minLength": 1
19
+ "$ref": "#/$defs/Identifier"
18
20
  },
19
21
  "name": {
20
- "type": "string",
21
- "description": "Human-readable name"
22
+ "type": "string"
22
23
  },
23
24
  "nodes": {
24
25
  "type": "array",
25
- "description": "Top-level nodes",
26
- "items": { "$ref": "#/$defs/GraphNode" }
26
+ "items": {
27
+ "$ref": "#/$defs/GraphNode"
28
+ }
27
29
  },
28
30
  "edges": {
29
31
  "type": "array",
30
- "description": "Connections between nodes",
31
- "items": { "$ref": "#/$defs/GraphEdge" }
32
+ "items": {
33
+ "$ref": "#/$defs/GraphEdge"
34
+ }
35
+ },
36
+ "constraints": {
37
+ "type": "array",
38
+ "items": {
39
+ "$ref": "#/$defs/SpatialConstraint"
40
+ }
41
+ },
42
+ "metadata": {
43
+ "$ref": "#/$defs/GraphMetadata"
44
+ },
45
+ "layoutOptions": {
46
+ "$ref": "#/$defs/LayoutOptions"
47
+ },
48
+ "profile": {
49
+ "$ref": "#/$defs/NotationProfile"
32
50
  },
33
- "metadata": { "$ref": "#/$defs/GraphMetadata" },
34
- "layoutOptions": { "$ref": "#/$defs/LayoutOptions" }
51
+ "interaction": {
52
+ "$ref": "#/$defs/Interaction"
53
+ }
35
54
  },
36
55
  "$defs": {
37
- "GraphNode": {
56
+ "Identifier": {
57
+ "type": "string",
58
+ "minLength": 1
59
+ },
60
+ "Position": {
38
61
  "type": "object",
39
- "required": ["id", "type"],
62
+ "additionalProperties": false,
63
+ "required": [
64
+ "x",
65
+ "y"
66
+ ],
40
67
  "properties": {
41
- "id": {
42
- "type": "string",
43
- "description": "Unique identifier within the graph",
44
- "minLength": 1
45
- },
46
- "type": {
47
- "type": "string",
48
- "description": "Node type (e.g., 'service', 'database')",
49
- "minLength": 1
50
- },
51
- "label": {
52
- "type": "string",
53
- "description": "Display label"
54
- },
55
- "description": {
56
- "type": "string",
57
- "description": "Optional description"
58
- },
59
- "symbol": {
60
- "type": "string",
61
- "description": "Symbol registry key used for visual representation"
68
+ "x": {
69
+ "type": "number"
62
70
  },
63
- "variant": {
64
- "type": "string",
65
- "description": "Optional variant of the selected symbol"
66
- },
67
- "properties": {
68
- "type": "object",
69
- "description": "Custom properties",
70
- "additionalProperties": true
71
- },
72
- "children": {
73
- "type": "array",
74
- "description": "Child nodes for compound graphs",
75
- "items": { "$ref": "#/$defs/GraphNode" }
71
+ "y": {
72
+ "type": "number"
73
+ }
74
+ }
75
+ },
76
+ "Dimensions": {
77
+ "type": "object",
78
+ "additionalProperties": false,
79
+ "required": [
80
+ "width",
81
+ "height"
82
+ ],
83
+ "properties": {
84
+ "width": {
85
+ "type": "number",
86
+ "minimum": 0
76
87
  },
77
- "parent": {
78
- "type": "string",
79
- "description": "Parent node ID"
88
+ "height": {
89
+ "type": "number",
90
+ "minimum": 0
91
+ }
92
+ }
93
+ },
94
+ "PlacementSide": {
95
+ "type": "string",
96
+ "enum": [
97
+ "above",
98
+ "below",
99
+ "left",
100
+ "right",
101
+ "center"
102
+ ]
103
+ },
104
+ "NodeLabelPlacement": {
105
+ "type": "object",
106
+ "additionalProperties": false,
107
+ "required": [
108
+ "side"
109
+ ],
110
+ "properties": {
111
+ "side": {
112
+ "$ref": "#/$defs/PlacementSide"
80
113
  },
81
- "ports": {
82
- "type": "array",
83
- "description": "Connection points",
84
- "items": { "$ref": "#/$defs/Port" }
114
+ "offset": {
115
+ "type": "number",
116
+ "minimum": 0,
117
+ "default": 0
118
+ }
119
+ },
120
+ "allOf": [
121
+ {
122
+ "if": {
123
+ "properties": {
124
+ "side": {
125
+ "const": "center"
126
+ }
127
+ },
128
+ "required": [
129
+ "side"
130
+ ]
131
+ },
132
+ "then": {
133
+ "properties": {
134
+ "offset": {
135
+ "const": 0
136
+ }
137
+ }
138
+ }
139
+ }
140
+ ]
141
+ },
142
+ "EdgeLabelPlacement": {
143
+ "type": "object",
144
+ "additionalProperties": false,
145
+ "required": [
146
+ "side"
147
+ ],
148
+ "properties": {
149
+ "side": {
150
+ "$ref": "#/$defs/PlacementSide"
85
151
  },
86
- "dimensions": { "$ref": "#/$defs/Dimensions" },
87
- "position": { "$ref": "#/$defs/Position" },
88
- "pinned": {
89
- "type": "boolean",
90
- "description": "Preserve position during layout"
152
+ "at": {
153
+ "type": "number",
154
+ "minimum": 0,
155
+ "maximum": 1,
156
+ "default": 0.5
91
157
  },
92
- "layoutOptions": { "$ref": "#/$defs/NodeLayoutOptions" },
93
- "sourceInfo": { "$ref": "#/$defs/SourceInfo" }
94
- }
158
+ "offset": {
159
+ "type": "number",
160
+ "minimum": 0,
161
+ "default": 0
162
+ }
163
+ },
164
+ "allOf": [
165
+ {
166
+ "if": {
167
+ "properties": {
168
+ "side": {
169
+ "const": "center"
170
+ }
171
+ },
172
+ "required": [
173
+ "side"
174
+ ]
175
+ },
176
+ "then": {
177
+ "properties": {
178
+ "offset": {
179
+ "const": 0
180
+ }
181
+ }
182
+ }
183
+ }
184
+ ]
95
185
  },
96
186
  "Port": {
97
187
  "type": "object",
98
- "required": ["id", "side"],
188
+ "additionalProperties": false,
189
+ "required": [
190
+ "id",
191
+ "side"
192
+ ],
99
193
  "properties": {
100
194
  "id": {
101
- "type": "string",
102
- "description": "Unique identifier within parent node",
103
- "minLength": 1
195
+ "$ref": "#/$defs/Identifier"
104
196
  },
105
197
  "side": {
106
198
  "type": "string",
107
- "enum": ["NORTH", "SOUTH", "EAST", "WEST"],
108
- "description": "Which side of the node"
199
+ "enum": [
200
+ "NORTH",
201
+ "SOUTH",
202
+ "EAST",
203
+ "WEST"
204
+ ]
109
205
  },
110
206
  "label": {
111
- "type": "string",
112
- "description": "Optional label"
207
+ "type": "string"
113
208
  },
114
209
  "position": {
115
210
  "type": "number",
116
211
  "minimum": 0,
117
- "maximum": 1,
118
- "description": "Position along the side (0.0 to 1.0)"
212
+ "maximum": 1
119
213
  },
120
214
  "properties": {
121
215
  "type": "object",
@@ -123,238 +217,1600 @@
123
217
  }
124
218
  }
125
219
  },
126
- "GraphEdge": {
220
+ "Padding": {
127
221
  "type": "object",
128
- "required": ["id", "source", "target"],
222
+ "additionalProperties": false,
129
223
  "properties": {
130
- "id": {
131
- "type": "string",
132
- "description": "Unique identifier within the graph",
133
- "minLength": 1
134
- },
135
- "source": {
136
- "type": "string",
137
- "description": "Source node ID",
138
- "minLength": 1
139
- },
140
- "target": {
141
- "type": "string",
142
- "description": "Target node ID",
143
- "minLength": 1
144
- },
145
- "sourcePort": {
146
- "type": "string",
147
- "description": "Source port ID"
148
- },
149
- "targetPort": {
150
- "type": "string",
151
- "description": "Target port ID"
152
- },
153
- "type": {
154
- "type": "string",
155
- "description": "Edge type"
156
- },
157
- "label": {
158
- "type": "string",
159
- "description": "Display label"
224
+ "top": {
225
+ "type": "number",
226
+ "minimum": 0,
227
+ "default": 0
160
228
  },
161
- "properties": {
162
- "type": "object",
163
- "additionalProperties": true
229
+ "right": {
230
+ "type": "number",
231
+ "minimum": 0,
232
+ "default": 0
164
233
  },
165
- "routingPoints": {
166
- "type": "array",
167
- "items": { "$ref": "#/$defs/Position" }
234
+ "bottom": {
235
+ "type": "number",
236
+ "minimum": 0,
237
+ "default": 0
168
238
  },
169
- "style": { "$ref": "#/$defs/EdgeStyle" },
170
- "sourceInfo": { "$ref": "#/$defs/SourceInfo" }
239
+ "left": {
240
+ "type": "number",
241
+ "minimum": 0,
242
+ "default": 0
243
+ }
171
244
  }
172
245
  },
173
- "EdgeStyle": {
246
+ "SpacingOptions": {
174
247
  "type": "object",
248
+ "additionalProperties": false,
175
249
  "properties": {
176
- "lineStyle": {
177
- "type": "string",
178
- "enum": ["solid", "dashed", "dotted"]
250
+ "nodeNode": {
251
+ "type": "number",
252
+ "minimum": 0
179
253
  },
180
- "targetArrow": {
181
- "type": "string",
182
- "enum": ["arrow", "diamond", "circle", "none"]
254
+ "nodeEdge": {
255
+ "type": "number",
256
+ "minimum": 0
183
257
  },
184
- "sourceArrow": {
185
- "type": "string",
186
- "enum": ["arrow", "diamond", "circle", "none"]
258
+ "edgeEdge": {
259
+ "type": "number",
260
+ "minimum": 0
187
261
  },
188
- "routing": {
189
- "type": "string",
190
- "enum": ["orthogonal", "polyline", "spline"]
262
+ "layerSpacing": {
263
+ "type": "number",
264
+ "minimum": 0
191
265
  }
192
266
  }
193
267
  },
194
- "Dimensions": {
195
- "type": "object",
196
- "required": ["width", "height"],
197
- "properties": {
198
- "width": { "type": "number", "minimum": 0 },
199
- "height": { "type": "number", "minimum": 0 }
200
- }
201
- },
202
- "Position": {
203
- "type": "object",
204
- "required": ["x", "y"],
205
- "properties": {
206
- "x": { "type": "number" },
207
- "y": { "type": "number" }
208
- }
209
- },
210
268
  "LayoutOptions": {
211
269
  "type": "object",
270
+ "additionalProperties": false,
212
271
  "properties": {
213
272
  "algorithm": {
214
273
  "type": "string",
215
- "enum": ["layered", "force", "radial", "tree", "fixed"]
274
+ "enum": [
275
+ "layered",
276
+ "force",
277
+ "radial",
278
+ "tree",
279
+ "fixed"
280
+ ]
216
281
  },
217
282
  "direction": {
218
283
  "type": "string",
219
- "enum": ["DOWN", "UP", "LEFT", "RIGHT"]
284
+ "enum": [
285
+ "DOWN",
286
+ "UP",
287
+ "LEFT",
288
+ "RIGHT"
289
+ ]
290
+ },
291
+ "spacing": {
292
+ "$ref": "#/$defs/SpacingOptions"
220
293
  },
221
- "spacing": { "$ref": "#/$defs/SpacingOptions" },
222
294
  "edgeRouting": {
223
295
  "type": "string",
224
- "enum": ["orthogonal", "polyline", "spline"]
296
+ "enum": [
297
+ "orthogonal",
298
+ "polyline",
299
+ "spline"
300
+ ]
225
301
  },
226
302
  "hierarchyHandling": {
227
303
  "type": "string",
228
- "enum": ["INCLUDE_CHILDREN", "SEPARATE_CHILDREN"]
229
- },
230
- "algorithmOptions": {
231
- "type": "object",
232
- "additionalProperties": {
233
- "oneOf": [
234
- { "type": "string" },
235
- { "type": "number" },
236
- { "type": "boolean" }
237
- ]
238
- }
304
+ "enum": [
305
+ "INCLUDE_CHILDREN",
306
+ "SEPARATE_CHILDREN"
307
+ ]
239
308
  }
240
309
  }
241
310
  },
242
- "SpacingOptions": {
243
- "type": "object",
244
- "properties": {
245
- "nodeNode": { "type": "number", "minimum": 0 },
246
- "nodeEdge": { "type": "number", "minimum": 0 },
247
- "edgeEdge": { "type": "number", "minimum": 0 },
248
- "layerSpacing": { "type": "number", "minimum": 0 }
249
- }
250
- },
251
311
  "NodeLayoutOptions": {
252
312
  "type": "object",
313
+ "additionalProperties": false,
253
314
  "properties": {
254
315
  "portConstraints": {
255
316
  "type": "string",
256
- "enum": ["FREE", "FIXED_SIDE", "FIXED_ORDER", "FIXED_POS"]
317
+ "enum": [
318
+ "FREE",
319
+ "FIXED_SIDE",
320
+ "FIXED_ORDER",
321
+ "FIXED_POS"
322
+ ]
257
323
  },
258
324
  "portAlignment": {
259
325
  "type": "string",
260
- "enum": ["BEGIN", "CENTER", "END", "JUSTIFIED"]
326
+ "enum": [
327
+ "BEGIN",
328
+ "CENTER",
329
+ "END",
330
+ "JUSTIFIED"
331
+ ]
261
332
  },
262
333
  "sizeConstraints": {
263
334
  "type": "array",
264
335
  "items": {
265
336
  "type": "string",
266
- "enum": ["MINIMUM_SIZE", "NODE_LABELS", "PORTS"]
267
- }
337
+ "enum": [
338
+ "MINIMUM_SIZE",
339
+ "NODE_LABELS",
340
+ "PORTS"
341
+ ]
342
+ },
343
+ "uniqueItems": true
344
+ },
345
+ "minimumSize": {
346
+ "$ref": "#/$defs/Dimensions"
268
347
  },
269
- "minimumSize": { "$ref": "#/$defs/Dimensions" },
270
348
  "padding": {
271
- "type": "object",
272
- "properties": {
273
- "top": { "type": "number", "minimum": 0 },
274
- "right": { "type": "number", "minimum": 0 },
275
- "bottom": { "type": "number", "minimum": 0 },
276
- "left": { "type": "number", "minimum": 0 }
277
- }
349
+ "$ref": "#/$defs/Padding"
278
350
  }
279
351
  }
280
352
  },
281
- "SourceInfo": {
353
+ "GraphNode": {
282
354
  "type": "object",
283
- "required": ["range"],
355
+ "additionalProperties": false,
356
+ "required": [
357
+ "id",
358
+ "type"
359
+ ],
284
360
  "properties": {
285
- "range": { "$ref": "#/$defs/SourceRange" },
286
- "leadingComments": {
361
+ "id": {
362
+ "$ref": "#/$defs/Identifier"
363
+ },
364
+ "type": {
365
+ "$ref": "#/$defs/Identifier"
366
+ },
367
+ "label": {
368
+ "type": "string"
369
+ },
370
+ "description": {
371
+ "type": "string"
372
+ },
373
+ "symbol": {
374
+ "type": "string"
375
+ },
376
+ "variant": {
377
+ "type": "string"
378
+ },
379
+ "properties": {
380
+ "type": "object",
381
+ "additionalProperties": true
382
+ },
383
+ "children": {
287
384
  "type": "array",
288
- "items": { "$ref": "#/$defs/Comment" }
385
+ "items": {
386
+ "$ref": "#/$defs/GraphNode"
387
+ }
289
388
  },
290
- "trailingComment": { "$ref": "#/$defs/Comment" },
291
- "leadingWhitespace": { "type": "string" },
292
- "modified": { "type": "boolean" },
293
- "originalText": { "type": "string" }
294
- }
389
+ "parent": {
390
+ "$ref": "#/$defs/Identifier"
391
+ },
392
+ "ports": {
393
+ "type": "array",
394
+ "items": {
395
+ "$ref": "#/$defs/Port"
396
+ }
397
+ },
398
+ "dimensions": {
399
+ "$ref": "#/$defs/Dimensions"
400
+ },
401
+ "position": {
402
+ "$ref": "#/$defs/Position"
403
+ },
404
+ "pinned": {
405
+ "type": "boolean"
406
+ },
407
+ "labelPlacement": {
408
+ "$ref": "#/$defs/NodeLabelPlacement"
409
+ },
410
+ "layoutOptions": {
411
+ "$ref": "#/$defs/NodeLayoutOptions"
412
+ },
413
+ "sourceInfo": {
414
+ "$ref": "#/$defs/SourceInfo"
415
+ },
416
+ "classifier": {
417
+ "$ref": "#/$defs/Classifier"
418
+ }
419
+ },
420
+ "allOf": [
421
+ {
422
+ "if": {
423
+ "properties": {
424
+ "pinned": {
425
+ "const": true
426
+ }
427
+ },
428
+ "required": [
429
+ "pinned"
430
+ ]
431
+ },
432
+ "then": {
433
+ "required": [
434
+ "position"
435
+ ]
436
+ }
437
+ }
438
+ ]
295
439
  },
296
- "SourceRange": {
440
+ "EdgeStyle": {
297
441
  "type": "object",
298
- "required": ["start", "end"],
442
+ "additionalProperties": false,
299
443
  "properties": {
300
- "start": { "type": "integer", "minimum": 0 },
301
- "end": { "type": "integer", "minimum": 0 },
302
- "startPosition": {
444
+ "lineStyle": {
445
+ "type": "string",
446
+ "enum": [
447
+ "solid",
448
+ "dashed",
449
+ "dotted"
450
+ ]
451
+ },
452
+ "routing": {
453
+ "type": "string",
454
+ "enum": [
455
+ "orthogonal",
456
+ "polyline",
457
+ "spline"
458
+ ]
459
+ }
460
+ }
461
+ },
462
+ "RouteAnchor": {
463
+ "oneOf": [
464
+ {
303
465
  "type": "object",
304
- "required": ["line", "column"],
466
+ "additionalProperties": false,
467
+ "required": [
468
+ "kind"
469
+ ],
305
470
  "properties": {
306
- "line": { "type": "integer", "minimum": 0 },
307
- "column": { "type": "integer", "minimum": 0 }
471
+ "kind": {
472
+ "const": "source"
473
+ }
308
474
  }
309
475
  },
310
- "endPosition": {
476
+ {
477
+ "type": "object",
478
+ "additionalProperties": false,
479
+ "required": [
480
+ "kind"
481
+ ],
482
+ "properties": {
483
+ "kind": {
484
+ "const": "target"
485
+ }
486
+ }
487
+ },
488
+ {
311
489
  "type": "object",
312
- "required": ["line", "column"],
490
+ "additionalProperties": false,
491
+ "required": [
492
+ "kind",
493
+ "nodeId"
494
+ ],
313
495
  "properties": {
314
- "line": { "type": "integer", "minimum": 0 },
315
- "column": { "type": "integer", "minimum": 0 }
496
+ "kind": {
497
+ "const": "node"
498
+ },
499
+ "nodeId": {
500
+ "$ref": "#/$defs/Identifier"
501
+ }
502
+ }
503
+ },
504
+ {
505
+ "type": "object",
506
+ "additionalProperties": false,
507
+ "required": [
508
+ "kind",
509
+ "nodeId",
510
+ "portId"
511
+ ],
512
+ "properties": {
513
+ "kind": {
514
+ "const": "port"
515
+ },
516
+ "nodeId": {
517
+ "$ref": "#/$defs/Identifier"
518
+ },
519
+ "portId": {
520
+ "$ref": "#/$defs/Identifier"
521
+ }
316
522
  }
317
523
  }
318
- }
524
+ ]
319
525
  },
320
- "Comment": {
526
+ "WaypointPlacement": {
527
+ "oneOf": [
528
+ {
529
+ "type": "object",
530
+ "additionalProperties": false,
531
+ "required": [
532
+ "kind",
533
+ "position"
534
+ ],
535
+ "properties": {
536
+ "kind": {
537
+ "const": "absolute"
538
+ },
539
+ "position": {
540
+ "$ref": "#/$defs/Position"
541
+ }
542
+ }
543
+ },
544
+ {
545
+ "type": "object",
546
+ "additionalProperties": false,
547
+ "required": [
548
+ "kind",
549
+ "anchor",
550
+ "offset"
551
+ ],
552
+ "properties": {
553
+ "kind": {
554
+ "const": "relative"
555
+ },
556
+ "anchor": {
557
+ "$ref": "#/$defs/RouteAnchor"
558
+ },
559
+ "offset": {
560
+ "$ref": "#/$defs/Position"
561
+ }
562
+ }
563
+ }
564
+ ]
565
+ },
566
+ "RouteWaypoint": {
321
567
  "type": "object",
322
- "required": ["text", "style"],
568
+ "additionalProperties": false,
569
+ "required": [
570
+ "id",
571
+ "placement"
572
+ ],
323
573
  "properties": {
324
- "text": { "type": "string" },
325
- "style": {
326
- "type": "string",
327
- "enum": ["line", "block"]
574
+ "id": {
575
+ "$ref": "#/$defs/Identifier"
328
576
  },
329
- "range": { "$ref": "#/$defs/SourceRange" }
577
+ "placement": {
578
+ "$ref": "#/$defs/WaypointPlacement"
579
+ }
330
580
  }
331
581
  },
332
- "GraphMetadata": {
582
+ "RouteIntent": {
333
583
  "type": "object",
584
+ "additionalProperties": false,
585
+ "required": [
586
+ "waypoints"
587
+ ],
334
588
  "properties": {
335
- "author": { "type": "string" },
336
- "created": {
337
- "type": "string",
338
- "format": "date-time"
589
+ "waypoints": {
590
+ "type": "array",
591
+ "minItems": 1,
592
+ "items": {
593
+ "$ref": "#/$defs/RouteWaypoint"
594
+ }
595
+ }
596
+ }
597
+ },
598
+ "GraphEdge": {
599
+ "type": "object",
600
+ "additionalProperties": false,
601
+ "required": [
602
+ "id",
603
+ "source",
604
+ "target"
605
+ ],
606
+ "properties": {
607
+ "id": {
608
+ "$ref": "#/$defs/Identifier"
339
609
  },
340
- "modified": {
341
- "type": "string",
342
- "format": "date-time"
610
+ "source": {
611
+ "$ref": "#/$defs/Identifier"
343
612
  },
344
- "description": { "type": "string" },
345
- "tags": {
346
- "type": "array",
347
- "items": { "type": "string" }
613
+ "target": {
614
+ "$ref": "#/$defs/Identifier"
348
615
  },
349
- "notation": {
616
+ "sourcePort": {
617
+ "$ref": "#/$defs/Identifier"
618
+ },
619
+ "targetPort": {
620
+ "$ref": "#/$defs/Identifier"
621
+ },
622
+ "type": {
623
+ "type": "string"
624
+ },
625
+ "label": {
626
+ "type": "string"
627
+ },
628
+ "description": {
629
+ "type": "string"
630
+ },
631
+ "labelPlacement": {
632
+ "$ref": "#/$defs/EdgeLabelPlacement"
633
+ },
634
+ "routeIntent": {
635
+ "$ref": "#/$defs/RouteIntent"
636
+ },
637
+ "properties": {
638
+ "type": "object",
639
+ "additionalProperties": true
640
+ },
641
+ "style": {
642
+ "$ref": "#/$defs/EdgeStyle"
643
+ },
644
+ "sourceInfo": {
645
+ "$ref": "#/$defs/SourceInfo"
646
+ },
647
+ "sourceEnd": {
648
+ "$ref": "#/$defs/RelationshipEnd"
649
+ },
650
+ "targetEnd": {
651
+ "$ref": "#/$defs/RelationshipEnd"
652
+ }
653
+ }
654
+ },
655
+ "ConstraintNodeReference": {
656
+ "type": "object",
657
+ "additionalProperties": false,
658
+ "required": [
659
+ "kind",
660
+ "nodeId"
661
+ ],
662
+ "properties": {
663
+ "kind": {
664
+ "const": "node"
665
+ },
666
+ "nodeId": {
667
+ "$ref": "#/$defs/Identifier"
668
+ }
669
+ }
670
+ },
671
+ "BoundaryScope": {
672
+ "oneOf": [
673
+ {
674
+ "type": "object",
675
+ "additionalProperties": false,
676
+ "required": [
677
+ "kind"
678
+ ],
679
+ "properties": {
680
+ "kind": {
681
+ "const": "graph"
682
+ }
683
+ }
684
+ },
685
+ {
686
+ "type": "object",
687
+ "additionalProperties": false,
688
+ "required": [
689
+ "kind",
690
+ "nodeId"
691
+ ],
692
+ "properties": {
693
+ "kind": {
694
+ "const": "node"
695
+ },
696
+ "nodeId": {
697
+ "$ref": "#/$defs/Identifier"
698
+ }
699
+ }
700
+ }
701
+ ]
702
+ },
703
+ "ConstraintBaseProperties": {
704
+ "type": "object",
705
+ "properties": {
706
+ "id": {
707
+ "$ref": "#/$defs/Identifier"
708
+ },
709
+ "strength": {
710
+ "type": "string",
711
+ "enum": [
712
+ "required",
713
+ "preferred"
714
+ ],
715
+ "default": "required"
716
+ },
717
+ "sourceInfo": {
718
+ "$ref": "#/$defs/SourceInfo"
719
+ }
720
+ }
721
+ },
722
+ "RelativeConstraint": {
723
+ "type": "object",
724
+ "additionalProperties": false,
725
+ "required": [
726
+ "id",
727
+ "kind",
728
+ "subject",
729
+ "relation",
730
+ "target"
731
+ ],
732
+ "properties": {
733
+ "id": {
734
+ "$ref": "#/$defs/Identifier"
735
+ },
736
+ "kind": {
737
+ "const": "relative"
738
+ },
739
+ "strength": {
740
+ "type": "string",
741
+ "enum": [
742
+ "required",
743
+ "preferred"
744
+ ],
745
+ "default": "required"
746
+ },
747
+ "sourceInfo": {
748
+ "$ref": "#/$defs/SourceInfo"
749
+ },
750
+ "subject": {
751
+ "$ref": "#/$defs/ConstraintNodeReference"
752
+ },
753
+ "relation": {
754
+ "type": "string",
755
+ "enum": [
756
+ "above",
757
+ "below",
758
+ "left-of",
759
+ "right-of"
760
+ ]
761
+ },
762
+ "target": {
763
+ "$ref": "#/$defs/ConstraintNodeReference"
764
+ },
765
+ "gap": {
766
+ "type": "number",
767
+ "minimum": 0,
768
+ "default": 0
769
+ },
770
+ "alignment": {
771
+ "type": "string",
772
+ "enum": [
773
+ "start",
774
+ "center",
775
+ "end"
776
+ ],
777
+ "default": "center"
778
+ }
779
+ }
780
+ },
781
+ "BoundaryConstraint": {
782
+ "type": "object",
783
+ "additionalProperties": false,
784
+ "required": [
785
+ "id",
786
+ "kind",
787
+ "subject",
788
+ "side",
789
+ "scope"
790
+ ],
791
+ "properties": {
792
+ "id": {
793
+ "$ref": "#/$defs/Identifier"
794
+ },
795
+ "kind": {
796
+ "const": "boundary"
797
+ },
798
+ "strength": {
799
+ "type": "string",
800
+ "enum": [
801
+ "required",
802
+ "preferred"
803
+ ],
804
+ "default": "required"
805
+ },
806
+ "sourceInfo": {
807
+ "$ref": "#/$defs/SourceInfo"
808
+ },
809
+ "subject": {
810
+ "$ref": "#/$defs/ConstraintNodeReference"
811
+ },
812
+ "side": {
813
+ "type": "string",
814
+ "enum": [
815
+ "top",
816
+ "bottom",
817
+ "left",
818
+ "right"
819
+ ]
820
+ },
821
+ "scope": {
822
+ "$ref": "#/$defs/BoundaryScope"
823
+ },
824
+ "inset": {
825
+ "type": "number",
826
+ "minimum": 0,
827
+ "default": 0
828
+ }
829
+ }
830
+ },
831
+ "ArrangementConstraint": {
832
+ "type": "object",
833
+ "additionalProperties": false,
834
+ "required": [
835
+ "id",
836
+ "kind",
837
+ "subjects",
838
+ "axis"
839
+ ],
840
+ "properties": {
841
+ "id": {
842
+ "$ref": "#/$defs/Identifier"
843
+ },
844
+ "kind": {
845
+ "const": "arrangement"
846
+ },
847
+ "strength": {
848
+ "type": "string",
849
+ "enum": [
850
+ "required",
851
+ "preferred"
852
+ ],
853
+ "default": "required"
854
+ },
855
+ "sourceInfo": {
856
+ "$ref": "#/$defs/SourceInfo"
857
+ },
858
+ "subjects": {
859
+ "type": "array",
860
+ "minItems": 2,
861
+ "uniqueItems": true,
862
+ "items": {
863
+ "$ref": "#/$defs/ConstraintNodeReference"
864
+ }
865
+ },
866
+ "axis": {
867
+ "type": "string",
868
+ "enum": [
869
+ "row",
870
+ "column"
871
+ ]
872
+ },
873
+ "direction": {
874
+ "type": "string",
875
+ "enum": [
876
+ "forward",
877
+ "reverse"
878
+ ],
879
+ "default": "forward"
880
+ },
881
+ "gap": {
882
+ "type": "number",
883
+ "minimum": 0,
884
+ "default": 0
885
+ },
886
+ "alignment": {
887
+ "type": "string",
888
+ "enum": [
889
+ "start",
890
+ "center",
891
+ "end"
892
+ ],
893
+ "default": "center"
894
+ }
895
+ }
896
+ },
897
+ "SpatialConstraint": {
898
+ "oneOf": [
899
+ {
900
+ "$ref": "#/$defs/RelativeConstraint"
901
+ },
902
+ {
903
+ "$ref": "#/$defs/BoundaryConstraint"
904
+ },
905
+ {
906
+ "$ref": "#/$defs/ArrangementConstraint"
907
+ }
908
+ ]
909
+ },
910
+ "SourcePosition": {
911
+ "type": "object",
912
+ "additionalProperties": false,
913
+ "required": [
914
+ "line",
915
+ "column"
916
+ ],
917
+ "properties": {
918
+ "line": {
919
+ "type": "integer",
920
+ "minimum": 0
921
+ },
922
+ "column": {
923
+ "type": "integer",
924
+ "minimum": 0
925
+ }
926
+ }
927
+ },
928
+ "SourceRange": {
929
+ "type": "object",
930
+ "additionalProperties": false,
931
+ "required": [
932
+ "start",
933
+ "end"
934
+ ],
935
+ "properties": {
936
+ "start": {
937
+ "type": "integer",
938
+ "minimum": 0
939
+ },
940
+ "end": {
941
+ "type": "integer",
942
+ "minimum": 0
943
+ },
944
+ "startPosition": {
945
+ "$ref": "#/$defs/SourcePosition"
946
+ },
947
+ "endPosition": {
948
+ "$ref": "#/$defs/SourcePosition"
949
+ }
950
+ }
951
+ },
952
+ "Comment": {
953
+ "type": "object",
954
+ "additionalProperties": false,
955
+ "required": [
956
+ "text",
957
+ "style"
958
+ ],
959
+ "properties": {
960
+ "text": {
961
+ "type": "string"
962
+ },
963
+ "style": {
964
+ "type": "string",
965
+ "enum": [
966
+ "line",
967
+ "block"
968
+ ]
969
+ },
970
+ "range": {
971
+ "$ref": "#/$defs/SourceRange"
972
+ }
973
+ }
974
+ },
975
+ "SourceInfo": {
976
+ "type": "object",
977
+ "additionalProperties": false,
978
+ "required": [
979
+ "range"
980
+ ],
981
+ "properties": {
982
+ "range": {
983
+ "$ref": "#/$defs/SourceRange"
984
+ },
985
+ "leadingComments": {
986
+ "type": "array",
987
+ "items": {
988
+ "$ref": "#/$defs/Comment"
989
+ }
990
+ },
991
+ "trailingComment": {
992
+ "$ref": "#/$defs/Comment"
993
+ },
994
+ "leadingWhitespace": {
995
+ "type": "string"
996
+ },
997
+ "modified": {
998
+ "type": "boolean"
999
+ },
1000
+ "originalText": {
1001
+ "type": "string"
1002
+ }
1003
+ }
1004
+ },
1005
+ "GraphMetadata": {
1006
+ "type": "object",
1007
+ "additionalProperties": false,
1008
+ "properties": {
1009
+ "author": {
1010
+ "type": "string"
1011
+ },
1012
+ "created": {
350
1013
  "type": "string",
351
- "description": "Notation used by the graph, such as flowchart or ERD"
1014
+ "format": "date-time"
1015
+ },
1016
+ "modified": {
1017
+ "type": "string",
1018
+ "format": "date-time"
1019
+ },
1020
+ "description": {
1021
+ "type": "string"
1022
+ },
1023
+ "tags": {
1024
+ "type": "array",
1025
+ "items": {
1026
+ "type": "string"
1027
+ }
1028
+ },
1029
+ "notation": {
1030
+ "type": "string"
352
1031
  },
353
1032
  "custom": {
354
1033
  "type": "object",
355
1034
  "additionalProperties": true
356
1035
  }
357
1036
  }
1037
+ },
1038
+ "NotationProfile": {
1039
+ "oneOf": [
1040
+ {
1041
+ "type": "object",
1042
+ "additionalProperties": false,
1043
+ "required": [
1044
+ "id",
1045
+ "kind",
1046
+ "version"
1047
+ ],
1048
+ "properties": {
1049
+ "id": {
1050
+ "const": "uml"
1051
+ },
1052
+ "kind": {
1053
+ "const": "class"
1054
+ },
1055
+ "version": {
1056
+ "const": "1.0.0"
1057
+ }
1058
+ }
1059
+ },
1060
+ {
1061
+ "type": "object",
1062
+ "additionalProperties": false,
1063
+ "required": [
1064
+ "id",
1065
+ "kind",
1066
+ "version"
1067
+ ],
1068
+ "properties": {
1069
+ "id": {
1070
+ "const": "uml"
1071
+ },
1072
+ "kind": {
1073
+ "const": "sequence"
1074
+ },
1075
+ "version": {
1076
+ "const": "1.0.0"
1077
+ }
1078
+ }
1079
+ }
1080
+ ]
1081
+ },
1082
+ "ClassifierParameter": {
1083
+ "type": "object",
1084
+ "additionalProperties": false,
1085
+ "required": [
1086
+ "name"
1087
+ ],
1088
+ "properties": {
1089
+ "name": {
1090
+ "$ref": "#/$defs/Identifier"
1091
+ },
1092
+ "type": {
1093
+ "$ref": "#/$defs/Identifier"
1094
+ }
1095
+ }
1096
+ },
1097
+ "ClassifierAttribute": {
1098
+ "type": "object",
1099
+ "additionalProperties": false,
1100
+ "required": [
1101
+ "id",
1102
+ "kind",
1103
+ "name"
1104
+ ],
1105
+ "properties": {
1106
+ "id": {
1107
+ "$ref": "#/$defs/Identifier"
1108
+ },
1109
+ "kind": {
1110
+ "const": "attribute"
1111
+ },
1112
+ "visibility": {
1113
+ "type": "string",
1114
+ "enum": [
1115
+ "public",
1116
+ "protected",
1117
+ "private",
1118
+ "package"
1119
+ ]
1120
+ },
1121
+ "name": {
1122
+ "$ref": "#/$defs/Identifier"
1123
+ },
1124
+ "type": {
1125
+ "$ref": "#/$defs/Identifier"
1126
+ },
1127
+ "modifiers": {
1128
+ "type": "array",
1129
+ "uniqueItems": true,
1130
+ "items": {
1131
+ "type": "string",
1132
+ "enum": [
1133
+ "abstract",
1134
+ "static",
1135
+ "readonly",
1136
+ "derived"
1137
+ ]
1138
+ }
1139
+ }
1140
+ }
1141
+ },
1142
+ "ClassifierOperation": {
1143
+ "type": "object",
1144
+ "additionalProperties": false,
1145
+ "required": [
1146
+ "id",
1147
+ "kind",
1148
+ "name",
1149
+ "parameters"
1150
+ ],
1151
+ "properties": {
1152
+ "id": {
1153
+ "$ref": "#/$defs/Identifier"
1154
+ },
1155
+ "kind": {
1156
+ "const": "operation"
1157
+ },
1158
+ "visibility": {
1159
+ "type": "string",
1160
+ "enum": [
1161
+ "public",
1162
+ "protected",
1163
+ "private",
1164
+ "package"
1165
+ ]
1166
+ },
1167
+ "name": {
1168
+ "$ref": "#/$defs/Identifier"
1169
+ },
1170
+ "parameters": {
1171
+ "type": "array",
1172
+ "items": {
1173
+ "$ref": "#/$defs/ClassifierParameter"
1174
+ }
1175
+ },
1176
+ "returnType": {
1177
+ "$ref": "#/$defs/Identifier"
1178
+ },
1179
+ "modifiers": {
1180
+ "type": "array",
1181
+ "uniqueItems": true,
1182
+ "items": {
1183
+ "type": "string",
1184
+ "enum": [
1185
+ "abstract",
1186
+ "static",
1187
+ "readonly",
1188
+ "derived"
1189
+ ]
1190
+ }
1191
+ }
1192
+ }
1193
+ },
1194
+ "ClassifierLiteral": {
1195
+ "type": "object",
1196
+ "additionalProperties": false,
1197
+ "required": [
1198
+ "id",
1199
+ "kind",
1200
+ "name"
1201
+ ],
1202
+ "properties": {
1203
+ "id": {
1204
+ "$ref": "#/$defs/Identifier"
1205
+ },
1206
+ "kind": {
1207
+ "const": "literal"
1208
+ },
1209
+ "name": {
1210
+ "$ref": "#/$defs/Identifier"
1211
+ },
1212
+ "value": {
1213
+ "type": "string"
1214
+ }
1215
+ }
1216
+ },
1217
+ "ClassifierCompartment": {
1218
+ "oneOf": [
1219
+ {
1220
+ "type": "object",
1221
+ "additionalProperties": false,
1222
+ "required": [
1223
+ "id",
1224
+ "kind"
1225
+ ],
1226
+ "properties": {
1227
+ "id": {
1228
+ "$ref": "#/$defs/Identifier"
1229
+ },
1230
+ "kind": {
1231
+ "const": "name"
1232
+ }
1233
+ }
1234
+ },
1235
+ {
1236
+ "type": "object",
1237
+ "additionalProperties": false,
1238
+ "required": [
1239
+ "id",
1240
+ "kind",
1241
+ "items"
1242
+ ],
1243
+ "properties": {
1244
+ "id": {
1245
+ "$ref": "#/$defs/Identifier"
1246
+ },
1247
+ "kind": {
1248
+ "const": "attributes"
1249
+ },
1250
+ "items": {
1251
+ "type": "array",
1252
+ "items": {
1253
+ "$ref": "#/$defs/ClassifierAttribute"
1254
+ }
1255
+ }
1256
+ }
1257
+ },
1258
+ {
1259
+ "type": "object",
1260
+ "additionalProperties": false,
1261
+ "required": [
1262
+ "id",
1263
+ "kind",
1264
+ "items"
1265
+ ],
1266
+ "properties": {
1267
+ "id": {
1268
+ "$ref": "#/$defs/Identifier"
1269
+ },
1270
+ "kind": {
1271
+ "const": "operations"
1272
+ },
1273
+ "items": {
1274
+ "type": "array",
1275
+ "items": {
1276
+ "$ref": "#/$defs/ClassifierOperation"
1277
+ }
1278
+ }
1279
+ }
1280
+ },
1281
+ {
1282
+ "type": "object",
1283
+ "additionalProperties": false,
1284
+ "required": [
1285
+ "id",
1286
+ "kind",
1287
+ "items"
1288
+ ],
1289
+ "properties": {
1290
+ "id": {
1291
+ "$ref": "#/$defs/Identifier"
1292
+ },
1293
+ "kind": {
1294
+ "const": "literals"
1295
+ },
1296
+ "items": {
1297
+ "type": "array",
1298
+ "items": {
1299
+ "$ref": "#/$defs/ClassifierLiteral"
1300
+ }
1301
+ }
1302
+ }
1303
+ }
1304
+ ]
1305
+ },
1306
+ "Classifier": {
1307
+ "type": "object",
1308
+ "additionalProperties": false,
1309
+ "required": [
1310
+ "kind",
1311
+ "name",
1312
+ "compartments"
1313
+ ],
1314
+ "properties": {
1315
+ "kind": {
1316
+ "type": "string",
1317
+ "enum": [
1318
+ "class",
1319
+ "interface",
1320
+ "enum"
1321
+ ]
1322
+ },
1323
+ "name": {
1324
+ "$ref": "#/$defs/Identifier"
1325
+ },
1326
+ "modifiers": {
1327
+ "type": "array",
1328
+ "uniqueItems": true,
1329
+ "items": {
1330
+ "type": "string",
1331
+ "enum": [
1332
+ "abstract",
1333
+ "static"
1334
+ ]
1335
+ }
1336
+ },
1337
+ "compartments": {
1338
+ "type": "array",
1339
+ "minItems": 1,
1340
+ "items": {
1341
+ "$ref": "#/$defs/ClassifierCompartment"
1342
+ }
1343
+ }
1344
+ },
1345
+ "allOf": [
1346
+ {
1347
+ "properties": {
1348
+ "compartments": {
1349
+ "contains": {
1350
+ "properties": { "kind": { "const": "name" } },
1351
+ "required": ["kind"]
1352
+ },
1353
+ "minContains": 1,
1354
+ "maxContains": 1
1355
+ }
1356
+ }
1357
+ },
1358
+ {
1359
+ "if": {
1360
+ "properties": { "kind": { "enum": ["class", "interface"] } },
1361
+ "required": ["kind"]
1362
+ },
1363
+ "then": {
1364
+ "properties": {
1365
+ "compartments": {
1366
+ "allOf": [
1367
+ {
1368
+ "contains": { "properties": { "kind": { "const": "attributes" } }, "required": ["kind"] },
1369
+ "minContains": 0,
1370
+ "maxContains": 1
1371
+ },
1372
+ {
1373
+ "contains": { "properties": { "kind": { "const": "operations" } }, "required": ["kind"] },
1374
+ "minContains": 0,
1375
+ "maxContains": 1
1376
+ },
1377
+ {
1378
+ "not": {
1379
+ "contains": { "properties": { "kind": { "const": "literals" } }, "required": ["kind"] }
1380
+ }
1381
+ }
1382
+ ]
1383
+ }
1384
+ }
1385
+ }
1386
+ },
1387
+ {
1388
+ "if": {
1389
+ "properties": { "kind": { "const": "enum" } },
1390
+ "required": ["kind"]
1391
+ },
1392
+ "then": {
1393
+ "properties": {
1394
+ "compartments": {
1395
+ "allOf": [
1396
+ {
1397
+ "contains": { "properties": { "kind": { "const": "literals" } }, "required": ["kind"] },
1398
+ "minContains": 1,
1399
+ "maxContains": 1
1400
+ },
1401
+ {
1402
+ "contains": { "properties": { "kind": { "const": "operations" } }, "required": ["kind"] },
1403
+ "minContains": 0,
1404
+ "maxContains": 1
1405
+ },
1406
+ {
1407
+ "not": {
1408
+ "contains": { "properties": { "kind": { "const": "attributes" } }, "required": ["kind"] }
1409
+ }
1410
+ }
1411
+ ]
1412
+ }
1413
+ }
1414
+ }
1415
+ }
1416
+ ]
1417
+ },
1418
+ "Multiplicity": {
1419
+ "type": "object",
1420
+ "additionalProperties": false,
1421
+ "required": [
1422
+ "lower",
1423
+ "upper"
1424
+ ],
1425
+ "properties": {
1426
+ "lower": {
1427
+ "type": "integer",
1428
+ "minimum": 0
1429
+ },
1430
+ "upper": {
1431
+ "oneOf": [
1432
+ {
1433
+ "type": "integer",
1434
+ "minimum": 0
1435
+ },
1436
+ {
1437
+ "const": "*"
1438
+ }
1439
+ ]
1440
+ }
1441
+ }
1442
+ },
1443
+ "EndpointMarker": {
1444
+ "type": "object",
1445
+ "additionalProperties": false,
1446
+ "required": [
1447
+ "kind",
1448
+ "fill"
1449
+ ],
1450
+ "properties": {
1451
+ "kind": {
1452
+ "type": "string",
1453
+ "enum": [
1454
+ "none",
1455
+ "arrow",
1456
+ "triangle",
1457
+ "diamond",
1458
+ "circle",
1459
+ "bar",
1460
+ "crow-foot",
1461
+ "zero-or-one",
1462
+ "one",
1463
+ "zero-or-many",
1464
+ "one-or-many"
1465
+ ]
1466
+ },
1467
+ "fill": {
1468
+ "type": "string",
1469
+ "enum": [
1470
+ "open",
1471
+ "filled",
1472
+ "unspecified"
1473
+ ]
1474
+ }
1475
+ },
1476
+ "allOf": [
1477
+ {
1478
+ "if": {
1479
+ "properties": {
1480
+ "kind": {
1481
+ "enum": [
1482
+ "none",
1483
+ "bar",
1484
+ "crow-foot",
1485
+ "zero-or-one",
1486
+ "one",
1487
+ "zero-or-many",
1488
+ "one-or-many"
1489
+ ]
1490
+ }
1491
+ },
1492
+ "required": [
1493
+ "kind"
1494
+ ]
1495
+ },
1496
+ "then": {
1497
+ "properties": {
1498
+ "fill": {
1499
+ "const": "unspecified"
1500
+ }
1501
+ }
1502
+ }
1503
+ }
1504
+ ]
1505
+ },
1506
+ "RelationshipEnd": {
1507
+ "type": "object",
1508
+ "additionalProperties": false,
1509
+ "required": [],
1510
+ "properties": {
1511
+ "role": {
1512
+ "$ref": "#/$defs/Identifier"
1513
+ },
1514
+ "multiplicity": {
1515
+ "$ref": "#/$defs/Multiplicity"
1516
+ },
1517
+ "navigability": {
1518
+ "type": "string",
1519
+ "enum": [
1520
+ "navigable",
1521
+ "non-navigable",
1522
+ "unspecified"
1523
+ ]
1524
+ },
1525
+ "marker": {
1526
+ "$ref": "#/$defs/EndpointMarker"
1527
+ }
1528
+ }
1529
+ },
1530
+ "InteractionParticipant": {
1531
+ "type": "object",
1532
+ "additionalProperties": false,
1533
+ "required": [
1534
+ "id",
1535
+ "nodeId"
1536
+ ],
1537
+ "properties": {
1538
+ "id": {
1539
+ "$ref": "#/$defs/Identifier"
1540
+ },
1541
+ "nodeId": {
1542
+ "$ref": "#/$defs/Identifier"
1543
+ }
1544
+ }
1545
+ },
1546
+ "InteractionMessage": {
1547
+ "type": "object",
1548
+ "additionalProperties": false,
1549
+ "required": [
1550
+ "id",
1551
+ "edgeId",
1552
+ "sourceParticipantId",
1553
+ "targetParticipantId"
1554
+ ],
1555
+ "properties": {
1556
+ "id": {
1557
+ "$ref": "#/$defs/Identifier"
1558
+ },
1559
+ "edgeId": {
1560
+ "$ref": "#/$defs/Identifier"
1561
+ },
1562
+ "sourceParticipantId": {
1563
+ "$ref": "#/$defs/Identifier"
1564
+ },
1565
+ "targetParticipantId": {
1566
+ "$ref": "#/$defs/Identifier"
1567
+ },
1568
+ "kind": {
1569
+ "type": "string",
1570
+ "enum": [
1571
+ "synchronous",
1572
+ "asynchronous",
1573
+ "return",
1574
+ "create",
1575
+ "destroy"
1576
+ ]
1577
+ }
1578
+ }
1579
+ },
1580
+ "InteractionActivation": {
1581
+ "type": "object",
1582
+ "additionalProperties": false,
1583
+ "required": [
1584
+ "id",
1585
+ "participantId",
1586
+ "startMessageId",
1587
+ "endMessageId"
1588
+ ],
1589
+ "properties": {
1590
+ "id": {
1591
+ "$ref": "#/$defs/Identifier"
1592
+ },
1593
+ "participantId": {
1594
+ "$ref": "#/$defs/Identifier"
1595
+ },
1596
+ "startMessageId": {
1597
+ "$ref": "#/$defs/Identifier"
1598
+ },
1599
+ "endMessageId": {
1600
+ "$ref": "#/$defs/Identifier"
1601
+ }
1602
+ }
1603
+ },
1604
+ "InteractionGuard": {
1605
+ "type": "object",
1606
+ "additionalProperties": false,
1607
+ "required": [
1608
+ "id",
1609
+ "text"
1610
+ ],
1611
+ "properties": {
1612
+ "id": {
1613
+ "$ref": "#/$defs/Identifier"
1614
+ },
1615
+ "text": {
1616
+ "$ref": "#/$defs/Identifier"
1617
+ }
1618
+ }
1619
+ },
1620
+ "InteractionOperand": {
1621
+ "type": "object",
1622
+ "additionalProperties": false,
1623
+ "required": [
1624
+ "id",
1625
+ "messageIds"
1626
+ ],
1627
+ "properties": {
1628
+ "id": {
1629
+ "$ref": "#/$defs/Identifier"
1630
+ },
1631
+ "guard": {
1632
+ "$ref": "#/$defs/InteractionGuard"
1633
+ },
1634
+ "messageIds": {
1635
+ "type": "array",
1636
+ "uniqueItems": true,
1637
+ "items": {
1638
+ "$ref": "#/$defs/Identifier"
1639
+ }
1640
+ }
1641
+ }
1642
+ },
1643
+ "InteractionFragment": {
1644
+ "type": "object",
1645
+ "additionalProperties": false,
1646
+ "required": [
1647
+ "id",
1648
+ "kind",
1649
+ "operands"
1650
+ ],
1651
+ "properties": {
1652
+ "id": {
1653
+ "$ref": "#/$defs/Identifier"
1654
+ },
1655
+ "kind": {
1656
+ "type": "string",
1657
+ "enum": [
1658
+ "loop",
1659
+ "alt",
1660
+ "opt"
1661
+ ]
1662
+ },
1663
+ "operands": {
1664
+ "type": "array",
1665
+ "items": {
1666
+ "$ref": "#/$defs/InteractionOperand"
1667
+ }
1668
+ }
1669
+ },
1670
+ "allOf": [
1671
+ {
1672
+ "if": {
1673
+ "properties": {
1674
+ "kind": {
1675
+ "enum": [
1676
+ "loop",
1677
+ "opt"
1678
+ ]
1679
+ }
1680
+ },
1681
+ "required": [
1682
+ "kind"
1683
+ ]
1684
+ },
1685
+ "then": {
1686
+ "properties": {
1687
+ "operands": {
1688
+ "minItems": 1,
1689
+ "maxItems": 1
1690
+ }
1691
+ }
1692
+ }
1693
+ },
1694
+ {
1695
+ "if": {
1696
+ "properties": {
1697
+ "kind": {
1698
+ "const": "alt"
1699
+ }
1700
+ },
1701
+ "required": [
1702
+ "kind"
1703
+ ]
1704
+ },
1705
+ "then": {
1706
+ "properties": {
1707
+ "operands": {
1708
+ "minItems": 2
1709
+ }
1710
+ }
1711
+ }
1712
+ }
1713
+ ]
1714
+ },
1715
+ "InteractionNote": {
1716
+ "type": "object",
1717
+ "additionalProperties": false,
1718
+ "required": [
1719
+ "id",
1720
+ "text"
1721
+ ],
1722
+ "properties": {
1723
+ "id": {
1724
+ "$ref": "#/$defs/Identifier"
1725
+ },
1726
+ "text": {
1727
+ "$ref": "#/$defs/Identifier"
1728
+ },
1729
+ "participantIds": {
1730
+ "type": "array",
1731
+ "minItems": 1,
1732
+ "uniqueItems": true,
1733
+ "items": {
1734
+ "$ref": "#/$defs/Identifier"
1735
+ }
1736
+ },
1737
+ "messageIds": {
1738
+ "type": "array",
1739
+ "minItems": 1,
1740
+ "uniqueItems": true,
1741
+ "items": {
1742
+ "$ref": "#/$defs/Identifier"
1743
+ }
1744
+ }
1745
+ },
1746
+ "anyOf": [
1747
+ {
1748
+ "required": [
1749
+ "participantIds"
1750
+ ]
1751
+ },
1752
+ {
1753
+ "required": [
1754
+ "messageIds"
1755
+ ]
1756
+ }
1757
+ ]
1758
+ },
1759
+ "Interaction": {
1760
+ "type": "object",
1761
+ "additionalProperties": false,
1762
+ "required": [
1763
+ "participants",
1764
+ "participantOrder",
1765
+ "messages",
1766
+ "messageOrder"
1767
+ ],
1768
+ "properties": {
1769
+ "participants": {
1770
+ "type": "array",
1771
+ "items": {
1772
+ "$ref": "#/$defs/InteractionParticipant"
1773
+ }
1774
+ },
1775
+ "participantOrder": {
1776
+ "type": "array",
1777
+ "uniqueItems": true,
1778
+ "items": {
1779
+ "$ref": "#/$defs/Identifier"
1780
+ }
1781
+ },
1782
+ "messages": {
1783
+ "type": "array",
1784
+ "items": {
1785
+ "$ref": "#/$defs/InteractionMessage"
1786
+ }
1787
+ },
1788
+ "messageOrder": {
1789
+ "type": "array",
1790
+ "uniqueItems": true,
1791
+ "items": {
1792
+ "$ref": "#/$defs/Identifier"
1793
+ }
1794
+ },
1795
+ "activations": {
1796
+ "type": "array",
1797
+ "items": {
1798
+ "$ref": "#/$defs/InteractionActivation"
1799
+ }
1800
+ },
1801
+ "fragments": {
1802
+ "type": "array",
1803
+ "items": {
1804
+ "$ref": "#/$defs/InteractionFragment"
1805
+ }
1806
+ },
1807
+ "notes": {
1808
+ "type": "array",
1809
+ "items": {
1810
+ "$ref": "#/$defs/InteractionNote"
1811
+ }
1812
+ }
1813
+ }
358
1814
  }
359
1815
  }
360
1816
  }