@coasys/ad4m 0.12.0-rc1-dev.2 → 0.12.0-rc1-dev.4

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 (153) hide show
  1. package/jest.config.js +10 -3
  2. package/lib/index.cjs +6893 -5884
  3. package/lib/index.js +6889 -5872
  4. package/lib/src/Ad4mClient.d.ts +9 -16
  5. package/lib/src/Ad4mClient.js +46 -25
  6. package/lib/src/Literal.d.ts +1 -2
  7. package/lib/src/Literal.js +38 -35
  8. package/lib/src/SmartLiteral.d.ts +1 -2
  9. package/lib/src/SmartLiteral.js +30 -15
  10. package/lib/src/agent/AgentClient.d.ts +1 -4
  11. package/lib/src/agent/AgentClient.js +79 -99
  12. package/lib/src/ai/AIClient.d.ts +1 -2
  13. package/lib/src/ai/AIClient.js +224 -220
  14. package/lib/src/expression/ExpressionClient.d.ts +1 -1
  15. package/lib/src/expression/ExpressionClient.js +73 -86
  16. package/lib/src/index.d.ts +1 -1
  17. package/lib/src/index.js +1 -1
  18. package/lib/src/language/LanguageClient.d.ts +1 -1
  19. package/lib/src/language/LanguageClient.js +52 -52
  20. package/lib/src/model/Ad4mModel.d.ts +1351 -144
  21. package/lib/src/model/Ad4mModel.js +3760 -228
  22. package/lib/src/model/Ad4mModel.test.js +522 -979
  23. package/lib/src/model/Subject.d.ts +3 -3
  24. package/lib/src/model/Subject.js +25 -25
  25. package/lib/src/model/decorators.d.ts +444 -100
  26. package/lib/src/model/decorators.js +686 -321
  27. package/lib/src/model/util.d.ts +6 -6
  28. package/lib/src/model/util.js +24 -24
  29. package/lib/src/neighbourhood/NeighbourhoodClient.d.ts +1 -5
  30. package/lib/src/neighbourhood/NeighbourhoodClient.js +179 -242
  31. package/lib/src/neighbourhood/NeighbourhoodProxy.d.ts +1 -2
  32. package/lib/src/neighbourhood/NeighbourhoodProxy.js +28 -13
  33. package/lib/src/neighbourhood/NeighbourhoodProxy.test.js +5 -1
  34. package/lib/src/perspectives/PerspectiveClient.d.ts +9 -9
  35. package/lib/src/perspectives/PerspectiveClient.js +240 -316
  36. package/lib/src/perspectives/PerspectiveProxy.d.ts +99 -61
  37. package/lib/src/perspectives/PerspectiveProxy.js +485 -832
  38. package/lib/src/runtime/RuntimeClient.d.ts +1 -5
  39. package/lib/src/runtime/RuntimeClient.js +238 -412
  40. package/lib/src/shacl/SHACLFlow.test.js +105 -164
  41. package/lib/src/shacl/SHACLShape.d.ts +12 -17
  42. package/lib/src/shacl/SHACLShape.js +115 -128
  43. package/lib/src/shacl/SHACLShape.test.js +176 -244
  44. package/lib/src/shims/reflect-metadata.d.ts +0 -0
  45. package/lib/src/shims/type-graphql.d.ts +32 -0
  46. package/lib/src/src/Ad4mClient.d.ts +28 -0
  47. package/lib/src/src/Address.d.ts +1 -0
  48. package/lib/src/src/DID.d.ts +1 -0
  49. package/lib/src/src/Exception.d.ts +7 -0
  50. package/lib/src/src/Literal.d.ts +7 -0
  51. package/lib/src/src/PubSub.d.ts +17 -0
  52. package/lib/src/src/SmartLiteral.d.ts +12 -0
  53. package/lib/src/src/agent/Agent.d.ts +110 -0
  54. package/lib/src/src/agent/AgentClient.d.ts +62 -0
  55. package/lib/src/src/agent/AgentResolver.d.ts +30 -0
  56. package/lib/src/src/agent/AgentStatus.d.ts +8 -0
  57. package/lib/src/src/ai/AIClient.d.ts +32 -0
  58. package/lib/src/src/ai/AIResolver.d.ts +75 -0
  59. package/lib/src/src/ai/Tasks.d.ts +37 -0
  60. package/lib/src/src/buildSchema.d.ts +1 -0
  61. package/lib/src/src/expression/Expression.d.ts +28 -0
  62. package/lib/src/src/expression/ExpressionClient.d.ts +13 -0
  63. package/lib/src/src/expression/ExpressionRef.d.ts +9 -0
  64. package/lib/src/src/expression/ExpressionResolver.d.ts +10 -0
  65. package/lib/src/src/index.d.ts +35 -0
  66. package/lib/src/src/jestSetup.d.ts +1 -0
  67. package/lib/src/src/language/Icon.d.ts +4 -0
  68. package/lib/src/src/language/Language.d.ts +206 -0
  69. package/lib/src/src/language/LanguageClient.d.ts +17 -0
  70. package/lib/src/src/language/LanguageContext.d.ts +37 -0
  71. package/lib/src/src/language/LanguageHandle.d.ts +9 -0
  72. package/lib/src/src/language/LanguageMeta.d.ts +35 -0
  73. package/lib/src/src/language/LanguageRef.d.ts +6 -0
  74. package/lib/src/src/language/LanguageResolver.d.ts +19 -0
  75. package/lib/src/src/links/Links.d.ts +39 -0
  76. package/lib/src/src/links/Links.test.d.ts +1 -0
  77. package/lib/src/src/model/Ad4mModel.d.ts +1438 -0
  78. package/lib/src/src/model/Ad4mModel.test.d.ts +1 -0
  79. package/lib/src/src/model/Subject.d.ts +25 -0
  80. package/lib/src/src/model/decorators.d.ts +545 -0
  81. package/lib/src/src/model/util.d.ts +12 -0
  82. package/lib/src/src/neighbourhood/Neighbourhood.d.ts +10 -0
  83. package/lib/src/src/neighbourhood/NeighbourhoodClient.d.ts +25 -0
  84. package/lib/src/src/neighbourhood/NeighbourhoodProxy.d.ts +19 -0
  85. package/lib/src/src/neighbourhood/NeighbourhoodProxy.test.d.ts +1 -0
  86. package/lib/src/src/neighbourhood/NeighbourhoodResolver.d.ts +24 -0
  87. package/lib/src/src/perspectives/LinkQuery.d.ts +11 -0
  88. package/lib/src/src/perspectives/Perspective.d.ts +38 -0
  89. package/lib/src/src/perspectives/Perspective.test.d.ts +1 -0
  90. package/lib/src/src/perspectives/PerspectiveClient.d.ts +97 -0
  91. package/lib/src/src/perspectives/PerspectiveDiff.d.ts +9 -0
  92. package/lib/src/src/perspectives/PerspectiveHandle.d.ts +18 -0
  93. package/lib/src/src/perspectives/PerspectiveProxy.d.ts +865 -0
  94. package/lib/src/src/perspectives/PerspectiveResolver.d.ts +57 -0
  95. package/lib/src/src/runtime/RuntimeClient.d.ts +56 -0
  96. package/lib/src/src/runtime/RuntimeResolver.d.ts +132 -0
  97. package/lib/src/src/shacl/SHACLFlow.d.ts +171 -0
  98. package/lib/src/src/shacl/SHACLFlow.test.d.ts +1 -0
  99. package/lib/src/src/shacl/SHACLShape.d.ts +117 -0
  100. package/lib/src/src/shacl/SHACLShape.test.d.ts +1 -0
  101. package/lib/src/src/typeDefs.d.ts +1 -0
  102. package/lib/src/src/unwrapApolloResult.d.ts +2 -0
  103. package/lib/src/src/utils.d.ts +25 -0
  104. package/lib/src/utils.d.ts +0 -8
  105. package/lib/src/utils.js +7 -21
  106. package/package.json +15 -14
  107. package/src/Ad4mClient.test.ts +1315 -1564
  108. package/src/Ad4mClient.ts +54 -55
  109. package/src/Literal.test.ts +26 -45
  110. package/src/Literal.ts +66 -82
  111. package/src/SmartLiteral.ts +58 -74
  112. package/src/agent/AgentClient.ts +99 -144
  113. package/src/ai/AIClient.ts +359 -409
  114. package/src/expression/ExpressionClient.ts +96 -142
  115. package/src/index.ts +1 -1
  116. package/src/language/LanguageClient.ts +113 -137
  117. package/src/model/Ad4mModel.test.ts +616 -1114
  118. package/src/model/Ad4mModel.ts +4386 -451
  119. package/src/model/Subject.ts +159 -0
  120. package/src/model/decorators.ts +1168 -667
  121. package/src/model/util.ts +54 -53
  122. package/src/neighbourhood/NeighbourhoodClient.ts +266 -392
  123. package/src/neighbourhood/NeighbourhoodProxy.test.ts +7 -3
  124. package/src/neighbourhood/NeighbourhoodProxy.ts +40 -58
  125. package/src/perspectives/PerspectiveClient.ts +540 -779
  126. package/src/perspectives/PerspectiveProxy.ts +2067 -2860
  127. package/src/runtime/RuntimeClient.ts +476 -775
  128. package/src/shacl/SHACLFlow.test.ts +129 -196
  129. package/src/shacl/SHACLShape.test.ts +190 -284
  130. package/src/shacl/SHACLShape.ts +200 -224
  131. package/src/utils.ts +17 -31
  132. package/tsconfig.json +10 -9
  133. package/src/model/IMPROVEMENTS.md +0 -482
  134. package/src/model/PREDICATE_COLLISION_FIX.md +0 -651
  135. package/src/model/README.md +0 -317
  136. package/src/model/SHACL_MUTATION_DECOUPLING.md +0 -356
  137. package/src/model/SUBSCRIPTION_STRATEGY.md +0 -317
  138. package/src/model/TC39_STAGE_3_DECORATORS.md +0 -609
  139. package/src/model/mutation.ts +0 -461
  140. package/src/model/parentUtils.ts +0 -91
  141. package/src/model/prolog/generatePrologFacts.ts +0 -176
  142. package/src/model/prolog/index.ts +0 -1
  143. package/src/model/query/ModelQueryBuilder.ts +0 -173
  144. package/src/model/query/fetchInstance.ts +0 -181
  145. package/src/model/query/hydration.ts +0 -273
  146. package/src/model/query/operations.ts +0 -510
  147. package/src/model/query/snapshot.ts +0 -126
  148. package/src/model/query/surrealCompiler.ts +0 -376
  149. package/src/model/schema/fromJSONSchema.ts +0 -411
  150. package/src/model/schema/metadata.ts +0 -148
  151. package/src/model/subscription.ts +0 -307
  152. package/src/model/transaction.ts +0 -60
  153. package/src/model/types.ts +0 -207
@@ -1,253 +1,194 @@
1
- import { SHACLFlow } from "./SHACLFlow";
2
- describe("SHACLFlow", () => {
3
- describe("basic construction", () => {
4
- it("creates a flow with name and namespace", () => {
5
- const flow = new SHACLFlow("TODO", "todo://");
6
- expect(flow.name).toBe("TODO");
7
- expect(flow.namespace).toBe("todo://");
8
- expect(flow.flowUri).toBe("todo://TODOFlow");
1
+ import { SHACLFlow } from './SHACLFlow';
2
+ describe('SHACLFlow', () => {
3
+ describe('basic construction', () => {
4
+ it('creates a flow with name and namespace', () => {
5
+ const flow = new SHACLFlow('TODO', 'todo://');
6
+ expect(flow.name).toBe('TODO');
7
+ expect(flow.namespace).toBe('todo://');
8
+ expect(flow.flowUri).toBe('todo://TODOFlow');
9
9
  });
10
- it("generates correct state URIs", () => {
11
- const flow = new SHACLFlow("TODO", "todo://");
12
- expect(flow.stateUri("ready")).toBe("todo://TODO.ready");
13
- expect(flow.stateUri("done")).toBe("todo://TODO.done");
10
+ it('generates correct state URIs', () => {
11
+ const flow = new SHACLFlow('TODO', 'todo://');
12
+ expect(flow.stateUri('ready')).toBe('todo://TODO.ready');
13
+ expect(flow.stateUri('done')).toBe('todo://TODO.done');
14
14
  });
15
- it("generates correct transition URIs", () => {
16
- const flow = new SHACLFlow("TODO", "todo://");
17
- expect(flow.transitionUri("ready", "doing")).toBe("todo://TODO.readyTodoing");
15
+ it('generates correct transition URIs', () => {
16
+ const flow = new SHACLFlow('TODO', 'todo://');
17
+ expect(flow.transitionUri('ready', 'doing')).toBe('todo://TODO.readyTodoing');
18
18
  });
19
19
  });
20
- describe("state management", () => {
21
- it("adds and retrieves states", () => {
22
- const flow = new SHACLFlow("TODO", "todo://");
20
+ describe('state management', () => {
21
+ it('adds and retrieves states', () => {
22
+ const flow = new SHACLFlow('TODO', 'todo://');
23
23
  flow.addState({
24
- name: "ready",
24
+ name: 'ready',
25
25
  value: 0,
26
- stateCheck: { predicate: "todo://state", target: "todo://ready" },
26
+ stateCheck: { predicate: 'todo://state', target: 'todo://ready' }
27
27
  });
28
28
  flow.addState({
29
- name: "done",
29
+ name: 'done',
30
30
  value: 1,
31
- stateCheck: { predicate: "todo://state", target: "todo://done" },
31
+ stateCheck: { predicate: 'todo://state', target: 'todo://done' }
32
32
  });
33
33
  expect(flow.states.length).toBe(2);
34
- expect(flow.states[0].name).toBe("ready");
35
- expect(flow.states[1].name).toBe("done");
34
+ expect(flow.states[0].name).toBe('ready');
35
+ expect(flow.states[1].name).toBe('done');
36
36
  });
37
37
  });
38
- describe("transition management", () => {
39
- it("adds and retrieves transitions", () => {
40
- const flow = new SHACLFlow("TODO", "todo://");
38
+ describe('transition management', () => {
39
+ it('adds and retrieves transitions', () => {
40
+ const flow = new SHACLFlow('TODO', 'todo://');
41
41
  flow.addTransition({
42
- actionName: "Complete",
43
- fromState: "ready",
44
- toState: "done",
42
+ actionName: 'Complete',
43
+ fromState: 'ready',
44
+ toState: 'done',
45
45
  actions: [
46
- {
47
- action: "addLink",
48
- source: "this",
49
- predicate: "todo://state",
50
- target: "todo://done",
51
- },
52
- {
53
- action: "removeLink",
54
- source: "this",
55
- predicate: "todo://state",
56
- target: "todo://ready",
57
- },
58
- ],
46
+ { action: 'addLink', source: 'this', predicate: 'todo://state', target: 'todo://done' },
47
+ { action: 'removeLink', source: 'this', predicate: 'todo://state', target: 'todo://ready' }
48
+ ]
59
49
  });
60
50
  expect(flow.transitions.length).toBe(1);
61
- expect(flow.transitions[0].actionName).toBe("Complete");
51
+ expect(flow.transitions[0].actionName).toBe('Complete');
62
52
  expect(flow.transitions[0].actions.length).toBe(2);
63
53
  });
64
54
  });
65
- describe("toLinks()", () => {
66
- it("serializes flow to links", () => {
67
- const flow = new SHACLFlow("TODO", "todo://");
68
- flow.flowable = "any";
55
+ describe('toLinks()', () => {
56
+ it('serializes flow to links', () => {
57
+ const flow = new SHACLFlow('TODO', 'todo://');
58
+ flow.flowable = 'any';
69
59
  flow.startAction = [
70
- {
71
- action: "addLink",
72
- source: "this",
73
- predicate: "todo://state",
74
- target: "todo://ready",
75
- },
60
+ { action: 'addLink', source: 'this', predicate: 'todo://state', target: 'todo://ready' }
76
61
  ];
77
62
  flow.addState({
78
- name: "ready",
63
+ name: 'ready',
79
64
  value: 0,
80
- stateCheck: { predicate: "todo://state", target: "todo://ready" },
65
+ stateCheck: { predicate: 'todo://state', target: 'todo://ready' }
81
66
  });
82
67
  flow.addTransition({
83
- actionName: "Start",
84
- fromState: "ready",
85
- toState: "doing",
86
- actions: [
87
- {
88
- action: "addLink",
89
- source: "this",
90
- predicate: "todo://state",
91
- target: "todo://doing",
92
- },
93
- ],
68
+ actionName: 'Start',
69
+ fromState: 'ready',
70
+ toState: 'doing',
71
+ actions: [{ action: 'addLink', source: 'this', predicate: 'todo://state', target: 'todo://doing' }]
94
72
  });
95
73
  const links = flow.toLinks();
96
74
  // Check flow type link
97
- const typeLink = links.find((l) => l.predicate === "rdf://type" && l.target === "ad4m://Flow");
75
+ const typeLink = links.find(l => l.predicate === 'rdf://type' && l.target === 'ad4m://Flow');
98
76
  expect(typeLink).toBeDefined();
99
- expect(typeLink.source).toBe("todo://TODOFlow");
77
+ expect(typeLink.source).toBe('todo://TODOFlow');
100
78
  // Check flowable link
101
- const flowableLink = links.find((l) => l.predicate === "ad4m://flowable");
79
+ const flowableLink = links.find(l => l.predicate === 'ad4m://flowable');
102
80
  expect(flowableLink).toBeDefined();
103
- expect(flowableLink.target).toBe("ad4m://any");
81
+ expect(flowableLink.target).toBe('ad4m://any');
104
82
  // Check start action link
105
- const startActionLink = links.find((l) => l.predicate === "ad4m://startAction");
83
+ const startActionLink = links.find(l => l.predicate === 'ad4m://startAction');
106
84
  expect(startActionLink).toBeDefined();
107
- expect(startActionLink.target).toContain("addLink");
85
+ expect(startActionLink.target).toContain('addLink');
108
86
  // Check state link
109
- const stateLink = links.find((l) => l.predicate === "ad4m://hasState");
87
+ const stateLink = links.find(l => l.predicate === 'ad4m://hasState');
110
88
  expect(stateLink).toBeDefined();
111
- expect(stateLink.target).toBe("todo://TODO.ready");
89
+ expect(stateLink.target).toBe('todo://TODO.ready');
112
90
  // Check transition link
113
- const transitionLink = links.find((l) => l.predicate === "ad4m://hasTransition");
91
+ const transitionLink = links.find(l => l.predicate === 'ad4m://hasTransition');
114
92
  expect(transitionLink).toBeDefined();
115
93
  });
116
94
  });
117
- describe("fromLinks()", () => {
118
- it("reconstructs flow from links", () => {
119
- const original = new SHACLFlow("TODO", "todo://");
120
- original.flowable = "any";
95
+ describe('fromLinks()', () => {
96
+ it('reconstructs flow from links', () => {
97
+ const original = new SHACLFlow('TODO', 'todo://');
98
+ original.flowable = 'any';
121
99
  original.startAction = [
122
- {
123
- action: "addLink",
124
- source: "this",
125
- predicate: "todo://state",
126
- target: "todo://ready",
127
- },
100
+ { action: 'addLink', source: 'this', predicate: 'todo://state', target: 'todo://ready' }
128
101
  ];
129
102
  original.addState({
130
- name: "ready",
103
+ name: 'ready',
131
104
  value: 0,
132
- stateCheck: { predicate: "todo://state", target: "todo://ready" },
105
+ stateCheck: { predicate: 'todo://state', target: 'todo://ready' }
133
106
  });
134
107
  original.addState({
135
- name: "done",
108
+ name: 'done',
136
109
  value: 1,
137
- stateCheck: { predicate: "todo://state", target: "todo://done" },
110
+ stateCheck: { predicate: 'todo://state', target: 'todo://done' }
138
111
  });
139
112
  original.addTransition({
140
- actionName: "Complete",
141
- fromState: "ready",
142
- toState: "done",
143
- actions: [
144
- {
145
- action: "addLink",
146
- source: "this",
147
- predicate: "todo://state",
148
- target: "todo://done",
149
- },
150
- ],
113
+ actionName: 'Complete',
114
+ fromState: 'ready',
115
+ toState: 'done',
116
+ actions: [{ action: 'addLink', source: 'this', predicate: 'todo://state', target: 'todo://done' }]
151
117
  });
152
118
  const links = original.toLinks();
153
- const reconstructed = SHACLFlow.fromLinks(links, "todo://TODOFlow");
154
- expect(reconstructed.name).toBe("TODO");
155
- expect(reconstructed.namespace).toBe("todo://");
156
- expect(reconstructed.flowable).toBe("any");
119
+ const reconstructed = SHACLFlow.fromLinks(links, 'todo://TODOFlow');
120
+ expect(reconstructed.name).toBe('TODO');
121
+ expect(reconstructed.namespace).toBe('todo://');
122
+ expect(reconstructed.flowable).toBe('any');
157
123
  expect(reconstructed.startAction.length).toBe(1);
158
124
  expect(reconstructed.states.length).toBe(2);
159
125
  expect(reconstructed.transitions.length).toBe(1);
160
- expect(reconstructed.transitions[0].actionName).toBe("Complete");
126
+ expect(reconstructed.transitions[0].actionName).toBe('Complete');
161
127
  });
162
128
  });
163
- describe("JSON serialization", () => {
164
- it("converts to and from JSON", () => {
165
- const original = new SHACLFlow("TODO", "todo://");
129
+ describe('JSON serialization', () => {
130
+ it('converts to and from JSON', () => {
131
+ const original = new SHACLFlow('TODO', 'todo://');
166
132
  original.addState({
167
- name: "ready",
133
+ name: 'ready',
168
134
  value: 0,
169
- stateCheck: { predicate: "todo://state", target: "todo://ready" },
135
+ stateCheck: { predicate: 'todo://state', target: 'todo://ready' }
170
136
  });
171
137
  original.addTransition({
172
- actionName: "Start",
173
- fromState: "ready",
174
- toState: "doing",
175
- actions: [],
138
+ actionName: 'Start',
139
+ fromState: 'ready',
140
+ toState: 'doing',
141
+ actions: []
176
142
  });
177
143
  const json = original.toJSON();
178
144
  const reconstructed = SHACLFlow.fromJSON(json);
179
- expect(reconstructed.name).toBe("TODO");
145
+ expect(reconstructed.name).toBe('TODO');
180
146
  expect(reconstructed.states.length).toBe(1);
181
147
  expect(reconstructed.transitions.length).toBe(1);
182
148
  });
183
149
  });
184
- describe("full TODO example", () => {
185
- it("creates complete TODO flow matching Prolog example", () => {
186
- const flow = new SHACLFlow("TODO", "todo://");
187
- flow.flowable = "any";
150
+ describe('full TODO example', () => {
151
+ it('creates complete TODO flow matching Prolog example', () => {
152
+ const flow = new SHACLFlow('TODO', 'todo://');
153
+ flow.flowable = 'any';
188
154
  // Start action - renders expression as TODO in 'ready' state
189
155
  flow.startAction = [
190
- {
191
- action: "addLink",
192
- source: "this",
193
- predicate: "todo://state",
194
- target: "todo://ready",
195
- },
156
+ { action: 'addLink', source: 'this', predicate: 'todo://state', target: 'todo://ready' }
196
157
  ];
197
158
  // Three states
198
159
  flow.addState({
199
- name: "ready",
160
+ name: 'ready',
200
161
  value: 0,
201
- stateCheck: { predicate: "todo://state", target: "todo://ready" },
162
+ stateCheck: { predicate: 'todo://state', target: 'todo://ready' }
202
163
  });
203
164
  flow.addState({
204
- name: "doing",
165
+ name: 'doing',
205
166
  value: 0.5,
206
- stateCheck: { predicate: "todo://state", target: "todo://doing" },
167
+ stateCheck: { predicate: 'todo://state', target: 'todo://doing' }
207
168
  });
208
169
  flow.addState({
209
- name: "done",
170
+ name: 'done',
210
171
  value: 1,
211
- stateCheck: { predicate: "todo://state", target: "todo://done" },
172
+ stateCheck: { predicate: 'todo://state', target: 'todo://done' }
212
173
  });
213
174
  // Transitions
214
175
  flow.addTransition({
215
- actionName: "Start",
216
- fromState: "ready",
217
- toState: "doing",
176
+ actionName: 'Start',
177
+ fromState: 'ready',
178
+ toState: 'doing',
218
179
  actions: [
219
- {
220
- action: "addLink",
221
- source: "this",
222
- predicate: "todo://state",
223
- target: "todo://doing",
224
- },
225
- {
226
- action: "removeLink",
227
- source: "this",
228
- predicate: "todo://state",
229
- target: "todo://ready",
230
- },
231
- ],
180
+ { action: 'addLink', source: 'this', predicate: 'todo://state', target: 'todo://doing' },
181
+ { action: 'removeLink', source: 'this', predicate: 'todo://state', target: 'todo://ready' }
182
+ ]
232
183
  });
233
184
  flow.addTransition({
234
- actionName: "Finish",
235
- fromState: "doing",
236
- toState: "done",
185
+ actionName: 'Finish',
186
+ fromState: 'doing',
187
+ toState: 'done',
237
188
  actions: [
238
- {
239
- action: "addLink",
240
- source: "this",
241
- predicate: "todo://state",
242
- target: "todo://done",
243
- },
244
- {
245
- action: "removeLink",
246
- source: "this",
247
- predicate: "todo://state",
248
- target: "todo://doing",
249
- },
250
- ],
189
+ { action: 'addLink', source: 'this', predicate: 'todo://state', target: 'todo://done' },
190
+ { action: 'removeLink', source: 'this', predicate: 'todo://state', target: 'todo://doing' }
191
+ ]
251
192
  });
252
193
  // Verify structure
253
194
  expect(flow.states.length).toBe(3);
@@ -21,7 +21,7 @@ export interface SHACLPropertyShape {
21
21
  /** Expected datatype (e.g., xsd:string, xsd:integer) */
22
22
  datatype?: string;
23
23
  /** Node kind constraint (IRI, Literal, BlankNode) */
24
- nodeKind?: "IRI" | "Literal" | "BlankNode";
24
+ nodeKind?: 'IRI' | 'Literal' | 'BlankNode';
25
25
  /** Minimum cardinality (required if >= 1) */
26
26
  minCount?: number;
27
27
  /** Maximum cardinality (single-valued if 1, omit for collections) */
@@ -36,8 +36,8 @@ export interface SHACLPropertyShape {
36
36
  hasValue?: string;
37
37
  /** AD4M-specific: Local-only property */
38
38
  local?: boolean;
39
- /** AD4M-specific: Read-only property (no setter actions) */
40
- readOnly?: boolean;
39
+ /** AD4M-specific: Writable property */
40
+ writable?: boolean;
41
41
  /** AD4M-specific: Language to resolve property values through */
42
42
  resolveLanguage?: string;
43
43
  /** AD4M-specific: Setter action for this property */
@@ -46,8 +46,6 @@ export interface SHACLPropertyShape {
46
46
  adder?: AD4MAction[];
47
47
  /** AD4M-specific: Remover action for collection properties */
48
48
  remover?: AD4MAction[];
49
- /** AD4M-specific: Reverse path traversal — sh:inversePath instead of sh:path */
50
- inversePath?: boolean;
51
49
  }
52
50
  /**
53
51
  * SHACL Node Shape
@@ -60,16 +58,12 @@ export declare class SHACLShape {
60
58
  targetClass?: string;
61
59
  /** Property constraints */
62
60
  properties: SHACLPropertyShape[];
63
- /**
64
- * Parent shape URIs for SHACL inheritance (sh:node references).
65
- * When a model class extends another @Model-decorated class, the child shape
66
- * references the parent shape via sh:node rather than duplicating its properties.
67
- */
68
- parentShapes?: string[];
69
61
  /** AD4M-specific: Constructor actions for creating instances */
70
62
  constructor_actions?: AD4MAction[];
71
63
  /** AD4M-specific: Destructor actions for removing instances */
72
64
  destructor_actions?: AD4MAction[];
65
+ /** Parent shape URIs for model inheritance (sh:node references) */
66
+ parentShapes: string[];
73
67
  /**
74
68
  * Create a new SHACL Shape
75
69
  * @param targetClassOrShapeUri - If one argument: the target class (shape URI auto-derived as {class}Shape)
@@ -78,15 +72,16 @@ export declare class SHACLShape {
78
72
  */
79
73
  constructor(targetClassOrShapeUri: string, targetClass?: string);
80
74
  /**
81
- * Add a property constraint to this shape
75
+ * Add a parent shape reference (sh:node) for model inheritance.
76
+ * When a @Model class extends another @Model, the child shape
77
+ * references the parent shape so SHACL validators can walk the
78
+ * class hierarchy.
82
79
  */
83
- addProperty(prop: SHACLPropertyShape): void;
80
+ addParentShape(parentShapeUri: string): void;
84
81
  /**
85
- * Add a parent shape reference (sh:node) for SHACL inheritance.
86
- * The child shape will reference the parent shape instead of duplicating its properties.
87
- * @param parentShapeUri - URI of the parent SHACL shape
82
+ * Add a property constraint to this shape
88
83
  */
89
- addParentShape(parentShapeUri: string): void;
84
+ addProperty(prop: SHACLPropertyShape): void;
90
85
  /**
91
86
  * Set constructor actions for this shape
92
87
  */