@_linked/core 2.12.0 → 2.13.0-next.20260706164859

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 (246) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/lib/esm/queries/IRPipeline.d.ts +7 -1
  3. package/lib/esm/queries/IRPipeline.js +20 -6
  4. package/lib/esm/queries/IRPipeline.js.map +1 -1
  5. package/lib/esm/queries/queryDispatch.js +12 -2
  6. package/lib/esm/queries/queryDispatch.js.map +1 -1
  7. package/package.json +10 -13
  8. package/lib/cjs/collections/CoreSet.d.ts +0 -47
  9. package/lib/cjs/collections/CoreSet.js +0 -136
  10. package/lib/cjs/collections/CoreSet.js.map +0 -1
  11. package/lib/cjs/collections/ShapeSet.d.ts +0 -6
  12. package/lib/cjs/collections/ShapeSet.js +0 -20
  13. package/lib/cjs/collections/ShapeSet.js.map +0 -1
  14. package/lib/cjs/expressions/Expr.d.ts +0 -29
  15. package/lib/cjs/expressions/Expr.js +0 -80
  16. package/lib/cjs/expressions/Expr.js.map +0 -1
  17. package/lib/cjs/expressions/ExpressionMethods.d.ts +0 -85
  18. package/lib/cjs/expressions/ExpressionMethods.js +0 -3
  19. package/lib/cjs/expressions/ExpressionMethods.js.map +0 -1
  20. package/lib/cjs/expressions/ExpressionNode.d.ts +0 -144
  21. package/lib/cjs/expressions/ExpressionNode.js +0 -432
  22. package/lib/cjs/expressions/ExpressionNode.js.map +0 -1
  23. package/lib/cjs/index.d.ts +0 -29
  24. package/lib/cjs/index.js +0 -65
  25. package/lib/cjs/index.js.map +0 -1
  26. package/lib/cjs/interfaces/ICoreIterable.d.ts +0 -14
  27. package/lib/cjs/interfaces/ICoreIterable.js +0 -3
  28. package/lib/cjs/interfaces/ICoreIterable.js.map +0 -1
  29. package/lib/cjs/interfaces/IDataset.d.ts +0 -26
  30. package/lib/cjs/interfaces/IDataset.js +0 -3
  31. package/lib/cjs/interfaces/IDataset.js.map +0 -1
  32. package/lib/cjs/interfaces/IFileStore.d.ts +0 -16
  33. package/lib/cjs/interfaces/IFileStore.js +0 -3
  34. package/lib/cjs/interfaces/IFileStore.js.map +0 -1
  35. package/lib/cjs/ontologies/linked-core.d.ts +0 -15
  36. package/lib/cjs/ontologies/linked-core.js +0 -38
  37. package/lib/cjs/ontologies/linked-core.js.map +0 -1
  38. package/lib/cjs/ontologies/npm.d.ts +0 -6
  39. package/lib/cjs/ontologies/npm.js +0 -15
  40. package/lib/cjs/ontologies/npm.js.map +0 -1
  41. package/lib/cjs/ontologies/owl.d.ts +0 -14
  42. package/lib/cjs/ontologies/owl.js +0 -21
  43. package/lib/cjs/ontologies/owl.js.map +0 -1
  44. package/lib/cjs/ontologies/rdf.d.ts +0 -13
  45. package/lib/cjs/ontologies/rdf.js +0 -27
  46. package/lib/cjs/ontologies/rdf.js.map +0 -1
  47. package/lib/cjs/ontologies/rdfs.d.ts +0 -16
  48. package/lib/cjs/ontologies/rdfs.js +0 -33
  49. package/lib/cjs/ontologies/rdfs.js.map +0 -1
  50. package/lib/cjs/ontologies/shacl.d.ts +0 -103
  51. package/lib/cjs/ontologies/shacl.js +0 -152
  52. package/lib/cjs/ontologies/shacl.js.map +0 -1
  53. package/lib/cjs/ontologies/xsd.d.ts +0 -19
  54. package/lib/cjs/ontologies/xsd.js +0 -41
  55. package/lib/cjs/ontologies/xsd.js.map +0 -1
  56. package/lib/cjs/package.d.ts +0 -4
  57. package/lib/cjs/package.js +0 -6
  58. package/lib/cjs/package.js.map +0 -1
  59. package/lib/cjs/package.json +0 -9
  60. package/lib/cjs/paths/PropertyPathExpr.d.ts +0 -38
  61. package/lib/cjs/paths/PropertyPathExpr.js +0 -221
  62. package/lib/cjs/paths/PropertyPathExpr.js.map +0 -1
  63. package/lib/cjs/paths/normalizePropertyPath.d.ts +0 -23
  64. package/lib/cjs/paths/normalizePropertyPath.js +0 -75
  65. package/lib/cjs/paths/normalizePropertyPath.js.map +0 -1
  66. package/lib/cjs/paths/pathExprToSparql.d.ts +0 -14
  67. package/lib/cjs/paths/pathExprToSparql.js +0 -136
  68. package/lib/cjs/paths/pathExprToSparql.js.map +0 -1
  69. package/lib/cjs/queries/ContextRef.d.ts +0 -32
  70. package/lib/cjs/queries/ContextRef.js +0 -69
  71. package/lib/cjs/queries/ContextRef.js.map +0 -1
  72. package/lib/cjs/queries/CreateBuilder.d.ts +0 -59
  73. package/lib/cjs/queries/CreateBuilder.js +0 -138
  74. package/lib/cjs/queries/CreateBuilder.js.map +0 -1
  75. package/lib/cjs/queries/CreateQuery.d.ts +0 -20
  76. package/lib/cjs/queries/CreateQuery.js +0 -3
  77. package/lib/cjs/queries/CreateQuery.js.map +0 -1
  78. package/lib/cjs/queries/DeleteBuilder.d.ts +0 -56
  79. package/lib/cjs/queries/DeleteBuilder.js +0 -172
  80. package/lib/cjs/queries/DeleteBuilder.js.map +0 -1
  81. package/lib/cjs/queries/DeleteQuery.d.ts +0 -37
  82. package/lib/cjs/queries/DeleteQuery.js +0 -3
  83. package/lib/cjs/queries/DeleteQuery.js.map +0 -1
  84. package/lib/cjs/queries/DslJsonExpression.d.ts +0 -68
  85. package/lib/cjs/queries/DslJsonExpression.js +0 -427
  86. package/lib/cjs/queries/DslJsonExpression.js.map +0 -1
  87. package/lib/cjs/queries/FieldSet.d.ts +0 -310
  88. package/lib/cjs/queries/FieldSet.js +0 -802
  89. package/lib/cjs/queries/FieldSet.js.map +0 -1
  90. package/lib/cjs/queries/IRAliasScope.d.ts +0 -20
  91. package/lib/cjs/queries/IRAliasScope.js +0 -52
  92. package/lib/cjs/queries/IRAliasScope.js.map +0 -1
  93. package/lib/cjs/queries/IRCanonicalize.d.ts +0 -19
  94. package/lib/cjs/queries/IRCanonicalize.js +0 -19
  95. package/lib/cjs/queries/IRCanonicalize.js.map +0 -1
  96. package/lib/cjs/queries/IRDesugar.d.ts +0 -123
  97. package/lib/cjs/queries/IRDesugar.js +0 -261
  98. package/lib/cjs/queries/IRDesugar.js.map +0 -1
  99. package/lib/cjs/queries/IRLower.d.ts +0 -25
  100. package/lib/cjs/queries/IRLower.js +0 -398
  101. package/lib/cjs/queries/IRLower.js.map +0 -1
  102. package/lib/cjs/queries/IRMutation.d.ts +0 -53
  103. package/lib/cjs/queries/IRMutation.js +0 -130
  104. package/lib/cjs/queries/IRMutation.js.map +0 -1
  105. package/lib/cjs/queries/IRPipeline.d.ts +0 -8
  106. package/lib/cjs/queries/IRPipeline.js +0 -25
  107. package/lib/cjs/queries/IRPipeline.js.map +0 -1
  108. package/lib/cjs/queries/IRProjection.d.ts +0 -39
  109. package/lib/cjs/queries/IRProjection.js +0 -105
  110. package/lib/cjs/queries/IRProjection.js.map +0 -1
  111. package/lib/cjs/queries/IntermediateRepresentation.d.ts +0 -282
  112. package/lib/cjs/queries/IntermediateRepresentation.js +0 -3
  113. package/lib/cjs/queries/IntermediateRepresentation.js.map +0 -1
  114. package/lib/cjs/queries/MutationQuery.d.ts +0 -50
  115. package/lib/cjs/queries/MutationQuery.js +0 -334
  116. package/lib/cjs/queries/MutationQuery.js.map +0 -1
  117. package/lib/cjs/queries/MutationSerialization.d.ts +0 -102
  118. package/lib/cjs/queries/MutationSerialization.js +0 -207
  119. package/lib/cjs/queries/MutationSerialization.js.map +0 -1
  120. package/lib/cjs/queries/MutationThenable.d.ts +0 -18
  121. package/lib/cjs/queries/MutationThenable.js +0 -32
  122. package/lib/cjs/queries/MutationThenable.js.map +0 -1
  123. package/lib/cjs/queries/PropertyPath.d.ts +0 -38
  124. package/lib/cjs/queries/PropertyPath.js +0 -82
  125. package/lib/cjs/queries/PropertyPath.js.map +0 -1
  126. package/lib/cjs/queries/ProxiedPathBuilder.d.ts +0 -14
  127. package/lib/cjs/queries/ProxiedPathBuilder.js +0 -29
  128. package/lib/cjs/queries/ProxiedPathBuilder.js.map +0 -1
  129. package/lib/cjs/queries/QueryBuilder.d.ts +0 -193
  130. package/lib/cjs/queries/QueryBuilder.js +0 -519
  131. package/lib/cjs/queries/QueryBuilder.js.map +0 -1
  132. package/lib/cjs/queries/QueryBuilderSerialization.d.ts +0 -31
  133. package/lib/cjs/queries/QueryBuilderSerialization.js +0 -68
  134. package/lib/cjs/queries/QueryBuilderSerialization.js.map +0 -1
  135. package/lib/cjs/queries/QueryContext.d.ts +0 -50
  136. package/lib/cjs/queries/QueryContext.js +0 -147
  137. package/lib/cjs/queries/QueryContext.js.map +0 -1
  138. package/lib/cjs/queries/QueryFactory.d.ts +0 -80
  139. package/lib/cjs/queries/QueryFactory.js +0 -21
  140. package/lib/cjs/queries/QueryFactory.js.map +0 -1
  141. package/lib/cjs/queries/SelectQuery.d.ts +0 -302
  142. package/lib/cjs/queries/SelectQuery.js +0 -761
  143. package/lib/cjs/queries/SelectQuery.js.map +0 -1
  144. package/lib/cjs/queries/UpdateBuilder.d.ts +0 -69
  145. package/lib/cjs/queries/UpdateBuilder.js +0 -199
  146. package/lib/cjs/queries/UpdateBuilder.js.map +0 -1
  147. package/lib/cjs/queries/UpdateQuery.d.ts +0 -18
  148. package/lib/cjs/queries/UpdateQuery.js +0 -3
  149. package/lib/cjs/queries/UpdateQuery.js.map +0 -1
  150. package/lib/cjs/queries/fromJSON.d.ts +0 -16
  151. package/lib/cjs/queries/fromJSON.js +0 -41
  152. package/lib/cjs/queries/fromJSON.js.map +0 -1
  153. package/lib/cjs/queries/lower.d.ts +0 -28
  154. package/lib/cjs/queries/lower.js +0 -114
  155. package/lib/cjs/queries/lower.js.map +0 -1
  156. package/lib/cjs/queries/lowerMutationJSON.d.ts +0 -25
  157. package/lib/cjs/queries/lowerMutationJSON.js +0 -173
  158. package/lib/cjs/queries/lowerMutationJSON.js.map +0 -1
  159. package/lib/cjs/queries/mutationLowerSpec.d.ts +0 -32
  160. package/lib/cjs/queries/mutationLowerSpec.js +0 -8
  161. package/lib/cjs/queries/mutationLowerSpec.js.map +0 -1
  162. package/lib/cjs/queries/queryDispatch.d.ts +0 -33
  163. package/lib/cjs/queries/queryDispatch.js +0 -33
  164. package/lib/cjs/queries/queryDispatch.js.map +0 -1
  165. package/lib/cjs/queries/resolveShape.d.ts +0 -10
  166. package/lib/cjs/queries/resolveShape.js +0 -23
  167. package/lib/cjs/queries/resolveShape.js.map +0 -1
  168. package/lib/cjs/queries/wireVersion.d.ts +0 -7
  169. package/lib/cjs/queries/wireVersion.js +0 -25
  170. package/lib/cjs/queries/wireVersion.js.map +0 -1
  171. package/lib/cjs/shapes/List.d.ts +0 -35
  172. package/lib/cjs/shapes/List.js +0 -72
  173. package/lib/cjs/shapes/List.js.map +0 -1
  174. package/lib/cjs/shapes/PathNode.d.ts +0 -20
  175. package/lib/cjs/shapes/PathNode.js +0 -68
  176. package/lib/cjs/shapes/PathNode.js.map +0 -1
  177. package/lib/cjs/shapes/SHACL.d.ts +0 -300
  178. package/lib/cjs/shapes/SHACL.js +0 -612
  179. package/lib/cjs/shapes/SHACL.js.map +0 -1
  180. package/lib/cjs/shapes/Shape.d.ts +0 -74
  181. package/lib/cjs/shapes/Shape.js +0 -124
  182. package/lib/cjs/shapes/Shape.js.map +0 -1
  183. package/lib/cjs/shapes/serializePathToNodeData.d.ts +0 -24
  184. package/lib/cjs/shapes/serializePathToNodeData.js +0 -67
  185. package/lib/cjs/shapes/serializePathToNodeData.js.map +0 -1
  186. package/lib/cjs/shapes/syncShapes.d.ts +0 -38
  187. package/lib/cjs/shapes/syncShapes.js +0 -214
  188. package/lib/cjs/shapes/syncShapes.js.map +0 -1
  189. package/lib/cjs/sparql/SparqlAlgebra.d.ts +0 -190
  190. package/lib/cjs/sparql/SparqlAlgebra.js +0 -4
  191. package/lib/cjs/sparql/SparqlAlgebra.js.map +0 -1
  192. package/lib/cjs/sparql/SparqlDataset.d.ts +0 -60
  193. package/lib/cjs/sparql/SparqlDataset.js +0 -117
  194. package/lib/cjs/sparql/SparqlDataset.js.map +0 -1
  195. package/lib/cjs/sparql/algebraToString.d.ts +0 -13
  196. package/lib/cjs/sparql/algebraToString.js +0 -385
  197. package/lib/cjs/sparql/algebraToString.js.map +0 -1
  198. package/lib/cjs/sparql/index.d.ts +0 -9
  199. package/lib/cjs/sparql/index.js +0 -41
  200. package/lib/cjs/sparql/index.js.map +0 -1
  201. package/lib/cjs/sparql/irToAlgebra.d.ts +0 -79
  202. package/lib/cjs/sparql/irToAlgebra.js +0 -2042
  203. package/lib/cjs/sparql/irToAlgebra.js.map +0 -1
  204. package/lib/cjs/sparql/resultMapping.d.ts +0 -36
  205. package/lib/cjs/sparql/resultMapping.js +0 -563
  206. package/lib/cjs/sparql/resultMapping.js.map +0 -1
  207. package/lib/cjs/sparql/sparqlUtils.d.ts +0 -53
  208. package/lib/cjs/sparql/sparqlUtils.js +0 -154
  209. package/lib/cjs/sparql/sparqlUtils.js.map +0 -1
  210. package/lib/cjs/utils/LinkedErrorLogging.d.ts +0 -13
  211. package/lib/cjs/utils/LinkedErrorLogging.js +0 -22
  212. package/lib/cjs/utils/LinkedErrorLogging.js.map +0 -1
  213. package/lib/cjs/utils/LinkedFileStorage.d.ts +0 -23
  214. package/lib/cjs/utils/LinkedFileStorage.js +0 -62
  215. package/lib/cjs/utils/LinkedFileStorage.js.map +0 -1
  216. package/lib/cjs/utils/LinkedStorage.d.ts +0 -40
  217. package/lib/cjs/utils/LinkedStorage.js +0 -148
  218. package/lib/cjs/utils/LinkedStorage.js.map +0 -1
  219. package/lib/cjs/utils/NameSpace.d.ts +0 -2
  220. package/lib/cjs/utils/NameSpace.js +0 -8
  221. package/lib/cjs/utils/NameSpace.js.map +0 -1
  222. package/lib/cjs/utils/NodeReference.d.ts +0 -30
  223. package/lib/cjs/utils/NodeReference.js +0 -54
  224. package/lib/cjs/utils/NodeReference.js.map +0 -1
  225. package/lib/cjs/utils/Package.d.ts +0 -153
  226. package/lib/cjs/utils/Package.js +0 -419
  227. package/lib/cjs/utils/Package.js.map +0 -1
  228. package/lib/cjs/utils/Prefix.d.ts +0 -22
  229. package/lib/cjs/utils/Prefix.js +0 -104
  230. package/lib/cjs/utils/Prefix.js.map +0 -1
  231. package/lib/cjs/utils/ShapeClass.d.ts +0 -30
  232. package/lib/cjs/utils/ShapeClass.js +0 -180
  233. package/lib/cjs/utils/ShapeClass.js.map +0 -1
  234. package/lib/cjs/utils/URI.d.ts +0 -18
  235. package/lib/cjs/utils/URI.js +0 -42
  236. package/lib/cjs/utils/URI.js.map +0 -1
  237. package/lib/cjs/utils/cached.d.ts +0 -14
  238. package/lib/cjs/utils/cached.js +0 -71
  239. package/lib/cjs/utils/cached.js.map +0 -1
  240. package/lib/cjs/utils/loadStores.d.ts +0 -34
  241. package/lib/cjs/utils/loadStores.js +0 -105
  242. package/lib/cjs/utils/loadStores.js.map +0 -1
  243. package/lib/cjs/utils/parseDatasetsConfig.d.ts +0 -49
  244. package/lib/cjs/utils/parseDatasetsConfig.js +0 -110
  245. package/lib/cjs/utils/parseDatasetsConfig.js.map +0 -1
  246. package/lib/esm/package.json +0 -9
@@ -1,74 +0,0 @@
1
- import type { NodeShape, PropertyShape } from './SHACL.js';
2
- import type { QueryBuildFn, QueryResponseToResultType, SelectAllQueryResponse, WhereClause } from '../queries/SelectQuery.js';
3
- import type { NodeReferenceValue, UpdatePartial } from '../queries/QueryFactory.js';
4
- import { QueryBuilder } from '../queries/QueryBuilder.js';
5
- import { CreateBuilder } from '../queries/CreateBuilder.js';
6
- import { UpdateBuilder } from '../queries/UpdateBuilder.js';
7
- import { DeleteBuilder, type DeleteId } from '../queries/DeleteBuilder.js';
8
- import type { ExpressionUpdateProxy, ExpressionUpdateResult } from '../expressions/ExpressionMethods.js';
9
- import { ShapeSet } from '../collections/ShapeSet.js';
10
- type AccessPropertiesShape<T extends Shape> = {
11
- [P in keyof T]: PropertyShape;
12
- };
13
- type PropertyShapeMapFunction<T extends Shape, ResponseType> = (p: AccessPropertiesShape<T>) => ResponseType;
14
- /**
15
- * Concrete constructor type for Shape subclasses — used at runtime boundaries
16
- * (Builder `from()` methods, Shape static `this` parameters, mutation factories).
17
- *
18
- * Uses concrete `new` (not `abstract new`), so TypeScript allows direct
19
- * instantiation (`new shape()`) and property access (`shape.shape`) without casts.
20
- */
21
- export type ShapeConstructor<S extends Shape = Shape> = (new (...args: any[]) => S) & {
22
- shape: NodeShape;
23
- targetClass?: NodeReferenceValue;
24
- };
25
- export declare abstract class Shape {
26
- static targetClass: NodeReferenceValue;
27
- static shape: NodeShape;
28
- static typesToShapes: Map<string, Set<typeof Shape>>;
29
- __queryContextId?: string;
30
- /** The query-context name this shape was registered under (for `{@ctx}` refs). */
31
- __queryContextName?: string;
32
- id?: string;
33
- constructor(node?: string | NodeReferenceValue);
34
- get nodeShape(): NodeShape;
35
- get uri(): string;
36
- set uri(value: string);
37
- /**
38
- * @internal
39
- * @param shapeClass
40
- * @param type
41
- */
42
- static registerByType(shapeClass: typeof Shape, type?: NodeReferenceValue): void;
43
- /**
44
- * Select properties of instances of this shape.
45
- * Chain `.for(id)` to target a single entity, or `.forAll(ids)` for multiple.
46
- * The select callback receives a proxy of the shape for type-safe property access.
47
- */
48
- static select<S extends Shape, R = unknown, ResultType = QueryResponseToResultType<R, S>[]>(this: ShapeConstructor<S>, selectFn: QueryBuildFn<S, R>): QueryBuilder<S, R, ResultType>;
49
- static select<S extends Shape, R = unknown, ResultType = QueryResponseToResultType<R, S>[]>(this: ShapeConstructor<S>): QueryBuilder<S, R, ResultType>;
50
- /**
51
- * Select all decorated properties of this shape.
52
- * Chain `.for(id)` to target a single entity.
53
- */
54
- static selectAll<S extends Shape, ResultType = QueryResponseToResultType<SelectAllQueryResponse<S>, S>[]>(this: ShapeConstructor<S>): QueryBuilder<S, any, ResultType>;
55
- /**
56
- * Update properties of an instance of this shape.
57
- * Chain `.for(id)` to target a specific entity.
58
- *
59
- * ```typescript
60
- * await Person.update({name: 'Alice'}).for({id: '...'});
61
- * ```
62
- */
63
- static update<S extends Shape>(this: ShapeConstructor<S>, data: (p: ExpressionUpdateProxy<S>) => ExpressionUpdateResult<S>): UpdateBuilder<S, any>;
64
- static update<S extends Shape, U extends UpdatePartial<S>>(this: ShapeConstructor<S>, data: U): UpdateBuilder<S, U>;
65
- static create<S extends Shape, U extends UpdatePartial<S>>(this: ShapeConstructor<S>, updateObjectOrFn?: U): CreateBuilder<S, U>;
66
- static delete<S extends Shape>(this: ShapeConstructor<S>, id: DeleteId | DeleteId[] | NodeReferenceValue[]): DeleteBuilder<S>;
67
- /** Delete all instances of this shape type. Returns void. */
68
- static deleteAll<S extends Shape>(this: ShapeConstructor<S>): DeleteBuilder<S, void>;
69
- /** Delete instances matching a condition. Sugar for `.delete().where(fn)`. Returns void. */
70
- static deleteWhere<S extends Shape>(this: ShapeConstructor<S>, fn: WhereClause<S>): DeleteBuilder<S, void>;
71
- static mapPropertyShapes<S extends Shape, ResponseType = unknown>(this: ShapeConstructor<S>, mapFunction?: PropertyShapeMapFunction<S, ResponseType>): ResponseType;
72
- static getSetOf<T extends Shape>(this: ShapeConstructor<T>, values: Iterable<T | NodeReferenceValue | string>): ShapeSet<T>;
73
- }
74
- export {};
@@ -1,124 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Shape = void 0;
4
- const QueryBuilder_js_1 = require("../queries/QueryBuilder.js");
5
- const CreateBuilder_js_1 = require("../queries/CreateBuilder.js");
6
- const UpdateBuilder_js_1 = require("../queries/UpdateBuilder.js");
7
- const DeleteBuilder_js_1 = require("../queries/DeleteBuilder.js");
8
- const ShapeClass_js_1 = require("../utils/ShapeClass.js");
9
- const ShapeSet_js_1 = require("../collections/ShapeSet.js");
10
- class Shape {
11
- constructor(node) {
12
- if (node) {
13
- this.id = typeof node === 'string' ? node : node.id;
14
- }
15
- }
16
- get nodeShape() {
17
- return this.constructor.shape;
18
- }
19
- get uri() {
20
- return this.id;
21
- }
22
- set uri(value) {
23
- this.id = value;
24
- }
25
- /**
26
- * @internal
27
- * @param shapeClass
28
- * @param type
29
- */
30
- static registerByType(shapeClass, type) {
31
- if (!type) {
32
- if (shapeClass === Shape) {
33
- return;
34
- }
35
- const shapeType = shapeClass.targetClass;
36
- if (shapeType) {
37
- type = shapeType;
38
- }
39
- }
40
- if (!type) {
41
- return;
42
- }
43
- const typeId = type.id;
44
- if (!this.typesToShapes.has(typeId)) {
45
- this.typesToShapes.set(typeId, new Set());
46
- }
47
- this.typesToShapes.get(typeId).add(shapeClass);
48
- }
49
- static select(selectFn) {
50
- let builder = QueryBuilder_js_1.QueryBuilder.from(this);
51
- if (selectFn) {
52
- builder = builder.select(selectFn);
53
- }
54
- return builder;
55
- }
56
- /**
57
- * Select all decorated properties of this shape.
58
- * Chain `.for(id)` to target a single entity.
59
- */
60
- static selectAll() {
61
- return QueryBuilder_js_1.QueryBuilder.from(this).selectAll();
62
- }
63
- static update(data) {
64
- return UpdateBuilder_js_1.UpdateBuilder.from(this).set(data);
65
- }
66
- static create(updateObjectOrFn) {
67
- let builder = CreateBuilder_js_1.CreateBuilder.from(this);
68
- if (updateObjectOrFn) {
69
- builder = builder.set(updateObjectOrFn);
70
- }
71
- return builder;
72
- }
73
- static delete(id) {
74
- return DeleteBuilder_js_1.DeleteBuilder.from(this, id);
75
- }
76
- /** Delete all instances of this shape type. Returns void. */
77
- static deleteAll() {
78
- return DeleteBuilder_js_1.DeleteBuilder.from(this).all();
79
- }
80
- /** Delete instances matching a condition. Sugar for `.delete().where(fn)`. Returns void. */
81
- static deleteWhere(fn) {
82
- return DeleteBuilder_js_1.DeleteBuilder.from(this).where(fn);
83
- }
84
- static mapPropertyShapes(mapFunction) {
85
- // SAFETY: dummyShape is used as a dynamic proxy target — we assign .proxy and
86
- // access arbitrary property names on it, which S doesn't declare.
87
- let dummyShape = new this();
88
- dummyShape.proxy = new Proxy(dummyShape, {
89
- get(target, key, receiver) {
90
- if (typeof key === 'string') {
91
- if (key in dummyShape) {
92
- if (typeof dummyShape[key] === 'function') {
93
- return target[key].bind(target);
94
- }
95
- let propertyShape = (0, ShapeClass_js_1.getPropertyShapeByLabel)(dummyShape.constructor, key.toString());
96
- if (propertyShape) {
97
- return propertyShape;
98
- }
99
- throw new Error(`${this.name}.${key.toString()} is missing a @linkedProperty decorator. This method can only access decorated get/set methods.`);
100
- }
101
- }
102
- },
103
- });
104
- return mapFunction(dummyShape.proxy);
105
- }
106
- static getSetOf(values) {
107
- const set = new ShapeSet_js_1.ShapeSet();
108
- for (const value of values) {
109
- if (value instanceof Shape) {
110
- set.add(value);
111
- }
112
- else {
113
- const instance = new this();
114
- instance.id = typeof value === 'string' ? value : value.id;
115
- set.add(instance);
116
- }
117
- }
118
- return set;
119
- }
120
- }
121
- exports.Shape = Shape;
122
- Shape.targetClass = null;
123
- Shape.typesToShapes = new Map();
124
- //# sourceMappingURL=Shape.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Shape.js","sourceRoot":"","sources":["../../../src/shapes/Shape.ts"],"names":[],"mappings":";;;AAcA,gEAAwD;AACxD,kEAA0D;AAC1D,kEAA0D;AAC1D,kEAAyE;AAEzE,0DAA+D;AAC/D,4DAAoD;AAwBpD,MAAsB,KAAK;IAUzB,YAAY,IAAkC;QAC5C,IAAI,IAAI,EAAE,CAAC;YACT,IAAI,CAAC,EAAE,GAAG,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;QACtD,CAAC;IACH,CAAC;IAED,IAAI,SAAS;QACX,OAAQ,IAAI,CAAC,WAA4B,CAAC,KAAK,CAAC;IAClD,CAAC;IAED,IAAI,GAAG;QACL,OAAO,IAAI,CAAC,EAAE,CAAC;IACjB,CAAC;IAED,IAAI,GAAG,CAAC,KAAa;QACnB,IAAI,CAAC,EAAE,GAAG,KAAK,CAAC;IAClB,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,cAAc,CAAC,UAAwB,EAAE,IAAyB;QACvE,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,IAAI,UAAU,KAAK,KAAK,EAAE,CAAC;gBACzB,OAAO;YACT,CAAC;YACD,MAAM,SAAS,GAAG,UAAU,CAAC,WAAW,CAAC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,KAAK,CAAC,CAAC;IACvC,CAAC;IAED,MAAM,CAAC,QAAQ,CAEb,MAAiD;QAEjD,MAAM,GAAG,GAAG,IAAI,sBAAQ,EAAK,CAAC;QAC9B,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;YAC3B,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;gBAC3B,GAAG,CAAC,GAAG,CAAC,KAAU,CAAC,CAAC;YACtB,CAAC;iBAAM,CAAC;gBACN,MAAM,QAAQ,GAAG,IAAI,IAAI,EAAE,CAAC;gBAC5B,QAAQ,CAAC,EAAE,GAAG,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC;gBAC3D,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;YACpB,CAAC;QACH,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC;;AA/MH,sBAgNC;AA/MQ,iBAAW,GAAuB,IAAI,CAAC;AAEvC,mBAAa,GAAmC,IAAI,GAAG,EAAE,CAAC"}
@@ -1,24 +0,0 @@
1
- import type { PathExpr } from '../paths/PropertyPathExpr.js';
2
- import type { NodeReferenceValue } from '../utils/NodeReference.js';
3
- import { List } from './List.js';
4
- import { PathNode } from './PathNode.js';
5
- /**
6
- * Node-data the create pipeline accepts for a `sh:path` value: an IRI reference (simple path),
7
- * an `rdf:List` (sequence / alternative members), or a `PathNode` operator node.
8
- */
9
- export type PathNodeData = NodeReferenceValue | {
10
- shape: typeof List | typeof PathNode;
11
- __id?: string;
12
- [k: string]: unknown;
13
- };
14
- /**
15
- * Translate a `PathExpr` into create-pipeline node-data for `sh:path`.
16
- *
17
- * - simple `PathRef` → `{id}` (a shared predicate IRI; NOT owned)
18
- * - sequence → an `rdf:List` of segments (via {@link rdfList})
19
- * - inverse / alternative / cardinality → a `PathNode` operator node (alt's operand is an `rdf:List`)
20
- *
21
- * `base` seeds deterministic ids for the minted owned nodes (`{base}/inv`, `{base}/seq/0`, …) so a
22
- * re-sync overwrites them in place; the owned subtree is cleaned by the containment cascade.
23
- */
24
- export declare function serializePathToNodeData(path: PathExpr, base: string): PathNodeData;
@@ -1,67 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.serializePathToNodeData = serializePathToNodeData;
4
- const PropertyPathExpr_js_1 = require("../paths/PropertyPathExpr.js");
5
- const List_js_1 = require("./List.js");
6
- const PathNode_js_1 = require("./PathNode.js");
7
- /**
8
- * Translate a `PathExpr` into create-pipeline node-data for `sh:path`.
9
- *
10
- * - simple `PathRef` → `{id}` (a shared predicate IRI; NOT owned)
11
- * - sequence → an `rdf:List` of segments (via {@link rdfList})
12
- * - inverse / alternative / cardinality → a `PathNode` operator node (alt's operand is an `rdf:List`)
13
- *
14
- * `base` seeds deterministic ids for the minted owned nodes (`{base}/inv`, `{base}/seq/0`, …) so a
15
- * re-sync overwrites them in place; the owned subtree is cleaned by the containment cascade.
16
- */
17
- function serializePathToNodeData(path, base) {
18
- const serialize = (e, b) => {
19
- if ((0, PropertyPathExpr_js_1.isPathRef)(e)) {
20
- return { id: typeof e === 'string' ? e : e.id };
21
- }
22
- if ('seq' in e) {
23
- // SHACL §2.3.1: a sequence path is a list with **at least two** members.
24
- // A 0/1-member sequence is not a list — collapse a singleton to its bare
25
- // member, reject an empty one. (normalizePropertyPath already collapses
26
- // these upstream; this keeps the serializer independently spec-correct.)
27
- if (e.seq.length === 0) {
28
- throw new Error('Cannot serialize an empty sequence path to SHACL sh:path.');
29
- }
30
- if (e.seq.length === 1)
31
- return serialize(e.seq[0], `${b}/seq/0`);
32
- return (0, List_js_1.rdfList)(e.seq.map((s, i) => serialize(s, `${b}/seq/${i}`)), { base: `${b}/seq` });
33
- }
34
- if ('inv' in e) {
35
- return { shape: PathNode_js_1.PathNode, __id: `${b}/inv`, inversePath: serialize(e.inv, `${b}/inv`) };
36
- }
37
- if ('alt' in e) {
38
- // SHACL §2.3.2: sh:alternativePath is a list with **at least two** members.
39
- // Collapse a singleton alternative to its bare member, reject an empty one.
40
- if (e.alt.length === 0) {
41
- throw new Error('Cannot serialize an empty alternative path to SHACL sh:path.');
42
- }
43
- if (e.alt.length === 1)
44
- return serialize(e.alt[0], `${b}/alt/0`);
45
- return {
46
- shape: PathNode_js_1.PathNode,
47
- __id: `${b}/alt`,
48
- alternativePath: (0, List_js_1.rdfList)(e.alt.map((a, i) => serialize(a, `${b}/alt/${i}`)), { base: `${b}/alt` }),
49
- };
50
- }
51
- if ('zeroOrMore' in e) {
52
- return { shape: PathNode_js_1.PathNode, __id: `${b}/zom`, zeroOrMorePath: serialize(e.zeroOrMore, `${b}/zom`) };
53
- }
54
- if ('oneOrMore' in e) {
55
- return { shape: PathNode_js_1.PathNode, __id: `${b}/oom`, oneOrMorePath: serialize(e.oneOrMore, `${b}/oom`) };
56
- }
57
- if ('zeroOrOne' in e) {
58
- return { shape: PathNode_js_1.PathNode, __id: `${b}/zoo`, zeroOrOnePath: serialize(e.zeroOrOne, `${b}/zoo`) };
59
- }
60
- if ('negatedPropertySet' in e) {
61
- throw new Error('negatedPropertySet cannot be serialized to SHACL sh:path — no SHACL representation.');
62
- }
63
- throw new Error(`Unknown PathExpr shape: ${JSON.stringify(e)}`);
64
- };
65
- return serialize(path, base);
66
- }
67
- //# sourceMappingURL=serializePathToNodeData.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"serializePathToNodeData.js","sourceRoot":"","sources":["../../../src/shapes/serializePathToNodeData.ts"],"names":[],"mappings":";;AA6BA,0DAuDC;AA9ED,sEAAuD;AAEvD,uCAAwC;AACxC,+CAAuC;AAUvC;;;;;;;;;GASG;AACH,SAAgB,uBAAuB,CAAC,IAAc,EAAE,IAAY;IAClE,MAAM,SAAS,GAAG,CAAC,CAAW,EAAE,CAAS,EAAgB,EAAE;QACzD,IAAI,IAAA,+BAAS,EAAC,CAAC,CAAC,EAAE,CAAC;YACjB,OAAO,EAAC,EAAE,EAAE,OAAO,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AAC,EAAE,CAAC,CAAC;IAClE,CAAC,CAAC;IACF,OAAO,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AAC/B,CAAC"}
@@ -1,38 +0,0 @@
1
- import { Shape } from './Shape.js';
2
- import type { IDataset } from '../interfaces/IDataset.js';
3
- /**
4
- * Plan an idempotent sync of all code-registered (non-framework) NodeShapes into the store as
5
- * SHACL data — the forward (code → graph) materialization of arch-05 "code is canonical".
6
- *
7
- * Returns built-but-unexecuted thunks; the caller controls execution and batching:
8
- * ```ts
9
- * await Promise.all((await syncShapes()).map((run) => run()));
10
- * ```
11
- * Each in-code shape's thunk runs `delete → create` in order (the delete cascade-cleans the old
12
- * property shapes / list / path subtrees via the containment cascade, the create rebuilds them).
13
- * Shapes present in the store but no longer in code are deleted as orphans (their owned subtree
14
- * cascades too). Reads existing shape IRIs for orphan detection.
15
- *
16
- * `ds` (optional) targets an explicit dataset instead of the global router. It is a **plan-time**
17
- * parameter: it feeds both the orphan-detection read (so orphans are computed against the same
18
- * store they'll be pruned from) and every delete/create thunk. Omitted → today's global behavior;
19
- * the returned thunks stay nullary either way.
20
- */
21
- export declare function syncShapes(ds?: IDataset): Promise<Array<() => Promise<void>>>;
22
- /**
23
- * Plan an idempotent sync of ONE code-registered NodeShape into the store as SHACL data.
24
- *
25
- * Scoped counterpart to {@link syncShapes}: materializes a single shape (delete → recreate, so the
26
- * delete cascade-cleans the old property-shape / list / path subtrees and the create rebuilds them)
27
- * and does NOT run the store-wide orphan sweep — other shapes in the store are untouched.
28
- *
29
- * @param target a shape class (e.g. `Person`) or its NodeShape IRI string. An IRI is resolved to
30
- * its registered class via `getShapeClass`; the shape must be code-registered.
31
- * @param ds optional explicit dataset to materialize into (a store or a router) — both the delete
32
- * and the create run against it instead of the global router. Omitted → global behavior.
33
- * @returns a single unexecuted thunk (consistent with {@link syncShapes}), so callers can batch
34
- * several together — e.g. a shape plus its referenced object-property shapes:
35
- * `await Promise.all([syncShape(Person), syncShape(Address)].map((run) => run()))`.
36
- * @throws if `target` is a framework/meta shape, is not registered, or has no `.shape`.
37
- */
38
- export declare function syncShape(target: typeof Shape | string, ds?: IDataset): () => Promise<void>;
@@ -1,214 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.syncShapes = syncShapes;
13
- exports.syncShape = syncShape;
14
- /*
15
- * This Source Code Form is subject to the terms of the Mozilla Public
16
- * License, v. 2.0. If a copy of the MPL was not distributed with this
17
- * file, You can obtain one at https://mozilla.org/MPL/2.0/.
18
- */
19
- const ShapeClass_js_1 = require("../utils/ShapeClass.js");
20
- const SHACL_js_1 = require("./SHACL.js");
21
- const DeleteBuilder_js_1 = require("../queries/DeleteBuilder.js");
22
- const List_js_1 = require("./List.js");
23
- const serializePathToNodeData_js_1 = require("./serializePathToNodeData.js");
24
- /**
25
- * The npm scope of framework shapes (NodeShape/PropertyShape/List/PathNode/Shape) that
26
- * describe the meta-model itself and must never be synced as user data.
27
- */
28
- const FRAMEWORK_PACKAGE = '@_linked/core';
29
- /** Build the create-pipeline data object for a single PropertyShape (flattened under shapeIri). */
30
- function buildPropertyShapeData(ps, shapeIri) {
31
- const psIri = `${shapeIri}/${ps.label}`;
32
- const d = {
33
- __id: psIri,
34
- path: (0, serializePathToNodeData_js_1.serializePathToNodeData)(ps.path, psIri),
35
- };
36
- if (ps.nodeKind)
37
- d.nodeKind = ps.nodeKind;
38
- if (ps.datatype)
39
- d.datatype = ps.datatype;
40
- if (typeof ps.minCount === 'number')
41
- d.minCount = ps.minCount;
42
- if (typeof ps.maxCount === 'number')
43
- d.maxCount = ps.maxCount;
44
- if (ps.name)
45
- d.name = ps.name;
46
- if (ps.description)
47
- d.description = ps.description;
48
- if (typeof ps.order === 'number')
49
- d.order = ps.order;
50
- if (ps.group)
51
- d.group = ps.group;
52
- if (ps.class)
53
- d.class = ps.class;
54
- if (ps.in)
55
- d.in = (0, List_js_1.rdfList)(ps.in, { base: `${psIri}/in` });
56
- if (ps.equalsConstraint)
57
- d.equals = ps.equalsConstraint;
58
- if (ps.disjoint)
59
- d.disjoint = ps.disjoint;
60
- if (ps.lessThan)
61
- d.lessThan = ps.lessThan;
62
- if (ps.lessThanOrEquals)
63
- d.lessThanOrEquals = ps.lessThanOrEquals;
64
- if (ps.minInclusive !== undefined)
65
- d.minInclusive = ps.minInclusive;
66
- if (ps.maxInclusive !== undefined)
67
- d.maxInclusive = ps.maxInclusive;
68
- if (ps.minExclusive !== undefined)
69
- d.minExclusive = ps.minExclusive;
70
- if (ps.maxExclusive !== undefined)
71
- d.maxExclusive = ps.maxExclusive;
72
- if (typeof ps.minLength === 'number')
73
- d.minLength = ps.minLength;
74
- if (typeof ps.maxLength === 'number')
75
- d.maxLength = ps.maxLength;
76
- // sh:pattern is serialized as its regex source string.
77
- if (ps.pattern)
78
- d.pattern = ps.pattern.source;
79
- if (ps.hasValueConstraint !== undefined)
80
- d.hasValue = ps.hasValueConstraint;
81
- if (ps.valueShape)
82
- d.valueShape = ps.valueShape;
83
- if (ps.contains)
84
- d.contains = true;
85
- return d;
86
- }
87
- /** Build the create-pipeline data object for a NodeShape and its (flattened) property shapes. */
88
- function buildNodeShapeData(nodeShape, shapeIri) {
89
- const d = {};
90
- if (nodeShape.targetClass)
91
- d.targetClass = nodeShape.targetClass;
92
- if (nodeShape.description)
93
- d.description = nodeShape.description;
94
- if (nodeShape.extends)
95
- d.extends = nodeShape.extends;
96
- if (nodeShape.dependent)
97
- d.dependent = true;
98
- if (nodeShape.closed !== undefined)
99
- d.closed = nodeShape.closed;
100
- if (nodeShape.ignoredProperties && nodeShape.ignoredProperties.length) {
101
- d.ignoredProperties = nodeShape.ignoredProperties;
102
- }
103
- // Flatten: emit own + inherited property shapes (deduped by label) under this shape.
104
- d.properties = nodeShape
105
- .getUniquePropertyShapes()
106
- .map((ps) => buildPropertyShapeData(ps, shapeIri));
107
- return d;
108
- }
109
- /**
110
- * The per-shape `delete → create` thunk shared by `syncShapes()` and `syncShape()`. The delete
111
- * cascade-cleans the shape's old property-shape / list / path subtrees; the create rebuilds them.
112
- *
113
- * `ds` (optional) targets an explicit dataset — both the delete and the create run against it
114
- * instead of the global router. Omitted → today's global behavior.
115
- */
116
- function buildSyncThunk(nodeShape, iri, ds) {
117
- return () => {
118
- // Build the data fresh on each invocation: the create pipeline mutates the node-data
119
- // (it strips nested `shape` keys), so a shared object can't be re-used across runs.
120
- const data = buildNodeShapeData(nodeShape, iri);
121
- return DeleteBuilder_js_1.DeleteBuilder.from(SHACL_js_1.NodeShape, { id: iri }).exec(ds)
122
- .then(() => SHACL_js_1.NodeShape.create(data).withId(iri).exec(ds))
123
- .then(() => undefined);
124
- };
125
- }
126
- /**
127
- * Plan an idempotent sync of all code-registered (non-framework) NodeShapes into the store as
128
- * SHACL data — the forward (code → graph) materialization of arch-05 "code is canonical".
129
- *
130
- * Returns built-but-unexecuted thunks; the caller controls execution and batching:
131
- * ```ts
132
- * await Promise.all((await syncShapes()).map((run) => run()));
133
- * ```
134
- * Each in-code shape's thunk runs `delete → create` in order (the delete cascade-cleans the old
135
- * property shapes / list / path subtrees via the containment cascade, the create rebuilds them).
136
- * Shapes present in the store but no longer in code are deleted as orphans (their owned subtree
137
- * cascades too). Reads existing shape IRIs for orphan detection.
138
- *
139
- * `ds` (optional) targets an explicit dataset instead of the global router. It is a **plan-time**
140
- * parameter: it feeds both the orphan-detection read (so orphans are computed against the same
141
- * store they'll be pruned from) and every delete/create thunk. Omitted → today's global behavior;
142
- * the returned thunks stay nullary either way.
143
- */
144
- function syncShapes(ds) {
145
- return __awaiter(this, void 0, void 0, function* () {
146
- // 1. Enumerate code-registered user shapes (exclude framework/meta shapes).
147
- const userShapes = [];
148
- for (const [iri, shapeClass] of (0, ShapeClass_js_1.getAllShapeClasses)()) {
149
- if (!(shapeClass === null || shapeClass === void 0 ? void 0 : shapeClass.shape))
150
- continue;
151
- const pkg = shapeClass.packageName;
152
- // Skip framework/meta shapes: the core package, and the base `Shape` which is registered
153
- // directly (no applyLinkedShape) and therefore carries no packageName.
154
- if (!pkg || pkg === FRAMEWORK_PACKAGE)
155
- continue;
156
- userShapes.push({ iri, nodeShape: shapeClass.shape });
157
- }
158
- const localShapeIris = new Set(userShapes.map((s) => s.iri));
159
- // 2. Identity-read existing NodeShape IRIs (ids only) for orphan detection. Must hit the same
160
- // `ds` the thunks target, or orphans get computed against the wrong store.
161
- const existingRows = (yield SHACL_js_1.NodeShape.select().exec(ds));
162
- const existingShapeIris = new Set(existingRows.map((r) => r.id));
163
- const thunks = [];
164
- // 3. Per in-code shape: delete (cascade) then recreate.
165
- for (const { iri, nodeShape } of userShapes) {
166
- thunks.push(buildSyncThunk(nodeShape, iri, ds));
167
- }
168
- // 4. Orphan shapes (in store, not in code) → delete (cascade cleans their owned subtree).
169
- for (const iri of existingShapeIris) {
170
- if (!localShapeIris.has(iri)) {
171
- thunks.push(() => DeleteBuilder_js_1.DeleteBuilder.from(SHACL_js_1.NodeShape, { id: iri }).exec(ds).then(() => undefined));
172
- }
173
- }
174
- return thunks;
175
- });
176
- }
177
- /**
178
- * Plan an idempotent sync of ONE code-registered NodeShape into the store as SHACL data.
179
- *
180
- * Scoped counterpart to {@link syncShapes}: materializes a single shape (delete → recreate, so the
181
- * delete cascade-cleans the old property-shape / list / path subtrees and the create rebuilds them)
182
- * and does NOT run the store-wide orphan sweep — other shapes in the store are untouched.
183
- *
184
- * @param target a shape class (e.g. `Person`) or its NodeShape IRI string. An IRI is resolved to
185
- * its registered class via `getShapeClass`; the shape must be code-registered.
186
- * @param ds optional explicit dataset to materialize into (a store or a router) — both the delete
187
- * and the create run against it instead of the global router. Omitted → global behavior.
188
- * @returns a single unexecuted thunk (consistent with {@link syncShapes}), so callers can batch
189
- * several together — e.g. a shape plus its referenced object-property shapes:
190
- * `await Promise.all([syncShape(Person), syncShape(Address)].map((run) => run()))`.
191
- * @throws if `target` is a framework/meta shape, is not registered, or has no `.shape`.
192
- */
193
- function syncShape(target, ds) {
194
- // Normalize target → its registered shape class.
195
- const cls = typeof target === 'string' ? (0, ShapeClass_js_1.getShapeClass)(target) : target;
196
- if (typeof target === 'string' && !cls) {
197
- throw new Error(`syncShape: no registered shape for IRI ${target}`);
198
- }
199
- const nodeShape = cls === null || cls === void 0 ? void 0 : cls.shape;
200
- if (!nodeShape) {
201
- throw new Error(typeof target === 'string'
202
- ? `syncShape: no registered shape for IRI ${target}`
203
- : `syncShape: shape class has no static .shape`);
204
- }
205
- const iri = nodeShape.id;
206
- // Never materialize a framework/meta shape as user data — same invariant syncShapes() enforces
207
- // by skipping (the base Shape carries no packageName).
208
- const pkg = cls.packageName;
209
- if (!pkg || pkg === FRAMEWORK_PACKAGE) {
210
- throw new Error(`syncShape: refusing to sync framework/meta shape ${iri}`);
211
- }
212
- return buildSyncThunk(nodeShape, iri, ds);
213
- }
214
- //# sourceMappingURL=syncShapes.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"syncShapes.js","sourceRoot":"","sources":["../../../src/shapes/syncShapes.ts"],"names":[],"mappings":";;;;;;;;;;;AAgHA,gCAuCC;AAkBD,8BAyBC;AAlMD;;;;GAIG;AACH,0DAAyE;AACzE,yCAAoD;AAEpD,kEAA0D;AAE1D,uCAAkC;AAClC,6EAAqE;AAErE;;;GAGG;AACH,MAAM,iBAAiB,GAAG,eAAe,CAAC;AAE1C,mGAAmG;AACnG,SAAS,sBAAsB,CAAC,EAAiB,EAAE,QAAgB;IACjE,MAAM,KAAK,GAAG,GA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