@_linked/core 2.22.7 → 2.22.9

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 (94) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/lib/esm/collections/CoreSet.js.map +1 -1
  3. package/lib/esm/collections/ShapeSet.js.map +1 -1
  4. package/lib/esm/expressions/Expr.js.map +1 -1
  5. package/lib/esm/expressions/ExpressionMethods.js.map +1 -1
  6. package/lib/esm/expressions/ExpressionNode.js +6 -1
  7. package/lib/esm/expressions/ExpressionNode.js.map +1 -1
  8. package/lib/esm/index.js.map +1 -1
  9. package/lib/esm/interfaces/ICoreIterable.js.map +1 -1
  10. package/lib/esm/interfaces/IDataset.js.map +1 -1
  11. package/lib/esm/interfaces/IFileStore.js.map +1 -1
  12. package/lib/esm/ontologies/linked-core.js.map +1 -1
  13. package/lib/esm/ontologies/npm.js.map +1 -1
  14. package/lib/esm/ontologies/owl.js.map +1 -1
  15. package/lib/esm/ontologies/rdf.js.map +1 -1
  16. package/lib/esm/ontologies/rdfs.js.map +1 -1
  17. package/lib/esm/ontologies/shacl.js.map +1 -1
  18. package/lib/esm/ontologies/xsd.js.map +1 -1
  19. package/lib/esm/package.js.map +1 -1
  20. package/lib/esm/paths/PropertyPathExpr.js.map +1 -1
  21. package/lib/esm/paths/normalizePropertyPath.js.map +1 -1
  22. package/lib/esm/paths/pathExprToSparql.js.map +1 -1
  23. package/lib/esm/queries/AskBuilder.js.map +1 -1
  24. package/lib/esm/queries/AskQuery.js.map +1 -1
  25. package/lib/esm/queries/ContextRef.js.map +1 -1
  26. package/lib/esm/queries/CountBuilder.js.map +1 -1
  27. package/lib/esm/queries/CountQuery.js.map +1 -1
  28. package/lib/esm/queries/CreateBuilder.js.map +1 -1
  29. package/lib/esm/queries/CreateQuery.js.map +1 -1
  30. package/lib/esm/queries/DeleteBuilder.js.map +1 -1
  31. package/lib/esm/queries/DeleteQuery.js.map +1 -1
  32. package/lib/esm/queries/DslJsonExpression.js.map +1 -1
  33. package/lib/esm/queries/FieldSet.js.map +1 -1
  34. package/lib/esm/queries/IRAliasScope.js.map +1 -1
  35. package/lib/esm/queries/IRCanonicalize.js.map +1 -1
  36. package/lib/esm/queries/IRDesugar.js.map +1 -1
  37. package/lib/esm/queries/IRLower.js.map +1 -1
  38. package/lib/esm/queries/IRMutation.js.map +1 -1
  39. package/lib/esm/queries/IRPipeline.js.map +1 -1
  40. package/lib/esm/queries/IRProjection.js.map +1 -1
  41. package/lib/esm/queries/IntermediateRepresentation.d.ts +6 -1
  42. package/lib/esm/queries/IntermediateRepresentation.js.map +1 -1
  43. package/lib/esm/queries/MutationQuery.js.map +1 -1
  44. package/lib/esm/queries/MutationSerialization.js.map +1 -1
  45. package/lib/esm/queries/MutationThenable.js.map +1 -1
  46. package/lib/esm/queries/PropertyPath.js.map +1 -1
  47. package/lib/esm/queries/ProxiedPathBuilder.js.map +1 -1
  48. package/lib/esm/queries/QueryBuilder.js.map +1 -1
  49. package/lib/esm/queries/QueryBuilderSerialization.js.map +1 -1
  50. package/lib/esm/queries/QueryContext.js.map +1 -1
  51. package/lib/esm/queries/QueryFactory.js.map +1 -1
  52. package/lib/esm/queries/SelectQuery.js.map +1 -1
  53. package/lib/esm/queries/UpdateBuilder.js.map +1 -1
  54. package/lib/esm/queries/UpdateQuery.js.map +1 -1
  55. package/lib/esm/queries/fromJSON.js.map +1 -1
  56. package/lib/esm/queries/lower.js.map +1 -1
  57. package/lib/esm/queries/lowerMutationJSON.js.map +1 -1
  58. package/lib/esm/queries/mutationLowerSpec.js.map +1 -1
  59. package/lib/esm/queries/queryDispatch.js.map +1 -1
  60. package/lib/esm/queries/reservedQueryNames.js.map +1 -1
  61. package/lib/esm/queries/resolveShape.js.map +1 -1
  62. package/lib/esm/queries/wireVersion.js.map +1 -1
  63. package/lib/esm/shapes/List.js.map +1 -1
  64. package/lib/esm/shapes/PathNode.js.map +1 -1
  65. package/lib/esm/shapes/SHACL.js.map +1 -1
  66. package/lib/esm/shapes/Shape.js.map +1 -1
  67. package/lib/esm/shapes/nodeShapeData.js.map +1 -1
  68. package/lib/esm/shapes/nodeShapeWire.js.map +1 -1
  69. package/lib/esm/shapes/propertyShapeTerms.js.map +1 -1
  70. package/lib/esm/shapes/registerRuntimeShape.js.map +1 -1
  71. package/lib/esm/shapes/serializePathToNodeData.js.map +1 -1
  72. package/lib/esm/shapes/syncShapes.js.map +1 -1
  73. package/lib/esm/shapes/validation.js.map +1 -1
  74. package/lib/esm/sparql/SparqlAlgebra.js.map +1 -1
  75. package/lib/esm/sparql/SparqlDataset.js.map +1 -1
  76. package/lib/esm/sparql/algebraToString.js.map +1 -1
  77. package/lib/esm/sparql/index.js.map +1 -1
  78. package/lib/esm/sparql/irToAlgebra.js +34 -5
  79. package/lib/esm/sparql/irToAlgebra.js.map +1 -1
  80. package/lib/esm/sparql/resultMapping.js.map +1 -1
  81. package/lib/esm/sparql/sparqlUtils.js.map +1 -1
  82. package/lib/esm/utils/LinkedErrorLogging.js.map +1 -1
  83. package/lib/esm/utils/LinkedFileStorage.js.map +1 -1
  84. package/lib/esm/utils/LinkedStorage.js.map +1 -1
  85. package/lib/esm/utils/NameSpace.js.map +1 -1
  86. package/lib/esm/utils/NodeReference.js.map +1 -1
  87. package/lib/esm/utils/Package.js.map +1 -1
  88. package/lib/esm/utils/Prefix.js.map +1 -1
  89. package/lib/esm/utils/ShapeClass.js.map +1 -1
  90. package/lib/esm/utils/URI.js.map +1 -1
  91. package/lib/esm/utils/cached.js.map +1 -1
  92. package/lib/esm/utils/loadStores.js.map +1 -1
  93. package/lib/esm/utils/parseDatasetsConfig.js.map +1 -1
  94. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"List.js","sourceRoot":"","sources":["../../../src/shapes/List.ts"],"names":[],"mappings":";;;;;;AAAA;;;;GAIG;AACH,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAC,KAAK,EAAC,MAAM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3C,IAAI,CAAC,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;YACtB,OAAO,EAAC,EAAE,EAAE,GAAG,CAAC,GAAG,CAAC,EAAE,EAAC,CAAC;QAC1B,CAAC;QACD,MAAM,IAAI,GAAoB;YAC5B,KAAK,EAAE,IAAI;YACX,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;YACf,IAAI,EAAE,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC;SACnB,CAAC;QACF,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;YACvB,IAAI,CAAC,IAAI,GAAG,GAAG,IAAI,IAAI,CAAC,EAAE,CAAC;QAC7B,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;IACF,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC","sourcesContent":["/*\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/.\n */\nimport {linkedShape} from '../package.js';\nimport {Shape} from './Shape.js';\nimport {linkedProperty, objectProperty} from './SHACL.js';\nimport {rdf} from '../ontologies/rdf.js';\n\n/**\n * SHACL/RDF ordered-list cell shape (`rdf:List`).\n *\n * A list is a chain of cells: `first` holds the value, `rest` points to the next cell\n * (or `rdf:nil`). The cell is `dependent` (it has no independent existence) and `rest` is\n * a `contains` edge, so deleting/replacing a list cascade-cleans the whole spine — while\n * `first` is NOT a `contains` edge, so the list's *contents* (shared IRIs/values) are kept.\n */\n@linkedShape({dependent: true})\nexport class List<T = unknown> extends Shape {\n static targetClass = rdf.List;\n\n @linkedProperty({path: rdf.first, maxCount: 1})\n get first(): T {\n return null;\n }\n\n @objectProperty({path: rdf.rest, maxCount: 1, shape: List, contains: true})\n get rest(): List<T> {\n return null;\n }\n}\n\n/**\n * Node-data for a single cell / the `rdf:nil` terminal. Accepted by the create pipeline.\n */\nexport type RdfListNodeData =\n | {id: string}\n | {shape: typeof List; first: unknown; rest: RdfListNodeData; __id?: string};\n\n/**\n * Build the nested `List` node-data chain for an ordered `rdf:List`, terminating at `rdf:nil`.\n * Pass `opts.base` to mint deterministic cell ids (`{base}/0`, `{base}/1`, …); otherwise the\n * create pipeline mints ids. The empty list serializes to `rdf:nil`.\n *\n * @example Playlist.create({ tracks: rdfList([t1, t2, t3]) })\n */\nexport function rdfList<T>(\n items: T[],\n opts?: {base?: string},\n): RdfListNodeData {\n const base = opts?.base;\n const build = (i: number): RdfListNodeData => {\n if (i >= items.length) {\n return {id: rdf.nil.id};\n }\n const cell: RdfListNodeData = {\n shape: List,\n first: items[i],\n rest: build(i + 1),\n };\n if (base !== undefined) {\n cell.__id = `${base}/${i}`;\n }\n return cell;\n };\n return build(0);\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"PathNode.js","sourceRoot":"","sources":["../../../src/shapes/PathNode.ts"],"names":[],"mappings":";;;;;;AAAA;;;;GAIG;AACH,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAC,KAAK,EAAC,MAAM,YAAY,CAAC;AACjC,OAAO,EAAC,cAAc,EAAC,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAC,KAAK,EAAC,MAAM,wBAAwB,CAAC;AAC7C,OAAO,EAAC,YAAY,EAAC,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAC,IAAI,EAAC,MAAM,WAAW,CAAC;AAE/B;;;;;;;;;GASG;AAEI,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,KAAK;IAIjC,IAAI,WAAW;QACb,OAAO,IAAI,CAAC;IACd,CAAC;IAGD,IAAI,eAAe;QACjB,OAAO,IAAI,CAAC;IACd,CAAC;IAGD,IAAI,cAAc;QAChB,OAAO,IAAI,CAAC;IACd,CAAC;IAGD,IAAI,aAAa;QACf,OAAO,IAAI,CAAC;IACd,CAAC;IAGD,IAAI,aAAa;QACf,OAAO,IAAI,CAAC;IACd,CAAC;;AAzBM,oBAAW,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AM,QAAQ,GAAd,MAAM,QAAS,SAAQ,KAAK;IAIjC,IAAI,WAAW;QACb,OAAO,IAAI,CAAC;IACd,CAAC;IAGD,IAAI,eAAe;QACjB,OAAO,IAAI,CAAC;IACd,CAAC;IAGD,IAAI,cAAc;QAChB,OAAO,IAAI,CAAC;IACd,CAAC;IAGD,IAAI,aAAa;QACf,OAAO,IAAI,CAAC;IACd,CAAC;IAGD,IAAI,aAAa;QACf,OAAO,IAAI,CAAC;IACd,CAAC;;AAzBM,oBAAW,GAAG,YAAY,CAAC,QAAQ,AAAxB,CAAyB;AAG3C;IADC,cAAc,CAAC,EAAC,IAAI,EAAE,KAAK,CAAC,WAAW,EAAE,QAAQ,EAAE,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC;2CAGtE;AAGD;IADC,cAAc,CAAC,EAAC,IAAI,EAAE,KAAK,CAAC,eAAe,EAAE,QAAQ,EAAE,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC;+CAGvF;AAGD;IADC,cAAc,CAAC,EAAC,IAAI,EAAE,KAAK,CAAC,cAAc,EAAE,QAAQ,EAAE,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC;8CAGzE;AAGD;IADC,cAAc,CAAC,EAAC,IAAI,EAAE,KAAK,CAAC,aAAa,EAAE,QAAQ,EAAE,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC;6CAGxE;AAGD;IADC,cAAc,CAAC,EAAC,IAAI,EAAE,KAAK,CAAC,aAAa,EAAE,QAAQ,EAAE,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC;6CAGxE;AA1BU,QAAQ;IADpB,WAAW,CAAC,EAAC,SAAS,EAAE,IAAI,EAAC,CAAC;GAClB,QAAQ,CA2BpB","sourcesContent":["/*\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/.\n */\nimport {linkedShape} from '../package.js';\nimport {Shape} from './Shape.js';\nimport {objectProperty} from './SHACL.js';\nimport {shacl} from '../ontologies/shacl.js';\nimport {coreOntology} from '../ontologies/linked-core.js';\nimport {List} from './List.js';\n\n/**\n * Operator node for SHACL property paths that are NOT a simple predicate or a sequence:\n * inverse (`sh:inversePath`), alternative (`sh:alternativePath` → an `rdf:List`), and the\n * cardinality forms (`sh:zeroOrMorePath`/`sh:oneOrMorePath`/`sh:zeroOrOnePath`).\n *\n * Each operator edge is `contains` (the operand subtree is owned), and the node itself is\n * `dependent`, so a property-shape's complex `sh:path` cascade-cleans on delete/replace.\n * Operands are polymorphic (a predicate IRI, a nested `PathNode`, or a `List`), so no fixed\n * `valueShape` is declared except for `alternativePath`, which is always an `rdf:List`.\n */\n@linkedShape({dependent: true})\nexport class PathNode extends Shape {\n static targetClass = coreOntology.PathNode;\n\n @objectProperty({path: shacl.inversePath, maxCount: 1, contains: true})\n get inversePath(): unknown {\n return null;\n }\n\n @objectProperty({path: shacl.alternativePath, maxCount: 1, shape: List, contains: true})\n get alternativePath(): List {\n return null;\n }\n\n @objectProperty({path: shacl.zeroOrMorePath, maxCount: 1, contains: true})\n get zeroOrMorePath(): unknown {\n return null;\n }\n\n @objectProperty({path: shacl.oneOrMorePath, maxCount: 1, contains: true})\n get oneOrMorePath(): unknown {\n return null;\n }\n\n @objectProperty({path: shacl.zeroOrOnePath, maxCount: 1, contains: true})\n get zeroOrOnePath(): unknown {\n return null;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"SHACL.js","sourceRoot":"","sources":["../../../src/shapes/SHACL.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAA0B,eAAe,EAAC,MAAM,2BAA2B,CAAC;AACnF,OAAO,EAAC,KAAK,EAAwB,MAAM,YAAY,CAAC;AACxD,OAAO,EAAC,KAAK,EAAC,MAAM,wBAAwB,CAAC;AAC7C,OAAO,EAAC,2BAA2B,EAAC,MA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,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC;QACzC,kBAAkB,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;IAC1C,CAAC;IACD,kBAAkB,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AACrD,CAAC,CAAC","sourcesContent":["/*\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/.\n */\nimport {type NodeReferenceValue, toNodeReference} from '../utils/NodeReference.js';\nimport {Shape, type ShapeConstructor} from './Shape.js';\nimport {shacl} from '../ontologies/shacl.js';\nimport {warnOnReservedPropertyLabel} from '../queries/reservedQueryNames.js';\nimport {getShapeClass} from '../utils/ShapeClass.js';\nimport type {PathExpr} from '../paths/PropertyPathExpr.js';\nimport {normalizePropertyPath, type PropertyPathDecoratorInput} from '../paths/normalizePropertyPath.js';\nimport {\n createPropertyShapeData,\n getPropertyShape as getPropertyShapeData,\n addPropertyShape as addPropertyShapeData,\n clonePropertyShape,\n type NodeShapeData,\n type PropertyShapeData,\n} from './nodeShapeData.js';\n\n// Metadata types now live in nodeShapeData.js (plain objects); re-exported here for\n// existing importers of `NodeShape`/`PropertyShape`-adjacent types.\nexport type {NodeShapeData, PropertyShapeData, PropertyShapeResult} from './nodeShapeData.js';\n// Metadata operations (formerly NodeShape/PropertyShape instance methods).\nexport {\n getPropertyShapes,\n getUniquePropertyShapes,\n getPropertyShape,\n addPropertyShape,\n clonePropertyShape,\n propertyShapeToResult,\n nodeShapeEquals,\n createNodeShapeData,\n createPropertyShapeData,\n} from './nodeShapeData.js';\n\n/**\n * Default identity root for shape & package IRIs. Public/first-party packages\n * publish under `linked.cm` (arch-02 §Domains). Packages may override per-package\n * via `linkedPackage(name, { baseUri })` — CN injects a workspace-scoped root\n * (`{workspaceSlug}.id.create.now`) for private packages; first-party packages\n * keep this default.\n */\nexport const LINKED_DATA_ROOT: string = 'https://linked.cm/';\n\n/**\n * Derive the public package slug — the npm package **basename** with the\n * `@scope/` dropped, kebab-cased (arch-02 §Slug rules: `^[a-z0-9]+(?:-[a-z0-9]+)*$`).\n * The package name is the single source of truth; there is no separate slug.\n * `@_linked/core` → `core`, `@linked.cm/blog` → `blog`, `mypkg` → `mypkg`.\n *\n * Both first-party (`@_linked`) and community (`@linked.cm`) packages publish into\n * the one `linked.cm/{shape,pkg}` space, so the basename must be globally unique —\n * enforced by the registry, which reserves the (handful of) first-party names.\n */\nexport function packageNameToSlug(packageName: string): string {\n return packageName\n .replace(/^@[^/]+\\//, '') // drop the npm scope (@scope/), keep the basename\n .replace(/[^a-zA-Z0-9]+/g, '-') // any run of non-alphanumerics → single hyphen\n .replace(/^-+|-+$/g, '') // trim stray hyphens\n .toLowerCase();\n}\n\n/**\n * Where each package publishes its IRIs (the identity root). The slug is always\n * derived from the package name; only the root is configurable — `linkedPackage`\n * defaults it to `LINKED_DATA_ROOT` (linked.cm), and CN injects a workspace-scoped\n * root (`{workspaceSlug}.id.create.now`) for private packages.\n */\nconst packageBaseUri = new Map<string, string>();\n\n/** Record a package's publish root. Called by `linkedPackage()`. */\nexport function setPackagePublishConfig(\n packageName: string,\n config?: {baseUri?: string},\n): void {\n packageBaseUri.set(packageName, config?.baseUri ?? LINKED_DATA_ROOT);\n}\n\n/** Resolve a package's publish root, defaulting to linked.cm if undeclared. */\nfunction resolveBaseUri(packageName: string): string {\n return packageBaseUri.get(packageName) ?? LINKED_DATA_ROOT;\n}\n\n/** Public/first-party package IRI — arch-02: `{baseUri}pkg/{slug}`. */\nexport function getPackageUri(packageName: string): string {\n return `${resolveBaseUri(packageName)}pkg/${packageNameToSlug(packageName)}`;\n}\n\ntype NodeKindConfig = NodeReferenceValue | NodeReferenceValue[];\n\nexport type PropertyPathInput = PropertyPathDecoratorInput;\nexport type PropertyPathInputList = PropertyPathDecoratorInput;\n\nconst normalizeNodeKind = (\n nodeKind?: NodeKindConfig,\n defaultNodeKind?: NodeReferenceValue,\n): NodeReferenceValue | undefined => {\n if (!nodeKind) {\n return defaultNodeKind;\n }\n if (Array.isArray(nodeKind)) {\n const ids = nodeKind.map((entry) => entry?.id);\n const includesBlank = ids.includes(shacl.BlankNode.id);\n const includesNamed = ids.includes(shacl.IRI.id);\n const includesLiteral = ids.includes(shacl.Literal.id);\n if (includesBlank && includesNamed) {\n return shacl.BlankNodeOrIRI;\n }\n if (includesLiteral && includesNamed) {\n return shacl.IRIOrLiteral;\n }\n if (includesLiteral && includesBlank) {\n return shacl.BlankNodeOrLiteral;\n }\n return nodeKind[0];\n }\n return nodeKind;\n};\n\nexport interface NodeShapeConfig {\n /**\n * Set to true to close the shape. This means any target node of this shape\n * that has properties outside the defined properties of this shape is invalid.\n */\n closed?: boolean;\n /**\n * Optional list of properties that are also permitted in addition to those explicitly listed by this shape.\n */\n ignoredProperties?: NodeReferenceValue[];\n}\n\nexport interface LiteralPropertyShapeConfig extends PropertyShapeConfig {\n nodeKind?: NodeReferenceValue;\n /**\n * Values of the configured property must be less than the values of this 'lessThan' property.\n * Value is always a property IRI (pair constraint).\n */\n lessThan?: NodeReferenceValue;\n /**\n * Values of the configured property must be less than or equal the values of this 'lessThanOrEquals' property.\n * Value is always a property IRI (pair constraint).\n */\n lessThanOrEquals?: NodeReferenceValue;\n /**\n * All values of this property must be higher than this number\n */\n minExclusive?: number | string;\n /**\n * All values of this property must be higher than or equal this number\n */\n minInclusive?: number;\n /**\n * All values of this property must be lower than this number\n */\n maxExclusive?: number;\n /**\n * All values of this property must be lower than or equal this number\n */\n maxInclusive?: number;\n /**\n * All literal values of this property must at least be this long\n */\n minLength?: number;\n /**\n * All literal values of this property must at most be this long\n */\n maxLength?: number;\n /**\n * All literal values of this property must match this regular expression\n */\n pattern?: RegExp;\n /**\n * All literal values of this property must have one of these languages as their language tag\n */\n languageIn?: string[];\n /**\n * No pair of values may use the same language tag.\n */\n uniqueLang?: boolean;\n /**\n * Each literal value of this property must use this datatype\n */\n datatype?: NodeReferenceValue;\n /**\n * Each value of the property must occur in this set.\n * Use {id: '...'} for IRI nodes, or plain strings/numbers/booleans for literal values.\n */\n in?: (NodeReferenceValue | string | number | boolean)[];\n}\n\nexport interface ObjectPropertyShapeConfig extends PropertyShapeConfig {\n nodeKind?: NodeReferenceValue;\n /**\n * Each value of this property must have this class as its rdf:type\n */\n class?: NodeReferenceValue;\n /**\n * The shape that values of this property path need to confirm to.\n * You need to provide a class that extends Shape.\n */\n shape?: typeof Shape | [string, string];\n /**\n * Marks this property as *containment* (composition): the value(s) are owned by the subject\n * and the delete/update cascade removes the owned subtree.\n */\n contains?: boolean;\n}\n\nexport interface PropertyShapeConfig {\n /**\n * The property path of this property shape.\n *\n * Four accepted forms, all equivalent where they overlap:\n *\n * - **An ontology term** — `documents.confidence`. The idiom for real shapes: it reuses the\n * ontology, so a namespace changes in one place. `createNameSpace` returns a `{id}` ref, so\n * the term IS the second form and is passed DIRECTLY — never `documents.confidence.id`,\n * which unwraps it back to a bare string.\n * - **A node reference** — `{id: 'https://example.org/vocab#startsAt'}`. What the first form\n * produces. Convenient in tests, or wherever an ontology module would be overkill.\n * - **A bare IRI or prefixed name** — `'https://example.org/vocab#startsAt'`, `'ex:startsAt'`.\n * - **A path expression** — `'ex:a/ex:b'`, `{seq: [...]}`, `{inv: ...}`, and the other\n * operators. An array is read as a sequence.\n *\n * A string is parsed as an expression only when it is not a bare absolute IRI: `ex:a/ex:b` is\n * a sequence, while the `/` inside `https://example.org/vocab#x` belongs to the IRI.\n */\n path: PropertyPathInputList;\n /**\n * Indicates that this property must exist.\n * Shorthand for minCount=1\n */\n required?: boolean;\n /**\n * Each value must be of this node type.\n */\n nodeKind?: NodeKindConfig;\n /**\n * Minimum number of values required\n */\n minCount?: number;\n /**\n * Maximum number of values allowed\n */\n maxCount?: number;\n /**\n * Values of the configured property must equal the values of this 'equals' property.\n * Value is always a property IRI (pair constraint).\n */\n equals?: NodeReferenceValue;\n /**\n * Values of the configured property must differ from the values of this 'disjoint' property.\n * Value is always a property IRI (pair constraint).\n */\n disjoint?: NodeReferenceValue;\n /**\n * At least one value of this property must equal the given value.\n * Use {id: '...'} for IRI nodes, or a plain string for literal values.\n */\n hasValue?: NodeReferenceValue | string | number | boolean;\n name?: string;\n description?: string;\n order?: number;\n group?: string;\n /**\n * Display importance, lower = more important (`linked_core:displayRank`).\n * A renderer that can show only N properties shows the N lowest ranks.\n */\n displayRank?: number;\n /** Omit this property from generic rendering (`linked_core:displayHidden`). */\n displayHidden?: boolean;\n /**\n * should correlate to the given datatype or class\n */\n defaultValue?: unknown;\n /**\n * Each value of the property must occur in this set.\n * Use {id: '...'} for IRI nodes, or plain strings for literal values.\n *\n * @example\n * in: ['ACTIVE', 'PENDING', 'CLOSED']\n * in: [{id: 'http://example.org/StatusA'}, {id: 'http://example.org/StatusB'}]\n */\n in?: (NodeReferenceValue | string | number | boolean)[];\n /**\n * Values of the configured property path are sorted by the values of this property path.\n */\n sortBy?: PropertyPathInputList;\n}\n\nconst EXPLICIT_NODE_KIND_SYMBOL = Symbol('explicitNodeKind');\nconst EXPLICIT_MIN_COUNT_SYMBOL = Symbol('explicitMinCount');\nconst EXPLICIT_MAX_COUNT_SYMBOL = Symbol('explicitMaxCount');\n\n/** Internal symbol-keyed flags on a PropertyShapeData object to track which fields were explicitly configured. */\ninterface ExplicitFlags {\n [EXPLICIT_NODE_KIND_SYMBOL]?: boolean;\n [EXPLICIT_MIN_COUNT_SYMBOL]?: boolean;\n [EXPLICIT_MAX_COUNT_SYMBOL]?: boolean;\n}\n\nexport interface ParameterConfig {\n optional?: number;\n}\n\n/**\n * Static-only DSL handle for the SHACL `sh:NodeShape` meta-shape.\n *\n * Never instantiated — a shape's metadata is a plain {@link NodeShapeData} object\n * (see nodeShapeData.js), and the instance methods that used to live here are now\n * free functions in that module. This class exists only to carry the meta-shape's\n * static `.shape` self-description and to serve as the DSL entry point for reading\n * and writing node-shape SHACL data (`NodeShape.create/select/delete`).\n */\nexport class NodeShape extends Shape {\n static targetClass = shacl.NodeShape;\n}\n\n/**\n * Static-only DSL handle for the SHACL `sh:PropertyShape` meta-shape.\n *\n * Never instantiated — property-shape metadata is a plain {@link PropertyShapeData}\n * object (see nodeShapeData.js). Exists only for its static `.shape` self-description\n * and as a DSL entry point (`PropertyShape.create/select`).\n */\nexport class PropertyShape extends Shape {\n static targetClass = shacl.PropertyShape;\n}\n\nconst connectValueShape = <\n Config extends LiteralPropertyShapeConfig | ObjectPropertyShapeConfig,\n>(\n config: Config,\n propertyKey: string,\n property: PropertyShapeData,\n) => {\n if ((config as ObjectPropertyShapeConfig).shape) {\n const shapeConfig = (config as ObjectPropertyShapeConfig).shape;\n\n if (Array.isArray(shapeConfig)) {\n const [packageName, shapeName] = shapeConfig;\n const nodeShapeUri = getNodeShapeUri(packageName, shapeName);\n property.valueShape = {id: nodeShapeUri};\n } else {\n const shapeClass = shapeConfig as typeof Shape;\n if (shapeClass.shape) {\n property.valueShape = {id: shapeClass.shape.id};\n } else {\n onShapeSetup(\n shapeConfig,\n (nodeShape: NodeShapeData) => {\n property.valueShape = {id: nodeShape.id};\n },\n propertyKey,\n );\n }\n }\n }\n};\n\n/**\n * The DSL-JSON where-clause combinators. A property may not be named after one,\n * because a condition key in those positions has no `{path}` escape (the key is a\n * bare string). See documentation/dsl-json.md (Reserved words).\n */\nconst RESERVED_PROPERTY_LABELS = new Set(['and', 'or', 'not']);\n\nexport function registerPropertyShape(\n shape: NodeShapeData,\n propertyShape: PropertyShapeData,\n) {\n if (RESERVED_PROPERTY_LABELS.has(propertyShape.label)) {\n throw new Error(\n `Property label '${propertyShape.label}' is reserved (a DSL-JSON boolean combinator) ` +\n `and cannot be used as a property name. See documentation/dsl-json.md (Reserved words).`,\n );\n }\n // Not fatal, but the author needs to hear it here rather than from the field tracer.\n warnOnReservedPropertyLabel(propertyShape.label, shape.label, shape.id);\n const inherited = getPropertyShapeData(shape, propertyShape.label, true);\n const existing = getPropertyShapeData(shape, propertyShape.label, false);\n if (!existing && inherited) {\n if (!(propertyShape as unknown as ExplicitFlags)[EXPLICIT_MIN_COUNT_SYMBOL]) {\n propertyShape.minCount = inherited.minCount;\n }\n if (!(propertyShape as unknown as ExplicitFlags)[EXPLICIT_MAX_COUNT_SYMBOL]) {\n propertyShape.maxCount = inherited.maxCount;\n }\n if (!(propertyShape as unknown as ExplicitFlags)[EXPLICIT_NODE_KIND_SYMBOL]) {\n propertyShape.nodeKind = inherited.nodeKind;\n }\n validateOverrideTightening(shape, inherited, propertyShape);\n }\n if (existing) {\n Object.assign(existing, propertyShape);\n return existing;\n }\n propertyShape.id = `${shape.id}/${propertyShape.label}`;\n addPropertyShapeData(shape, propertyShape);\n return propertyShape;\n}\n\nconst ATOMIC_NODE_KINDS = [\n shacl.BlankNode.id,\n shacl.IRI.id,\n shacl.Literal.id,\n];\n\nconst nodeKindToAtomics = (nodeKind?: NodeReferenceValue): Set<string> => {\n if (!nodeKind?.id) {\n return new Set();\n }\n switch (nodeKind.id) {\n case shacl.BlankNode.id:\n case shacl.IRI.id:\n case shacl.Literal.id:\n return new Set([nodeKind.id]);\n case shacl.BlankNodeOrIRI.id:\n return new Set([shacl.BlankNode.id, shacl.IRI.id]);\n case shacl.IRIOrLiteral.id:\n return new Set([shacl.IRI.id, shacl.Literal.id]);\n case shacl.BlankNodeOrLiteral.id:\n return new Set([shacl.BlankNode.id, shacl.Literal.id]);\n default:\n return new Set(ATOMIC_NODE_KINDS);\n }\n};\n\nconst throwOverrideError = (\n shape: NodeShapeData,\n propertyShape: PropertyShapeData,\n message: string,\n) => {\n throw new Error(\n `Invalid override for ${shape.label}.${propertyShape.label}: ${message}`,\n );\n};\n\nconst validateOverrideTightening = (\n shape: NodeShapeData,\n base: PropertyShapeData,\n override: PropertyShapeData,\n) => {\n if (\n typeof base.minCount === 'number' &&\n typeof override.minCount === 'number' &&\n override.minCount < base.minCount\n ) {\n throwOverrideError(\n shape,\n override,\n `minCount cannot be lowered (${base.minCount} -> ${override.minCount}).`,\n );\n }\n\n if (\n typeof base.maxCount === 'number' &&\n typeof override.maxCount === 'number' &&\n override.maxCount > base.maxCount\n ) {\n throwOverrideError(\n shape,\n override,\n `maxCount cannot be increased (${base.maxCount} -> ${override.maxCount}).`,\n );\n }\n\n if (base.nodeKind && override.nodeKind) {\n const baseKinds = nodeKindToAtomics(base.nodeKind);\n const overrideKinds = nodeKindToAtomics(override.nodeKind);\n const widensNodeKind = [...overrideKinds].some((kind) => !baseKinds.has(kind));\n if (widensNodeKind) {\n throwOverrideError(\n shape,\n override,\n `nodeKind cannot be widened (${base.nodeKind.id} -> ${override.nodeKind.id}).`,\n );\n }\n }\n};\n\nexport function createPropertyShape<\n Config extends LiteralPropertyShapeConfig | ObjectPropertyShapeConfig,\n>(\n config: Config,\n propertyKey: string,\n defaultNodeKind: NodeReferenceValue = null,\n shapeClass: typeof Shape | [string, string] = null,\n) {\n const propertyShape = createPropertyShapeData();\n propertyShape.path = normalizePropertyPath(config.path);\n propertyShape.label = propertyKey;\n\n if (config.name) {\n propertyShape.name = config.name;\n }\n if (config.description) {\n propertyShape.description = config.description;\n }\n\n if (config.required) {\n propertyShape.minCount = 1;\n } else if (config.minCount !== undefined) {\n propertyShape.minCount = config.minCount;\n }\n (propertyShape as unknown as ExplicitFlags)[EXPLICIT_MIN_COUNT_SYMBOL] =\n config.required === true || config.minCount !== undefined;\n\n if (config.maxCount !== undefined) {\n propertyShape.maxCount = config.maxCount;\n }\n (propertyShape as unknown as ExplicitFlags)[EXPLICIT_MAX_COUNT_SYMBOL] =\n config.maxCount !== undefined;\n if ((config as LiteralPropertyShapeConfig).datatype) {\n propertyShape.datatype = toNodeReference(\n (config as LiteralPropertyShapeConfig).datatype,\n );\n }\n\n if ((config as ObjectPropertyShapeConfig).class) {\n propertyShape.class = toNodeReference(\n (config as ObjectPropertyShapeConfig).class,\n );\n }\n\n if ((config as ObjectPropertyShapeConfig).contains) {\n propertyShape.contains = true;\n }\n\n if (config.equals) {\n propertyShape.equalsConstraint = toNodeReference(config.equals);\n }\n if (config.disjoint) {\n propertyShape.disjoint = toNodeReference(config.disjoint);\n }\n if ((config as LiteralPropertyShapeConfig).lessThan) {\n propertyShape.lessThan = toNodeReference((config as LiteralPropertyShapeConfig).lessThan);\n }\n if ((config as LiteralPropertyShapeConfig).lessThanOrEquals) {\n propertyShape.lessThanOrEquals = toNodeReference((config as LiteralPropertyShapeConfig).lessThanOrEquals);\n }\n // Value-range / string-length / pattern constraints (report 021 §3, G5). These are\n // recorded on the shape and serialized to SHACL; there is no DSL-side runtime\n // enforcement — they describe the shape for validators / introspection.\n {\n const lit = config as LiteralPropertyShapeConfig;\n if (lit.minInclusive !== undefined) propertyShape.minInclusive = lit.minInclusive;\n if (lit.maxInclusive !== undefined) propertyShape.maxInclusive = lit.maxInclusive;\n if (lit.minExclusive !== undefined) propertyShape.minExclusive = lit.minExclusive;\n if (lit.maxExclusive !== undefined) propertyShape.maxExclusive = lit.maxExclusive;\n if (lit.minLength !== undefined) propertyShape.minLength = lit.minLength;\n if (lit.maxLength !== undefined) propertyShape.maxLength = lit.maxLength;\n if (lit.pattern !== undefined) propertyShape.pattern = lit.pattern;\n }\n if (config.hasValue !== undefined) {\n const v = config.hasValue;\n propertyShape.hasValueConstraint = typeof v === 'object' && v !== null ? toNodeReference(v) : v;\n }\n if (config.defaultValue !== undefined) {\n propertyShape.defaultValue = config.defaultValue;\n }\n if (config.in) {\n propertyShape.in = config.in.map((entry) =>\n typeof entry === 'object' && entry !== null ? toNodeReference(entry) : entry,\n );\n }\n if (config.sortBy) {\n propertyShape.sortBy = normalizePropertyPath(config.sortBy);\n }\n // Arrangement + display metadata. `order` and `group` were declared on the config\n // but never copied onto the property shape, so a declared `sh:order` was silently\n // dropped and every renderer fell back to array position. Carried now, alongside\n // the two display terms.\n if (config.order !== undefined) propertyShape.order = config.order;\n if (config.group !== undefined) propertyShape.group = config.group;\n if (config.displayRank !== undefined) propertyShape.displayRank = config.displayRank;\n if (config.displayHidden !== undefined)\n propertyShape.displayHidden = config.displayHidden;\n\n propertyShape.nodeKind = normalizeNodeKind(config.nodeKind, defaultNodeKind);\n (propertyShape as unknown as ExplicitFlags)[EXPLICIT_NODE_KIND_SYMBOL] =\n config.nodeKind !== undefined;\n\n if (shapeClass) {\n onShapeSetup(shapeClass, (shape: NodeShapeData) => {\n connectValueShape(config, propertyKey, propertyShape);\n registerPropertyShape(shape, propertyShape);\n });\n }\n\n return propertyShape;\n}\n\nexport function onShapeSetup(\n shapeClass: typeof Shape | [string, string],\n callback: (shape: NodeShapeData) => void,\n propertyName?: string,\n waitForSuperShapes?: boolean,\n) {\n const cb = waitForSuperShapes\n ? (shape: NodeShapeData) => {\n const superClass = Object.getPrototypeOf(shapeClass) as typeof Shape;\n if (superClass.name === 'Shape') {\n callback(shape);\n return;\n }\n if (superClass.name === '') {\n console.error(\n `Shape ${shape.label} does not extend base class lincd/shapes/Shape. Make sure it extends Shape.`,\n );\n return;\n }\n onShapeSetup(\n superClass,\n () => {\n callback(shape);\n },\n propertyName,\n waitForSuperShapes,\n );\n }\n : callback;\n\n const safeCallback = (\n targetShapeClass: typeof Shape,\n innerCallback: (shape: NodeShapeData) => void,\n ) => {\n if (targetShapeClass.hasOwnProperty('shape')) {\n innerCallback((targetShapeClass as typeof Shape).shape);\n } else {\n if (!targetShapeClass['shapeCallbacks']) {\n targetShapeClass['shapeCallbacks'] = [];\n }\n targetShapeClass['shapeCallbacks'].push(innerCallback);\n }\n };\n\n if (Array.isArray(shapeClass)) {\n const [packageName, shapeName] = shapeClass;\n const nodeShapeId = getNodeShapeUri(packageName, shapeName);\n if (typeof document !== 'undefined') {\n window.addEventListener('load', () => {\n const resolved = getShapeClass(nodeShapeId);\n if (!resolved) {\n console.warn(\n `Could not find value shape (${packageName}/${shapeName}) for accessor get ${propertyName}(). Likely because it is not bundled.`,\n );\n return;\n }\n safeCallback(resolved as unknown as typeof Shape, cb);\n });\n } else {\n addNodeShapeCallback(nodeShapeId, cb);\n }\n } else {\n safeCallback(shapeClass, cb);\n }\n}\n\nconst _linkedProperty = <\n Config extends ObjectPropertyShapeConfig | LiteralPropertyShapeConfig,\n>(\n config: Config,\n defaultNodeKind: NodeReferenceValue = null,\n) => {\n return function (\n target: any,\n propertyKey: string,\n _descriptor: PropertyDescriptor,\n ) {\n createPropertyShape(config, propertyKey, defaultNodeKind, target.constructor);\n };\n};\n\nexport const literalProperty = (config: LiteralPropertyShapeConfig) => {\n return _linkedProperty<LiteralPropertyShapeConfig>(config, shacl.Literal);\n};\n\nexport const objectProperty = (config: ObjectPropertyShapeConfig) => {\n return _linkedProperty<ObjectPropertyShapeConfig>(config, shacl.IRI);\n};\n\nexport const linkedProperty = (\n config: ObjectPropertyShapeConfig | LiteralPropertyShapeConfig,\n) => {\n return _linkedProperty(config);\n};\n\nexport function disallowProperty(\n target: any,\n propertyKey: string,\n _descriptor: PropertyDescriptor,\n) {\n onShapeSetup(\n target.constructor,\n (shape: NodeShapeData) => {\n const superClass = Object.getPrototypeOf(target.constructor) as typeof Shape;\n const superNodeShape = superClass.shape;\n const superPropertyShape = getPropertyShapeData(\n superNodeShape,\n propertyKey,\n true,\n );\n if (!superPropertyShape) {\n console.warn(\n `Property ${propertyKey} not found in super class ${superClass.name} or any of its super classes. Does it have a property decorator? Cannot disallow property ${target.constructor.name}.${propertyKey}`,\n );\n return;\n }\n const clonedPropertyShape = clonePropertyShape(superPropertyShape);\n clonedPropertyShape.maxCount = 0;\n registerPropertyShape(shape, clonedPropertyShape);\n },\n '',\n true,\n );\n}\n\nexport function getNodeShapeUri(packageName: string, shapeName: string): string {\n // arch-02: `{baseUri}shape/{packageSlug}/{ShapeName}` — ShapeName kept PascalCase\n // (it is a class name, already URI-safe), packageSlug derived from the name.\n return `${resolveBaseUri(packageName)}shape/${packageNameToSlug(packageName)}/${shapeName}`;\n}\n\nconst nodeShapeCallbacks = new Map<string, ((shape: NodeShapeData) => void)[]>();\nexport function getAndClearCallbacks(\n nodeShapeId: string,\n): ((shape: NodeShapeData) => void)[] {\n const callbacks = nodeShapeCallbacks.get(nodeShapeId);\n nodeShapeCallbacks.delete(nodeShapeId);\n return callbacks;\n}\nexport const addNodeShapeCallback = (\n nodeShapeId: string,\n callback: (shape: NodeShapeData) => void,\n) => {\n if (!nodeShapeCallbacks.has(nodeShapeId)) {\n nodeShapeCallbacks.set(nodeShapeId, []);\n }\n nodeShapeCallbacks.get(nodeShapeId).push(callback);\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Shape.js","sourceRoot":"","sources":["../../../src/shapes/Shape.ts"],"names":[],"mappings":";;;;;;;;;AAcA,OAAO,EAAC,YAAY,EAAC,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAC,UAAU,EAAC,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAC,YAAY,EAAC,MAAM,4BAA4B,CAAC;AAGxD,OAAO,EAAC,aAAa,EAAC,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAC,aAAa,EAAC,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAC,aAAa,EAAgB,MAAM,6BAA6B,CAAC;AAEzE,OAAO,EAAC,uBAAuB,EAAC,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAC,QAAQ,EAAC,MAAM,4BAA4B,CAAC;AA2BpD;;;;;;;;GAQG;AACH,MAAM,UAAU,iBAAiB,CAC/B,UAA8C,EAC9C,EAAW;IAEX,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,SAAS,CAAM,CAAC;IACxD,IAAI,EAAE,KAAK,SAAS,EAAE,CAAC;QACrB,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC;IACjB,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,OAAgB,KAAK;IAUzB,0EAA0E;IAC1E,+EAA+E;IAC/E,2EAA2E;IAC3E,8EAA8E;IAC9E,gFAAgF;IAChF,0EAA0E;IAC1E,gFAAgF;IAChF,YAAY,IAA6B;Q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IACvC,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ,CAEb,MAAiD;QAEjD,MAAM,GAAG,GAAG,IAAI,QAAQ,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,iBAAiB,CAChC,IAAI,EACJ,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAC7C,CAAC;gBACF,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;YACpB,CAAC;QACH,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC;;AAtYM,iBAAW,GAAuB,IAAI,CAAC;AAEvC,mBAAa,GAAmC,IAAI,GAAG,EAAE,CAAC","sourcesContent":["/*\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/.\n */\nimport type {NodeShapeData, PropertyShapeData} from './nodeShapeData.js';\nimport type {\n QueryBuildFn,\n QueryResponseToResultType,\n SelectAllQueryResponse,\n WhereClause,\n} from '../queries/SelectQuery.js';\nimport type {NodeReferenceValue, UpdatePartial} from '../queries/QueryFactory.js';\nimport type {NodeId} from '../queries/MutationQuery.js';\nimport {QueryBuilder} from '../queries/QueryBuilder.js';\nimport {AskBuilder} from '../queries/AskBuilder.js';\nimport {CountBuilder} from '../queries/CountBuilder.js';\nimport type {PendingQueryContext} from '../queries/QueryContext.js';\nimport type {IDataset} from '../interfaces/IDataset.js';\nimport {CreateBuilder} from '../queries/CreateBuilder.js';\nimport {UpdateBuilder} from '../queries/UpdateBuilder.js';\nimport {DeleteBuilder, type DeleteId} from '../queries/DeleteBuilder.js';\nimport type {ExpressionUpdateProxy, ExpressionUpdateResult} from '../expressions/ExpressionMethods.js';\nimport {getPropertyShapeByLabel} from '../utils/ShapeClass.js';\nimport {ShapeSet} from '../collections/ShapeSet.js';\n\n//shape that returns property shapes for its keys\ntype AccessPropertiesShape<T extends Shape> = {\n [P in keyof T]: PropertyShapeData;\n};\ntype PropertyShapeMapFunction<T extends Shape, ResponseType> = (\n p: AccessPropertiesShape<T>,\n) => ResponseType;\n\n/**\n * Concrete constructor type for Shape subclasses — used at runtime boundaries\n * (Builder `from()` methods, Shape static `this` parameters, mutation factories).\n *\n * Uses concrete `new` (not `abstract new`) so TypeScript accepts the class as a\n * value and reads its static `.shape`/`.targetClass` without casts. NOTE: `new\n * shape()` is only a *type-level* capability — at runtime the `Shape` constructor\n * throws (shapes are metadata, not data). The framework builds proxy targets via\n * `createShapeTarget()` (Object.create), never `new`.\n */\nexport type ShapeConstructor<S extends Shape = Shape> = (new (\n ...args: any[]\n) => S) & {\n shape: NodeShapeData;\n targetClass?: NodeReferenceValue;\n};\n\n/**\n * @internal\n * Build a constructor-less, prototype-linked Shape used ONLY as a proxy /\n * metadata-carrier target inside the query DSL (never handed to consumers and\n * never persisted). It is a genuine `Shape` on the prototype chain — so\n * `.constructor`, the `nodeShape` getter, `ShapeSet`, and `getLeastSpecificShape`\n * all work — but it deliberately bypasses the `Shape` constructor, which is\n * guarded to reject direct instantiation. Not exported from the package index.\n */\nexport function createShapeTarget<S extends Shape>(\n shapeClass: ShapeConstructor<S> | typeof Shape,\n id?: string,\n): S {\n const target = Object.create(shapeClass.prototype) as S;\n if (id !== undefined) {\n target.id = id;\n }\n return target;\n}\n\nexport abstract class Shape {\n static targetClass: NodeReferenceValue = null;\n static shape: NodeShapeData;\n static typesToShapes: Map<string, Set<typeof Shape>> = new Map();\n\n __queryContextId?: string;\n /** The query-context name this shape was registered under (for `{@ctx}` refs). */\n __queryContextName?: string;\n id?: string;\n\n // Instantiation guard DEFERRED on the `lego-demo` branch (per René): some\n // framework shapes (e.g. server `LocalFileStore`) legitimately `extends Shape`\n // and are constructed as runtime service objects, which the upstream guard\n // (core report 026) rejects at backend boot. The `validate()`/`assertValid()`\n // work from the same dev merge is KEPT; only the constructor throw is relaxed —\n // restoring pre-guard behaviour: accept an optional node ref and set `id`\n // (mirrors `createShapeTarget`). Re-enable the guard once those shapes migrate.\n constructor(node?: string | {id?: string}) {\n if (node !== undefined) {\n this.id = typeof node === 'string' ? node : node.id;\n }\n }\n\n get nodeShape(): NodeShapeData {\n return (this.constructor as typeof Shape).shape;\n }\n\n get uri(): string {\n return this.id;\n }\n\n set uri(value: string) {\n this.id = value;\n }\n\n /**\n * @internal\n * @param shapeClass\n * @param type\n */\n static registerByType(shapeClass: typeof Shape, type?: NodeReferenceValue) {\n if (!type) {\n if (shapeClass === Shape) {\n return;\n }\n const shapeType = shapeClass.targetClass;\n if (shapeType) {\n type = shapeType;\n }\n }\n if (!type) {\n return;\n }\n const typeId = type.id;\n if (!this.typesToShapes.has(typeId)) {\n this.typesToShapes.set(typeId, new Set());\n }\n this.typesToShapes.get(typeId).add(shapeClass);\n }\n\n /**\n * Select properties of instances of this shape.\n * Chain `.for(id)` to target a single entity, or `.forAll(ids)` for multiple.\n * The select callback receives a proxy of the shape for type-safe property access.\n */\n static select<\n S extends Shape,\n R = unknown,\n ResultType = QueryResponseToResultType<R, S>[],\n >(\n this: ShapeConstructor<S>,\n selectFn: QueryBuildFn<S, R>,\n ): QueryBuilder<S, R, ResultType>;\n static select<\n S extends Shape,\n R = unknown,\n ResultType = QueryResponseToResultType<R, S>[],\n >(\n this: ShapeConstructor<S>,\n ): QueryBuilder<S, R, ResultType>;\n static select<\n S extends Shape,\n R = unknown,\n ResultType = QueryResponseToResultType<R, S>[],\n >(\n this: ShapeConstructor<S>,\n selectFn?: QueryBuildFn<S, R>,\n ): QueryBuilder<S, R, ResultType> {\n let builder = QueryBuilder.from(this) as QueryBuilder<S, any, any>;\n if (selectFn) {\n builder = builder.select(selectFn as any);\n }\n return builder as QueryBuilder<S, R, ResultType>;\n }\n\n /**\n * Select all decorated properties of this shape.\n * Chain `.for(id)` to target a single entity.\n */\n static selectAll<\n S extends Shape,\n ResultType = QueryResponseToResultType<\n SelectAllQueryResponse<S>,\n S\n >[],\n >(\n this: ShapeConstructor<S>,\n ): QueryBuilder<S, any, ResultType> {\n return QueryBuilder.from(this).selectAll() as QueryBuilder<S, any, ResultType>;\n }\n\n /**\n * Whether a node with this id exists as an instance of this shape.\n *\n * On the base class — `Shape.exists(uri)` — it means something different and\n * weaker: does a node with this IRI exist **at all**, under any type or none.\n * There is no shape to constrain by, so no `rdf:type` triple is emitted and the\n * query is `ASK { <uri> ?p ?o }`. (`Shape` is free to mean this because the\n * shapes themselves are described by `NodeShape` and `PropertyShape`, so\n * `Shape.exists` is not needed for \"is this a shape?\".) Because a shapeless ask\n * has no shape to route on, a router asks every dataset it knows — see\n * `LinkedStorage.askQuery`.\n *\n * ```typescript\n * if (await SourceDocument.exists({id})) {\n * await SourceDocument.update(values).for({id});\n * } else {\n * await SourceDocument.create({id, ...values});\n * }\n * ```\n *\n * Resolves to a real `boolean` — unlike `select().where(…).one()`, which resolves\n * to a row or `null` and leaves the conversion (and the failure modes) to the\n * caller. Runs the cheapest correct query: against a SPARQL store, an\n * `ASK WHERE { ?a0 rdf:type <ShapeClass> . FILTER(?a0 = <id>) }` — the shape's\n * type triple and an equality filter on the subject, nothing else.\n *\n * Note the type triple: this asks whether the node exists **as an instance of\n * this shape**. A node with that IRI and a different type answers `false`.\n *\n * A `null`/`undefined` id resolves to `false` without touching the store — as does\n * a `PendingQueryContext` whose value has not landed yet, since there is no subject\n * to ask about. (An unresolved context inside a *where clause* rejects instead; see\n * {@link QueryBuilder.exists}.)\n *\n * **Errors reject — they are never reported as `false`.** Do not wrap this in a\n * `.catch(() => false)`: that is exactly how a broken existence check hides,\n * turning every `exists ? update : create` into an unconditional `create`.\n *\n * For \"does *anything* match?\", compose on the builder instead:\n * `await Person.select().where(p => p.name.equals('Semmy')).exists()`.\n *\n * @param id The node id: a string IRI, a `{id}` reference, or a `PendingQueryContext`.\n * A malformed string IRI rejects (it does not throw synchronously).\n * @param target Optional explicit dataset to run against; omitted uses the\n * global query dispatch.\n */\n static async exists<S extends Shape>(\n this: ShapeConstructor<S> | typeof Shape,\n id: string | NodeReferenceValue | PendingQueryContext | null | undefined,\n target?: IDataset,\n ): Promise<boolean> {\n // `async`, so that a bad string IRI (resolveUriOrThrow) rejects rather than\n // throwing synchronously past the caller's .catch().\n if ((this as unknown) === Shape) {\n // Called on the base class: no shape to constrain by, so no rdf:type triple.\n // `ASK { <iri> ?p ?o }` — does this node exist at all?\n return AskBuilder.forNode(id).exec(target);\n }\n return QueryBuilder.from(this as ShapeConstructor<S>).for(id).exists(target);\n }\n\n /**\n * How many instances of this shape exist — a real `number`.\n *\n * ```typescript\n * const total = await Person.count();\n * ```\n *\n * This is the unfiltered total. For a filtered one, compose on the builder, which\n * is the form a paging table wants:\n *\n * ```typescript\n * await Person.select().where(p => p.name.equals('Semmy')).count();\n * ```\n *\n * Runs the cheapest correct query: against a SPARQL store,\n * `SELECT (COUNT(DISTINCT ?a0) AS ?count) WHERE { ?a0 rdf:type <ShapeClass> }` —\n * the shape's type triple and nothing else. Note the type triple: this counts\n * instances **of this shape**, not nodes in general.\n *\n * **On the base class — `Shape.count()` — this throws.** Unlike\n * {@link Shape.exists}, whose shapeless reading (\"does this node exist at all?\")\n * is useful and cheap, a shapeless count would count every node in every dataset\n * the router knows. No caller means that, so it is refused rather than answered.\n *\n * **Errors reject — they are never reported as `0`.** Do not wrap this in a\n * `.catch(() => 0)`: `0` is a plausible count, so a broken one renders an empty\n * table that looks exactly like real data.\n *\n * @param target Optional explicit dataset to run against; omitted uses the\n * global query dispatch.\n */\n static async count<S extends Shape>(\n this: ShapeConstructor<S> | typeof Shape,\n target?: IDataset,\n ): Promise<number> {\n // `async`, so the base-class refusal rejects rather than throwing synchronously\n // past the caller's `.catch()`.\n if ((this as unknown) === Shape) {\n throw new Error(\n 'Shape.count() has no meaning on the base class: there is no shape to ' +\n 'constrain by, so it would count every node in the store, under any type or ' +\n 'none. Call it on a shape subclass (`Person.count()`), or compose a filter ' +\n 'on the builder (`Person.select().where(…).count()`).',\n );\n }\n return CountBuilder.of({\n shapeClass: this as ShapeConstructor<S>,\n }).exec(target);\n }\n\n /**\n * Update properties of an instance of this shape.\n * Chain `.for(id)` to target a specific entity.\n *\n * ```typescript\n * await Person.update({name: 'Alice'}).for({id: '...'});\n * ```\n *\n * **`__id` is for *new* nodes only** — a fixed id for a nested node being\n * created (here, when **adding** to a relation: `update({friends: {add: {__id, name}}})`).\n * Do NOT put `__id` on a plain single-valued *replace* (`update({image: {__id, contentUrl}})`):\n * it re-targets that same node and *adds* another value instead of replacing\n * (breaks `sh:maxCount 1`). For a replace, **omit `__id`** — the engine drops the\n * old edge and writes a fresh node, so the value replaces cleanly. (Use `Shape.create`\n * for `__id` at creation; use `.delete()` or `{remove: […]}` for full owned-node cleanup.)\n *\n * **On a node that does not exist, this still writes — untyped.** `update`'s WHERE is a\n * bare `OPTIONAL`, so it matches whether or not the subject exists, and the INSERT fires\n * either way. What it never writes is `rdf:type`, so the result is an id carrying\n * properties that no shape-scoped select can find, and the call reports success. If the\n * node may be absent, use {@link Shape.upsert} instead, which asserts the type. (Whether\n * `update` should instead no-op on an absent node is an open semantic question — core\n * backlog 039.)\n */\n static update<S extends Shape>(\n this: ShapeConstructor<S>,\n data: (p: ExpressionUpdateProxy<S>) => ExpressionUpdateResult<S>,\n ): UpdateBuilder<S, any>;\n static update<S extends Shape, U extends UpdatePartial<S>>(\n this: ShapeConstructor<S>,\n data: U,\n ): UpdateBuilder<S, U>;\n static update<S extends Shape>(\n this: ShapeConstructor<S>,\n data: any,\n ): UpdateBuilder<S, any> {\n return UpdateBuilder.from(this).set(data) as unknown as UpdateBuilder<S, any>;\n }\n\n /**\n * Create the node if it is absent, replace the named properties if it is present —\n * in one request.\n *\n * ```ts\n * await SourceDocument.upsert(values).for({id});\n * ```\n *\n * This replaces the branch callers otherwise hand-roll:\n *\n * ```ts\n * if (await S.exists({id})) await S.update(values).for({id});\n * else await S.create({id, ...values});\n * ```\n *\n * which costs two round-trips, races between them, and — if the check is wrong in the\n * `false` direction — takes the `create` branch silently, duplicating single-valued\n * properties rather than erroring.\n *\n * Semantics:\n * - Replaces **only the properties named**; others on an existing node are untouched.\n * It is not a whole-node replace.\n * - Always asserts the node's type, which `update().for({id})` does not — an update\n * against an absent id writes its properties onto an untyped node.\n * - Returns what `update` returns. It deliberately does **not** report whether it\n * created or replaced: knowing that needs the extra read this avoids.\n * - `.where()` / `.forAll()` are rejected — an upsert targets one known id.\n * - **The id goes in `.for(id)`, not in the data object** — unlike `create`, where an\n * `id`/`__id` in the data names the node being created. Here the data object is\n * properties only; an `id` in it is rejected.\n * - Expression-valued fields are rejected: an expression reads the node's current\n * value, which does not exist when upsert creates it, and the property would be\n * silently skipped.\n */\n static upsert<S extends Shape, U extends UpdatePartial<S>>(\n this: ShapeConstructor<S>,\n data: U,\n ): UpdateBuilder<S, U> {\n return UpdateBuilder.upsertFrom(this).set(data) as unknown as UpdateBuilder<S, U>;\n }\n\n static create<S extends Shape, U extends UpdatePartial<S>>(\n this: ShapeConstructor<S>,\n updateObjectOrFn?: U,\n ): CreateBuilder<S, U> {\n let builder = CreateBuilder.from(this) as CreateBuilder<S, any>;\n if (updateObjectOrFn) {\n builder = builder.set(updateObjectOrFn);\n }\n return builder as unknown as CreateBuilder<S, U>;\n }\n\n static delete<S extends Shape>(\n this: ShapeConstructor<S>,\n id: DeleteId | DeleteId[] | NodeReferenceValue[],\n ): DeleteBuilder<S> {\n return DeleteBuilder.from(this, id) as DeleteBuilder<S>;\n }\n\n /** Delete all instances of this shape type. Returns void. */\n static deleteAll<S extends Shape>(\n this: ShapeConstructor<S>,\n ): DeleteBuilder<S, void> {\n return (DeleteBuilder.from(this) as DeleteBuilder<S>).all();\n }\n\n /** Delete instances matching a condition. Sugar for `.delete().where(fn)`. Returns void. */\n static deleteWhere<S extends Shape>(\n this: ShapeConstructor<S>,\n fn: WhereClause<S>,\n ): DeleteBuilder<S, void> {\n return (DeleteBuilder.from(this) as DeleteBuilder<S>).where(fn);\n }\n\n /**\n * @deprecated Unused; the DSL reads property shapes via `nodeShapeData` free\n * functions and static metadata. Scheduled for removal.\n */\n static mapPropertyShapes<S extends Shape, ResponseType = unknown>(\n this: ShapeConstructor<S>,\n mapFunction?: PropertyShapeMapFunction<S, ResponseType>,\n ): ResponseType {\n // SAFETY: dummyShape is used as a dynamic proxy target — we assign .proxy and\n // access arbitrary property names on it, which S doesn't declare.\n let dummyShape: any = createShapeTarget(this);\n dummyShape.proxy = new Proxy(dummyShape, {\n get(target, key, receiver) {\n if (typeof key === 'string') {\n if (key in dummyShape) {\n if (typeof dummyShape[key] === 'function') {\n return target[key].bind(target);\n }\n let propertyShape = getPropertyShapeByLabel(\n dummyShape.constructor,\n key.toString(),\n );\n if (propertyShape) {\n return propertyShape;\n }\n throw new Error(\n `${this.name}.${key.toString()} is missing a @linkedProperty decorator. This method can only access decorated get/set methods.`,\n );\n }\n }\n },\n });\n return mapFunction(dummyShape.proxy);\n }\n\n /**\n * @deprecated Unused; shapes are metadata and no longer materialized into\n * `ShapeSet`s of instances. Scheduled for removal.\n */\n static getSetOf<T extends Shape>(\n this: ShapeConstructor<T>,\n values: Iterable<T | NodeReferenceValue | string>,\n ): ShapeSet<T> {\n const set = new ShapeSet<T>();\n for (const value of values) {\n if (value instanceof Shape) {\n set.add(value as T);\n } else {\n const instance = createShapeTarget(\n this,\n typeof value === 'string' ? value : value.id,\n );\n set.add(instance);\n }\n }\n return set;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"nodeShapeData.js","sourceRoot":"","sources":["../../../src/shapes/nodeShapeData.ts"],"names":[],"mappings":"AAOA,OAAO,EAAC,cAAc,EAAC,MAAM,wBAAwB,CAAC;AAsGtD,8EAA8E;AAC9E,YAAY;AACZ,8EAA8E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,CAAC,SAAS,KAAK,QAAQ;QAAE,MAAM,CAAC,SAAS,GAAG,EAAE,CAAC,SAAS,CAAC;IACtE,IAAI,EAAE,CAAC,OAAO;QAAE,MAAM,CAAC,OAAO,GAAG,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC;IACnD,IAAI,EAAE,CAAC,kBAAkB,KAAK,SAAS;QAAE,MAAM,CAAC,QAAQ,GAAG,EAAE,CAAC,kBAAkB,CAAC;IACjF,IAAI,EAAE,CAAC,YAAY,KAAK,SAAS;QAAE,MAAM,CAAC,YAAY,GAAG,EAAE,CAAC,YAAY,CAAC;IACzE,IAAI,EAAE,CAAC,MAAM;QAAE,MAAM,CAAC,MAAM,GAAG,EAAE,CAAC,MAAM,CAAC;IACzC,IAAI,EAAE,CAAC,UAAU;QAAE,MAAM,CAAC,UAAU,GAAG,EAAE,CAAC,UAAU,CAAC;IACrD,OAAO,MAA6B,CAAC;AACvC,CAAC","sourcesContent":["/*\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/.\n */\nimport type {NodeReferenceValue} from '../utils/NodeReference.js';\nimport type {PathExpr} from '../paths/PropertyPathExpr.js';\nimport {getSuperShapes} from '../utils/ShapeClass.js';\n\n/**\n * Plain-object SHACL metadata — the QResult-like shape of a `sh:PropertyShape`.\n *\n * Shapes are metadata, not data: a shape class's `.shape` and its property shapes\n * are plain objects (no class instance, no methods). Operations that used to be\n * instance methods now live as free functions in this module.\n */\nexport interface PropertyShapeData {\n id: string;\n label: string;\n path: PathExpr;\n nodeKind?: NodeReferenceValue;\n datatype?: NodeReferenceValue;\n minCount?: number;\n maxCount?: number;\n name?: string;\n description?: string;\n order?: number;\n group?: string;\n /**\n * `linked_core:displayRank` — a single linear importance rank, lower = more\n * important. Truncated display contexts (\"the top 3 properties\") derive from it.\n * Distinct from `order`, which is arrangement rather than importance.\n */\n displayRank?: number;\n /** `linked_core:displayHidden` — omit from generic rendering. */\n displayHidden?: boolean;\n class?: NodeReferenceValue;\n in?: (NodeReferenceValue | string | number | boolean)[];\n equalsConstraint?: NodeReferenceValue;\n disjoint?: NodeReferenceValue;\n lessThan?: NodeReferenceValue;\n lessThanOrEquals?: NodeReferenceValue;\n /** Value-range constraints (sh:minInclusive / sh:maxInclusive / sh:minExclusive / sh:maxExclusive). */\n minInclusive?: number;\n maxInclusive?: number;\n minExclusive?: number | string;\n maxExclusive?: number;\n /** String-length constraints (sh:minLength / sh:maxLength). */\n minLength?: number;\n maxLength?: number;\n /** Regex constraint (sh:pattern); serialized as its source string. */\n pattern?: RegExp;\n hasValueConstraint?: NodeReferenceValue | string | number | boolean;\n defaultValue?: unknown;\n sortBy?: PathExpr;\n valueShape?: NodeReferenceValue;\n /** Composition marker: the value(s) of this property are owned by the subject. */\n contains?: boolean;\n parentNodeShape?: NodeShapeData;\n}\n\n/**\n * Plain-object SHACL metadata — the QResult-like shape of a `sh:NodeShape`.\n */\nexport interface NodeShapeData {\n id: string;\n label?: string;\n description?: string;\n targetClass?: NodeReferenceValue;\n extends?: NodeReferenceValue;\n /** Composition marker: instances are dependent (cascade-deletable via `contains`). */\n dependent?: boolean;\n /** sh:closed — target nodes with undeclared properties are invalid. */\n closed?: boolean;\n /** sh:ignoredProperties — extra properties permitted when the shape is closed. */\n ignoredProperties?: NodeReferenceValue[];\n propertyShapes: PropertyShapeData[];\n}\n\n/**\n * Result object produced by `propertyShapeToResult()` (SHACL projection).\n * @deprecated No production callers remain (the `NodeShape.properties` getter and\n * `PropertyShape.getResult()` were removed with the plain-object conversion). Read\n * the plain `PropertyShapeData` fields directly. Scheduled for removal.\n */\nexport interface PropertyShapeResult {\n id: string;\n label: string;\n path: PathExpr;\n nodeKind?: NodeReferenceValue;\n datatype?: NodeReferenceValue;\n minCount?: number;\n maxCount?: number;\n name?: string;\n description?: string;\n order?: number;\n group?: string;\n class?: NodeReferenceValue;\n in?: (NodeReferenceValue | string | number | boolean)[];\n equals?: NodeReferenceValue;\n disjoint?: NodeReferenceValue;\n lessThan?: NodeReferenceValue;\n lessThanOrEquals?: NodeReferenceValue;\n hasValue?: NodeReferenceValue | string | number | boolean;\n defaultValue?: unknown;\n sortBy?: PathExpr;\n valueShape?: NodeReferenceValue;\n}\n\n// ---------------------------------------------------------------------------\n// Factories\n// ---------------------------------------------------------------------------\n\n/** Create an empty NodeShape metadata object for the given shape IRI. */\nexport function createNodeShapeData(id: string): NodeShapeData {\n return {id, propertyShapes: []};\n}\n\n/** Create a blank PropertyShape metadata object (fields filled in by the caller). */\nexport function createPropertyShapeData(): PropertyShapeData {\n return {id: '', label: '', path: null as unknown as PathExpr};\n}\n\n// ---------------------------------------------------------------------------\n// Free functions (formerly NodeShape/PropertyShape instance methods)\n// ---------------------------------------------------------------------------\n\n/** One-time warning keys for shapes whose `propertyShapes` is missing/invalid. */\nconst warnedMissingPropertyShapes = new Set<string>();\n\n/**\n * Read a node shape's own property shapes, tolerating a missing/invalid array.\n *\n * A non-array `propertyShapes` almost always means a duplicate `@_linked/core`\n * install or a non-normalized static shape on a superclass; warn once per shape id\n * (diagnostic parity with the former `NodeShape.listPropertyShapesSafe`) and treat\n * it as empty.\n */\nfunction ownPropertyShapes(nodeShape: NodeShapeData): PropertyShapeData[] {\n const own = (nodeShape as {propertyShapes?: PropertyShapeData[]}).propertyShapes;\n if (Array.isArray(own)) {\n return own;\n }\n const id = (nodeShape as {id?: string}).id ?? '';\n if (!warnedMissingPropertyShapes.has(id)) {\n warnedMissingPropertyShapes.add(id);\n console.warn(\n `[@_linked/core] static shape ${id ? `'${id}'` : '(unknown id)'} has missing ` +\n `or invalid propertyShapes. Treating as []. Often caused by duplicate ` +\n `@_linked/core installs or a non-normalized static shape on a superclass.`,\n );\n }\n return [];\n}\n\n/**\n * Property shapes declared on this NodeShape. With `includeSuperClasses`, walks the\n * inheritance chain via `getSuperShapes` and concatenates each ancestor's own property\n * shapes — the prototype chain for a class-backed shape, `extends` for one known only\n * as data.\n */\nexport function getPropertyShapes(\n nodeShape: NodeShapeData,\n includeSuperClasses: boolean = false,\n): PropertyShapeData[] {\n if (!includeSuperClasses) {\n return [...ownPropertyShapes(nodeShape)];\n }\n // One inheritance walk, shared with getSuperShapes: the prototype chain for a\n // class-backed shape (which includes the framework `Shape` root and its `label` /\n // `type` properties), or `extends` through the registry for a shape that exists only\n // as data. Previously this walked the prototype chain directly and returned ONLY own\n // properties when no class existed — so a project-authored shape silently lost\n // everything it inherited.\n const res: PropertyShapeData[] = [...ownPropertyShapes(nodeShape)];\n for (const superShape of getSuperShapes(nodeShape)) {\n res.push(...ownPropertyShapes(superShape));\n }\n return res;\n}\n\n/** Property shapes across the inheritance chain, deduped by label (most specific wins). */\nexport function getUniquePropertyShapes(\n nodeShape: NodeShapeData,\n): PropertyShapeData[] {\n const unique: PropertyShapeData[] = [];\n const seen = new Set<string>();\n for (const ps of getPropertyShapes(nodeShape, true)) {\n if (!seen.has(ps.label)) {\n seen.add(ps.label);\n unique.push(ps);\n }\n }\n return unique;\n}\n\n/**\n * Find a property shape by label. With `checkSubShapes` (default true), ascends the\n * inheritance chain if the label isn't found locally.\n *\n * Shares `getSuperShapes` with {@link getPropertyShapes}, so the singular and plural\n * lookups can never disagree about what a shape inherits — and so a shape registered\n * from data resolves inherited properties through `extends` rather than stopping at its\n * own. This is what `getPropertyShapeByLabel` delegates to (PR #211), so closing the gap\n * here closes it for the query proxies too. See docs/backlog/040.\n */\nexport function getPropertyShape(\n nodeShape: NodeShapeData,\n label: string,\n checkSubShapes: boolean = true,\n): PropertyShapeData | undefined {\n const own = ownPropertyShapes(nodeShape).find((ps) => ps.label === label);\n if (own || !checkSubShapes) return own;\n for (const superShape of getSuperShapes(nodeShape)) {\n const inherited = ownPropertyShapes(superShape).find(\n (ps) => ps.label === label,\n );\n if (inherited) return inherited;\n }\n return undefined;\n}\n\n/** Two node shapes are equal when they share the same IRI. */\nexport function nodeShapeEquals(a: NodeShapeData, b?: NodeShapeData): boolean {\n return !!b && a?.id === b.id;\n}\n\n/** Append a property shape to a node shape, wiring the back-reference. */\nexport function addPropertyShape(\n nodeShape: NodeShapeData,\n propertyShape: PropertyShapeData,\n): void {\n propertyShape.parentNodeShape = nodeShape;\n if (!Array.isArray(nodeShape.propertyShapes)) {\n nodeShape.propertyShapes = [];\n }\n nodeShape.propertyShapes.push(propertyShape);\n}\n\n/** Shallow-clone a property shape (used by property override / disallow). */\nexport function clonePropertyShape(\n propertyShape: PropertyShapeData,\n): PropertyShapeData {\n return {...propertyShape};\n}\n\n/**\n * Project a property shape to its SHACL result object.\n * @deprecated No production callers remain. Read the plain `PropertyShapeData`\n * fields directly (note this projection renames `equalsConstraint`→`equals`,\n * `hasValueConstraint`→`hasValue`, and serializes `pattern` to its source string).\n * Scheduled for removal.\n */\nexport function propertyShapeToResult(ps: PropertyShapeData): PropertyShapeResult {\n const result: Record<string, unknown> & {id: string; label: string; path: PathExpr} = {\n id: ps.id,\n label: ps.label,\n path: ps.path,\n };\n if (ps.nodeKind) result.nodeKind = ps.nodeKind;\n if (ps.datatype) result.datatype = ps.datatype;\n if (typeof ps.minCount === 'number') result.minCount = ps.minCount;\n if (typeof ps.maxCount === 'number') result.maxCount = ps.maxCount;\n if (ps.name) result.name = ps.name;\n if (ps.description) result.description = ps.description;\n if (typeof ps.order === 'number') result.order = ps.order;\n if (ps.group) result.group = ps.group;\n if (ps.class) result.class = ps.class;\n if (ps.in) result.in = ps.in;\n if (ps.equalsConstraint) result.equals = ps.equalsConstraint;\n if (ps.disjoint) result.disjoint = ps.disjoint;\n if (ps.lessThan) result.lessThan = ps.lessThan;\n if (ps.lessThanOrEquals) result.lessThanOrEquals = ps.lessThanOrEquals;\n if (ps.minInclusive !== undefined) result.minInclusive = ps.minInclusive;\n if (ps.maxInclusive !== undefined) result.maxInclusive = ps.maxInclusive;\n if (ps.minExclusive !== undefined) result.minExclusive = ps.minExclusive;\n if (ps.maxExclusive !== undefined) result.maxExclusive = ps.maxExclusive;\n if (typeof ps.minLength === 'number') result.minLength = ps.minLength;\n if (typeof ps.maxLength === 'number') result.maxLength = ps.maxLength;\n if (ps.pattern) result.pattern = ps.pattern.source;\n if (ps.hasValueConstraint !== undefined) result.hasValue = ps.hasValueConstraint;\n if (ps.defaultValue !== undefined) result.defaultValue = ps.defaultValue;\n if (ps.sortBy) result.sortBy = ps.sortBy;\n if (ps.valueShape) result.valueShape = ps.valueShape;\n return result as PropertyShapeResult;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"nodeShapeWire.js","sourceRoot":"","sources":["../../../src/shapes/nodeShapeWire.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;;;;;;;;;;;AA0CH;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,eAAe,CAC7B,KAAoC;;IAEpC,OAAO,CAAC,MAAA,KAAK,CAAC,cAAc,mCAAI,EAAE,CAAC,CAAC,KAAK,CACvC,CAAC,IAAI,EAAE,EAAE,CACP,CAAE,IAA0B,CAAC,eAAe;QAC5C,CAAC,CAAE,IAA0B,CAAC,OAAO,YAAY,MAAM,CAAC,CAC3D,CAAC;AACJ,CAAC;AAED,kFAAkF;AAClF,MAAM,UAAU,MAAM,CAAC,KAAoB;;IACzC,uCACK,KAAK,KACR,cAAc,EAAE,CAAC,MAAA,KAAK,CAAC,cAAc,mCAAI,EAAE,CAAC,CAAC,GAAG,CAAC,cAAc,CAAC,IAChE;AACJ,CAAC;AAED,oFAAoF;AACpF,MAAM,UAAU,QAAQ,CAAC,IAAmB;;IAC1C,MAAM,KAAK,mCACN,IAAI,KACP,cAAc,EAAE,EAAE,GACnB,CAAC;IACF,KAAK,CAAC,cAAc,GAAG,CAAC,MAAA,IAAI,CAAC,cAAc,mCAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAC9D,gBAAgB,CAAC,IAAI,EAAE,KAAK,CAAC,CAC9B,CAAC;IACF,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,cAAc,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AG,OAAO,CAAC,MAAM,CAAC;QAC9B,IAAI,OAAO,CAAC,KAAK;YAAE,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,KAAK,CAAC;IACvD,CAAC;SAAM,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QACvC,2EAA2E;QAC3E,iFAAiF;QACjF,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,gBAAgB,CACvB,IAAuB,EACvB,MAAqB;IAErB,MAAM,EAAC,OAAO,EAAE,YAAY,KAAa,IAAI,EAAZ,IAAI,UAAI,IAAI,EAAvC,2BAAgC,CAAO,CAAC;IAC9C,MAAM,IAAI,GAAG,IAAyB,CAAC;IACvC,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QAChC,IAAI,CAAC,OAAO,GAAG,IAAI,MAAM,CAAC,OAAO,EAAE,YAAY,aAAZ,YAAY,cAAZ,YAAY,GAAI,EAAE,CAAC,CAAC;IACzD,CAAC;SAAM,IAAK,OAAmB,YAAY,MAAM,EAAE,CAAC;QAClD,8EAA8E;QAC9E,wEAAwE;QACxE,8EAA8E;QAC9E,4EAA4E;QAC5E,+EAA+E;QAC/E,+CAA+C;QAC/C,EAAE;QACF,0EAA0E;QAC1E,0EAA0E;QAC1E,8EAA8E;QAC9E,oBAAoB;QACpB,IAAI,CAAC,OAAO,GAAG,OAA4B,CAAC;IAC9C,CAAC;IACD,IAAI,CAAC,eAAe,GAAG,MAAM,CAAC;IAC9B,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["/*\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/.\n */\n\n/**\n * JSON-safe transport form of the shape metamodel.\n *\n * `NodeShapeData` is the one shape metamodel (see `nodeShapeData.ts`). It is\n * *almost* JSON-safe already — `PathExpr` is a plain discriminated union, and every\n * constraint field holds a primitive or a `{id}` reference. Exactly two things stop\n * it crossing a wire:\n *\n * 1. `PropertyShapeData.parentNodeShape` is a back-reference to the owning node\n * shape, so the object graph is circular and `JSON.stringify` throws.\n * 2. `PropertyShapeData.pattern` is a live `RegExp`, which serializes to `{}`.\n *\n * So the wire form is defined *by subtraction* from the metamodel rather than as a\n * parallel type: drop the back-reference, carry the pattern as its source string,\n * change nothing else. Every field added to `PropertyShapeData` is therefore carried\n * automatically — the single biggest maintenance failure of the `ShapeDetails` type\n * this replaces was that it enumerated a subset by hand and silently fell behind.\n *\n * `fromWire` restores the back-reference and recompiles the pattern, so\n * `fromWire(toWire(shape))` is structurally equal to `shape`.\n */\n\nimport type {NodeShapeData, PropertyShapeData} from './nodeShapeData.js';\n\n/** `PropertyShapeData` minus the circular parent link, with `pattern` as a string. */\nexport type PropertyShapeWire = Omit<\n PropertyShapeData,\n 'pattern' | 'parentNodeShape'\n> & {\n /** `sh:pattern` as its SOURCE string — never a live RegExp. */\n pattern?: string;\n /** RegExp flags, so a case-insensitive pattern survives the round trip. */\n patternFlags?: string;\n};\n\n/** `NodeShapeData` whose property shapes are in wire form. */\nexport type NodeShapeWire = Omit<NodeShapeData, 'propertyShapes'> & {\n propertyShapes: PropertyShapeWire[];\n};\n\n/**\n * True when the value is already in wire form — a structural guess, not a fact.\n *\n * The two forms differ only by `parentNodeShape` and by `pattern` being a RegExp\n * rather than a string, so a shape carrying neither satisfies both types. An empty\n * `propertyShapes` array is the extreme case: `[].every()` is vacuously true, so\n * every propertyless shape reads as wire.\n *\n * This is safe **because the conversions are idempotent**, not because the guess is\n * reliable. `fromWire` preserves an already-compiled pattern and re-attaching a\n * parent link is a no-op, and `toWire` tolerates a pattern that is already a source\n * string. So misclassifying a shape in either direction costs nothing.\n *\n * That property is load-bearing: keep it if you change either converter. Before it\n * held, `fromWire` on an already-converted shape dropped every RegExp pattern.\n */\nexport function isNodeShapeWire(\n shape: NodeShapeData | NodeShapeWire,\n): shape is NodeShapeWire {\n return (shape.propertyShapes ?? []).every(\n (prop) =>\n !(prop as PropertyShapeData).parentNodeShape &&\n !((prop as PropertyShapeData).pattern instanceof RegExp),\n );\n}\n\n/** Metamodel → wire. Drops the parent back-reference, stringifies the pattern. */\nexport function toWire(shape: NodeShapeData): NodeShapeWire {\n return {\n ...shape,\n propertyShapes: (shape.propertyShapes ?? []).map(propertyToWire),\n };\n}\n\n/** Wire → metamodel. Restores the parent back-reference, recompiles the pattern. */\nexport function fromWire(wire: NodeShapeWire): NodeShapeData {\n const shape: NodeShapeData = {\n ...wire,\n propertyShapes: [],\n };\n shape.propertyShapes = (wire.propertyShapes ?? []).map((prop) =>\n propertyFromWire(prop, shape),\n );\n return shape;\n}\n\nfunction propertyToWire(prop: PropertyShapeData): PropertyShapeWire {\n // Destructure the two problem fields out; everything else is carried verbatim,\n // which is what keeps this from falling behind the metamodel.\n const {pattern, parentNodeShape: _drop, ...rest} = prop;\n const wire = rest as PropertyShapeWire;\n if (pattern instanceof RegExp) {\n wire.pattern = pattern.source;\n if (pattern.flags) wire.patternFlags = pattern.flags;\n } else if (typeof pattern === 'string') {\n // Tolerate a pattern that is already a source string (a wire object handed\n // back in). Not a supported input type, but silently dropping it would be worse.\n wire.pattern = pattern;\n }\n return wire;\n}\n\nfunction propertyFromWire(\n wire: PropertyShapeWire,\n parent: NodeShapeData,\n): PropertyShapeData {\n const {pattern, patternFlags, ...rest} = wire;\n const prop = rest as PropertyShapeData;\n if (typeof pattern === 'string') {\n prop.pattern = new RegExp(pattern, patternFlags ?? '');\n } else if ((pattern as unknown) instanceof RegExp) {\n // The cast is the point: `pattern` is declared `string` on the wire type, and\n // this branch exists precisely for the input that does not honour that.\n // Already in metamodel form. `pattern` was destructured out above, so without\n // this branch it is silently DROPPED -- converting a shape that was already\n // converted would quietly discard every `sh:pattern` constraint, and the shape\n // would then validate values it should reject.\n //\n // Keeping it makes this function idempotent: fromWire(fromWire(x)) equals\n // fromWire(x) for any input. That matters because the only thing deciding\n // whether to call it is `isNodeShapeWire`, a structural guess -- see the note\n // on that function.\n prop.pattern = pattern as unknown as RegExp;\n }\n prop.parentNodeShape = parent;\n return prop;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"propertyShapeTerms.js","sourceRoot":"","sources":["../../../src/shapes/propertyShapeTerms.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,qBAAqB,CAAC,CAAC,uDAAuD;AACrF,OAAO,EAAC,SAAS,EAAC,MAAM,8BAA8B,CAAC;AACvD,OAAO,EAAC,aAAa,EAAC,MAAM,YAAY,CAAC;AAuBzC,IAAI,MAAkD,CAAC;AAEvD;;;;;;;;;;;;GAYG;AACH;;;;;;;;;;;GAWG;AACH,MAAM,kBAAkB,GAA2B;IACjD,MAAM,EAAE,kBAAkB;CAC3B,CAAC;AAEF,MAAM,UAAU,qBAAqB;;IACnC,IAAI,MAAM,IAAI,MAAM,CAAC,IAAI;QAAE,OAAO,MAAM,CAAC;IACzC,MAAM,GAAG,GAAG,IAAI,GAAG,EAA6B,CAAC;IACjD,KAAK,MAAM,EAAE,IAAI,MAAA,MAAA,aAAa,CAAC,KAAK,0CAAE,cAAc,mCAAI,EAAE,EAAE,CAAC;QAC3D,yEAAyE;QACzE,IAAI,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,IAAI,CAAC;YAAE,SAAS;QAC9C,MAAM,SAAS,GAAG,OAAO,EAAE,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;QACrE,IAAI,CAAC,SAAS;YAAE,SAAS;QACzB,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,KAAK,EAAE;YAChB,KAAK,EAAE,EAAE,CAAC,KAAK;YACf,SAAS;YACT,QAAQ,EAAE,MAAA,EAAE,CAAC,QAAQ,0CAAE,EAAE;YACzB,QAAQ,EAAE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I,CAAC,EAAE,CAAC;QACrE,IAAI,CAAC,SAAS;YAAE,SAAS;QACzB,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,KAAK,EAAE;YAChB,KAAK,EAAE,EAAE,CAAC,KAAK;YACf,SAAS;YACT,QAAQ,EAAE,MAAA,EAAE,CAAC,QAAQ,0CAAE,EAAE;YACzB,QAAQ,EAAE,MAAA,EAAE,CAAC,QAAQ,0CAAE,EAAE;SAC1B,CAAC,CAAC;IACL,CAAC;IACD,MAAM,GAAG,GAAG,CAAC;IACb,OAAO,GAAG,CAAC;AACb,CAAC;AAED,kFAAkF;AAClF,MAAM,UAAU,oBAAoB,CAAC,KAAa;;IAChD,OAAO,MAAA,qBAAqB,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,mCAAI,qBAAqB,EAAE,CAAC,GAAG,CAAC,MAAA,kBAAkB,CAAC,KAAK,CAAC,mCAAI,EAAE,CAAC,CAAC;AAC5G,CAAC","sourcesContent":["/*\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/.\n */\nimport '../utils/Package.js'; // side effect: sets up the meta-model this table reads\nimport {isPathRef} from '../paths/PropertyPathExpr.js';\nimport {PropertyShape} from './SHACL.js';\n\n/**\n * How ONE SHACL constraint of a `sh:PropertyShape` is written to RDF: which predicate\n * it uses and (when the meta-model pins one) which literal datatype / node kind.\n */\nexport interface PropertyShapeTerm {\n /**\n * The constraint's name as used by the decorator config and by `PropertyShapeData`\n * — e.g. `pattern`, `minLength`, `in`. Usually the bare SHACL name, but not always:\n * `sh:equals` is labelled `equalsConstraint`, because a property labelled `equals`\n * would be shadowed by the query builder's own `equals()` (backlog 041). Look a\n * constraint up by label, never by assuming the predicate's local name.\n */\n label: string;\n /** The predicate IRI the constraint serializes to, e.g. `sh:pattern`. */\n predicate: string;\n /** Fixed literal datatype IRI, when the meta-model pins one (e.g. `xsd:integer` for `sh:minLength`). */\n datatype?: string;\n /** `sh:IRI` or `sh:Literal`, when the meta-model pins one (absent for the generic `sh:hasValue`). */\n nodeKind?: string;\n}\n\nlet cached: Map<string, PropertyShapeTerm> | undefined;\n\n/**\n * The SHACL constraints a `sh:PropertyShape` can carry, keyed by label — derived from the\n * core meta-model (`PropertyShape.shape`, set up in `utils/Package.ts`) rather than from a\n * hand-kept list, so a constraint added to the meta-model is immediately known here.\n *\n * This is the seam for **alternative serializers**: code that writes SHACL by a route other\n * than the create pipeline (e.g. raw SPARQL `INSERT DATA`) can look up the predicate and the\n * literal datatype for a constraint instead of re-deriving them. Constraints whose meta-model\n * path is a complex property path are omitted (they have no single predicate).\n *\n * Requires the meta-model to have been set up (importing `@_linked/core` or `utils/Package`\n * does that). The result is cached once non-empty.\n */\n/**\n * Author-facing decorator config keys that do not match the meta-shape label.\n *\n * `sh:equals` is labelled `equalsConstraint` on the meta-shape, because the bare name\n * collides with `QueryShape.equals` and made the constraint unselectable through the DSL.\n * The DECORATOR key stayed `equals` — that is what a person writes, and renaming it would\n * break every existing shape for a reason internal to the query builder.\n *\n * Which leaves a gap this map closes: code-to-SHACL materialization looks terms up by the\n * config key, so without the alias `@literalProperty({equals: …})` silently stopped\n * emitting `sh:equals` — no error, just a constraint quietly missing from the graph.\n */\nconst CONFIG_KEY_ALIASES: Record<string, string> = {\n equals: 'equalsConstraint',\n};\n\nexport function getPropertyShapeTerms(): ReadonlyMap<string, PropertyShapeTerm> {\n if (cached && cached.size) return cached;\n const map = new Map<string, PropertyShapeTerm>();\n for (const ps of PropertyShape.shape?.propertyShapes ?? []) {\n // Only single-predicate paths describe a constraint; skip complex paths.\n if (!ps.path || !isPathRef(ps.path)) continue;\n const predicate = typeof ps.path === 'string' ? ps.path : ps.path.id;\n if (!predicate) continue;\n map.set(ps.label, {\n label: ps.label,\n predicate,\n datatype: ps.datatype?.id,\n nodeKind: ps.nodeKind?.id,\n });\n }\n cached = map;\n return map;\n}\n\n/** Lookup of a single constraint by label — see {@link getPropertyShapeTerms}. */\nexport function getPropertyShapeTerm(label: string): PropertyShapeTerm | undefined {\n return getPropertyShapeTerms().get(label) ?? getPropertyShapeTerms().get(CONFIG_KEY_ALIASES[label] ?? '');\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"registerRuntimeShape.js","sourceRoot":"","sources":["../../../src/shapes/registerRuntimeShape.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAC,aAAa,EAAE,iBAAiB,EAAC,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAAC,2BAA2B,EAAC,MAAM,kCAAkC,CAAC;AAE7E,OAAO,EAAC,QAAQ,EAAE,eAAe,EAAqB,MAAM,oBAAoB,CAAC;AAEjF;;;;;;;;;;GAUG;AACH,MAAM,UAAU,oBAAoB,CAClC,KAAoC;;IAEpC,IAAI,CAAC,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,EAAE,CAAA;QAAE,OAAO,KAAK,CAAC;IAC7B,IAAI,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC;QAAE,OAAO,KAAK,CAAC;IAC1C,MAAM,IAAI,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAE,KAAuB,CAAC;IACjF,iFAAiF;IACjF,oFAAoF;IACpF,mEAAmE;IACnE,KAAK,MAAM,EAAE,IAAI,MAAA,IAAI,CAAC,cAAc,mCAAI,EAAE,EAAE,CAAC;QAC3C,2BAA2B,CAAC,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;IAC7D,CAAC;IACD,iBAAiB,CAAC,IAAI,CAAC,CAAC;IACxB,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,qBAAqB,CACnC,MAAyF;IAEzF,MAAM,IAAI,GAAG,KAAK,C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form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/.\n */\n\n/**\n * Register a shape that exists only as data.\n *\n * This is the return leg of the round trip. `@linkedShape` is class → metadata and\n * `syncShapes` is metadata → RDF; this is RDF → metadata, so a shape authored in a\n * project and read back from its materialized SHACL resolves in queries exactly like a\n * compiled one.\n *\n * It takes metadata — `NodeShapeData`, or its wire form — rather than a bespoke DTO. The\n * previous implementation of this idea lived outside core and rebuilt the shape field by\n * field from a projection, which meant it silently dropped `extends` (so a child shape\n * lost every inherited property), the value constraints, and any property whose label was\n * absent. Taking the metamodel removes that whole class of loss: there is nothing to\n * re-derive.\n *\n * No class is synthesized here. Consumers that need a constructor — the query builders —\n * get one on demand from `getOrCreateShapeAdapter`, so `getShapeClass` keeps reporting\n * only the shapes that have a real authored class.\n */\n\nimport {getShapeClass, registerNodeShape} from '../utils/ShapeClass.js';\nimport {warnOnReservedPropertyLabel} from '../queries/reservedQueryNames.js';\nimport type {NodeShapeData} from './nodeShapeData.js';\nimport {fromWire, isNodeShapeWire, type NodeShapeWire} from './nodeShapeWire.js';\n\n/**\n * Register one shape's metadata under its IRI.\n *\n * Idempotent by replacement: registering the same IRI again replaces the metadata, which\n * is what a shape edited in a builder needs. A shape that already has a compiled class is\n * left alone — an authored class is always the better answer, and shadowing it would make\n * behaviour depend on import order.\n *\n * @returns true when the shape was registered, false when a compiled class already owns\n * the IRI.\n */\nexport function registerRuntimeShape(\n shape: NodeShapeData | NodeShapeWire,\n): boolean {\n if (!shape?.id) return false;\n if (getShapeClass(shape.id)) return false;\n const data = isNodeShapeWire(shape) ? fromWire(shape) : (shape as NodeShapeData);\n // A data-only shape never passes through registerPropertyShape, so the collision\n // check has to happen here too — otherwise a shape authored in a builder is the one\n // kind of shape that gets no warning until the field tracer fails.\n for (const ps of data.propertyShapes ?? []) {\n warnOnReservedPropertyLabel(ps.label, data.label, data.id);\n }\n registerNodeShape(data);\n return true;\n}\n\n/**\n * Register a whole catalog, parents before children.\n *\n * Order matters: inheritance is resolved by looking `extends` up in the registry, so a\n * child registered before its parent would resolve an empty chain until the parent\n * arrived. Callers should not have to know that, so this sorts by depth first.\n */\nexport function registerRuntimeShapes(\n shapes: Record<string, NodeShapeData | NodeShapeWire> | (NodeShapeData | NodeShapeWire)[],\n): number {\n const list = Array.isArray(shapes) ? shapes : Object.values(shapes);\n const byId = new Map(list.map((s) => [s.id, s]));\n\n const depth = (shape: NodeShapeData | NodeShapeWire): number => {\n let d = 0;\n const seen = new Set<string>([shape.id]);\n let current = shape;\n while (current?.extends?.id && !seen.has(current.extends.id)) {\n seen.add(current.extends.id);\n const parent = byId.get(current.extends.id);\n if (!parent) break; // parent outside this batch — already registered, or absent\n current = parent;\n d++;\n }\n return d;\n };\n\n let registered = 0;\n for (const shape of [...list].sort((a, b) => depth(a) - depth(b))) {\n if (registerRuntimeShape(shape)) registered++;\n }\n return registered;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"serializePathToNodeData.js","sourceRoot":"","sources":["../../../src/shapes/serializePathToNodeData.ts"],"names":[],"mappings":"AAMA,OAAO,EAAC,SAAS,EAAC,MAAM,8BAA8B,CAAC;AAEvD,OAAO,EAAO,OAAO,EAAC,MAAM,WAAW,CAAC;AACxC,OAAO,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAC;AAUvC;;;;;;;;;GASG;AACH,MAAM,UAAU,uBAAuB,CAAC,IAAc,EAAE,IAAY;IAClE,MAAM,SAAS,GAAG,CAAC,CAAW,EAAE,CAAS,EAAgB,EAAE;QACzD,IAAI,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;YACjB,OAAO,EAAC,EAAE,EAAE,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAC,CAAC;QAChD,CAAC;QACD,IAAI,KAAK,IAAI,CAAC,EAAE,CAAC;YACf,yEAAyE;YAC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EAAE,CAAC;YACrB,OAAO,EAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,EAAE,SAAS,CAAC,CAAC,CAAC,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,EAAC,CAAC;QAChG,CAAC;QACD,IAAI,oBAAoB,IAAI,CAAC,EAAE,CAAC;YAC9B,MAAM,IAAI,KAAK,CACb,qFAAqF,CACtF,CAAC;QACJ,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,2BAA2B,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IAClE,CAAC,CAAC;IACF,OAAO,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AAC/B,CAAC","sourcesContent":["/*\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/.\n */\nimport type {PathExpr} from '../paths/PropertyPathExpr.js';\nimport {isPathRef} from '../paths/PropertyPathExpr.js';\nimport type {NodeReferenceValue} from '../utils/NodeReference.js';\nimport {List, rdfList} from './List.js';\nimport {PathNode} from './PathNode.js';\n\n/**\n * Node-data the create pipeline accepts for a `sh:path` value: an IRI reference (simple path),\n * an `rdf:List` (sequence / alternative members), or a `PathNode` operator node.\n */\nexport type PathNodeData =\n | NodeReferenceValue\n | {shape: typeof List | typeof PathNode; __id?: string; [k: string]: unknown};\n\n/**\n * Translate a `PathExpr` into create-pipeline node-data for `sh:path`.\n *\n * - simple `PathRef` → `{id}` (a shared predicate IRI; NOT owned)\n * - sequence → an `rdf:List` of segments (via {@link rdfList})\n * - inverse / alternative / cardinality → a `PathNode` operator node (alt's operand is an `rdf:List`)\n *\n * `base` seeds deterministic ids for the minted owned nodes (`{base}/inv`, `{base}/seq/0`, …) so a\n * re-sync overwrites them in place; the owned subtree is cleaned by the containment cascade.\n */\nexport function serializePathToNodeData(path: PathExpr, base: string): PathNodeData {\n const serialize = (e: PathExpr, b: string): PathNodeData => {\n if (isPathRef(e)) {\n return {id: typeof e === 'string' ? e : e.id};\n }\n if ('seq' in e) {\n // SHACL §2.3.1: a sequence path is a list with **at least two** members.\n // A 0/1-member sequence is not a list — collapse a singleton to its bare\n // member, reject an empty one. (normalizePropertyPath already collapses\n // these upstream; this keeps the serializer independently spec-correct.)\n if (e.seq.length === 0) {\n throw new Error('Cannot serialize an empty sequence path to SHACL sh:path.');\n }\n if (e.seq.length === 1) return serialize(e.seq[0], `${b}/seq/0`);\n return rdfList(\n e.seq.map((s, i) => serialize(s, `${b}/seq/${i}`)),\n {base: `${b}/seq`},\n ) as PathNodeData;\n }\n if ('inv' in e) {\n return {shape: PathNode, __id: `${b}/inv`, inversePath: serialize(e.inv, `${b}/inv`)};\n }\n if ('alt' in e) {\n // SHACL §2.3.2: sh:alternativePath is a list with **at least two** members.\n // Collapse a singleton alternative to its bare member, reject an empty one.\n if (e.alt.length === 0) {\n throw new Error('Cannot serialize an empty alternative path to SHACL sh:path.');\n }\n if (e.alt.length === 1) return serialize(e.alt[0], `${b}/alt/0`);\n return {\n shape: PathNode,\n __id: `${b}/alt`,\n alternativePath: rdfList(\n e.alt.map((a, i) => serialize(a, `${b}/alt/${i}`)),\n {base: `${b}/alt`},\n ),\n };\n }\n if ('zeroOrMore' in e) {\n return {shape: PathNode, __id: `${b}/zom`, zeroOrMorePath: serialize(e.zeroOrMore, `${b}/zom`)};\n }\n if ('oneOrMore' in e) {\n return {shape: PathNode, __id: `${b}/oom`, oneOrMorePath: serialize(e.oneOrMore, `${b}/oom`)};\n }\n if ('zeroOrOne' in e) {\n return {shape: PathNode, __id: `${b}/zoo`, zeroOrOnePath: serialize(e.zeroOrOne, `${b}/zoo`)};\n }\n if ('negatedPropertySet' in e) {\n throw new Error(\n 'negatedPropertySet cannot be serialized to SHACL sh:path — no SHACL representation.',\n );\n }\n throw new Error(`Unknown PathExpr shape: ${JSON.stringify(e)}`);\n };\n return serialize(path, base);\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C,6CAA6C,CAClD,CAAC;IACJ,CAAC;IACD,MAAM,GAAG,GAAG,SAAS,CAAC,EAAE,CAAC;IAEzB,+FAA+F;IAC/F,uDAAuD;IACvD,MAAM,GAAG,GAAI,GAA8B,CAAC,WAAW,CAAC;IACxD,IAAI,CAAC,GAAG,IAAI,GAAG,KAAK,iBAAiB,EAAE,CAAC;QACtC,MAAM,IAAI,KAAK,CAAC,oDAAoD,GAAG,EAAE,CAAC,CAAC;IAC7E,CAAC;IAED,OAAO,cAAc,CAAC,SAAS,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC;AAC5C,CAAC","sourcesContent":["/*\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/.\n */\nimport {getAllShapeClasses, getShapeClass} from '../utils/ShapeClass.js';\nimport {NodeShape} from './SHACL.js';\nimport {\n getUniquePropertyShapes,\n type NodeShapeData,\n type PropertyShapeData,\n} from './nodeShapeData.js';\nimport {Shape} from './Shape.js';\nimport {DeleteBuilder} from '../queries/DeleteBuilder.js';\nimport type {IDataset} from '../interfaces/IDataset.js';\nimport {rdfList} from './List.js';\nimport {serializePathToNodeData} from './serializePathToNodeData.js';\n\n/**\n * The npm scope of framework shapes (NodeShape/PropertyShape/List/PathNode/Shape) that\n * describe the meta-model itself and must never be synced as user data.\n */\nconst FRAMEWORK_PACKAGE = '@_linked/core';\n\n/**\n * Build the create-pipeline data object for a single PropertyShape (flattened under shapeIri).\n *\n * @internal Exported for tests only — not part of the public API.\n */\nexport function buildPropertyShapeData(ps: PropertyShapeData, shapeIri: string): Record<string, unknown> {\n const psIri = `${shapeIri}/${ps.label}`;\n const d: Record<string, unknown> = {\n __id: psIri,\n path: serializePathToNodeData(ps.path, psIri),\n };\n // `rdfs:label` — the DSL label, i.e. the accessor name the property is reached\n // by in code (`person.memberships`). It is NOT `sh:name`, written below, which\n // is a human-readable display string.\n //\n // Without this the label is only ever implied by `psIri`, and a reader has to\n // re-derive one from the path's local part. That works right up until the two\n // differ — `@_linked/org` declares `memberships` on the path `org:hasMembership`\n // — at which point the catalog reports `hasMembership`, the query proxy indexes\n // the shape with it, and the class (which only knows `memberships`) throws.\n // Readers already prefer a stored label and fall back to the path, so writing it\n // is the whole fix; old catalogs keep working via that fallback.\n if (ps.label) d.label = ps.label;\n if (ps.nodeKind) d.nodeKind = ps.nodeKind;\n if (ps.datatype) d.datatype = ps.datatype;\n if (typeof ps.minCount === 'number') d.minCount = ps.minCount;\n if (typeof ps.maxCount === 'number') d.maxCount = ps.maxCount;\n if (ps.name) d.name = ps.name;\n if (ps.description) d.description = ps.description;\n if (typeof ps.order === 'number') d.order = ps.order;\n if (ps.group) d.group = ps.group;\n if (typeof ps.displayRank === 'number') d.displayRank = ps.displayRank;\n if (ps.displayHidden !== undefined) d.displayHidden = ps.displayHidden;\n if (ps.class) d.class = ps.class;\n if (ps.in) d.in = rdfList(ps.in, {base: `${psIri}/in`});\n if (ps.equalsConstraint) d.equalsConstraint = ps.equalsConstraint;\n if (ps.disjoint) d.disjoint = ps.disjoint;\n if (ps.lessThan) d.lessThan = ps.lessThan;\n if (ps.lessThanOrEquals) d.lessThanOrEquals = ps.lessThanOrEquals;\n if (ps.minInclusive !== undefined) d.minInclusive = ps.minInclusive;\n if (ps.maxInclusive !== undefined) d.maxInclusive = ps.maxInclusive;\n if (ps.minExclusive !== undefined) d.minExclusive = ps.minExclusive;\n if (ps.maxExclusive !== undefined) d.maxExclusive = ps.maxExclusive;\n if (typeof ps.minLength === 'number') d.minLength = ps.minLength;\n if (typeof ps.maxLength === 'number') d.maxLength = ps.maxLength;\n // sh:pattern is serialized as its regex source string.\n if (ps.pattern) d.pattern = ps.pattern.source;\n if (ps.hasValueConstraint !== undefined) d.hasValue = ps.hasValueConstraint;\n if (ps.valueShape) d.valueShape = ps.valueShape;\n if (ps.contains) d.contains = true;\n return d;\n}\n\n/** Build the create-pipeline data object for a NodeShape and its (flattened) property shapes. */\nfunction buildNodeShapeData(nodeShape: NodeShapeData, shapeIri: string): Record<string, unknown> {\n const d: Record<string, unknown> = {};\n if (nodeShape.targetClass) d.targetClass = nodeShape.targetClass;\n if (nodeShape.description) d.description = nodeShape.description;\n if (nodeShape.extends) d.extends = nodeShape.extends;\n if (nodeShape.dependent) d.dependent = true;\n if (nodeShape.closed !== undefined) d.closed = nodeShape.closed;\n if (nodeShape.ignoredProperties && nodeShape.ignoredProperties.length) {\n d.ignoredProperties = nodeShape.ignoredProperties;\n }\n // Flatten: emit own + inherited property shapes (deduped by label) under this shape.\n d.properties = getUniquePropertyShapes(nodeShape).map((ps) =>\n buildPropertyShapeData(ps, shapeIri),\n );\n return d;\n}\n\n/**\n * The per-shape `delete → create` thunk shared by `syncShapes()` and `syncShape()`. The delete\n * cascade-cleans the shape's old property-shape / list / path subtrees; the create rebuilds them.\n *\n * `ds` (optional) targets an explicit dataset — both the delete and the create run against it\n * instead of the global router. Omitted → today's global behavior.\n */\nfunction buildSyncThunk(nodeShape: NodeShapeData, iri: string, ds?: IDataset): () => Promise<void> {\n return () => {\n // Build the data fresh on each invocation: the create pipeline mutates the node-data\n // (it strips nested `shape` keys), so a shared object can't be re-used across runs.\n const data = buildNodeShapeData(nodeShape, iri);\n return (DeleteBuilder.from(NodeShape, {id: iri}).exec(ds) as Promise<unknown>)\n .then(() =>\n (NodeShape.create(data as never).withId(iri) as unknown as {\n exec: (target?: IDataset) => Promise<unknown>;\n }).exec(ds),\n )\n .then(() => undefined);\n };\n}\n\n/** Options controlling how {@link syncShapes} treats store shapes that are not in code. */\nexport interface SyncShapesOptions {\n /**\n * How to treat NodeShapes present in the store but not in the current process's code:\n * - `'all'` (default) — prune every store-only shape as an orphan. Correct for a\n * **single-writer** dataset (CN's own storage sync, tests), where \"not in code\" ⇒ deleted.\n * - `'ownedNamespaces'` — prune a store-only shape ONLY if its IRI falls within a namespace\n * this process actually writes (the package-namespace of one of its code-registered shapes,\n * i.e. the IRI prefix up to the last `/` or `#`). This is the **multi-writer** rule (arch-04:\n * one app-data dataset, several writers): an app booting `syncShapesOnBoot` must not delete\n * shapes another writer (e.g. CN's `enableCapability`) materialized into the same dataset in a\n * package the app never registers. Renames/removals WITHIN the app's own package still prune.\n * - `'none'` — never prune; purely additive (delete→recreate the code shapes, touch nothing else).\n */\n orphanScope?: 'all' | 'ownedNamespaces' | 'none';\n}\n\n/** The owning namespace of a shape IRI — everything up to and including the last `/` or `#`. */\nfunction shapeNamespace(iri: string): string {\n const cut = Math.max(iri.lastIndexOf('/'), iri.lastIndexOf('#'));\n return cut >= 0 ? iri.slice(0, cut + 1) : iri;\n}\n\n/**\n * Plan an idempotent sync of all code-registered (non-framework) NodeShapes into the store as\n * SHACL data — the forward (code → graph) materialization of arch-05 \"code is canonical\".\n *\n * Returns built-but-unexecuted thunks; the caller controls execution and batching:\n * ```ts\n * await Promise.all((await syncShapes()).map((run) => run()));\n * ```\n * Each in-code shape's thunk runs `delete → create` in order (the delete cascade-cleans the old\n * property shapes / list / path subtrees via the containment cascade, the create rebuilds them).\n * Shapes present in the store but no longer in code are deleted as orphans (their owned subtree\n * cascades too) — subject to `options.orphanScope`. Reads existing shape IRIs for orphan detection.\n *\n * `ds` (optional) targets an explicit dataset instead of the global router. It is a **plan-time**\n * parameter: it feeds both the orphan-detection read (so orphans are computed against the same\n * store they'll be pruned from) and every delete/create thunk. Omitted → today's global behavior;\n * the returned thunks stay nullary either way.\n *\n * `options.orphanScope` (default `'all'`) scopes the orphan sweep — see {@link SyncShapesOptions}.\n * Multi-writer datasets (an app materializing on boot next to CN's capability shapes) MUST pass\n * `'ownedNamespaces'` so the sweep never clobbers another writer's shapes.\n */\nexport async function syncShapes(\n ds?: IDataset,\n options?: SyncShapesOptions,\n): Promise<Array<() => Promise<void>>> {\n const orphanScope = options?.orphanScope ?? 'all';\n // 1. Enumerate code-registered user shapes (exclude framework/meta shapes).\n const userShapes: Array<{iri: string; nodeShape: NodeShapeData}> = [];\n for (const [iri, shapeClass] of getAllShapeClasses()) {\n if (!shapeClass?.shape) continue;\n const pkg = (shapeClass as {packageName?: string}).packageName;\n // Skip framework/meta shapes: the core package, and the base `Shape` which is registered\n // directly (no applyLinkedShape) and therefore carries no packageName.\n if (!pkg || pkg === FRAMEWORK_PACKAGE) continue;\n userShapes.push({iri, nodeShape: shapeClass.shape});\n }\n const localShapeIris = new Set(userShapes.map((s) => s.iri));\n // Namespaces this process actually writes — the ownership scope for `'ownedNamespaces'` pruning.\n const ownedNamespaces = new Set(userShapes.map((s) => shapeNamespace(s.iri)));\n\n const thunks: Array<() => Promise<void>> = [];\n\n // 2. Per in-code shape: delete (cascade) then recreate.\n for (const {iri, nodeShape} of userShapes) {\n thunks.push(buildSyncThunk(nodeShape, iri, ds));\n }\n\n // 3. Orphan sweep (unless disabled). Identity-read existing NodeShape IRIs (ids only). Must hit\n // the same `ds` the thunks target, or orphans get computed against the wrong store.\n if (orphanScope !== 'none') {\n const existingRows = (await (NodeShape as unknown as {\n select: () => {exec: (target?: IDataset) => Promise<Array<{id: string}>>};\n }).select().exec(ds)) as Array<{id: string}>;\n\n // Orphan shapes (in store, not in code) → delete (cascade cleans their owned subtree). In\n // `'ownedNamespaces'` mode, only shapes within a namespace this process writes are eligible —\n // other writers' shapes (different package namespace) are left untouched.\n for (const {id: iri} of existingRows) {\n if (localShapeIris.has(iri)) continue;\n if (orphanScope === 'ownedNamespaces' && !ownedNamespaces.has(shapeNamespace(iri))) {\n continue;\n }\n thunks.push(() =>\n (DeleteBuilder.from(NodeShape, {id: iri}).exec(ds) as Promise<unknown>).then(\n () => undefined,\n ),\n );\n }\n }\n\n return thunks;\n}\n\n/**\n * Plan an idempotent sync of ONE code-registered NodeShape into the store as SHACL data.\n *\n * Scoped counterpart to {@link syncShapes}: materializes a single shape (delete → recreate, so the\n * delete cascade-cleans the old property-shape / list / path subtrees and the create rebuilds them)\n * and does NOT run the store-wide orphan sweep — other shapes in the store are untouched.\n *\n * @param target a shape class (e.g. `Person`) or its NodeShape IRI string. An IRI is resolved to\n * its registered class via `getShapeClass`; the shape must be code-registered.\n * @param ds optional explicit dataset to materialize into (a store or a router) — both the delete\n * and the create run against it instead of the global router. Omitted → global behavior.\n * @returns a single unexecuted thunk (consistent with {@link syncShapes}), so callers can batch\n * several together — e.g. a shape plus its referenced object-property shapes:\n * `await Promise.all([syncShape(Person), syncShape(Address)].map((run) => run()))`.\n * @throws if `target` is a framework/meta shape, is not registered, or has no `.shape`.\n */\nexport function syncShape(target: typeof Shape | string, ds?: IDataset): () => Promise<void> {\n // Normalize target → its registered shape class.\n const cls =\n typeof target === 'string' ? getShapeClass(target) : (target as typeof Shape);\n if (typeof target === 'string' && !cls) {\n throw new Error(`syncShape: no registered shape for IRI ${target}`);\n }\n const nodeShape = cls?.shape;\n if (!nodeShape) {\n throw new Error(\n typeof target === 'string'\n ? `syncShape: no registered shape for IRI ${target}`\n : `syncShape: shape class has no static .shape`,\n );\n }\n const iri = nodeShape.id;\n\n // Never materialize a framework/meta shape as user data — same invariant syncShapes() enforces\n // by skipping (the base Shape carries no packageName).\n const pkg = (cls as {packageName?: string}).packageName;\n if (!pkg || pkg === FRAMEWORK_PACKAGE) {\n throw new Error(`syncShape: refusing to sync framework/meta shape ${iri}`);\n }\n\n return buildSyncThunk(nodeShape, iri, ds);\n}\n"]}