@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,194 +1,253 @@
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
- { action: 'addLink', source: 'this', predicate: 'todo://state', target: 'todo://done' },
47
- { action: 'removeLink', source: 'this', predicate: 'todo://state', target: 'todo://ready' }
48
- ]
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
+ ],
49
59
  });
50
60
  expect(flow.transitions.length).toBe(1);
51
- expect(flow.transitions[0].actionName).toBe('Complete');
61
+ expect(flow.transitions[0].actionName).toBe("Complete");
52
62
  expect(flow.transitions[0].actions.length).toBe(2);
53
63
  });
54
64
  });
55
- describe('toLinks()', () => {
56
- it('serializes flow to links', () => {
57
- const flow = new SHACLFlow('TODO', 'todo://');
58
- flow.flowable = 'any';
65
+ describe("toLinks()", () => {
66
+ it("serializes flow to links", () => {
67
+ const flow = new SHACLFlow("TODO", "todo://");
68
+ flow.flowable = "any";
59
69
  flow.startAction = [
60
- { action: 'addLink', source: 'this', predicate: 'todo://state', target: 'todo://ready' }
70
+ {
71
+ action: "addLink",
72
+ source: "this",
73
+ predicate: "todo://state",
74
+ target: "todo://ready",
75
+ },
61
76
  ];
62
77
  flow.addState({
63
- name: 'ready',
78
+ name: "ready",
64
79
  value: 0,
65
- stateCheck: { predicate: 'todo://state', target: 'todo://ready' }
80
+ stateCheck: { predicate: "todo://state", target: "todo://ready" },
66
81
  });
67
82
  flow.addTransition({
68
- actionName: 'Start',
69
- fromState: 'ready',
70
- toState: 'doing',
71
- actions: [{ action: 'addLink', source: 'this', predicate: 'todo://state', target: 'todo://doing' }]
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
+ ],
72
94
  });
73
95
  const links = flow.toLinks();
74
96
  // Check flow type link
75
- const typeLink = links.find(l => l.predicate === 'rdf://type' && l.target === 'ad4m://Flow');
97
+ const typeLink = links.find((l) => l.predicate === "rdf://type" && l.target === "ad4m://Flow");
76
98
  expect(typeLink).toBeDefined();
77
- expect(typeLink.source).toBe('todo://TODOFlow');
99
+ expect(typeLink.source).toBe("todo://TODOFlow");
78
100
  // Check flowable link
79
- const flowableLink = links.find(l => l.predicate === 'ad4m://flowable');
101
+ const flowableLink = links.find((l) => l.predicate === "ad4m://flowable");
80
102
  expect(flowableLink).toBeDefined();
81
- expect(flowableLink.target).toBe('ad4m://any');
103
+ expect(flowableLink.target).toBe("ad4m://any");
82
104
  // Check start action link
83
- const startActionLink = links.find(l => l.predicate === 'ad4m://startAction');
105
+ const startActionLink = links.find((l) => l.predicate === "ad4m://startAction");
84
106
  expect(startActionLink).toBeDefined();
85
- expect(startActionLink.target).toContain('addLink');
107
+ expect(startActionLink.target).toContain("addLink");
86
108
  // Check state link
87
- const stateLink = links.find(l => l.predicate === 'ad4m://hasState');
109
+ const stateLink = links.find((l) => l.predicate === "ad4m://hasState");
88
110
  expect(stateLink).toBeDefined();
89
- expect(stateLink.target).toBe('todo://TODO.ready');
111
+ expect(stateLink.target).toBe("todo://TODO.ready");
90
112
  // Check transition link
91
- const transitionLink = links.find(l => l.predicate === 'ad4m://hasTransition');
113
+ const transitionLink = links.find((l) => l.predicate === "ad4m://hasTransition");
92
114
  expect(transitionLink).toBeDefined();
93
115
  });
94
116
  });
95
- describe('fromLinks()', () => {
96
- it('reconstructs flow from links', () => {
97
- const original = new SHACLFlow('TODO', 'todo://');
98
- original.flowable = 'any';
117
+ describe("fromLinks()", () => {
118
+ it("reconstructs flow from links", () => {
119
+ const original = new SHACLFlow("TODO", "todo://");
120
+ original.flowable = "any";
99
121
  original.startAction = [
100
- { action: 'addLink', source: 'this', predicate: 'todo://state', target: 'todo://ready' }
122
+ {
123
+ action: "addLink",
124
+ source: "this",
125
+ predicate: "todo://state",
126
+ target: "todo://ready",
127
+ },
101
128
  ];
102
129
  original.addState({
103
- name: 'ready',
130
+ name: "ready",
104
131
  value: 0,
105
- stateCheck: { predicate: 'todo://state', target: 'todo://ready' }
132
+ stateCheck: { predicate: "todo://state", target: "todo://ready" },
106
133
  });
107
134
  original.addState({
108
- name: 'done',
135
+ name: "done",
109
136
  value: 1,
110
- stateCheck: { predicate: 'todo://state', target: 'todo://done' }
137
+ stateCheck: { predicate: "todo://state", target: "todo://done" },
111
138
  });
112
139
  original.addTransition({
113
- actionName: 'Complete',
114
- fromState: 'ready',
115
- toState: 'done',
116
- actions: [{ action: 'addLink', source: 'this', predicate: 'todo://state', target: 'todo://done' }]
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
+ ],
117
151
  });
118
152
  const links = original.toLinks();
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');
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");
123
157
  expect(reconstructed.startAction.length).toBe(1);
124
158
  expect(reconstructed.states.length).toBe(2);
125
159
  expect(reconstructed.transitions.length).toBe(1);
126
- expect(reconstructed.transitions[0].actionName).toBe('Complete');
160
+ expect(reconstructed.transitions[0].actionName).toBe("Complete");
127
161
  });
128
162
  });
129
- describe('JSON serialization', () => {
130
- it('converts to and from JSON', () => {
131
- const original = new SHACLFlow('TODO', 'todo://');
163
+ describe("JSON serialization", () => {
164
+ it("converts to and from JSON", () => {
165
+ const original = new SHACLFlow("TODO", "todo://");
132
166
  original.addState({
133
- name: 'ready',
167
+ name: "ready",
134
168
  value: 0,
135
- stateCheck: { predicate: 'todo://state', target: 'todo://ready' }
169
+ stateCheck: { predicate: "todo://state", target: "todo://ready" },
136
170
  });
137
171
  original.addTransition({
138
- actionName: 'Start',
139
- fromState: 'ready',
140
- toState: 'doing',
141
- actions: []
172
+ actionName: "Start",
173
+ fromState: "ready",
174
+ toState: "doing",
175
+ actions: [],
142
176
  });
143
177
  const json = original.toJSON();
144
178
  const reconstructed = SHACLFlow.fromJSON(json);
145
- expect(reconstructed.name).toBe('TODO');
179
+ expect(reconstructed.name).toBe("TODO");
146
180
  expect(reconstructed.states.length).toBe(1);
147
181
  expect(reconstructed.transitions.length).toBe(1);
148
182
  });
149
183
  });
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';
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";
154
188
  // Start action - renders expression as TODO in 'ready' state
155
189
  flow.startAction = [
156
- { action: 'addLink', source: 'this', predicate: 'todo://state', target: 'todo://ready' }
190
+ {
191
+ action: "addLink",
192
+ source: "this",
193
+ predicate: "todo://state",
194
+ target: "todo://ready",
195
+ },
157
196
  ];
158
197
  // Three states
159
198
  flow.addState({
160
- name: 'ready',
199
+ name: "ready",
161
200
  value: 0,
162
- stateCheck: { predicate: 'todo://state', target: 'todo://ready' }
201
+ stateCheck: { predicate: "todo://state", target: "todo://ready" },
163
202
  });
164
203
  flow.addState({
165
- name: 'doing',
204
+ name: "doing",
166
205
  value: 0.5,
167
- stateCheck: { predicate: 'todo://state', target: 'todo://doing' }
206
+ stateCheck: { predicate: "todo://state", target: "todo://doing" },
168
207
  });
169
208
  flow.addState({
170
- name: 'done',
209
+ name: "done",
171
210
  value: 1,
172
- stateCheck: { predicate: 'todo://state', target: 'todo://done' }
211
+ stateCheck: { predicate: "todo://state", target: "todo://done" },
173
212
  });
174
213
  // Transitions
175
214
  flow.addTransition({
176
- actionName: 'Start',
177
- fromState: 'ready',
178
- toState: 'doing',
215
+ actionName: "Start",
216
+ fromState: "ready",
217
+ toState: "doing",
179
218
  actions: [
180
- { action: 'addLink', source: 'this', predicate: 'todo://state', target: 'todo://doing' },
181
- { action: 'removeLink', source: 'this', predicate: 'todo://state', target: 'todo://ready' }
182
- ]
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
+ ],
183
232
  });
184
233
  flow.addTransition({
185
- actionName: 'Finish',
186
- fromState: 'doing',
187
- toState: 'done',
234
+ actionName: "Finish",
235
+ fromState: "doing",
236
+ toState: "done",
188
237
  actions: [
189
- { action: 'addLink', source: 'this', predicate: 'todo://state', target: 'todo://done' },
190
- { action: 'removeLink', source: 'this', predicate: 'todo://state', target: 'todo://doing' }
191
- ]
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
+ ],
192
251
  });
193
252
  // Verify structure
194
253
  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: Writable property */
40
- writable?: boolean;
39
+ /** AD4M-specific: Read-only property (no setter actions) */
40
+ readOnly?: 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,6 +46,8 @@ 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;
49
51
  }
50
52
  /**
51
53
  * SHACL Node Shape
@@ -58,6 +60,12 @@ export declare class SHACLShape {
58
60
  targetClass?: string;
59
61
  /** Property constraints */
60
62
  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[];
61
69
  /** AD4M-specific: Constructor actions for creating instances */
62
70
  constructor_actions?: AD4MAction[];
63
71
  /** AD4M-specific: Destructor actions for removing instances */
@@ -73,6 +81,12 @@ export declare class SHACLShape {
73
81
  * Add a property constraint to this shape
74
82
  */
75
83
  addProperty(prop: SHACLPropertyShape): void;
84
+ /**
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
88
+ */
89
+ addParentShape(parentShapeUri: string): void;
76
90
  /**
77
91
  * Set constructor actions for this shape
78
92
  */