@coasys/ad4m 0.12.0-rc1-dev → 0.12.0-rc1-dev.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 (128) hide show
  1. package/jest.config.js +4 -4
  2. package/lib/index.cjs +5999 -6044
  3. package/lib/index.js +5977 -6038
  4. package/lib/src/Ad4mClient.d.ts +16 -9
  5. package/lib/src/Ad4mClient.js +25 -46
  6. package/lib/src/Ad4mClient.test.d.ts +1 -0
  7. package/lib/src/Ad4mClient.test.js +1204 -0
  8. package/lib/src/Literal.d.ts +2 -1
  9. package/lib/src/Literal.js +35 -38
  10. package/lib/src/Literal.test.d.ts +1 -0
  11. package/lib/src/Literal.test.js +41 -0
  12. package/lib/src/SmartLiteral.d.ts +2 -1
  13. package/lib/src/SmartLiteral.js +15 -30
  14. package/lib/src/agent/AgentClient.d.ts +4 -1
  15. package/lib/src/agent/AgentClient.js +99 -79
  16. package/lib/src/ai/AIClient.d.ts +2 -1
  17. package/lib/src/ai/AIClient.js +220 -224
  18. package/lib/src/expression/ExpressionClient.d.ts +1 -1
  19. package/lib/src/expression/ExpressionClient.js +86 -73
  20. package/lib/src/index.d.ts +1 -1
  21. package/lib/src/index.js +1 -1
  22. package/lib/src/language/LanguageClient.d.ts +1 -1
  23. package/lib/src/language/LanguageClient.js +52 -52
  24. package/lib/src/model/Ad4mModel.d.ts +157 -937
  25. package/lib/src/model/Ad4mModel.js +212 -2797
  26. package/lib/src/model/Ad4mModel.test.js +1002 -561
  27. package/lib/src/model/decorators.d.ts +94 -426
  28. package/lib/src/model/decorators.js +333 -741
  29. package/lib/src/model/mutation.d.ts +81 -0
  30. package/lib/src/model/mutation.js +317 -0
  31. package/lib/src/model/parentUtils.d.ts +32 -0
  32. package/lib/src/model/parentUtils.js +64 -0
  33. package/lib/src/model/prolog/generatePrologFacts.d.ts +36 -0
  34. package/lib/src/model/prolog/generatePrologFacts.js +139 -0
  35. package/lib/src/model/prolog/index.d.ts +1 -0
  36. package/lib/src/model/prolog/index.js +1 -0
  37. package/lib/src/model/query/ModelQueryBuilder.d.ts +82 -0
  38. package/lib/src/model/query/ModelQueryBuilder.js +115 -0
  39. package/lib/src/model/query/QueryBuilder.d.ts +101 -0
  40. package/lib/src/model/query/QueryBuilder.js +193 -0
  41. package/lib/src/model/query/SurrealQueryBuilder.d.ts +48 -0
  42. package/lib/src/model/query/SurrealQueryBuilder.js +371 -0
  43. package/lib/src/model/query/fetchInstance.d.ts +24 -0
  44. package/lib/src/model/query/fetchInstance.js +144 -0
  45. package/lib/src/model/query/hydration.d.ts +54 -0
  46. package/lib/src/model/query/hydration.js +214 -0
  47. package/lib/src/model/query/operations.d.ts +59 -0
  48. package/lib/src/model/query/operations.js +384 -0
  49. package/lib/src/model/query/snapshot.d.ts +59 -0
  50. package/lib/src/model/query/snapshot.js +106 -0
  51. package/lib/src/model/query/surrealCompiler.d.ts +42 -0
  52. package/lib/src/model/query/surrealCompiler.js +304 -0
  53. package/lib/src/model/schema/fromJSONSchema.d.ts +67 -0
  54. package/lib/src/model/schema/fromJSONSchema.js +264 -0
  55. package/lib/src/model/schema/metadata.d.ts +15 -0
  56. package/lib/src/model/schema/metadata.js +112 -0
  57. package/lib/src/model/subscription.d.ts +47 -0
  58. package/lib/src/model/subscription.js +231 -0
  59. package/lib/src/model/transaction.d.ts +27 -0
  60. package/lib/src/model/transaction.js +32 -0
  61. package/lib/src/model/types.d.ts +195 -0
  62. package/lib/src/model/types.js +8 -0
  63. package/lib/src/model/util.js +7 -7
  64. package/lib/src/neighbourhood/NeighbourhoodClient.d.ts +5 -1
  65. package/lib/src/neighbourhood/NeighbourhoodClient.js +263 -181
  66. package/lib/src/neighbourhood/NeighbourhoodProxy.d.ts +2 -1
  67. package/lib/src/neighbourhood/NeighbourhoodProxy.js +13 -28
  68. package/lib/src/neighbourhood/NeighbourhoodProxy.test.js +1 -5
  69. package/lib/src/perspectives/PerspectiveClient.d.ts +9 -9
  70. package/lib/src/perspectives/PerspectiveClient.js +316 -240
  71. package/lib/src/perspectives/PerspectiveProxy.d.ts +54 -92
  72. package/lib/src/perspectives/PerspectiveProxy.js +803 -444
  73. package/lib/src/runtime/RuntimeClient.d.ts +5 -1
  74. package/lib/src/runtime/RuntimeClient.js +412 -238
  75. package/lib/src/shacl/SHACLFlow.test.js +164 -105
  76. package/lib/src/shacl/SHACLShape.d.ts +17 -3
  77. package/lib/src/shacl/SHACLShape.js +127 -90
  78. package/lib/src/shacl/SHACLShape.test.js +244 -176
  79. package/lib/src/utils.d.ts +8 -0
  80. package/lib/src/utils.js +21 -7
  81. package/package.json +8 -13
  82. package/src/Ad4mClient.test.ts +1564 -1315
  83. package/src/Ad4mClient.ts +55 -54
  84. package/src/Literal.test.ts +45 -26
  85. package/src/Literal.ts +82 -66
  86. package/src/SmartLiteral.ts +74 -58
  87. package/src/agent/AgentClient.ts +144 -99
  88. package/src/ai/AIClient.ts +409 -359
  89. package/src/expression/ExpressionClient.ts +142 -96
  90. package/src/index.ts +1 -1
  91. package/src/language/LanguageClient.ts +137 -113
  92. package/src/model/Ad4mModel.test.ts +1128 -647
  93. package/src/model/Ad4mModel.ts +485 -3247
  94. package/src/model/IMPROVEMENTS.md +482 -0
  95. package/src/model/PREDICATE_COLLISION_FIX.md +651 -0
  96. package/src/model/README.md +317 -0
  97. package/src/model/SHACL_MUTATION_DECOUPLING.md +356 -0
  98. package/src/model/SUBSCRIPTION_STRATEGY.md +317 -0
  99. package/src/model/TC39_STAGE_3_DECORATORS.md +609 -0
  100. package/src/model/decorators.ts +689 -1046
  101. package/src/model/mutation.ts +461 -0
  102. package/src/model/parentUtils.ts +91 -0
  103. package/src/model/prolog/generatePrologFacts.ts +176 -0
  104. package/src/model/prolog/index.ts +1 -0
  105. package/src/model/query/ModelQueryBuilder.ts +173 -0
  106. package/src/model/query/fetchInstance.ts +181 -0
  107. package/src/model/query/hydration.ts +273 -0
  108. package/src/model/query/operations.ts +510 -0
  109. package/src/model/query/snapshot.ts +126 -0
  110. package/src/model/query/surrealCompiler.ts +376 -0
  111. package/src/model/schema/fromJSONSchema.ts +411 -0
  112. package/src/model/schema/metadata.ts +148 -0
  113. package/src/model/subscription.ts +307 -0
  114. package/src/model/transaction.ts +60 -0
  115. package/src/model/types.ts +207 -0
  116. package/src/model/util.ts +47 -48
  117. package/src/neighbourhood/NeighbourhoodClient.ts +393 -251
  118. package/src/neighbourhood/NeighbourhoodProxy.test.ts +3 -7
  119. package/src/neighbourhood/NeighbourhoodProxy.ts +58 -40
  120. package/src/perspectives/PerspectiveClient.ts +779 -540
  121. package/src/perspectives/PerspectiveProxy.ts +2860 -2053
  122. package/src/runtime/RuntimeClient.ts +775 -476
  123. package/src/shacl/SHACLFlow.test.ts +196 -129
  124. package/src/shacl/SHACLShape.test.ts +284 -190
  125. package/src/shacl/SHACLShape.ts +225 -172
  126. package/src/utils.ts +31 -17
  127. package/tsconfig.json +9 -10
  128. package/src/model/Subject.ts +0 -159
@@ -1,233 +1,300 @@
1
- import { SHACLFlow, FlowState, FlowTransition, AD4MAction } from './SHACLFlow';
2
-
3
- describe('SHACLFlow', () => {
4
- describe('basic construction', () => {
5
- it('creates a flow with name and namespace', () => {
6
- const flow = new SHACLFlow('TODO', 'todo://');
7
- expect(flow.name).toBe('TODO');
8
- expect(flow.namespace).toBe('todo://');
9
- expect(flow.flowUri).toBe('todo://TODOFlow');
1
+ import { SHACLFlow } from "./SHACLFlow";
2
+
3
+ describe("SHACLFlow", () => {
4
+ describe("basic construction", () => {
5
+ it("creates a flow with name and namespace", () => {
6
+ const flow = new SHACLFlow("TODO", "todo://");
7
+ expect(flow.name).toBe("TODO");
8
+ expect(flow.namespace).toBe("todo://");
9
+ expect(flow.flowUri).toBe("todo://TODOFlow");
10
10
  });
11
11
 
12
- it('generates correct state URIs', () => {
13
- const flow = new SHACLFlow('TODO', 'todo://');
14
- expect(flow.stateUri('ready')).toBe('todo://TODO.ready');
15
- expect(flow.stateUri('done')).toBe('todo://TODO.done');
12
+ it("generates correct state URIs", () => {
13
+ const flow = new SHACLFlow("TODO", "todo://");
14
+ expect(flow.stateUri("ready")).toBe("todo://TODO.ready");
15
+ expect(flow.stateUri("done")).toBe("todo://TODO.done");
16
16
  });
17
17
 
18
- it('generates correct transition URIs', () => {
19
- const flow = new SHACLFlow('TODO', 'todo://');
20
- expect(flow.transitionUri('ready', 'doing')).toBe('todo://TODO.readyTodoing');
18
+ it("generates correct transition URIs", () => {
19
+ const flow = new SHACLFlow("TODO", "todo://");
20
+ expect(flow.transitionUri("ready", "doing")).toBe(
21
+ "todo://TODO.readyTodoing",
22
+ );
21
23
  });
22
24
  });
23
25
 
24
- describe('state management', () => {
25
- it('adds and retrieves states', () => {
26
- const flow = new SHACLFlow('TODO', 'todo://');
27
-
26
+ describe("state management", () => {
27
+ it("adds and retrieves states", () => {
28
+ const flow = new SHACLFlow("TODO", "todo://");
29
+
28
30
  flow.addState({
29
- name: 'ready',
31
+ name: "ready",
30
32
  value: 0,
31
- stateCheck: { predicate: 'todo://state', target: 'todo://ready' }
33
+ stateCheck: { predicate: "todo://state", target: "todo://ready" },
32
34
  });
33
-
35
+
34
36
  flow.addState({
35
- name: 'done',
37
+ name: "done",
36
38
  value: 1,
37
- stateCheck: { predicate: 'todo://state', target: 'todo://done' }
39
+ stateCheck: { predicate: "todo://state", target: "todo://done" },
38
40
  });
39
-
41
+
40
42
  expect(flow.states.length).toBe(2);
41
- expect(flow.states[0].name).toBe('ready');
42
- expect(flow.states[1].name).toBe('done');
43
+ expect(flow.states[0].name).toBe("ready");
44
+ expect(flow.states[1].name).toBe("done");
43
45
  });
44
46
  });
45
47
 
46
- describe('transition management', () => {
47
- it('adds and retrieves transitions', () => {
48
- const flow = new SHACLFlow('TODO', 'todo://');
49
-
48
+ describe("transition management", () => {
49
+ it("adds and retrieves transitions", () => {
50
+ const flow = new SHACLFlow("TODO", "todo://");
51
+
50
52
  flow.addTransition({
51
- actionName: 'Complete',
52
- fromState: 'ready',
53
- toState: 'done',
53
+ actionName: "Complete",
54
+ fromState: "ready",
55
+ toState: "done",
54
56
  actions: [
55
- { action: 'addLink', source: 'this', predicate: 'todo://state', target: 'todo://done' },
56
- { action: 'removeLink', source: 'this', predicate: 'todo://state', target: 'todo://ready' }
57
- ]
57
+ {
58
+ action: "addLink",
59
+ source: "this",
60
+ predicate: "todo://state",
61
+ target: "todo://done",
62
+ },
63
+ {
64
+ action: "removeLink",
65
+ source: "this",
66
+ predicate: "todo://state",
67
+ target: "todo://ready",
68
+ },
69
+ ],
58
70
  });
59
-
71
+
60
72
  expect(flow.transitions.length).toBe(1);
61
- expect(flow.transitions[0].actionName).toBe('Complete');
73
+ expect(flow.transitions[0].actionName).toBe("Complete");
62
74
  expect(flow.transitions[0].actions.length).toBe(2);
63
75
  });
64
76
  });
65
77
 
66
- describe('toLinks()', () => {
67
- it('serializes flow to links', () => {
68
- const flow = new SHACLFlow('TODO', 'todo://');
69
- flow.flowable = 'any';
78
+ describe("toLinks()", () => {
79
+ it("serializes flow to links", () => {
80
+ const flow = new SHACLFlow("TODO", "todo://");
81
+ flow.flowable = "any";
70
82
  flow.startAction = [
71
- { action: 'addLink', source: 'this', predicate: 'todo://state', target: 'todo://ready' }
83
+ {
84
+ action: "addLink",
85
+ source: "this",
86
+ predicate: "todo://state",
87
+ target: "todo://ready",
88
+ },
72
89
  ];
73
-
90
+
74
91
  flow.addState({
75
- name: 'ready',
92
+ name: "ready",
76
93
  value: 0,
77
- stateCheck: { predicate: 'todo://state', target: 'todo://ready' }
94
+ stateCheck: { predicate: "todo://state", target: "todo://ready" },
78
95
  });
79
-
96
+
80
97
  flow.addTransition({
81
- actionName: 'Start',
82
- fromState: 'ready',
83
- toState: 'doing',
84
- actions: [{ action: 'addLink', source: 'this', predicate: 'todo://state', target: 'todo://doing' }]
98
+ actionName: "Start",
99
+ fromState: "ready",
100
+ toState: "doing",
101
+ actions: [
102
+ {
103
+ action: "addLink",
104
+ source: "this",
105
+ predicate: "todo://state",
106
+ target: "todo://doing",
107
+ },
108
+ ],
85
109
  });
86
-
110
+
87
111
  const links = flow.toLinks();
88
-
112
+
89
113
  // Check flow type link
90
- const typeLink = links.find(l => l.predicate === 'rdf://type' && l.target === 'ad4m://Flow');
114
+ const typeLink = links.find(
115
+ (l) => l.predicate === "rdf://type" && l.target === "ad4m://Flow",
116
+ );
91
117
  expect(typeLink).toBeDefined();
92
- expect(typeLink!.source).toBe('todo://TODOFlow');
93
-
118
+ expect(typeLink!.source).toBe("todo://TODOFlow");
119
+
94
120
  // Check flowable link
95
- const flowableLink = links.find(l => l.predicate === 'ad4m://flowable');
121
+ const flowableLink = links.find((l) => l.predicate === "ad4m://flowable");
96
122
  expect(flowableLink).toBeDefined();
97
- expect(flowableLink!.target).toBe('ad4m://any');
98
-
123
+ expect(flowableLink!.target).toBe("ad4m://any");
124
+
99
125
  // Check start action link
100
- const startActionLink = links.find(l => l.predicate === 'ad4m://startAction');
126
+ const startActionLink = links.find(
127
+ (l) => l.predicate === "ad4m://startAction",
128
+ );
101
129
  expect(startActionLink).toBeDefined();
102
- expect(startActionLink!.target).toContain('addLink');
103
-
130
+ expect(startActionLink!.target).toContain("addLink");
131
+
104
132
  // Check state link
105
- const stateLink = links.find(l => l.predicate === 'ad4m://hasState');
133
+ const stateLink = links.find((l) => l.predicate === "ad4m://hasState");
106
134
  expect(stateLink).toBeDefined();
107
- expect(stateLink!.target).toBe('todo://TODO.ready');
108
-
135
+ expect(stateLink!.target).toBe("todo://TODO.ready");
136
+
109
137
  // Check transition link
110
- const transitionLink = links.find(l => l.predicate === 'ad4m://hasTransition');
138
+ const transitionLink = links.find(
139
+ (l) => l.predicate === "ad4m://hasTransition",
140
+ );
111
141
  expect(transitionLink).toBeDefined();
112
142
  });
113
143
  });
114
144
 
115
- describe('fromLinks()', () => {
116
- it('reconstructs flow from links', () => {
117
- const original = new SHACLFlow('TODO', 'todo://');
118
- original.flowable = 'any';
145
+ describe("fromLinks()", () => {
146
+ it("reconstructs flow from links", () => {
147
+ const original = new SHACLFlow("TODO", "todo://");
148
+ original.flowable = "any";
119
149
  original.startAction = [
120
- { action: 'addLink', source: 'this', predicate: 'todo://state', target: 'todo://ready' }
150
+ {
151
+ action: "addLink",
152
+ source: "this",
153
+ predicate: "todo://state",
154
+ target: "todo://ready",
155
+ },
121
156
  ];
122
157
  original.addState({
123
- name: 'ready',
158
+ name: "ready",
124
159
  value: 0,
125
- stateCheck: { predicate: 'todo://state', target: 'todo://ready' }
160
+ stateCheck: { predicate: "todo://state", target: "todo://ready" },
126
161
  });
127
162
  original.addState({
128
- name: 'done',
163
+ name: "done",
129
164
  value: 1,
130
- stateCheck: { predicate: 'todo://state', target: 'todo://done' }
165
+ stateCheck: { predicate: "todo://state", target: "todo://done" },
131
166
  });
132
167
  original.addTransition({
133
- actionName: 'Complete',
134
- fromState: 'ready',
135
- toState: 'done',
136
- actions: [{ action: 'addLink', source: 'this', predicate: 'todo://state', target: 'todo://done' }]
168
+ actionName: "Complete",
169
+ fromState: "ready",
170
+ toState: "done",
171
+ actions: [
172
+ {
173
+ action: "addLink",
174
+ source: "this",
175
+ predicate: "todo://state",
176
+ target: "todo://done",
177
+ },
178
+ ],
137
179
  });
138
-
180
+
139
181
  const links = original.toLinks();
140
- const reconstructed = SHACLFlow.fromLinks(links, 'todo://TODOFlow');
141
-
142
- expect(reconstructed.name).toBe('TODO');
143
- expect(reconstructed.namespace).toBe('todo://');
144
- expect(reconstructed.flowable).toBe('any');
182
+ const reconstructed = SHACLFlow.fromLinks(links, "todo://TODOFlow");
183
+
184
+ expect(reconstructed.name).toBe("TODO");
185
+ expect(reconstructed.namespace).toBe("todo://");
186
+ expect(reconstructed.flowable).toBe("any");
145
187
  expect(reconstructed.startAction.length).toBe(1);
146
188
  expect(reconstructed.states.length).toBe(2);
147
189
  expect(reconstructed.transitions.length).toBe(1);
148
- expect(reconstructed.transitions[0].actionName).toBe('Complete');
190
+ expect(reconstructed.transitions[0].actionName).toBe("Complete");
149
191
  });
150
192
  });
151
193
 
152
- describe('JSON serialization', () => {
153
- it('converts to and from JSON', () => {
154
- const original = new SHACLFlow('TODO', 'todo://');
194
+ describe("JSON serialization", () => {
195
+ it("converts to and from JSON", () => {
196
+ const original = new SHACLFlow("TODO", "todo://");
155
197
  original.addState({
156
- name: 'ready',
198
+ name: "ready",
157
199
  value: 0,
158
- stateCheck: { predicate: 'todo://state', target: 'todo://ready' }
200
+ stateCheck: { predicate: "todo://state", target: "todo://ready" },
159
201
  });
160
202
  original.addTransition({
161
- actionName: 'Start',
162
- fromState: 'ready',
163
- toState: 'doing',
164
- actions: []
203
+ actionName: "Start",
204
+ fromState: "ready",
205
+ toState: "doing",
206
+ actions: [],
165
207
  });
166
-
208
+
167
209
  const json = original.toJSON();
168
210
  const reconstructed = SHACLFlow.fromJSON(json);
169
-
170
- expect(reconstructed.name).toBe('TODO');
211
+
212
+ expect(reconstructed.name).toBe("TODO");
171
213
  expect(reconstructed.states.length).toBe(1);
172
214
  expect(reconstructed.transitions.length).toBe(1);
173
215
  });
174
216
  });
175
217
 
176
- describe('full TODO example', () => {
177
- it('creates complete TODO flow matching Prolog example', () => {
178
- const flow = new SHACLFlow('TODO', 'todo://');
179
- flow.flowable = 'any';
180
-
218
+ describe("full TODO example", () => {
219
+ it("creates complete TODO flow matching Prolog example", () => {
220
+ const flow = new SHACLFlow("TODO", "todo://");
221
+ flow.flowable = "any";
222
+
181
223
  // Start action - renders expression as TODO in 'ready' state
182
224
  flow.startAction = [
183
- { action: 'addLink', source: 'this', predicate: 'todo://state', target: 'todo://ready' }
225
+ {
226
+ action: "addLink",
227
+ source: "this",
228
+ predicate: "todo://state",
229
+ target: "todo://ready",
230
+ },
184
231
  ];
185
-
232
+
186
233
  // Three states
187
234
  flow.addState({
188
- name: 'ready',
235
+ name: "ready",
189
236
  value: 0,
190
- stateCheck: { predicate: 'todo://state', target: 'todo://ready' }
237
+ stateCheck: { predicate: "todo://state", target: "todo://ready" },
191
238
  });
192
239
  flow.addState({
193
- name: 'doing',
240
+ name: "doing",
194
241
  value: 0.5,
195
- stateCheck: { predicate: 'todo://state', target: 'todo://doing' }
242
+ stateCheck: { predicate: "todo://state", target: "todo://doing" },
196
243
  });
197
244
  flow.addState({
198
- name: 'done',
245
+ name: "done",
199
246
  value: 1,
200
- stateCheck: { predicate: 'todo://state', target: 'todo://done' }
247
+ stateCheck: { predicate: "todo://state", target: "todo://done" },
201
248
  });
202
-
249
+
203
250
  // Transitions
204
251
  flow.addTransition({
205
- actionName: 'Start',
206
- fromState: 'ready',
207
- toState: 'doing',
252
+ actionName: "Start",
253
+ fromState: "ready",
254
+ toState: "doing",
208
255
  actions: [
209
- { action: 'addLink', source: 'this', predicate: 'todo://state', target: 'todo://doing' },
210
- { action: 'removeLink', source: 'this', predicate: 'todo://state', target: 'todo://ready' }
211
- ]
256
+ {
257
+ action: "addLink",
258
+ source: "this",
259
+ predicate: "todo://state",
260
+ target: "todo://doing",
261
+ },
262
+ {
263
+ action: "removeLink",
264
+ source: "this",
265
+ predicate: "todo://state",
266
+ target: "todo://ready",
267
+ },
268
+ ],
212
269
  });
213
270
  flow.addTransition({
214
- actionName: 'Finish',
215
- fromState: 'doing',
216
- toState: 'done',
271
+ actionName: "Finish",
272
+ fromState: "doing",
273
+ toState: "done",
217
274
  actions: [
218
- { action: 'addLink', source: 'this', predicate: 'todo://state', target: 'todo://done' },
219
- { action: 'removeLink', source: 'this', predicate: 'todo://state', target: 'todo://doing' }
220
- ]
275
+ {
276
+ action: "addLink",
277
+ source: "this",
278
+ predicate: "todo://state",
279
+ target: "todo://done",
280
+ },
281
+ {
282
+ action: "removeLink",
283
+ source: "this",
284
+ predicate: "todo://state",
285
+ target: "todo://doing",
286
+ },
287
+ ],
221
288
  });
222
-
289
+
223
290
  // Verify structure
224
291
  expect(flow.states.length).toBe(3);
225
292
  expect(flow.transitions.length).toBe(2);
226
-
293
+
227
294
  // Verify links generation
228
295
  const links = flow.toLinks();
229
296
  expect(links.length).toBeGreaterThan(15); // Flow + 3 states + 2 transitions = many links
230
-
297
+
231
298
  // Verify round-trip
232
299
  const reconstructed = SHACLFlow.fromLinks(links, flow.flowUri);
233
300
  expect(reconstructed.states.length).toBe(3);