@coasys/ad4m 0.11.2-dev.6 → 0.12.0-rc1-dev

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 (36) hide show
  1. package/lib/index.cjs +1737 -314
  2. package/lib/index.js +1736 -315
  3. package/lib/src/index.d.ts +2 -0
  4. package/lib/src/index.js +2 -0
  5. package/lib/src/model/Ad4mModel.js +17 -5
  6. package/lib/src/model/decorators.js +196 -6
  7. package/lib/src/model/util.d.ts +1 -1
  8. package/lib/src/model/util.js +15 -12
  9. package/lib/src/perspectives/PerspectiveClient.d.ts +11 -1
  10. package/lib/src/perspectives/PerspectiveClient.js +15 -4
  11. package/lib/src/perspectives/PerspectiveProxy.d.ts +124 -8
  12. package/lib/src/perspectives/PerspectiveProxy.js +573 -274
  13. package/lib/src/perspectives/PerspectiveResolver.d.ts +1 -1
  14. package/lib/src/perspectives/PerspectiveResolver.js +5 -4
  15. package/lib/src/schema.gql +1 -1
  16. package/lib/src/shacl/SHACLFlow.d.ts +171 -0
  17. package/lib/src/shacl/SHACLFlow.js +370 -0
  18. package/lib/src/shacl/SHACLFlow.test.d.ts +1 -0
  19. package/lib/src/shacl/SHACLFlow.test.js +205 -0
  20. package/lib/src/shacl/SHACLShape.d.ts +108 -0
  21. package/lib/src/shacl/SHACLShape.js +566 -0
  22. package/lib/src/shacl/SHACLShape.test.d.ts +1 -0
  23. package/lib/src/shacl/SHACLShape.test.js +336 -0
  24. package/lib/src/typeDefs.js +1 -1
  25. package/package.json +13 -8
  26. package/src/index.ts +2 -0
  27. package/src/model/Ad4mModel.ts +19 -5
  28. package/src/model/decorators.ts +221 -5
  29. package/src/model/util.ts +15 -12
  30. package/src/perspectives/PerspectiveClient.ts +15 -4
  31. package/src/perspectives/PerspectiveProxy.ts +588 -304
  32. package/src/perspectives/PerspectiveResolver.ts +1 -1
  33. package/src/shacl/SHACLFlow.test.ts +237 -0
  34. package/src/shacl/SHACLFlow.ts +503 -0
  35. package/src/shacl/SHACLShape.test.ts +400 -0
  36. package/src/shacl/SHACLShape.ts +755 -0
@@ -0,0 +1,336 @@
1
+ import { SHACLShape } from './SHACLShape';
2
+ describe('SHACLShape', () => {
3
+ describe('toLinks()', () => {
4
+ it('creates basic shape links', () => {
5
+ const shape = new SHACLShape('recipe://Recipe');
6
+ const links = shape.toLinks();
7
+ // Should have targetClass link
8
+ const targetClassLink = links.find(l => l.predicate === 'sh://targetClass');
9
+ expect(targetClassLink).toBeDefined();
10
+ expect(targetClassLink.source).toBe('recipe://RecipeShape');
11
+ expect(targetClassLink.target).toBe('recipe://Recipe');
12
+ });
13
+ it('creates property shape links with named URIs', () => {
14
+ const shape = new SHACLShape('recipe://Recipe');
15
+ const prop = {
16
+ name: 'name',
17
+ path: 'recipe://name',
18
+ datatype: 'xsd:string',
19
+ minCount: 1,
20
+ maxCount: 1,
21
+ };
22
+ shape.addProperty(prop);
23
+ const links = shape.toLinks();
24
+ // Property shape should use named URI
25
+ const propLink = links.find(l => l.predicate === 'sh://property');
26
+ expect(propLink).toBeDefined();
27
+ expect(propLink.target).toBe('recipe://Recipe.name'); // Named URI, not blank node
28
+ // Path link
29
+ const pathLink = links.find(l => l.source === 'recipe://Recipe.name' && l.predicate === 'sh://path');
30
+ expect(pathLink).toBeDefined();
31
+ expect(pathLink.target).toBe('recipe://name');
32
+ // Datatype link
33
+ const datatypeLink = links.find(l => l.source === 'recipe://Recipe.name' && l.predicate === 'sh://datatype');
34
+ expect(datatypeLink).toBeDefined();
35
+ expect(datatypeLink.target).toBe('xsd:string');
36
+ // Cardinality links
37
+ const minCountLink = links.find(l => l.source === 'recipe://Recipe.name' && l.predicate === 'sh://minCount');
38
+ expect(minCountLink).toBeDefined();
39
+ expect(minCountLink.target).toContain('1');
40
+ const maxCountLink = links.find(l => l.source === 'recipe://Recipe.name' && l.predicate === 'sh://maxCount');
41
+ expect(maxCountLink).toBeDefined();
42
+ expect(maxCountLink.target).toContain('1');
43
+ });
44
+ it('creates action links', () => {
45
+ const shape = new SHACLShape('recipe://Recipe');
46
+ const setterAction = {
47
+ action: 'addLink',
48
+ source: 'this',
49
+ predicate: 'recipe://name',
50
+ target: 'value',
51
+ };
52
+ const prop = {
53
+ name: 'title',
54
+ path: 'recipe://title',
55
+ setter: [setterAction],
56
+ };
57
+ shape.addProperty(prop);
58
+ const links = shape.toLinks();
59
+ // Setter action link
60
+ const setterLink = links.find(l => l.source === 'recipe://Recipe.title' && l.predicate === 'ad4m://setter');
61
+ expect(setterLink).toBeDefined();
62
+ expect(setterLink.target).toContain('addLink');
63
+ });
64
+ it('includes constructor and destructor actions', () => {
65
+ const shape = new SHACLShape('recipe://Recipe');
66
+ shape.constructor_actions = [{
67
+ action: 'addLink',
68
+ source: 'this',
69
+ predicate: 'ad4m://type',
70
+ target: 'recipe://Recipe',
71
+ }];
72
+ shape.destructor_actions = [{
73
+ action: 'removeLink',
74
+ source: 'this',
75
+ predicate: 'ad4m://type',
76
+ target: 'recipe://Recipe',
77
+ }];
78
+ const links = shape.toLinks();
79
+ const constructorLink = links.find(l => l.predicate === 'ad4m://constructor');
80
+ expect(constructorLink).toBeDefined();
81
+ expect(constructorLink.target).toContain('addLink');
82
+ const destructorLink = links.find(l => l.predicate === 'ad4m://destructor');
83
+ expect(destructorLink).toBeDefined();
84
+ expect(destructorLink.target).toContain('removeLink');
85
+ });
86
+ });
87
+ describe('fromLinks()', () => {
88
+ it('reconstructs shape from links', () => {
89
+ const originalShape = new SHACLShape('recipe://Recipe');
90
+ originalShape.addProperty({
91
+ name: 'name',
92
+ path: 'recipe://name',
93
+ datatype: 'xsd:string',
94
+ minCount: 1,
95
+ });
96
+ const links = originalShape.toLinks();
97
+ const reconstructed = SHACLShape.fromLinks(links, 'recipe://RecipeShape');
98
+ expect(reconstructed.targetClass).toBe('recipe://Recipe');
99
+ expect(reconstructed.properties.length).toBe(1);
100
+ expect(reconstructed.properties[0].path).toBe('recipe://name');
101
+ expect(reconstructed.properties[0].datatype).toBe('xsd:string');
102
+ expect(reconstructed.properties[0].minCount).toBe(1);
103
+ });
104
+ it('handles multiple properties', () => {
105
+ const originalShape = new SHACLShape('recipe://Recipe');
106
+ originalShape.addProperty({
107
+ name: 'name',
108
+ path: 'recipe://name',
109
+ datatype: 'xsd:string',
110
+ });
111
+ originalShape.addProperty({
112
+ name: 'servings',
113
+ path: 'recipe://servings',
114
+ datatype: 'xsd:integer',
115
+ });
116
+ const links = originalShape.toLinks();
117
+ const reconstructed = SHACLShape.fromLinks(links, 'recipe://RecipeShape');
118
+ expect(reconstructed.properties.length).toBe(2);
119
+ const nameProp = reconstructed.properties.find(p => p.path === 'recipe://name');
120
+ const servingsProp = reconstructed.properties.find(p => p.path === 'recipe://servings');
121
+ expect(nameProp).toBeDefined();
122
+ expect(servingsProp).toBeDefined();
123
+ expect(nameProp.datatype).toBe('xsd:string');
124
+ expect(servingsProp.datatype).toBe('xsd:integer');
125
+ });
126
+ it('reconstructs action arrays', () => {
127
+ const originalShape = new SHACLShape('recipe://Recipe');
128
+ const setterAction = {
129
+ action: 'addLink',
130
+ source: 'this',
131
+ predicate: 'recipe://name',
132
+ target: 'value',
133
+ };
134
+ originalShape.addProperty({
135
+ name: 'name',
136
+ path: 'recipe://name',
137
+ setter: [setterAction],
138
+ });
139
+ const links = originalShape.toLinks();
140
+ const reconstructed = SHACLShape.fromLinks(links, 'recipe://RecipeShape');
141
+ expect(reconstructed.properties[0].setter).toBeDefined();
142
+ expect(reconstructed.properties[0].setter.length).toBe(1);
143
+ expect(reconstructed.properties[0].setter[0].action).toBe('addLink');
144
+ });
145
+ });
146
+ describe('round-trip serialization', () => {
147
+ it('preserves all property attributes', () => {
148
+ const original = new SHACLShape('test://Model');
149
+ original.addProperty({
150
+ name: 'field',
151
+ path: 'test://field',
152
+ datatype: 'xsd:string',
153
+ nodeKind: 'Literal',
154
+ minCount: 0,
155
+ maxCount: 5,
156
+ pattern: '^[a-z]+$',
157
+ minInclusive: 10,
158
+ maxInclusive: 100,
159
+ hasValue: 'expectedValue',
160
+ resolveLanguage: 'test://language',
161
+ local: true,
162
+ writable: true,
163
+ setter: [{ action: 'addLink', source: 'this', predicate: 'test://field', target: 'value' }],
164
+ adder: [{ action: 'addLink', source: 'this', predicate: 'test://items', target: 'value' }],
165
+ remover: [{ action: 'removeLink', source: 'this', predicate: 'test://items', target: 'value' }],
166
+ });
167
+ const links = original.toLinks();
168
+ const reconstructed = SHACLShape.fromLinks(links, 'test://ModelShape');
169
+ const prop = reconstructed.properties[0];
170
+ expect(prop.path).toBe('test://field');
171
+ expect(prop.datatype).toBe('xsd:string');
172
+ expect(prop.nodeKind).toBe('Literal');
173
+ expect(prop.minCount).toBe(0);
174
+ expect(prop.maxCount).toBe(5);
175
+ expect(prop.pattern).toBe('^[a-z]+$');
176
+ expect(prop.minInclusive).toBe(10);
177
+ expect(prop.maxInclusive).toBe(100);
178
+ expect(prop.hasValue).toBe('expectedValue');
179
+ expect(prop.resolveLanguage).toBe('test://language');
180
+ expect(prop.local).toBe(true);
181
+ expect(prop.writable).toBe(true);
182
+ expect(prop.setter).toBeDefined();
183
+ expect(prop.adder).toBeDefined();
184
+ expect(prop.remover).toBeDefined();
185
+ });
186
+ it('preserves constructor and destructor actions', () => {
187
+ const original = new SHACLShape('test://Model');
188
+ original.constructor_actions = [
189
+ { action: 'addLink', source: 'this', predicate: 'rdf://type', target: 'test://Model' }
190
+ ];
191
+ original.destructor_actions = [
192
+ { action: 'removeLink', source: 'this', predicate: 'rdf://type', target: 'test://Model' }
193
+ ];
194
+ const links = original.toLinks();
195
+ const reconstructed = SHACLShape.fromLinks(links, 'test://ModelShape');
196
+ expect(reconstructed.constructor_actions).toBeDefined();
197
+ expect(reconstructed.constructor_actions.length).toBe(1);
198
+ expect(reconstructed.constructor_actions[0].action).toBe('addLink');
199
+ expect(reconstructed.destructor_actions).toBeDefined();
200
+ expect(reconstructed.destructor_actions.length).toBe(1);
201
+ expect(reconstructed.destructor_actions[0].action).toBe('removeLink');
202
+ });
203
+ });
204
+ describe('edge cases', () => {
205
+ it('handles empty shape', () => {
206
+ const shape = new SHACLShape('test://Empty');
207
+ const links = shape.toLinks();
208
+ expect(links.length).toBeGreaterThanOrEqual(1); // At least targetClass link
209
+ const reconstructed = SHACLShape.fromLinks(links, 'test://EmptyShape');
210
+ expect(reconstructed.targetClass).toBe('test://Empty');
211
+ expect(reconstructed.properties.length).toBe(0);
212
+ });
213
+ it('handles URI with hash fragment', () => {
214
+ const shape = new SHACLShape('https://example.com/vocab#Recipe');
215
+ const links = shape.toLinks();
216
+ const targetClassLink = links.find(l => l.predicate === 'sh://targetClass');
217
+ expect(targetClassLink.source).toBe('https://example.com/vocab#RecipeShape');
218
+ });
219
+ it('falls back to blank nodes when property has no name', () => {
220
+ const shape = new SHACLShape('test://Model');
221
+ shape.addProperty({
222
+ path: 'test://unnamed',
223
+ // No name property
224
+ });
225
+ const links = shape.toLinks();
226
+ const propLink = links.find(l => l.predicate === 'sh://property');
227
+ expect(propLink).toBeDefined();
228
+ // Should use blank node format when no name provided
229
+ expect(propLink.target).toMatch(/_:propShape\d+|test:\/\/Model\./);
230
+ });
231
+ });
232
+ describe('toJSON/fromJSON', () => {
233
+ it('serializes and deserializes basic shape', () => {
234
+ const original = new SHACLShape('recipe://Recipe');
235
+ original.addProperty({
236
+ name: 'name',
237
+ path: 'recipe://name',
238
+ datatype: 'xsd:string',
239
+ minCount: 1,
240
+ });
241
+ const json = original.toJSON();
242
+ const reconstructed = SHACLShape.fromJSON(json);
243
+ expect(reconstructed.targetClass).toBe('recipe://Recipe');
244
+ expect(reconstructed.properties.length).toBe(1);
245
+ expect(reconstructed.properties[0].name).toBe('name');
246
+ expect(reconstructed.properties[0].path).toBe('recipe://name');
247
+ expect(reconstructed.properties[0].datatype).toBe('xsd:string');
248
+ expect(reconstructed.properties[0].minCount).toBe(1);
249
+ });
250
+ it('preserves nodeShapeUri in round-trip', () => {
251
+ const original = new SHACLShape('custom://CustomShape', 'recipe://Recipe');
252
+ const json = original.toJSON();
253
+ const reconstructed = SHACLShape.fromJSON(json);
254
+ expect(reconstructed.nodeShapeUri).toBe('custom://CustomShape');
255
+ expect(reconstructed.targetClass).toBe('recipe://Recipe');
256
+ });
257
+ it('preserves minInclusive and maxInclusive', () => {
258
+ const original = new SHACLShape('test://Model');
259
+ original.addProperty({
260
+ name: 'rating',
261
+ path: 'test://rating',
262
+ datatype: 'xsd:integer',
263
+ minInclusive: 1,
264
+ maxInclusive: 5,
265
+ });
266
+ const json = original.toJSON();
267
+ const reconstructed = SHACLShape.fromJSON(json);
268
+ expect(reconstructed.properties[0].minInclusive).toBe(1);
269
+ expect(reconstructed.properties[0].maxInclusive).toBe(5);
270
+ });
271
+ it('preserves resolveLanguage', () => {
272
+ const original = new SHACLShape('test://Model');
273
+ original.addProperty({
274
+ name: 'content',
275
+ path: 'test://content',
276
+ resolveLanguage: 'literal',
277
+ });
278
+ const json = original.toJSON();
279
+ const reconstructed = SHACLShape.fromJSON(json);
280
+ expect(reconstructed.properties[0].resolveLanguage).toBe('literal');
281
+ });
282
+ it('preserves constructor and destructor actions', () => {
283
+ const original = new SHACLShape('test://Model');
284
+ original.constructor_actions = [
285
+ { action: 'addLink', source: 'this', predicate: 'rdf://type', target: 'test://Model' }
286
+ ];
287
+ original.destructor_actions = [
288
+ { action: 'removeLink', source: 'this', predicate: 'rdf://type', target: 'test://Model' }
289
+ ];
290
+ const json = original.toJSON();
291
+ const reconstructed = SHACLShape.fromJSON(json);
292
+ expect(reconstructed.constructor_actions).toEqual(original.constructor_actions);
293
+ expect(reconstructed.destructor_actions).toEqual(original.destructor_actions);
294
+ });
295
+ it('preserves all property attributes', () => {
296
+ const original = new SHACLShape('test://Model');
297
+ original.addProperty({
298
+ name: 'field',
299
+ path: 'test://field',
300
+ datatype: 'xsd:string',
301
+ nodeKind: 'Literal',
302
+ minCount: 0,
303
+ maxCount: 5,
304
+ minInclusive: 0,
305
+ maxInclusive: 100,
306
+ pattern: '^[a-z]+$',
307
+ hasValue: 'default',
308
+ local: true,
309
+ writable: true,
310
+ resolveLanguage: 'literal',
311
+ setter: [{ action: 'addLink', source: 'this', predicate: 'test://field', target: 'value' }],
312
+ adder: [{ action: 'addLink', source: 'this', predicate: 'test://items', target: 'value' }],
313
+ remover: [{ action: 'removeLink', source: 'this', predicate: 'test://items', target: 'value' }],
314
+ });
315
+ const json = original.toJSON();
316
+ const reconstructed = SHACLShape.fromJSON(json);
317
+ const prop = reconstructed.properties[0];
318
+ expect(prop.name).toBe('field');
319
+ expect(prop.path).toBe('test://field');
320
+ expect(prop.datatype).toBe('xsd:string');
321
+ expect(prop.nodeKind).toBe('Literal');
322
+ expect(prop.minCount).toBe(0);
323
+ expect(prop.maxCount).toBe(5);
324
+ expect(prop.minInclusive).toBe(0);
325
+ expect(prop.maxInclusive).toBe(100);
326
+ expect(prop.pattern).toBe('^[a-z]+$');
327
+ expect(prop.hasValue).toBe('default');
328
+ expect(prop.local).toBe(true);
329
+ expect(prop.writable).toBe(true);
330
+ expect(prop.resolveLanguage).toBe('literal');
331
+ expect(prop.setter).toEqual(original.properties[0].setter);
332
+ expect(prop.adder).toEqual(original.properties[0].adder);
333
+ expect(prop.remover).toEqual(original.properties[0].remover);
334
+ });
335
+ });
336
+ });
@@ -336,7 +336,7 @@ type Mutation {
336
336
  perspectiveAddLink(batchId: String, link: LinkInput!, status: String = "shared", uuid: String!): LinkExpression!
337
337
  perspectiveAddLinkExpression(batchId: String, link: LinkExpressionInput!, status: String = "shared", uuid: String!): LinkExpression!
338
338
  perspectiveAddLinks(batchId: String, links: [LinkInput!]!, status: String = "shared", uuid: String!): [LinkExpression!]!
339
- perspectiveAddSdna(name: String!, sdnaCode: String!, sdnaType: String!, uuid: String!): Boolean!
339
+ perspectiveAddSdna(name: String!, sdnaCode: String, sdnaType: String!, shaclJson: String, uuid: String!): Boolean!
340
340
  perspectiveCommitBatch(batchId: String!, uuid: String!): LinkExpressionMutations!
341
341
  perspectiveCreateBatch(uuid: String!): String!
342
342
  perspectiveCreateSubject(batchId: String, expressionAddress: String!, initialValues: String, subjectClass: String!, uuid: String!): Boolean!
package/package.json CHANGED
@@ -5,6 +5,12 @@
5
5
  "module": "lib/index.js",
6
6
  "types": "lib/src/index.d.ts",
7
7
  "type": "module",
8
+ "scripts": {
9
+ "build": "patch-package && tsc && pnpm run buildSchema && pnpm run bundle",
10
+ "buildSchema": "node --es-module-specifier-resolution=node lib/src/buildSchema.js",
11
+ "bundle": "rollup -c rollup.config.js",
12
+ "test": "jest --forceExit"
13
+ },
8
14
  "repository": {
9
15
  "type": "git",
10
16
  "url": "git+https://github.com/coasys/ad4m.git"
@@ -57,11 +63,10 @@
57
63
  "react-dom": "*"
58
64
  },
59
65
  "patchedDependencies": {},
60
- "version": "0.11.2-dev.6",
61
- "scripts": {
62
- "build": "patch-package && tsc && pnpm run buildSchema && pnpm run bundle",
63
- "buildSchema": "node --es-module-specifier-resolution=node lib/src/buildSchema.js",
64
- "bundle": "rollup -c rollup.config.js",
65
- "test": "jest --forceExit"
66
- }
67
- }
66
+ "pnpm": {
67
+ "patchedDependencies": {
68
+ "graphql@15.7.2": "patches/graphql@15.7.2.patch"
69
+ }
70
+ },
71
+ "version": "0.12.0-rc1-dev"
72
+ }
package/src/index.ts CHANGED
@@ -31,3 +31,5 @@ export * from "./ai/AIClient"
31
31
  export * from "./ai/Tasks"
32
32
  export * from "./runtime/RuntimeResolver"
33
33
  export * from './model/Ad4mModel'
34
+ export * from './shacl/SHACLShape'
35
+ export { SHACLFlow, FlowState, FlowTransition, LinkPattern, FlowableCondition } from './shacl/SHACLFlow'
@@ -1671,8 +1671,12 @@ WHERE ${whereConditions.join(' AND ')}
1671
1671
 
1672
1672
  // Only process if target has a value
1673
1673
  if (target !== undefined && target !== null && target !== '') {
1674
- // Check if we need to resolve a non-literal language expression
1675
- if (propMeta.resolveLanguage != undefined && propMeta.resolveLanguage !== 'literal' && typeof target === 'string') {
1674
+ // Check if we need to resolve a non-literal language expression.
1675
+ // resolveLanguage must be defined and not 'literal' to trigger expression resolution.
1676
+ // Also skip if the target itself is a literal:// URI — those are handled by the
1677
+ // literal-parsing branch below (avoids calling getExpression on empty literals like
1678
+ // "literal://string:" which would cause a deserialization error).
1679
+ if (propMeta.resolveLanguage != undefined && propMeta.resolveLanguage !== 'literal' && typeof target === 'string' && !target.startsWith('literal://')) {
1676
1680
  // For non-literal languages, resolve the expression via perspective.getExpression()
1677
1681
  // Note: Literals are already parsed by SurrealDB's fn::parse_literal()
1678
1682
  try {
@@ -1691,8 +1695,10 @@ WHERE ${whereConditions.join(' AND ')}
1691
1695
  console.warn("Falling back to raw value");
1692
1696
  convertedValue = target; // Fall back to raw value
1693
1697
  }
1694
- } else if (typeof target === 'string' && target.startsWith('literal://')) {
1695
- // Fallback: If we somehow got a literal URL that wasn't parsed by SurrealDB, parse it now
1698
+ } else if (propMeta.resolveLanguage === 'literal' && typeof target === 'string' && target.startsWith('literal://')) {
1699
+ // Only parse literal URIs when resolveLanguage is explicitly set to 'literal'.
1700
+ // Without this check, properties pointing to baseExpressions of other models
1701
+ // (which may be literal:// strings) would get unwrapped, breaking link URI validation.
1696
1702
  try {
1697
1703
  const parsed = Literal.fromUrl(target).get();
1698
1704
  if(parsed.data !== undefined) {
@@ -2236,6 +2242,11 @@ WHERE ${whereConditions.join(' AND ')}
2236
2242
  // Get resolve language from metadata (replaces Prolog query)
2237
2243
  let resolveLanguage = metadata.resolveLanguage;
2238
2244
 
2245
+ // Skip storing empty/null/undefined values to avoid invalid empty literals (e.g. literal://string:)
2246
+ if (value === undefined || value === null || value === "") {
2247
+ return;
2248
+ }
2249
+
2239
2250
  if (resolveLanguage) {
2240
2251
  value = await this.#perspective.createExpression(value, resolveLanguage);
2241
2252
  }
@@ -2355,9 +2366,12 @@ WHERE ${whereConditions.join(' AND ')}
2355
2366
  }
2356
2367
  }
2357
2368
 
2369
+ // Get the class name instead of passing the instance to avoid Prolog query generation
2370
+ const className = await this.perspective.stringOrTemplateObjectToSubjectClassName(this);
2371
+
2358
2372
  // Create the subject with the initial values
2359
2373
  await this.perspective.createSubject(
2360
- this,
2374
+ className,
2361
2375
  this.#baseExpression,
2362
2376
  initialValues,
2363
2377
  batchId