@_linked/core 2.22.8 → 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.
- package/CHANGELOG.md +6 -0
- package/lib/esm/collections/CoreSet.js.map +1 -1
- package/lib/esm/collections/ShapeSet.js.map +1 -1
- package/lib/esm/expressions/Expr.js.map +1 -1
- package/lib/esm/expressions/ExpressionMethods.js.map +1 -1
- package/lib/esm/expressions/ExpressionNode.js.map +1 -1
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/interfaces/ICoreIterable.js.map +1 -1
- package/lib/esm/interfaces/IDataset.js.map +1 -1
- package/lib/esm/interfaces/IFileStore.js.map +1 -1
- package/lib/esm/ontologies/linked-core.js.map +1 -1
- package/lib/esm/ontologies/npm.js.map +1 -1
- package/lib/esm/ontologies/owl.js.map +1 -1
- package/lib/esm/ontologies/rdf.js.map +1 -1
- package/lib/esm/ontologies/rdfs.js.map +1 -1
- package/lib/esm/ontologies/shacl.js.map +1 -1
- package/lib/esm/ontologies/xsd.js.map +1 -1
- package/lib/esm/package.js.map +1 -1
- package/lib/esm/paths/PropertyPathExpr.js.map +1 -1
- package/lib/esm/paths/normalizePropertyPath.js.map +1 -1
- package/lib/esm/paths/pathExprToSparql.js.map +1 -1
- package/lib/esm/queries/AskBuilder.js.map +1 -1
- package/lib/esm/queries/AskQuery.js.map +1 -1
- package/lib/esm/queries/ContextRef.js.map +1 -1
- package/lib/esm/queries/CountBuilder.js.map +1 -1
- package/lib/esm/queries/CountQuery.js.map +1 -1
- package/lib/esm/queries/CreateBuilder.js.map +1 -1
- package/lib/esm/queries/CreateQuery.js.map +1 -1
- package/lib/esm/queries/DeleteBuilder.js.map +1 -1
- package/lib/esm/queries/DeleteQuery.js.map +1 -1
- package/lib/esm/queries/DslJsonExpression.js.map +1 -1
- package/lib/esm/queries/FieldSet.js.map +1 -1
- package/lib/esm/queries/IRAliasScope.js.map +1 -1
- package/lib/esm/queries/IRCanonicalize.js.map +1 -1
- package/lib/esm/queries/IRDesugar.js.map +1 -1
- package/lib/esm/queries/IRLower.js.map +1 -1
- package/lib/esm/queries/IRMutation.js.map +1 -1
- package/lib/esm/queries/IRPipeline.js.map +1 -1
- package/lib/esm/queries/IRProjection.js.map +1 -1
- package/lib/esm/queries/IntermediateRepresentation.js.map +1 -1
- package/lib/esm/queries/MutationQuery.js.map +1 -1
- package/lib/esm/queries/MutationSerialization.js.map +1 -1
- package/lib/esm/queries/MutationThenable.js.map +1 -1
- package/lib/esm/queries/PropertyPath.js.map +1 -1
- package/lib/esm/queries/ProxiedPathBuilder.js.map +1 -1
- package/lib/esm/queries/QueryBuilder.js.map +1 -1
- package/lib/esm/queries/QueryBuilderSerialization.js.map +1 -1
- package/lib/esm/queries/QueryContext.js.map +1 -1
- package/lib/esm/queries/QueryFactory.js.map +1 -1
- package/lib/esm/queries/SelectQuery.js.map +1 -1
- package/lib/esm/queries/UpdateBuilder.js.map +1 -1
- package/lib/esm/queries/UpdateQuery.js.map +1 -1
- package/lib/esm/queries/fromJSON.js.map +1 -1
- package/lib/esm/queries/lower.js.map +1 -1
- package/lib/esm/queries/lowerMutationJSON.js.map +1 -1
- package/lib/esm/queries/mutationLowerSpec.js.map +1 -1
- package/lib/esm/queries/queryDispatch.js.map +1 -1
- package/lib/esm/queries/reservedQueryNames.js.map +1 -1
- package/lib/esm/queries/resolveShape.js.map +1 -1
- package/lib/esm/queries/wireVersion.js.map +1 -1
- package/lib/esm/shapes/List.js.map +1 -1
- package/lib/esm/shapes/PathNode.js.map +1 -1
- package/lib/esm/shapes/SHACL.js.map +1 -1
- package/lib/esm/shapes/Shape.js.map +1 -1
- package/lib/esm/shapes/nodeShapeData.js.map +1 -1
- package/lib/esm/shapes/nodeShapeWire.js.map +1 -1
- package/lib/esm/shapes/propertyShapeTerms.js.map +1 -1
- package/lib/esm/shapes/registerRuntimeShape.js.map +1 -1
- package/lib/esm/shapes/serializePathToNodeData.js.map +1 -1
- package/lib/esm/shapes/syncShapes.js.map +1 -1
- package/lib/esm/shapes/validation.js.map +1 -1
- package/lib/esm/sparql/SparqlAlgebra.js.map +1 -1
- package/lib/esm/sparql/SparqlDataset.js.map +1 -1
- package/lib/esm/sparql/algebraToString.js.map +1 -1
- package/lib/esm/sparql/index.js.map +1 -1
- package/lib/esm/sparql/irToAlgebra.js.map +1 -1
- package/lib/esm/sparql/resultMapping.js.map +1 -1
- package/lib/esm/sparql/sparqlUtils.js.map +1 -1
- package/lib/esm/utils/LinkedErrorLogging.js.map +1 -1
- package/lib/esm/utils/LinkedFileStorage.js.map +1 -1
- package/lib/esm/utils/LinkedStorage.js.map +1 -1
- package/lib/esm/utils/NameSpace.js.map +1 -1
- package/lib/esm/utils/NodeReference.js.map +1 -1
- package/lib/esm/utils/Package.js.map +1 -1
- package/lib/esm/utils/Prefix.js.map +1 -1
- package/lib/esm/utils/ShapeClass.js.map +1 -1
- package/lib/esm/utils/URI.js.map +1 -1
- package/lib/esm/utils/cached.js.map +1 -1
- package/lib/esm/utils/loadStores.js.map +1 -1
- package/lib/esm/utils/parseDatasetsConfig.js.map +1 -1
- package/package.json +1 -1
|
@@ -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;AAE9E,yEAAyE;AACzE,MAAM,UAAU,mBAAmB,CAAC,EAAU;IAC5C,OAAO,EAAC,EAAE,EAAE,cAAc,EAAE,EAAE,EAAC,CAAC;AAClC,CAAC;AAED,qFAAqF;AACrF,MAAM,UAAU,uBAAuB;IACrC,OAAO,EAAC,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,IAA2B,EAAC,CAAC;AAChE,CAAC;AAED,8EAA8E;AAC9E,qEAAqE;AACrE,8EAA8E;AAE9E,k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AAE,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
|
-
{"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AS,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,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B,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;AA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AAG,CAAC,CAAC;QACV,MAAM,IAAI,GAAG,IAAI,GAAG,CAAS,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC;QACzC,IAAI,OAAO,GAAG,KAAK,CAAC;QACpB,OAAO,CAAA,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,0CAAE,EAAE,KAAI,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,CAAC;YAC7D,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;YAC7B,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;YAC5C,IAAI,CAAC,MAAM;gBAAE,MAAM,CAAC,4DAA4D;YAChF,OAAO,GAAG,MAAM,CAAC;YACjB,CAAC,EAAE,CAAC;QACN,CAAC;QACD,OAAO,CAAC,CAAC;IACX,CAAC,CAAC;IAEF,IAAI,UAAU,GAAG,CAAC,CAAC;IACnB,KAAK,MAAM,KAAK,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAClE,IAAI,oBAAoB,CAAC,KAAK,CAAC;YAAE,UAAU,EAAE,CAAC;IAChD,CAAC;IACD,OAAO,UAAU,CAAC;AACpB,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 * 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;YACzE,yEAAyE;YACzE,wEAAwE;YACxE,yEAAyE;YACzE,IAAI,CAAC,CAAC,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBACvB,MAAM,IAAI,KAAK,CAAC,2DAA2D,CAAC,CAAC;YAC/E,CAAC;YACD,IAAI,CAAC,CAAC,GAAG,CAAC,MAAM,KAAK,CAAC;gBAAE,OAAO,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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);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"syncShapes.js","sourceRoot":"","sources":["../../../src/shapes/syncShapes.ts"],"names":[],"mappings":";;;;;;;;;AAAA;;;;GAIG;AACH,OAAO,EAAC,kBAAkB,EAAE,aAAa,EAAC,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAC,SAAS,E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AiB,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"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../../src/shapes/validation.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,OAAO,EAAC,6BAA6B,EAAC,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAC,KAAK,EAAC,MAAM,wBAAwB,CAAC;AAC7C,OAAO,EAAC,GAAG,EAAC,MAAM,sBAAsB,CAAC;AACzC,OAAO,EAAC,oBAAoB,EAA0B,MAAM,2BAA2B,CAAC;AACxF,OAAO,EAAC,uBAAuB,EAAC,MAAM,oBAAoB,CAAC;AAE3D,OAAO,EAAC,YAAY,EAAE,aAAa,EAAC,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAAC,gBAAgB,EAAC,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAC,YAAY,EAAC,MAAM,4BAA4B,CAAC;AAgFxD,6FAA6F;AAC7F,MA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P,OAAO,EACP,KAAK,CAAC,uBAAuB,EAC7B,2BAA2B,CAAC,OAAO,CAAC,aAAa,CAAC,CACnD,CACF,CAAC;gBACF,SAAS;YACX,CAAC;YACD,OAAO,CAAC,IAAI,CACV,GAAG,YAAY,CAAC,WAAW,EAAE,EAAE,kCAC1B,IAAI,KACP,KAAK,EAAE,IAAI,CAAC,KAAK,GAAG,CAAC,EACrB,MAAM,EAAE,OAAO,CAAC,QAAQ,EACxB,SAAS,EAAE,SAAS,IACpB,CACH,CAAC;QACJ,CAAC;IACH,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;;GAIG;AACH,SAAS,2BAA2B,CAAC,EAAqB;IACxD,MAAM,KAAK,GAAG,OAAO,CAAC,EAAE,CAAC,CAAC;IAC1B,OAAO,EAAE,CAAC,UAAU;QAClB,CAAC,CAAC,iCAAiC,KAAK,iBAAiB,EAAE,CAAC,UAAU,CAAC,EAAE,sBAAsB;QAC/F,CAAC,CAAC,iCAAiC,KAAK,oDAAoD;YACxF,kFAAkF,CAAC;AAC3F,CAAC;AAED;;;;;GAKG;AACH,SAAS,iBAAiB,CACxB,EAAqB,EACrB,KAAc;;IAEd,IAAI,EAAE,CAAC,UAAU;QAAE,OAAO,MAAA,aAAa,CAAC,EAAE,CAAC,UAAU,CAAC,0CAAE,KAAK,CAAC;IAC9D,MAAM,QAAQ,GAAI,KAA2C,CAAC,KAAK,CAAC;IACpE,OAAO,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,KAAK,CAAC;AACzB,CAAC;AAED,SAAS,IAAI,CAAC,MAAc,EAAE,KAAa;IACzC,OAAO,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;AAC/C,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 * SHACL-aligned validation of plain data objects against a node shape.\n *\n * One entry point — {@link validate} — used by the create and update pipelines\n * (via `MutationQueryFactory.describe()`) and directly by callers that want to\n * know how well an object fits a shape without building a mutation.\n *\n * **Shape of the output.** This library has no triple/Turtle layer and this\n * module does not add one: a {@link ValidationReport} is plain JavaScript. It is\n * however 1-1 with the SHACL vocabulary — one key per SHACL property, named\n * after it, holding a value the mutation pipeline accepts (a literal, or a\n * `{id}` node reference for IRI-valued properties). So a report can be\n * materialized by an ordinary create query as soon as shape classes for\n * `sh:ValidationReport` / `sh:ValidationResult` exist, with no transform step:\n *\n * ```ts\n * const report = validate(Slide, data);\n * await ValidationReport.create(report); // once those shape classes exist\n * ```\n *\n * Two deliberate departures, both documented on the types: `results` is plural\n * where SHACL's repeated property is `sh:result`, and `propertyPath` is a\n * non-SHACL locator. Both map cleanly — a shape class chooses its own labels for\n * SHACL paths, and an extension property is legal on a SHACL report.\n *\n * **Coverage.** Cardinality (`sh:minCount` / `sh:maxCount`), node kind (literal\n * vs relation), undeclared properties (as `sh:closed`), `sh:datatype`, the four\n * `sh:min/maxInclusive/Exclusive` bounds, `sh:min/maxLength`, `sh:pattern` and\n * `sh:in`. Each is one entry in {@link CARDINALITY_CONSTRAINTS} or\n * {@link VALUE_CONSTRAINTS}, so adding another is one function and one test.\n *\n * Not covered: `sh:languageIn` / `sh:uniqueLang` (skipped at serialization time\n * too, so there is no metadata to check against) and `sh:hasValue`.\n */\nimport {getShapeRegistryInstanceCount} from '../utils/ShapeClass.js';\nimport {shacl} from '../ontologies/shacl.js';\nimport {xsd} from '../ontologies/xsd.js';\nimport {isNodeReferenceValue, type NodeReferenceValue} from '../utils/NodeReference.js';\nimport {getUniquePropertyShapes} from './nodeShapeData.js';\nimport type {NodeShapeData, PropertyShapeData} from './nodeShapeData.js';\nimport {getNodeShape, getShapeClass} from '../utils/ShapeClass.js';\nimport {isExpressionNode} from '../expressions/ExpressionNode.js';\nimport {asContextRef} from '../queries/QueryContext.js';\n\n/**\n * Which constraints apply to the data being validated.\n *\n * - `complete` — the object describes a whole node (a create, or a standalone\n * object being checked for fit). Properties absent from the data are genuinely\n * absent, so `sh:minCount` presence is checkable.\n * - `partial` — the object describes a change to an existing node (an update).\n * The store holds whatever the payload does not mention, so presence is\n * unknowable; only the values actually provided are checked.\n */\nexport type ValidationMode = 'complete' | 'partial';\n\n/**\n * A single constraint violation — an `sh:ValidationResult`.\n *\n * Every key is the local name of the SHACL property it carries, and every value\n * is in a form the create pipeline accepts (a literal, or a `{id}` node\n * reference for IRI-valued properties). A shape class declaring these\n * properties therefore materializes a result with no transform step:\n * `ValidationResult.create(result)`. The one non-SHACL key is `propertyPath`;\n * see {@link ValidationReport}.\n */\nexport interface ValidationResult {\n /** `sh:focusNode` — the node the violation is about, when its id is known. */\n focusNode?: NodeReferenceValue;\n /** `sh:resultPath` — the IRI of the property the violation is about. */\n resultPath?: NodeReferenceValue;\n /**\n * `sh:value` — the offending value, present only when it is an RDF term (a\n * literal or a node reference). Cardinality violations are about the property\n * rather than any one value, so they carry none.\n */\n value?: LiteralTerm | NodeReferenceValue;\n /** `sh:sourceShape` — the node or property shape carrying the constraint. */\n sourceShape?: NodeReferenceValue;\n /** `sh:sourceConstraintComponent` — which SHACL constraint failed. */\n sourceConstraintComponent: NodeReferenceValue;\n /** `sh:resultSeverity` — `sh:Violation`, `sh:Warning` or `sh:Info`. */\n resultSeverity: NodeReferenceValue;\n /** `sh:resultMessage` — human-readable explanation. */\n resultMessage: string;\n /**\n * **Not SHACL.** The property's label, dot-joined through nested shapes\n * (`author.fullName`) — the locator a caller needs to point at a field in the\n * object they passed in, which `sh:resultPath` alone cannot give (it names the\n * property, not where the nesting reached it). Materializes like any other\n * property once a shape class declares it; drop it for a pure-SHACL result.\n */\n propertyPath?: string;\n}\n\n/**\n * The outcome of a validation run — an `sh:ValidationReport`.\n *\n * Plain objects, 1-1 with the SHACL vocabulary, so a report can later be\n * materialized through an ordinary create query against shape classes for\n * `sh:ValidationReport` / `sh:ValidationResult` — whether or not this library\n * ever ships those classes. `results` is the sole plural rename (SHACL's\n * property is `sh:result`, repeated); a shape class maps it with\n * `@objectProperty({path: shacl.result, …}) get results()`.\n */\nexport interface ValidationReport {\n /** `sh:conforms` — true when there are no `sh:Violation`-severity results. */\n conforms: boolean;\n /** `sh:result` — every violation found, in deterministic order. */\n results: ValidationResult[];\n}\n\n/** The literal types the mutation pipeline accepts as a value. */\ntype LiteralTerm = string | number | boolean | Date;\n\nexport interface ValidateOptions {\n /** Defaults to `complete`. */\n mode?: ValidationMode;\n /** How deep to descend into nested node descriptions. Defaults to 10. */\n maxDepth?: number;\n}\n\n/** Thrown by {@link assertValid} — carries the full report, not just the first violation. */\nexport class ShapeValidationError extends Error {\n readonly report: ValidationReport;\n constructor(report: ValidationReport) {\n super(report.results.map((r) => r.resultMessage).join('\\n'));\n this.name = 'ShapeValidationError';\n this.report = report;\n }\n}\n\n/**\n * Keys that carry metadata about the node rather than a property value: `id` /\n * `__id` name it, and `shape` names the shape of a nested value when the\n * property shape itself doesn't declare one (see `convertUpdateValue`).\n */\nconst RESERVED_KEYS = new Set(['id', '__id', 'shape']);\n\n/**\n * The message for an undeclared property key. Shared with the normalization path\n * in `MutationQuery`, which needs the same guard to build a field at all.\n */\nexport function undeclaredPropertyMessage(key: string, shape: NodeShapeData): string {\n const shapeName = shape.label || shape.id?.split('/').pop();\n const base =\n `Invalid property key: ${key}. The shape ${shapeName} does not have a registered ` +\n `property with this name. Make sure the get/set method exists, and that it uses a ` +\n `@objectProperty or @literalProperty decorator.`;\n\n // If more than one copy of the shape registry module has evaluated, this message is\n // very probably lying: the property IS declared, on a copy this code cannot see.\n // Saying so here is the whole point — the previous version of this error accused\n // correct application code, and finding the real cause took a day of eliminating\n // innocent suspects. See docs/reports/043-module-identity-in-the-backend.md.\n const copies = getShapeRegistryInstanceCount();\n if (copies > 1) {\n return (\n `${base}\\n\\n` +\n `NOTE: ${copies} copies of the shape registry have loaded in this process. If this ` +\n `property is declared, it almost certainly registered on a different copy than the ` +\n `one validating here, and the declaration is not the problem. This happens when part ` +\n `of the app resolves a framework package to its source and part to its built output.`\n );\n }\n return base;\n}\n\n// ---------------------------------------------------------------------------\n// Constraint components\n// ---------------------------------------------------------------------------\n\n/** What a constraint check needs to know about the property it is checking. */\ninterface PropertyContext {\n shape: NodeShapeData;\n propertyShape: PropertyShapeData;\n /** Dot-joined label path from the root of the validated object. */\n property: string;\n focusNode?: string;\n mode: ValidationMode;\n}\n\n/**\n * A constraint check. Receives the property's values already normalized to an\n * array (a single value becomes a one-element array) and returns any violations.\n */\ntype ConstraintCheck = (values: unknown[], ctx: PropertyContext) => ValidationResult[];\n\n/**\n * `sh:value` must be an RDF term. A literal or a node reference is one; a plain\n * object, array or function is not, so it is left off rather than emitted as\n * something no store could materialize — the message still names it.\n */\nfunction asTerm(value: unknown): LiteralTerm | NodeReferenceValue | undefined {\n if (isScalarValue(value)) return value as LiteralTerm;\n if (isNodeReference(value)) return {id: (value as NodeReferenceValue).id};\n return undefined;\n}\n\n/**\n * A violation about the node itself rather than one of its property shapes —\n * `sh:sourceShape` is the node shape, and there is no `sh:resultPath` (an\n * undeclared key has no property IRI to point at).\n */\nfunction nodeViolation(\n shape: NodeShapeData,\n ctx: {focusNode?: string},\n component: NodeReferenceValue,\n message: string,\n propertyPath?: string,\n value?: unknown,\n): ValidationResult {\n const result: ValidationResult = {\n sourceConstraintComponent: component,\n resultSeverity: shacl.Violation,\n resultMessage: message,\n };\n if (ctx.focusNode) result.focusNode = {id: ctx.focusNode};\n if (propertyPath) result.propertyPath = propertyPath;\n const term = asTerm(value);\n if (term !== undefined) result.value = term;\n if (shape.id) result.sourceShape = {id: shape.id};\n return result;\n}\n\n/**\n * Build a result, omitting absent keys entirely — an `undefined` value is not a\n * property the create pipeline should see.\n */\nfunction violation(\n ctx: PropertyContext,\n component: NodeReferenceValue,\n message: string,\n value?: unknown,\n): ValidationResult {\n const result: ValidationResult = {\n sourceConstraintComponent: component,\n resultSeverity: shacl.Violation,\n resultMessage: message,\n };\n if (ctx.focusNode) result.focusNode = {id: ctx.focusNode};\n const path = ctx.propertyShape.path as NodeReferenceValue | undefined;\n if (path?.id) result.resultPath = {id: path.id};\n if (ctx.property) result.propertyPath = ctx.property;\n const term = asTerm(value);\n if (term !== undefined) result.value = term;\n const sourceShape = ctx.propertyShape.id || ctx.shape.id;\n if (sourceShape) result.sourceShape = {id: sourceShape};\n return result;\n}\n\n/** The label used in messages — the property's own label, not its nested path. */\nfunction labelOf(ps: PropertyShapeData): string {\n return ps.label || ps.id;\n}\n\n/** `sh:maxCount` — no more values than the shape allows. */\nconst maxCountCheck: ConstraintCheck = (values, ctx) => {\n const {maxCount} = ctx.propertyShape;\n if (typeof maxCount !== 'number' || values.length <= maxCount) return [];\n return [\n violation(\n ctx,\n shacl.MaxCountConstraintComponent,\n `Property '${labelOf(ctx.propertyShape)}' allows at most ${maxCount} value(s), but ${values.length} were provided.`,\n ),\n ];\n};\n\n/** `sh:minCount` — at least as many values as the shape requires. */\nconst minCountCheck: ConstraintCheck = (values, ctx) => {\n const {minCount} = ctx.propertyShape;\n if (typeof minCount !== 'number' || minCount <= 0 || values.length >= minCount) return [];\n return [\n violation(\n ctx,\n shacl.MinCountConstraintComponent,\n `Property '${labelOf(ctx.propertyShape)}' requires at least ${minCount} value(s), but ${values.length} were provided.`,\n ),\n ];\n};\n\n/** True when the property clearly accepts only literal values. */\nfunction expectsLiteral(ps: PropertyShapeData): boolean {\n if (ps.nodeKind) return ps.nodeKind.id === shacl.Literal.id;\n return !!ps.datatype && !ps.valueShape;\n}\n\n/** True when the property clearly accepts only nodes (IRIs/blank nodes). */\nfunction expectsNode(ps: PropertyShapeData): boolean {\n if (ps.nodeKind) {\n return (\n ps.nodeKind.id === shacl.IRI.id ||\n ps.nodeKind.id === shacl.BlankNode.id ||\n ps.nodeKind.id === shacl.BlankNodeOrIRI.id\n );\n }\n return !!ps.valueShape;\n}\n\nfunction isScalarValue(value: unknown): boolean {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n typeof value === 'boolean' ||\n value instanceof Date\n );\n}\n\n/**\n * `sh:nodeKind` — literal properties reject nodes/objects, relation properties\n * reject bare scalars. Ambiguous kinds (`sh:IRIOrLiteral`, or no `nodeKind` and\n * no `datatype`/`valueShape` to infer from) are not enforced.\n */\nconst nodeKindCheck: ConstraintCheck = (values, ctx) => {\n const ps = ctx.propertyShape;\n const literalExpected = expectsLiteral(ps);\n const nodeExpected = expectsNode(ps);\n if (!literalExpected && !nodeExpected) return [];\n\n const results: ValidationResult[] = [];\n for (const el of values) {\n if (!isCheckableElement(el)) continue;\n const scalar = isScalarValue(el);\n if (literalExpected && !scalar) {\n results.push(\n violation(\n ctx,\n shacl.NodeKindConstraintComponent,\n `Property '${labelOf(ps)}' is a literal property but was given a ${typeof el === 'object' ? 'node/object' : typeof el} value.`,\n el,\n ),\n );\n } else if (nodeExpected && scalar) {\n results.push(\n violation(\n ctx,\n shacl.NodeKindConstraintComponent,\n `Property '${labelOf(ps)}' is a relation (object) property but was given a literal (${typeof el}). Provide a {id} reference or a nested object.`,\n el,\n ),\n );\n }\n }\n return results;\n};\n\n/**\n * An element worth checking: a concrete value rather than something whose final\n * form is decided elsewhere (an expression, a context ref, an absent value).\n */\nfunction isCheckableElement(el: unknown): boolean {\n return el !== null && el !== undefined && !isExpressionNode(el) && !asContextRef(el);\n}\n\nconst XSD_BASE = xsd.string.id.slice(0, -'string'.length);\n\n/** `xsd:integer` rather than the full IRI, when the datatype is an XSD one. */\nfunction datatypeLabel(datatype: NodeReferenceValue): string {\n return datatype.id.startsWith(XSD_BASE)\n ? `xsd:${datatype.id.slice(XSD_BASE.length)}`\n : datatype.id;\n}\n\n/** How a value reads in a message — its JS kind, which is what went wrong. */\nfunction describeValue(value: unknown): string {\n if (value instanceof Date) return 'a Date';\n if (Array.isArray(value)) return 'an array';\n if (typeof value === 'number') return Number.isInteger(value) ? 'a whole number' : 'a decimal number';\n if (typeof value === 'object') return 'a node/object';\n return `a ${typeof value}`;\n}\n\nconst isFiniteNumber = (v: unknown) => typeof v === 'number' && Number.isFinite(v);\n\n/**\n * What each XSD datatype accepts as a JavaScript value.\n *\n * This matters more than a normal type check: mutation literals are typed from\n * the *JavaScript* type when they reach SPARQL (`irToAlgebra`), not from the\n * declared datatype — a number becomes `xsd:integer`/`xsd:double`, a boolean\n * `xsd:boolean`, a `Date` `xsd:dateTime`, and a string an untyped literal. So a\n * string handed to an `xsd:integer` property does not merely skip a check, it\n * writes the wrong RDF term. Rejecting it is a correctness fix.\n *\n * `xsd:date` and `xsd:dateTime` take a `Date` and nothing else — one representation for a point\n * in time, rather than a JS object and a hand-written lexical string that behave differently.\n * The serializer derives the right lexical form from the declared datatype\n * (`irToAlgebra.dateToTerm`), so an `xsd:date` property gets `\"2020-06-15\"^^xsd:date` from the\n * same `Date` an `xsd:dateTime` property gets a full timestamp from.\n *\n * `xsd:time` is the exception, and takes a STRING. A `Date` cannot express a time of day without\n * inventing a date to carry it: the date half is meaningless, has to be discarded on\n * serialization, and makes two identical clock times on different days compare unequal. JS has\n * no time-only type — `Temporal.PlainTime` is the right answer and is not available yet — so the\n * lexical form is the honest representation. It is pattern-checked here, and `irToAlgebra` types\n * it from the declared datatype so it is written `\"10:30:00\"^^xsd:time` rather than as a plain\n * literal.\n *\n * Datatypes with no obvious JS counterpart (`xsd:duration`, `xsd:gYear`,\n * `xsd:Bytes`) are not checked.\n */\n/**\n * `HH:MM:SS` with optional milliseconds and optional timezone.\n *\n * Ranges are enforced by the pattern rather than parsed: hours 00-23, minutes and seconds 00-59,\n * so \"25:00:00\" is rejected where a looser `\\d{2}` would let it through and write a malformed\n * literal. The optional `Z`/offset is included because it is valid `xsd:time` — rejecting\n * \"14:30:00Z\" would make this stricter than the datatype it validates.\n */\nconst XSD_TIME_PATTERN = /^([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(\\.\\d{1,3})?(Z|[+-]([01]\\d|2[0-3]):[0-5]\\d)?$/;\n\nconst DATATYPE_RULES: Record<string, {accepts: (v: unknown) => boolean; expected: string}> = {\n [xsd.string.id]: {accepts: (v) => typeof v === 'string', expected: 'a string'},\n [xsd.boolean.id]: {accepts: (v) => typeof v === 'boolean', expected: 'a boolean'},\n [xsd.integer.id]: {accepts: (v) => isFiniteNumber(v) && Number.isInteger(v), expected: 'a whole number'},\n [xsd.long.id]: {accepts: (v) => isFiniteNumber(v) && Number.isInteger(v), expected: 'a whole number'},\n [xsd.decimal.id]: {accepts: isFiniteNumber, expected: 'a number'},\n [xsd.float.id]: {accepts: isFiniteNumber, expected: 'a number'},\n [xsd.double.id]: {accepts: isFiniteNumber, expected: 'a number'},\n [xsd.date.id]: {accepts: (v) => v instanceof Date, expected: 'a Date'},\n [xsd.dateTime.id]: {accepts: (v) => v instanceof Date, expected: 'a Date'},\n [xsd.time.id]: {\n accepts: (v) => typeof v === 'string' && XSD_TIME_PATTERN.test(v),\n expected: 'a time string like \"14:30:00\", \"14:30:00.250\" or \"14:30:00Z\"',\n },\n};\n\n/** `sh:datatype` — the value's JavaScript type must match the declared datatype. */\nconst datatypeCheck: ConstraintCheck = (values, ctx) => {\n const ps = ctx.propertyShape;\n if (!ps.datatype) return [];\n const rule = DATATYPE_RULES[ps.datatype.id];\n if (!rule) return [];\n\n const results: ValidationResult[] = [];\n for (const el of values) {\n // A node reference is a node-kind problem, not a datatype one — one\n // violation per mistake, reported by the check that owns it.\n if (!isCheckableElement(el) || isNodeReference(el) || rule.accepts(el)) continue;\n results.push(\n violation(\n ctx,\n shacl.DatatypeConstraintComponent,\n `Property '${labelOf(ps)}' expects ${datatypeLabel(ps.datatype)} (${rule.expected}), but was given ${describeValue(el)}.`,\n el,\n ),\n );\n }\n return results;\n};\n\n/** The four `sh:min/maxInclusive/Exclusive` range constraints, on numbers. */\nconst rangeCheck: ConstraintCheck = (values, ctx) => {\n const ps = ctx.propertyShape;\n const bounds: {\n limit: unknown;\n component: NodeReferenceValue;\n ok: (v: number, limit: number) => boolean;\n phrase: string;\n }[] = [\n {limit: ps.minInclusive, component: shacl.MinInclusiveConstraintComponent, ok: (v, l) => v >= l, phrase: 'at least'},\n {limit: ps.maxInclusive, component: shacl.MaxInclusiveConstraintComponent, ok: (v, l) => v <= l, phrase: 'at most'},\n {limit: ps.minExclusive, component: shacl.MinExclusiveConstraintComponent, ok: (v, l) => v > l, phrase: 'greater than'},\n {limit: ps.maxExclusive, component: shacl.MaxExclusiveConstraintComponent, ok: (v, l) => v < l, phrase: 'less than'},\n ];\n const active = bounds.filter((b) => typeof b.limit === 'number');\n if (!active.length) return [];\n\n const results: ValidationResult[] = [];\n for (const el of values) {\n // Non-numbers are the datatype check's business.\n if (!isCheckableElement(el) || typeof el !== 'number') continue;\n for (const bound of active) {\n if (bound.ok(el, bound.limit as number)) continue;\n results.push(\n violation(\n ctx,\n bound.component,\n `Property '${labelOf(ps)}' must be ${bound.phrase} ${bound.limit}, but was given ${el}.`,\n el,\n ),\n );\n }\n }\n return results;\n};\n\n/** `sh:minLength` / `sh:maxLength`, on strings. */\nconst lengthCheck: ConstraintCheck = (values, ctx) => {\n const ps = ctx.propertyShape;\n if (typeof ps.minLength !== 'number' && typeof ps.maxLength !== 'number') return [];\n\n const results: ValidationResult[] = [];\n for (const el of values) {\n if (!isCheckableElement(el) || typeof el !== 'string') continue;\n if (typeof ps.minLength === 'number' && el.length < ps.minLength) {\n results.push(\n violation(\n ctx,\n shacl.MinLengthConstraintComponent,\n `Property '${labelOf(ps)}' must be at least ${ps.minLength} character(s), but was given ${el.length}.`,\n el,\n ),\n );\n }\n if (typeof ps.maxLength === 'number' && el.length > ps.maxLength) {\n results.push(\n violation(\n ctx,\n shacl.MaxLengthConstraintComponent,\n `Property '${labelOf(ps)}' must be at most ${ps.maxLength} character(s), but was given ${el.length}.`,\n el,\n ),\n );\n }\n }\n return results;\n};\n\n/** `sh:pattern` — the string form of the value must match the shape's regex. */\nconst patternCheck: ConstraintCheck = (values, ctx) => {\n const ps = ctx.propertyShape;\n if (!ps.pattern) return [];\n // Rebuild without `g`/`y`: those carry `lastIndex` between calls, so a shared\n // shape regex would match every other value.\n const regex = new RegExp(ps.pattern.source, ps.pattern.flags.replace(/[gy]/g, ''));\n\n const results: ValidationResult[] = [];\n for (const el of values) {\n if (!isCheckableElement(el) || typeof el !== 'string') continue;\n if (regex.test(el)) continue;\n results.push(\n violation(\n ctx,\n shacl.PatternConstraintComponent,\n `Property '${labelOf(ps)}' must match ${String(ps.pattern)}, but was given \"${el}\".`,\n el,\n ),\n );\n }\n return results;\n};\n\n/** `sh:in` — the value must be one of the shape's allowed values. */\nconst inCheck: ConstraintCheck = (values, ctx) => {\n const ps = ctx.propertyShape;\n if (!ps.in?.length) return [];\n const allowed = ps.in;\n const matches = (el: unknown) =>\n allowed.some((a) =>\n isNodeReferenceValue(a)\n ? isNodeReference(el) && (el as NodeReferenceValue).id === a.id\n : a === el,\n );\n\n const results: ValidationResult[] = [];\n for (const el of values) {\n if (!isCheckableElement(el) || matches(el)) continue;\n const rendered = allowed\n .map((a) => (isNodeReferenceValue(a) ? a.id : JSON.stringify(a)))\n .join(', ');\n results.push(\n violation(\n ctx,\n shacl.InConstraintComponent,\n `Property '${labelOf(ps)}' must be one of [${rendered}].`,\n el,\n ),\n );\n }\n return results;\n};\n\n/**\n * The registry. Every property-level constraint the library enforces lives here;\n * adding another SHACL component is one more entry plus its test.\n *\n * Split by what each kind of check needs to see. **Cardinality** needs the\n * property's whole value set, so it cannot run against a set modification —\n * `{add: […]}` changes a count that lives in the store. **Value** checks need\n * only the value in hand, so they run everywhere a concrete value appears,\n * including inside `add`.\n *\n * Cardinality runs first when it runs at all: a count problem explains itself\n * better than the per-value violations that would follow it.\n */\nconst CARDINALITY_CONSTRAINTS: ConstraintCheck[] = [maxCountCheck, minCountCheck];\n\nconst VALUE_CONSTRAINTS: ConstraintCheck[] = [\n nodeKindCheck,\n datatypeCheck,\n rangeCheck,\n lengthCheck,\n patternCheck,\n inCheck,\n];\n\nconst PROPERTY_CONSTRAINTS: ConstraintCheck[] = [\n ...CARDINALITY_CONSTRAINTS,\n ...VALUE_CONSTRAINTS,\n];\n\n// ---------------------------------------------------------------------------\n// Value classification\n// ---------------------------------------------------------------------------\n\n/**\n * A `{add, remove}` set modification. The resulting value count depends on the\n * node's current state, so cardinality and kind are unknowable here.\n */\nfunction isSetModification(value: unknown): boolean {\n if (typeof value !== 'object' || value === null) return false;\n const obj = value as Record<string, unknown>;\n const expected = (obj.add ? 1 : 0) + (obj.remove ? 1 : 0);\n return expected > 0 && Object.getOwnPropertyNames(obj).length === expected;\n}\n\n/** An object carrying only an `id` — a reference to an existing node, not a description. */\nfunction isNodeReference(value: unknown): boolean {\n return (\n typeof value === 'object' &&\n value !== null &&\n 'id' in value &&\n Object.keys(value).length === 1\n );\n}\n\n/**\n * A value that stands for something resolved later — an expression, a query\n * context reference, a callback, or nothing at all.\n *\n * Must be ruled out *before* anything reads properties off the value: a resolved\n * context ref is a query proxy that throws on any undecorated key, so probing it\n * for `.add` is not a safe way to ask what it is.\n */\nfunction isDeferredValue(value: unknown): boolean {\n return (\n value === undefined ||\n typeof value === 'function' ||\n isExpressionNode(value) ||\n !!asContextRef(value)\n );\n}\n\n/** Values whose final shape isn't knowable without the store or a lowering pass. */\nfunction isOpaqueValue(value: unknown): boolean {\n return isDeferredValue(value) || isSetModification(value);\n}\n\n/** A nested node description — an object to descend into, rather than a leaf value. */\nfunction isNodeDescription(value: unknown): boolean {\n return (\n typeof value === 'object' &&\n value !== null &&\n !Array.isArray(value) &&\n !(value instanceof Date) &&\n !isNodeReference(value) &&\n !isOpaqueValue(value)\n );\n}\n\n// ---------------------------------------------------------------------------\n// Entry points\n// ---------------------------------------------------------------------------\n\n/**\n * What can be validated against: a shape class (`Person`) or the plain\n * `NodeShapeData` the decorators generate (`Person.shape`, or the same object\n * obtained anywhere else). The two are interchangeable — the class is unwrapped\n * to its `shape` and nothing else about it is read.\n */\nexport type ValidatableShape = NodeShapeData | {shape: NodeShapeData};\n\nfunction resolveShapeData(shape: ValidatableShape): NodeShapeData {\n const resolved = 'propertyShapes' in shape ? shape : (shape as {shape: NodeShapeData}).shape;\n if (!resolved) {\n throw new Error(\n 'validate() requires a node shape or a shape class with a static `shape`. ' +\n 'Did you pass an unregistered class (missing @linkedShape)?',\n );\n }\n return resolved as NodeShapeData;\n}\n\n/**\n * Validate a plain data object against a node shape.\n *\n * Never throws for invalid *data* — a violation is a result, not an exception.\n * (It does throw when the *shape* argument itself is unusable.)\n *\n * ```ts\n * const report = validate(Person, {name: ['a', 'b']});\n * report.conforms; // false\n * report.results[0].sourceConstraintComponent.id; // …shacl#MaxCountConstraintComponent\n * ```\n *\n * **A shape class is optional.** The plain `NodeShapeData` the decorators\n * generate validates identically, so a caller that only ever holds shape\n * objects needs no class reference:\n *\n * ```ts\n * validate(Person, data); // ≡\n * validate(Person.shape, data); // same report\n * ```\n *\n * That holds even though a shape object carries neither its inherited property\n * shapes (a subclass's `propertyShapes` holds only its own) nor its nested\n * shapes (`valueShape` is a bare `{id}`): both are resolved through the shape\n * registry by id. A shape whose id is not registered therefore cannot be fully\n * checked, and says so — see {@link unresolvedValueShapeMessage} and the\n * inherited-properties check in `validateNode` — rather than reporting a node\n * as conforming on the strength of a branch it could not look at.\n */\nexport function validate(\n shape: ValidatableShape,\n data: unknown,\n options: ValidateOptions = {},\n): ValidationReport {\n const {mode = 'complete', maxDepth = 10} = options;\n const results = validateNode(resolveShapeData(shape), data, {\n mode,\n maxDepth,\n depth: 0,\n prefix: '',\n });\n return {\n conforms: !results.some((r) => r.resultSeverity.id === shacl.Violation.id),\n results,\n };\n}\n\n/** {@link validate}, but throws a {@link ShapeValidationError} when the data doesn't conform. */\nexport function assertValid(\n shape: ValidatableShape,\n data: unknown,\n options: ValidateOptions = {},\n): void {\n const report = validate(shape, data, options);\n if (!report.conforms) throw new ShapeValidationError(report);\n}\n\n// ---------------------------------------------------------------------------\n// Walk\n// ---------------------------------------------------------------------------\n\ninterface WalkContext {\n mode: ValidationMode;\n maxDepth: number;\n depth: number;\n /** Dot-joined label path of the node being validated (`''` at the root). */\n prefix: string;\n focusNode?: string;\n}\n\nfunction validateNode(\n shape: NodeShapeData,\n data: unknown,\n ctx: WalkContext,\n): ValidationResult[] {\n if (typeof data !== 'object' || data === null || Array.isArray(data)) {\n return [\n nodeViolation(\n shape,\n ctx,\n shacl.NodeConstraintComponent,\n `Expected an object describing '${shape.label || shape.id}', but got ${data === null ? 'null' : typeof data}.`,\n ctx.prefix,\n data,\n ),\n ];\n }\n\n const obj = data as Record<string, unknown>;\n const propertyShapes = getUniquePropertyShapes(shape);\n const byLabel = new Map(propertyShapes.map((ps) => [ps.label, ps]));\n const focusNode =\n typeof obj.__id === 'string'\n ? obj.__id\n : typeof obj.id === 'string'\n ? obj.id\n : ctx.focusNode;\n const results: ValidationResult[] = [];\n\n // A shape declaring a superclass carries only its *own* property shapes; the\n // inherited ones are resolved through the registry by id. If this shape's id\n // is not registered, that resolution quietly yields half a shape — required\n // inherited properties go unchecked, and any that *are* supplied look\n // undeclared. Report it rather than let a partial shape pass as a clean bill.\n //\n // \"Registered\" means present in EITHER registry. Checking only for a class rejected\n // exactly the shapes the metamodel work exists to support: a data-only child is\n // registered, its parent resolves, and its inherited properties are checked — it simply\n // has no class, which is not a defect.\n if (shape.extends?.id && !getShapeClass(shape.id) && !getNodeShape(shape.id)) {\n results.push(\n nodeViolation(\n shape,\n {focusNode},\n shacl.NodeConstraintComponent,\n `Cannot resolve the properties '${shape.label || shape.id}' inherits from '${shape.extends.id}': shape '${shape.id}' is not registered, so only its own properties could be checked.`,\n ctx.prefix,\n ),\n );\n }\n\n // Presence of required properties — only decidable for a complete description.\n if (ctx.mode === 'complete') {\n for (const ps of propertyShapes) {\n if (typeof ps.minCount !== 'number' || ps.minCount <= 0) continue;\n if (ps.label in obj) continue;\n results.push(\n violation(\n {shape, propertyShape: ps, property: join(ctx.prefix, ps.label), focusNode, mode: ctx.mode},\n shacl.MinCountConstraintComponent,\n `Property '${labelOf(ps)}' requires at least ${ps.minCount} value(s), but none were provided.`,\n ),\n );\n }\n }\n\n // The values actually provided.\n for (const [key, value] of Object.entries(obj)) {\n if (RESERVED_KEYS.has(key)) continue;\n const propertyShape = byLabel.get(key);\n if (!propertyShape) {\n results.push(\n nodeViolation(\n shape,\n {...ctx, focusNode},\n shacl.ClosedConstraintComponent,\n undeclaredPropertyMessage(key, shape),\n join(ctx.prefix, key),\n value,\n ),\n );\n continue;\n }\n results.push(\n ...validateProperty(value, {\n shape,\n propertyShape,\n property: join(ctx.prefix, key),\n focusNode,\n mode: ctx.mode,\n }, ctx),\n );\n }\n\n return results;\n}\n\nfunction validateProperty(\n value: unknown,\n propCtx: PropertyContext,\n walk: WalkContext,\n): ValidationResult[] {\n const ps = propCtx.propertyShape;\n\n // `null` clears the property — the same as providing zero values, so clearing\n // a required one is a cardinality violation (both spellings behave alike).\n if (value === null) {\n if (typeof ps.minCount === 'number' && ps.minCount > 0) {\n return [\n violation(\n propCtx,\n shacl.MinCountConstraintComponent,\n `Property '${labelOf(ps)}' requires at least ${ps.minCount} value(s) and cannot be cleared.`,\n ),\n ];\n }\n return [];\n }\n\n // Ruled out first: reading `.add` off a resolved context proxy would throw.\n if (isDeferredValue(value)) return [];\n\n // A set modification adds to and removes from what the store already holds,\n // so the resulting *count* is unknowable here — but each added value is as\n // checkable as any other, and skipping them let mistyped literals through the\n // one door the rest of this module closes. `remove` takes `{id}` references\n // only, which normalization enforces on its own.\n if (isSetModification(value)) {\n const {add} = value as {add?: unknown};\n if (add === undefined) return [];\n return runChecks(VALUE_CONSTRAINTS, toValues(add), propCtx, walk);\n }\n\n return runChecks(PROPERTY_CONSTRAINTS, toValues(value), propCtx, walk);\n}\n\n/** A property's value(s) as an array — a single value becomes a one-element one. */\nfunction toValues(value: unknown): unknown[] {\n return Array.isArray(value) ? value : [value];\n}\n\n/**\n * Run a set of constraint checks over a property's values, then descend into any\n * nested node descriptions among them (`sh:node`-style recursion). A bare `{id}`\n * is a reference to an existing node and has nothing to validate; an object with\n * an id *and* data is a nested create with a predefined id.\n */\nfunction runChecks(\n checks: ConstraintCheck[],\n values: unknown[],\n propCtx: PropertyContext,\n walk: WalkContext,\n): ValidationResult[] {\n const results: ValidationResult[] = [];\n for (const check of checks) {\n results.push(...check(values, propCtx));\n }\n\n if (walk.depth < walk.maxDepth) {\n for (const el of values) {\n if (!isNodeDescription(el)) continue;\n const nestedShape = resolveValueShape(propCtx.propertyShape, el);\n if (!nestedShape) {\n // The value is a node description we have no shape for, so nothing about\n // it can be checked. Silently skipping would report the whole node as\n // conforming on the strength of a branch never looked at.\n results.push(\n violation(\n propCtx,\n shacl.NodeConstraintComponent,\n unresolvedValueShapeMessage(propCtx.propertyShape),\n ),\n );\n continue;\n }\n results.push(\n ...validateNode(nestedShape, el, {\n ...walk,\n depth: walk.depth + 1,\n prefix: propCtx.property,\n focusNode: undefined,\n }),\n );\n }\n }\n\n return results;\n}\n\n/**\n * Why a nested value could not be resolved to a shape — the property named one\n * that is not registered, or named none and the value did not carry one either.\n * Both are actionable, and they are fixed differently.\n */\nfunction unresolvedValueShapeMessage(ps: PropertyShapeData): string {\n const label = labelOf(ps);\n return ps.valueShape\n ? `Cannot validate the value of '${label}': its shape '${ps.valueShape.id}' is not registered.`\n : `Cannot validate the value of '${label}': the property declares no shape for its values. ` +\n `Add a 'shape' to its @objectProperty decorator, or give the value a 'shape' key.`;\n}\n\n/**\n * The shape a nested value should be validated against: the property's declared\n * `valueShape`, or — for properties that declare none — the shape class carried\n * in the value's reserved `shape` key. Mirrors `convertUpdateValue`; returns\n * undefined when neither is available.\n */\nfunction resolveValueShape(\n ps: PropertyShapeData,\n value: unknown,\n): NodeShapeData | undefined {\n if (ps.valueShape) return getShapeClass(ps.valueShape)?.shape;\n const declared = (value as {shape?: {shape?: NodeShapeData}}).shape;\n return declared?.shape;\n}\n\nfunction join(prefix: string, label: string): string {\n return prefix ? `${prefix}.${label}` : label;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SparqlAlgebra.js","sourceRoot":"","sources":["../../../src/sparql/SparqlAlgebra.ts"],"names":[],"mappings":"AAAA,qBAAqB"}
|
|
1
|
+
{"version":3,"file":"SparqlAlgebra.js","sourceRoot":"","sources":["../../../src/sparql/SparqlAlgebra.ts"],"names":[],"mappings":"AAAA,qBAAqB","sourcesContent":["// --- Term types ---\n\nexport type SparqlTerm =\n | {kind: 'variable'; name: string}\n | {kind: 'iri'; value: string}\n | {kind: 'literal'; value: string; datatype?: string; language?: string}\n | {kind: 'path'; value: string; uris: string[]};\n\nexport type SparqlTriple = {\n subject: SparqlTerm;\n predicate: SparqlTerm;\n object: SparqlTerm;\n};\n\n// --- Algebra node types ---\n\nexport type SparqlAlgebraNode =\n | SparqlBGP\n | SparqlJoin\n | SparqlLeftJoin\n | SparqlFilter\n | SparqlUnion\n | SparqlMinus\n | SparqlExtend\n | SparqlGraph\n | SparqlValues\n | SparqlSubSelect;\n\nexport type SparqlBGP = {\n type: 'bgp';\n triples: SparqlTriple[];\n};\n\nexport type SparqlJoin = {\n type: 'join';\n left: SparqlAlgebraNode;\n right: SparqlAlgebraNode;\n};\n\nexport type SparqlLeftJoin = {\n type: 'left_join';\n left: SparqlAlgebraNode;\n right: SparqlAlgebraNode;\n condition?: SparqlExpression;\n};\n\nexport type SparqlFilter = {\n type: 'filter';\n expression: SparqlExpression;\n inner: SparqlAlgebraNode;\n};\n\nexport type SparqlUnion = {\n type: 'union';\n left: SparqlAlgebraNode;\n right: SparqlAlgebraNode;\n};\n\nexport type SparqlMinus = {\n type: 'minus';\n left: SparqlAlgebraNode;\n right: SparqlAlgebraNode;\n};\n\nexport type SparqlExtend = {\n type: 'extend';\n inner: SparqlAlgebraNode;\n variable: string;\n expression: SparqlExpression;\n};\n\nexport type SparqlGraph = {\n type: 'graph';\n iri: string;\n inner: SparqlAlgebraNode;\n};\n\nexport type SparqlValues = {\n type: 'values';\n variable: string;\n iris: string[];\n};\n\n/**\n * A nested sub-SELECT used as a group graph pattern inside a WHERE block.\n *\n * Emitted for nested-select inner LIMIT/OFFSET: the root→child traverse is\n * wrapped in `{ SELECT <projection> WHERE { <inner> } ORDER BY … LIMIT … OFFSET … }`\n * so the related collection is bounded per parent. Only valid when the outer\n * query targets a single root subject (see irToAlgebra).\n */\nexport type SparqlSubSelect = {\n type: 'subselect';\n projection: string[];\n inner: SparqlAlgebraNode;\n orderBy?: SparqlOrderCondition[];\n limit?: number;\n offset?: number;\n};\n\n// --- Expressions ---\n\nexport type SparqlExpression =\n | SparqlVariableExpr\n | SparqlIriExpr\n | SparqlLiteralExpr\n | SparqlBinaryExpr\n | SparqlLogicalExpr\n | SparqlNotExpr\n | SparqlFunctionExpr\n | SparqlAggregateExpr\n | SparqlExistsExpr\n | SparqlBoundExpr\n | SparqlInExpr;\n\n/** Membership test — `value IN (list)` / `value NOT IN (list)`. */\nexport type SparqlInExpr = {\n kind: 'in_expr';\n negated: boolean;\n value: SparqlExpression;\n list: SparqlExpression[];\n};\n\nexport type SparqlVariableExpr = {\n kind: 'variable_expr';\n name: string;\n};\n\nexport type SparqlIriExpr = {\n kind: 'iri_expr';\n value: string;\n};\n\nexport type SparqlLiteralExpr = {\n kind: 'literal_expr';\n value: string;\n datatype?: string;\n};\n\nexport type SparqlBinaryExpr = {\n kind: 'binary_expr';\n op: string;\n left: SparqlExpression;\n right: SparqlExpression;\n};\n\nexport type SparqlLogicalExpr = {\n kind: 'logical_expr';\n op: 'and' | 'or';\n exprs: SparqlExpression[];\n};\n\nexport type SparqlNotExpr = {\n kind: 'not_expr';\n inner: SparqlExpression;\n};\n\nexport type SparqlFunctionExpr = {\n kind: 'function_expr';\n name: string;\n args: SparqlExpression[];\n};\n\nexport type SparqlAggregateExpr = {\n kind: 'aggregate_expr';\n name: string;\n args: SparqlExpression[];\n distinct?: boolean;\n};\n\nexport type SparqlExistsExpr = {\n kind: 'exists_expr';\n pattern: SparqlAlgebraNode;\n negated: boolean;\n};\n\nexport type SparqlBoundExpr = {\n kind: 'bound_expr';\n variable: string;\n};\n\n// --- Projection and ordering ---\n\nexport type SparqlProjectionItem =\n | {kind: 'variable'; name: string}\n | {kind: 'aggregate'; expression: SparqlAggregateExpr; alias: string}\n | {kind: 'expression'; expression: SparqlExpression; alias: string};\n\nexport type SparqlOrderCondition = {\n expression: SparqlExpression;\n direction: 'ASC' | 'DESC';\n};\n\nexport type SparqlAggregateBinding = {\n variable: string;\n aggregate: SparqlAggregateExpr;\n};\n\n// --- Top-level query plans ---\n\nexport type SparqlSelectPlan = {\n type: 'select';\n algebra: SparqlAlgebraNode;\n projection: SparqlProjectionItem[];\n distinct?: boolean;\n orderBy?: SparqlOrderCondition[];\n limit?: number;\n offset?: number;\n groupBy?: string[];\n having?: SparqlExpression;\n aggregates?: SparqlAggregateBinding[];\n};\n\n/**\n * `ASK WHERE { … }` — a boolean existence check.\n *\n * Deliberately carries nothing but the pattern: `ASK` has no projection, no\n * solution modifiers and no pagination, so there is no field here that could be\n * silently ignored at serialization time.\n */\nexport type SparqlAskPlan = {\n type: 'ask';\n algebra: SparqlAlgebraNode;\n};\n\nexport type SparqlInsertDataPlan = {\n type: 'insert_data';\n triples: SparqlTriple[];\n graph?: string;\n};\n\nexport type SparqlDeleteInsertPlan = {\n type: 'delete_insert';\n deletePatterns: SparqlTriple[];\n insertPatterns: SparqlTriple[];\n whereAlgebra: SparqlAlgebraNode;\n graph?: string;\n};\n\nexport type SparqlDeleteWherePlan = {\n type: 'delete_where';\n patterns: SparqlAlgebraNode;\n graph?: string;\n};\n\nexport type SparqlPlan =\n | SparqlSelectPlan\n | SparqlAskPlan\n | SparqlInsertDataPlan\n | SparqlDeleteInsertPlan\n | SparqlDeleteWherePlan;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SparqlDataset.js","sourceRoot":"","sources":["../../../src/sparql/SparqlDataset.ts"],"names":[],"mappings":";;;;;;;;;AAeA,OAAO,EACL,cAAc,EACd,WAAW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C,mBAAmB,CAAC,MAAM,CAAC,CAAC;gBACvC,OAAO,EAAC,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,EAAC,CAAC;YACjC,CAAC;YACD,MAAM,MAAM,GAAG,cAAc,CAAC,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;YAChD,MAAM,IAAI,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC;YACvC,OAAO;gBACL,OAAO,EAAE,EAAE,CAAC,GAAG;gBACf,KAAK,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM;aACrB,CAAC;QACJ,CAAC;KAAA;IAED;;;OAGG;IACG,QAAQ,CACZ,MAAc,EACd,IAAyB;;YAEzB,IAAI,IAAI,KAAK,QAAQ,EAAE,CAAC;gBACtB,OAAO,IAAI,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC;YAC1C,CAAC;YACD,OAAO,IAAI,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC;QAC1C,CAAC;KAAA;CACF;AAED,6EAA6E;AAC7E,OAAO,EAAC,aAAa,IAAI,WAAW,EAAC,CAAC","sourcesContent":["import type {IDataset} from '../interfaces/IDataset.js';\nimport type {SelectQuery} from '../queries/SelectQuery.js';\nimport type {AskQuery} from '../queries/AskQuery.js';\nimport type {CountQuery} from '../queries/CountQuery.js';\nimport type {CreateQuery} from '../queries/CreateQuery.js';\nimport type {UpdateQuery} from '../queries/UpdateQuery.js';\nimport type {DeleteQuery, DeleteResponse} from '../queries/DeleteQuery.js';\nimport type {\n IRSelectQuery,\n IRCountQuery,\n SelectResult,\n CreateResult,\n UpdateResult,\n} from '../queries/IntermediateRepresentation.js';\nimport type {SparqlQueryResults} from './resultMapping.js';\nimport {\n selectToSparql,\n askToSparql,\n countToSparql,\n createToSparql,\n updateToSparql,\n upsertToSparql,\n updateWhereToSparql,\n deleteToSparql,\n deleteAllToSparql,\n deleteWhereToSparql,\n} from './irToAlgebra.js';\nimport {\n mapSparqlSelectResult,\n mapSparqlAskResult,\n mapSparqlCountResult,\n mapSparqlCreateResult,\n mapSparqlUpdateResult,\n isSparqlSelectResults,\n} from './resultMapping.js';\nimport {generateEntityUri, type SparqlOptions} from './sparqlUtils.js';\nimport {lower} from '../queries/lower.js';\n\n/**\n * Abstract base class for SPARQL-backed datasets.\n *\n * Handles the full pipeline: IR query → SPARQL string → execute → map results.\n * Subclasses only need to implement the two transport methods:\n * - `executeSparqlSelect` — send a SPARQL SELECT and return JSON results\n * - `executeSparqlUpdate` — send a SPARQL UPDATE (INSERT DATA / DELETE..INSERT / etc.)\n *\n * Example subclass (Fuseki):\n * ```ts\n * class FusekiDataset extends SparqlDataset {\n * constructor(baseUrl: string, dataset: string) {\n * super({ dataRoot: 'http://data.example.org' });\n * this.queryEndpoint = `${baseUrl}/${dataset}/sparql`;\n * this.updateEndpoint = `${baseUrl}/${dataset}/update`;\n * }\n * protected async executeSparqlSelect(sparql: string) {\n * const res = await fetch(this.queryEndpoint, { ... });\n * return res.json();\n * }\n * protected async executeSparqlUpdate(sparql: string) {\n * await fetch(this.updateEndpoint, { ... });\n * }\n * }\n * ```\n */\nexport abstract class SparqlDataset implements IDataset {\n protected options?: SparqlOptions;\n\n constructor(options?: SparqlOptions) {\n this.options = options;\n }\n\n /**\n * Send a SPARQL SELECT/ASK/CONSTRUCT query and return the parsed\n * SPARQL JSON Results (application/sparql-results+json).\n *\n * The return type is the union of both response shapes a query endpoint can\n * produce: a SELECT result set (`results.bindings`) or an ASK answer\n * (`boolean`). A subclass may still declare the narrower `SparqlJsonResults` —\n * a return type is covariant, so existing implementations stay valid.\n */\n protected abstract executeSparqlSelect(\n sparql: string,\n ): Promise<SparqlQueryResults>;\n\n /**\n * Send a SPARQL UPDATE request (INSERT DATA, DELETE/INSERT, etc.).\n * No return value — the update is fire-and-forget at the SPARQL level.\n */\n protected abstract executeSparqlUpdate(sparql: string): Promise<void>;\n\n /**\n * Answer a select query — **and a count, which is a select.**\n *\n * A count is not a distinct query form the way an ask is. An ask really is\n * `ASK WHERE { … }` and needs its own method; a count is\n * `SELECT (COUNT(DISTINCT ?a0) AS ?count) WHERE { … }` — the same query form, the\n * same transport (`executeSparqlSelect`), the same result-set response, differing\n * only in its projection. `countToAlgebra` says so itself: it builds its plan by\n * calling `selectToAlgebra` and swapping the projection, and yields\n * `{type: 'select'}`.\n *\n * So a count rides this channel rather than a method of its own. That is not\n * tidiness: it is what lets a count reach a store through every router that\n * already forwards a select — `LinkedStorage.selectQuery`, a backend API store —\n * with no per-kind plumbing to add in each of them, and no optional `IDataset`\n * member that a third-party store silently lacks.\n *\n * The branch is on the LOWERED IR, as `updateQuery` and `deleteQuery` branch on\n * theirs: `lower()` is the one place that knows a count from a select, and a\n * rehydrated envelope (`fromJSON`) arrives here as a builder like any other.\n *\n * A count carries only a pattern, so there is nothing to normalise away on that\n * path: no projection, no ordering, and in particular no `LIMIT`/`OFFSET`, which\n * the builder dropped before the query ever reached the IR. Errors reject; a count\n * failure is never reported as `0`.\n */\n selectQuery(query: SelectQuery): Promise<SelectResult>;\n selectQuery(query: CountQuery): Promise<number>;\n async selectQuery(\n query: SelectQuery | CountQuery,\n ): Promise<SelectResult | number> {\n // Cast once for the call rather than lowering in each branch: `lower` is\n // overloaded per query kind and cannot resolve a union, and lowering twice\n // would be the thing this method most needs not to do.\n const ir = lower(query as SelectQuery) as IRSelectQuery | IRCountQuery;\n if (ir.kind === 'count') {\n const sparql = countToSparql(ir, this.options);\n const json = await this.executeSparqlSelect(sparql);\n // `mapSparqlCountResult` is strict in the same way the guard below is: it\n // refuses an ASK response, an empty result set and a non-integer binding\n // rather than answering `0`.\n return mapSparqlCountResult(json, ir);\n }\n const sparql = selectToSparql(ir, this.options);\n const json = await this.executeSparqlSelect(sparql);\n if (!isSparqlSelectResults(json)) {\n throw new Error(\n 'Expected a SPARQL SELECT result set, got an ASK response. The endpoint ' +\n 'did not answer the SELECT query that was sent.',\n );\n }\n return mapSparqlSelectResult(json, ir);\n }\n\n /**\n * Answer an ask query — emitted as `ASK WHERE { … }`.\n *\n * An {@link AskQuery} carries only a pattern, so there is nothing to normalise\n * away here. A query with no shape lowers to `ASK { <iri> ?p ?o }` — existence\n * of the node under any type or none. Errors reject; never reported as `false`.\n */\n async askQuery(query: AskQuery): Promise<boolean> {\n const ir = lower(query);\n const sparql = askToSparql(ir, this.options);\n const json = await this.executeSparqlSelect(sparql);\n return mapSparqlAskResult(json);\n }\n\n async createQuery(query: CreateQuery): Promise<CreateResult> {\n const ir = lower(query);\n const uri = ir.data.id || generateEntityUri(ir.data.shape, this.options);\n ir.data.id = uri;\n const sparql = createToSparql(ir, this.options);\n await this.executeSparqlUpdate(sparql);\n return mapSparqlCreateResult(uri, ir);\n }\n\n async updateQuery(query: UpdateQuery): Promise<UpdateResult> {\n const ir = lower(query);\n if (ir.kind === 'update_where') {\n const sparql = updateWhereToSparql(ir, this.options);\n await this.executeSparqlUpdate(sparql);\n return {id: ''} as UpdateResult;\n }\n const sparql =\n ir.kind === 'upsert'\n ? upsertToSparql(ir, this.options)\n : updateToSparql(ir, this.options);\n await this.executeSparqlUpdate(sparql);\n return mapSparqlUpdateResult(ir);\n }\n\n async deleteQuery(query: DeleteQuery): Promise<DeleteResponse> {\n const ir = lower(query);\n if (ir.kind === 'delete_all') {\n const sparql = deleteAllToSparql(ir, this.options);\n await this.executeSparqlUpdate(sparql);\n return {deleted: [], count: 0};\n }\n if (ir.kind === 'delete_where') {\n const sparql = deleteWhereToSparql(ir, this.options);\n await this.executeSparqlUpdate(sparql);\n return {deleted: [], count: 0};\n }\n const sparql = deleteToSparql(ir, this.options);\n await this.executeSparqlUpdate(sparql);\n return {\n deleted: ir.ids,\n count: ir.ids.length,\n };\n }\n\n /**\n * Execute a raw SPARQL query string directly against the dataset.\n * Defaults to SELECT; pass `'update'` for INSERT/DELETE operations.\n */\n async rawQuery(\n sparql: string,\n mode?: 'query' | 'update',\n ): Promise<SparqlQueryResults | void> {\n if (mode === 'update') {\n return this.executeSparqlUpdate(sparql);\n }\n return this.executeSparqlSelect(sparql);\n }\n}\n\n// Backwards-compatibility re-export — remove once all consumers are updated.\nexport {SparqlDataset as SparqlStore};\n"]}
|