@_linked/core 2.22.8 → 2.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/lib/esm/collections/CoreSet.js.map +1 -1
  3. package/lib/esm/collections/ShapeSet.js.map +1 -1
  4. package/lib/esm/expressions/Expr.js.map +1 -1
  5. package/lib/esm/expressions/ExpressionMethods.js.map +1 -1
  6. package/lib/esm/expressions/ExpressionNode.js.map +1 -1
  7. package/lib/esm/index.d.ts +1 -0
  8. package/lib/esm/index.js +2 -0
  9. package/lib/esm/index.js.map +1 -1
  10. package/lib/esm/interfaces/ICoreIterable.js.map +1 -1
  11. package/lib/esm/interfaces/IDataset.js.map +1 -1
  12. package/lib/esm/interfaces/IFileStore.js.map +1 -1
  13. package/lib/esm/ontologies/linked-core.js.map +1 -1
  14. package/lib/esm/ontologies/npm.js.map +1 -1
  15. package/lib/esm/ontologies/owl.js.map +1 -1
  16. package/lib/esm/ontologies/rdf.js.map +1 -1
  17. package/lib/esm/ontologies/rdfs.js.map +1 -1
  18. package/lib/esm/ontologies/shacl.js.map +1 -1
  19. package/lib/esm/ontologies/xsd.js.map +1 -1
  20. package/lib/esm/package.js.map +1 -1
  21. package/lib/esm/paths/PropertyPathExpr.js.map +1 -1
  22. package/lib/esm/paths/normalizePropertyPath.js.map +1 -1
  23. package/lib/esm/paths/pathExprToSparql.js.map +1 -1
  24. package/lib/esm/queries/AskBuilder.js.map +1 -1
  25. package/lib/esm/queries/AskQuery.js.map +1 -1
  26. package/lib/esm/queries/ContextRef.js.map +1 -1
  27. package/lib/esm/queries/CountBuilder.js.map +1 -1
  28. package/lib/esm/queries/CountQuery.js.map +1 -1
  29. package/lib/esm/queries/CreateBuilder.js.map +1 -1
  30. package/lib/esm/queries/CreateQuery.js.map +1 -1
  31. package/lib/esm/queries/DeleteBuilder.js.map +1 -1
  32. package/lib/esm/queries/DeleteQuery.js.map +1 -1
  33. package/lib/esm/queries/DslJsonExpression.js.map +1 -1
  34. package/lib/esm/queries/FieldSet.js.map +1 -1
  35. package/lib/esm/queries/IRAliasScope.js.map +1 -1
  36. package/lib/esm/queries/IRCanonicalize.js.map +1 -1
  37. package/lib/esm/queries/IRDesugar.js.map +1 -1
  38. package/lib/esm/queries/IRLower.js.map +1 -1
  39. package/lib/esm/queries/IRMutation.js.map +1 -1
  40. package/lib/esm/queries/IRPipeline.js.map +1 -1
  41. package/lib/esm/queries/IRProjection.js.map +1 -1
  42. package/lib/esm/queries/IntermediateRepresentation.js.map +1 -1
  43. package/lib/esm/queries/MutationQuery.js.map +1 -1
  44. package/lib/esm/queries/MutationSerialization.js.map +1 -1
  45. package/lib/esm/queries/MutationThenable.js.map +1 -1
  46. package/lib/esm/queries/PropertyPath.js.map +1 -1
  47. package/lib/esm/queries/ProxiedPathBuilder.js.map +1 -1
  48. package/lib/esm/queries/QueryBuilder.js.map +1 -1
  49. package/lib/esm/queries/QueryBuilderSerialization.js.map +1 -1
  50. package/lib/esm/queries/QueryContext.js.map +1 -1
  51. package/lib/esm/queries/QueryFactory.js.map +1 -1
  52. package/lib/esm/queries/SelectQuery.js.map +1 -1
  53. package/lib/esm/queries/UpdateBuilder.js.map +1 -1
  54. package/lib/esm/queries/UpdateQuery.js.map +1 -1
  55. package/lib/esm/queries/fromJSON.js.map +1 -1
  56. package/lib/esm/queries/lower.js.map +1 -1
  57. package/lib/esm/queries/lowerMutationJSON.js.map +1 -1
  58. package/lib/esm/queries/mutationLowerSpec.js.map +1 -1
  59. package/lib/esm/queries/queryDispatch.js.map +1 -1
  60. package/lib/esm/queries/reservedQueryNames.js.map +1 -1
  61. package/lib/esm/queries/resolveShape.js.map +1 -1
  62. package/lib/esm/queries/wireVersion.js.map +1 -1
  63. package/lib/esm/shapes/List.class.d.ts +20 -0
  64. package/lib/esm/shapes/List.class.js +44 -0
  65. package/lib/esm/shapes/List.class.js.map +1 -0
  66. package/lib/esm/shapes/List.d.ts +3 -14
  67. package/lib/esm/shapes/List.js +5 -35
  68. package/lib/esm/shapes/List.js.map +1 -1
  69. package/lib/esm/shapes/PathNode.js +4 -1
  70. package/lib/esm/shapes/PathNode.js.map +1 -1
  71. package/lib/esm/shapes/SHACL.js.map +1 -1
  72. package/lib/esm/shapes/Shape.js.map +1 -1
  73. package/lib/esm/shapes/index.d.ts +3 -0
  74. package/lib/esm/shapes/index.js +14 -0
  75. package/lib/esm/shapes/index.js.map +1 -0
  76. package/lib/esm/shapes/nodeShapeData.js.map +1 -1
  77. package/lib/esm/shapes/nodeShapeWire.js.map +1 -1
  78. package/lib/esm/shapes/propertyShapeTerms.js.map +1 -1
  79. package/lib/esm/shapes/registerRuntimeShape.js.map +1 -1
  80. package/lib/esm/shapes/serializePathToNodeData.js.map +1 -1
  81. package/lib/esm/shapes/syncShapes.js.map +1 -1
  82. package/lib/esm/shapes/validation.js.map +1 -1
  83. package/lib/esm/sparql/SparqlAlgebra.js.map +1 -1
  84. package/lib/esm/sparql/SparqlDataset.js.map +1 -1
  85. package/lib/esm/sparql/algebraToString.js.map +1 -1
  86. package/lib/esm/sparql/index.js.map +1 -1
  87. package/lib/esm/sparql/irToAlgebra.js.map +1 -1
  88. package/lib/esm/sparql/resultMapping.js.map +1 -1
  89. package/lib/esm/sparql/sparqlUtils.js.map +1 -1
  90. package/lib/esm/utils/LinkedErrorLogging.js.map +1 -1
  91. package/lib/esm/utils/LinkedFileStorage.js.map +1 -1
  92. package/lib/esm/utils/LinkedStorage.js.map +1 -1
  93. package/lib/esm/utils/NameSpace.js.map +1 -1
  94. package/lib/esm/utils/NodeReference.js.map +1 -1
  95. package/lib/esm/utils/Package.js +14 -1
  96. package/lib/esm/utils/Package.js.map +1 -1
  97. package/lib/esm/utils/Prefix.js.map +1 -1
  98. package/lib/esm/utils/ShapeClass.js.map +1 -1
  99. package/lib/esm/utils/URI.js.map +1 -1
  100. package/lib/esm/utils/cached.js.map +1 -1
  101. package/lib/esm/utils/loadStores.js.map +1 -1
  102. package/lib/esm/utils/parseDatasetsConfig.js.map +1 -1
  103. package/package.json +8 -2
@@ -1 +1 @@
1
- {"version":3,"file":"SelectQuery.js","sourceRoot":"","sources":["../../../src/queries/SelectQuery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAE,iBAAiB,EAAwB,MAAM,oBAAoB,CAAC;AACnF,OAAO,EAAC,iBAAiB,EAAE,uBAAuB,EAAE,eAAe,EAAC,MAAM,4BAA4B,CAAC;AAGvG,OAAO,EAAC,QAAQ,EAAC,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAC,KAAK,EAAC,MAAM,wBAAwB,CAAC;AAC7C,OAAO,EAAC,OAAO,EAAC,MAAM,2BAA2B,CAAC;AAClD,OAAO,EAAC,uBAAuB,EAAE,aAAa,EAAE,uBAAuB,EAAC,MAAM,wBAAwB,CAAC;AAGvG,OAAO,EAAC,GAAG,EAAC,MAAM,sBAAsB,CAAC;AAEzC,OAAO,EAAC,wBAAwB,EAAC,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAC;AACvC,OAAO,EAAC,YAAY,EAAC,MAAM,mBAAmB,CAAC;AAE/C,OAAO,EAAC,cAAc,EAAE,eAAe,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,qBAAqB,EAAC,MAAM,kCAAkC,CAAC;AACvK,OAAO,EAAC,mBAAmB,EAAC,MAAM,mBAAmB,CAAC;AAEtD;;;;;GAKG;AACH,MAAM,wBAAwB,GAAG,IAAI,GAAG,CAAS;IAC/C,MAAM;IACN,UAAU;IACV,QAAQ;IACR,UAAU;IACV,SAAS;IACT,aAAa;IACb,iBAAiB,EAAE,2BAA2B;IAC9C,UAAU,EAAE,6BAA6B;CAC1C,CAAC,CAAC;AAwCH,MAAM,SAAS,GAAG,CAChB,CAAsB,EACtB,CAAsB,EACb,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAA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,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAChB,OAAO,IAAI,CAAC;QACd,CAAC;QACD,OAAO,CAAC,IAAI,CAAC,CAAC;IAChB,CAAC;CACF","sourcesContent":["import {Shape, createShapeTarget, type ShapeConstructor} from '../shapes/Shape.js';\nimport {getPropertyShapes, getUniquePropertyShapes, nodeShapeEquals} from '../shapes/nodeShapeData.js';\nimport type {NodeShapeData, PropertyShapeData} from '../shapes/SHACL.js';\nimport type {RawSelectInput} from './IRDesugar.js';\nimport {ShapeSet} from '../collections/ShapeSet.js';\nimport {shacl} from '../ontologies/shacl.js';\nimport {CoreSet} from '../collections/CoreSet.js';\nimport {getPropertyShapeByLabel, getShapeClass, resolveShapeConstructor} from '../utils/ShapeClass.js';\n\nimport {NodeReferenceValue,type Prettify,type ShapeReferenceValue} from './QueryFactory.js';\nimport {xsd} from '../ontologies/xsd.js';\nimport type {IRSelectQuery} from './IntermediateRepresentation.js';\nimport {createProxiedPathBuilder} from './ProxiedPathBuilder.js';\nimport {FieldSet} from './FieldSet.js';\nimport {PropertyPath} from './PropertyPath.js';\nimport type {QueryBuilder, QueryBuilderJSON} from './QueryBuilder.js';\nimport {ExpressionNode, ExistsCondition, isExpressionNode, isExistsCondition, tracedPropertyExpression, tracedAliasExpression} from '../expressions/ExpressionNode.js';\nimport {PendingQueryContext} from './QueryContext.js';\n\n/**\n * String keys the query-shape proxy must let through *without* treating them as\n * a property access — promise-awaiting (`then`), React (`$$typeof`), and common\n * serializer/object-protocol probes. Everything else that isn't a decorated\n * property is a genuine misuse and throws. (Symbol keys always pass through.)\n */\nconst INTEROP_PASSTHROUGH_KEYS = new Set<string>([\n 'then',\n '$$typeof',\n 'toJSON',\n 'toString',\n 'valueOf',\n 'constructor',\n 'asymmetricMatch', // jest matchers probe this\n 'nodeType', // some DOM/serializer probes\n]);\n\n/**\n * The closed, read-only select query a dataset receives (implemented by\n * `SelectBuilder`). It exposes the wire form (`toJSON`), the routing key\n * (`shape`), and the read-only lowering hook (`toRawInput`) — but none of the\n * fluent mutators, so a store cannot keep building on it. The IR algebra is\n * `IRSelectQuery`, produced on demand by `lower(query)`.\n */\nexport interface SelectQuery {\n readonly __queryKind: 'select';\n readonly shape: NodeShapeData;\n toJSON(): QueryBuilderJSON;\n toRawInput(): RawSelectInput;\n}\n\n/**\n * ###################################\n * #### TYPES FOR QUERY BUILDING ####\n * ###################################\n */\nexport type JSPrimitive = JSNonNullPrimitive | null | undefined;\nexport type JSNonNullPrimitive = string | number | boolean | Date;\n\n/**\n * What a comparison on a primitive-valued query property accepts.\n *\n * `NodeReferenceValue` belongs here because an object property may be DECLARED\n * with a primitive accessor type — `@objectProperty({path: …}) get project():\n * string` returns the referenced node's IRI — which projects to a\n * `QueryPrimitive<string>`, not a `QueryShape`. The documented way to match such\n * a property is still by reference (`.equals({id})`), and the lowering has always\n * supported it: `toIRExpression` turns `{id}` into a `reference_expr`, so the\n * comparison renders as `<iri>` rather than a string literal.\n */\nexport type ComparisonValue =\n | JSPrimitive\n | QueryBuilderObject\n | NodeReferenceValue;\n\nconst isSameRef = (\n a?: NodeReferenceValue,\n b?: NodeReferenceValue,\n): boolean => !!a && !!b && a.id === b.id;\n\nexport type SingleResult<ResultType> =\n ResultType extends Array<infer R>\n ? R\n : ResultType extends Set<infer R>\n ? R\n : ResultType;\n\n/**\n * All the possible types that a regular get/set method of a Shape can return\n */\nexport type AccessorReturnValue =\n | Shape\n | ShapeSet\n | JSPrimitive\n | NodeReferenceValue;\n\nexport type WhereClause<S extends Shape | AccessorReturnValue> =\n | ExpressionNode\n | ExistsCondition\n | ((s: ToQueryBuilderObject<S>) => ExpressionNode | ExistsCondition);\n\nexport type QueryBuildFn<T extends Shape, ResponseType> = (\n p: ToQueryBuilderObject<T>,\n) => ResponseType;\n\nexport type SortByPath = {\n paths: PropertyPath[];\n /** Per-path sort direction (parallel to `paths`). */\n directions: ('ASC' | 'DESC')[];\n};\n\n/**\n * A property-only query path, used by where/sort proxy tracing.\n */\nexport type QueryPropertyPath = QueryStep[];\n\n/**\n * A QueryStep is a single step in a query path.\n */\nexport type QueryStep =\n | PropertyQueryStep\n | SizeStep\n | ShapeReferenceValue;\nexport type SizeStep = {\n count: QueryPropertyPath;\n label?: string;\n};\nexport type PropertyQueryStep = {\n property: PropertyShapeData;\n where?: WherePath;\n};\n\n/**\n * Maps all the return types of get/set methods of a Shape and maps their return types to QueryBuilderObjects\n */\nexport type QueryShapeProps<\n T extends Shape,\n Source,\n Property extends string | number | symbol = any,\n> = {\n [P in keyof T]: ToQueryBuilderObject<T[P], QShape<T, Source, Property>, P>;\n};\n\nexport type SelectAllQueryResponse<T extends Shape> = Array<\n QueryShapeProps<T, null, ''>[Exclude<\n Extract<\n {\n [K in keyof T]-?: T[K] extends (...args: any[]) => any ? never : K;\n }[keyof T],\n string\n >,\n Extract<keyof Shape, string>\n >]\n>;\n\n/**\n * This type states that the ShapeSet has access to the same methods as the shape of all the items in the set\n * (this is enabled with the QueryShapeSet.proxifyShapeSet method)\n * Each value of the shape is converted to a QueryBuilderObject\n */\nexport type QueryShapeSetProps<SourceShapeSet, Shape> = {\n [P in keyof Shape]: ToQueryBuilderObject<Shape[P], SourceShapeSet, P>;\n};\n\n/**\n * ShapeSets are converted to QueryShapeSets, but also inherit all the properties of the shape that each item in the set has (with converted result types)\n */\nexport type QShapeSet<\n ShapeSetType extends Shape,\n Source = null,\n Property extends string | number | symbol = null,\n> = QueryShapeSet<ShapeSetType, Source, Property> &\n QueryShapeSetProps<\n QueryShapeSet<ShapeSetType, Source, Property>,\n ShapeSetType\n >;\n\n/**\n * Shapes are converted to QueryShapes, but also inherit all the properties of the shape (with converted result types)\n */\nexport type QShape<\n T extends Shape,\n Source = any,\n Property extends string | number | symbol = any,\n> = QueryShape<T, Source, Property> & QueryShapeProps<T, Source, Property>;\n\nexport type ToQueryBuilderObject<\n T,\n Source = null,\n Property extends string | number | symbol = '',\n> =\n T extends ShapeSet<infer ShapeSetType>\n ? QShapeSet<ShapeSetType, Source, Property>\n : T extends Shape\n ? QShape<T, Source, Property>\n : T extends string | number | Date | boolean\n ? ToQueryPrimitive<T, Source, Property>\n : // : QueryBuilderObject<T,Source,Property>;\n T extends Array<infer AT>\n ? AT extends Date | string | number\n ? QueryPrimitiveSet<ToQueryPrimitive<AT, Source, Property>>\n : AT extends boolean\n ? QueryPrimitive<boolean>\n : AT[]\n : //added support for get/set methods that return NodeReferenceValue, treating them as plain Shapes\n T extends NodeReferenceValue\n ? QShape<Shape, Source, Property>\n : QueryBuilderObject<T, Source, Property>;\n\nexport type ToQueryPrimitive<\n T extends string | number | Date | boolean,\n Source,\n Property extends string | number | symbol = '',\n> = T extends string\n ? QueryPrimitive<string, Source, Property>\n : T extends number\n ? QueryPrimitive<number, Source, Property>\n : T extends Date\n ? QueryPrimitive<Date, Source, Property>\n : T extends boolean\n ? QueryPrimitive<boolean, Source, Property>\n : never & {__error: 'ToQueryPrimitive: no matching primitive type'};\n\nexport type WhereExpressionPath = {\n expressionNode: ExpressionNode;\n};\n\nexport type WhereExistsPath = {\n existsCondition: ExistsCondition;\n};\n\nexport type WherePath = WhereExpressionPath | WhereExistsPath;\n\n/**\n * An argument can be a direct reference to a node, a js primitive (boolean,number), a path to resolve (like from a query context variables)\n * Or a wherePath in the case of some() or every() (e.g. x.where(x.friends.some(f => f.age > 18) -> the argument is a wherePath)\n */\nexport type QueryComponentLike<ShapeType extends Shape, CompQueryResult> = {\n query:\n | QueryBuilder<ShapeType>\n | FieldSet\n | Record<string, QueryBuilder<ShapeType>>;\n fields?: FieldSet;\n};\n\n/**\n * Interface that linked components (e.g. from `@_linked/react`'s `linkedComponent()`)\n * must satisfy to participate in preloadFor.\n *\n * Components expose their data requirements as a QueryBuilder,\n * and optionally a FieldSet for declarative field access.\n */\nexport interface LinkedComponentInterface<S extends Shape = Shape, R = any> {\n /** The component's data query (QueryBuilder template, not executed). */\n query: QueryBuilder<S, any, R>;\n /** The component's field requirements as a FieldSet. */\n fields?: FieldSet;\n}\n\n/**\n * ###################################\n * #### QUERY RESULT TYPES ####\n * ###################################\n */\n\nexport type QResult<ShapeType extends Shape = Shape, Object = {}> = Object & {\n id: string;\n // shape?: ShapeType;\n};\n\n/**\n * MAIN ENTRY to convert the response of a query into a result object\n */\nexport type QueryResponseToResultType<\n T,\n QShapeType extends Shape = null,\n HasName = false,\n> = T extends QueryBuilderObject\n ? GetQueryObjectResultType<T, {}, false, HasName>\n : T extends FieldSet<infer Response, infer Source>\n ? GetNestedQueryResultType<Response, Source>\n : T extends Array<infer Type>\n ? UnionToIntersection<QueryResponseToResultType<Type>>\n : T extends ExpressionNode\n ? boolean\n : T extends Object\n ? QResult<QShapeType, Prettify<ObjectToPlainResult<T>>>\n : never & {__error: 'QueryResponseToResultType: unmatched query response type'};\n\n/**\n * Turns a QueryBuilderObject into a plain JS object\n * @param QV the query value type\n * @param SubProperties to add extra properties into the result object (used to merge arrays into objects for example)\n * @param SourceOverwrite if the source of the query value should be overwritten\n */\nexport type GetQueryObjectResultType<\n QV,\n SubProperties = {},\n PrimitiveArray = false,\n HasName = false,\n> =\n //note: count needs to be above primitive\n QV extends SetSize<infer Source>\n ? SetSizeToQueryResult<Source, HasName>\n : QV extends QueryPrimitive<infer Primitive, infer Source, infer Property>\n ? CreateQResult<\n Source,\n PrimitiveArray extends true ? Primitive[] : Primitive,\n Property,\n {},\n HasName\n >\n : QV extends QueryShape<infer ShapeType, infer Source, infer Property>\n ? CreateQResult<Source, ShapeType, Property, SubProperties, HasName>\n : QV extends BoundComponent<infer Source, infer CompQueryResult>\n ? GetQueryObjectResultType<\n Source,\n SubProperties & QueryResponseToResultType<CompQueryResult>,\n PrimitiveArray,\n HasName\n >\n : QV extends QueryShapeSet<\n infer ShapeType,\n infer Source,\n infer Property\n >\n ? CreateShapeSetQResult<\n ShapeType,\n Source,\n Property,\n SubProperties,\n HasName\n >\n : QV extends QueryPrimitiveSet<\n infer QPrim extends QueryPrimitive<any>\n >\n ? GetQueryObjectResultType<QPrim, null, null, true>\n : QV extends Array<infer Type>\n ? UnionToIntersection<QueryResponseToResultType<Type>>\n : QV extends QueryPrimitive<boolean, any, any>\n ? 'bool'\n : never & {__error: 'GetQueryObjectResultType: unmatched query value type'};\n\nexport type SetSizeToQueryResult<Source, HasName = false> =\n Source extends QueryShapeSet<\n infer ShapeType,\n infer ParentSource,\n infer SourceProperty\n >\n ? HasName extends false\n ? //when we count something and we already know what the name of the variable of the resulting number is, then we return a number\n //But if we count a shapeset and its NOT in a custom object where a key (name) is already known, then we return a QResult\n //This QResult will be the same as it would be if there was no .count() statement. Except now it returns a number (hence we send number as value type)\n CreateQResult<ParentSource, number, SourceProperty>\n : number\n : number;\n\n/**\n * If the source is an object (it extends shape)\n * then the result is a plain JS Object, with Property as its key, with type Value\n */\nexport type CreateQResult<\n Source,\n Value = undefined,\n Property extends string | number | symbol = '',\n SubProperties = {},\n HasName = false,\n> =\n Source extends QueryShape<\n infer SourceShapeType,\n infer ParentSource,\n infer SourceProperty\n >\n ? //if the parent source is null, that means this is the final source-node in the query\n ParentSource extends null\n ? HasName extends true\n ? Value\n : //TODO: this must be simplified and rewritten\n // it is likely the most complex part of the type system currently\n // It turns out that sub-.select() on a QueryShapeSet ends up here with Value being null, and sub properties need to be added to the QResult itself\n // Whilst sub-.select() on a single QueryShape ends up here with Value being defined, in which case the SubProperties need to be included in the inner QResult\n Value extends null\n ? //hence we create a single QResult, but do not use CreateQResult (which will keep creating nested QResults)\n QResult<\n SourceShapeType,\n {\n //we pass Value and Value but not Property, so that when the value is a Shape or ShapeSet, there is recursion\n //but for all other cases (like string, number, boolean) the value is just passed through\n [P in Property]: CreateQResult<Value, Value>;\n } & SubProperties\n >\n : //hence we create a single QResult, but do not use CreateQResult (which will keep creating nested QResults)\n QResult<\n SourceShapeType,\n {\n //we pass Value and Value but not Property, so that when the value is a Shape or ShapeSet, there is recursion\n //but for all other cases (like string, number, boolean) the value is just passed through\n [P in Property]: CreateQResult<Value, Value, '', SubProperties>;\n }\n >\n : CreateQResult<\n ParentSource,\n QResult<\n SourceShapeType,\n {\n //we pass Value and Value but not Property, so that when the value is a Shape or ShapeSet, there is recursion\n //but for all other cases (like string, number, boolean) the value is just passed through\n [P in Property]: CreateQResult<Value, Value>;\n } & SubProperties\n >,\n SourceProperty,\n {},\n HasName\n >\n : Source extends QueryShapeSet<\n infer ShapeType,\n infer ParentSource,\n infer SourceProperty\n >\n ? //for a ShapeSet, we make the current result (a QResult) the value of a parent QResult (created with ToQueryResult)\n CreateQResult<\n ParentSource,\n QResult<\n ShapeType,\n {\n //we pass Value and Value but not Property, so that when the value is a Shape or ShapeSet, there is recursion\n //but for all other cases (like string, number, boolean) the value is just passed through\n [P in Property]: CreateQResult<Value, Value, null, SubProperties>;\n }\n >[],\n SourceProperty,\n {},\n HasName\n >\n : //Source is not a QueryShape or QueryShape set (currently sometimes used by end QueryPrimitives) ..\n // this needs to convert to value (amongst other things) for .select({customKeys}) and ObjectToPlainResult\n Value extends Shape\n ? QResult<Value, SubProperties>\n : // : Value extends boolean ? 'boolean' : Value;\n NormaliseBoolean<Value>;\n\ntype NormaliseBoolean<T> = [T] extends [boolean] ? boolean : T;\n\nexport type CreateShapeSetQResult<\n ShapeType = undefined,\n Source = undefined,\n Property extends string | number | symbol = '',\n SubProperties = {},\n HasName = false,\n> =\n Source extends QueryShape<infer SourceShapeType, infer ParentSource>\n ? //if HasName is true and source is a QueryShape, but ITS source (ParentSource) is null\n //then we don't want to create a nested QResult, but instead we ignore this last property and we return an array of QResults of this source\n //This is used by custom object keys with values like: p.friends, which should return an array of QResult<Person> Objects, not a {friends:...} QResult\n //NOTE: this notation check if 2 statements are true: HasName is true, and ParentSource is null\n [HasName, ParentSource] extends [true, null]\n ? CreateQResult<Source, null, null>[]\n : ParentSource extends null\n ? QResult<\n SourceShapeType,\n {[P in Property]: CreateQResult<Source, null, null, SubProperties>[]}\n >\n : //when ParentSource is not null, we need to continue unwinding the source chain\n //Pass the inner ShapeSet items as SubProperties so they stay at the correct nesting level\n CreateQResult<\n Source,\n null,\n null,\n {[P in Property]: (ShapeType extends Shape ? QResult<ShapeType, SubProperties> : QResult<Shape, SubProperties>)[]}\n >\n : Source extends QueryShapeSet<\n infer ShapeType,\n infer ParentSource,\n infer SourceProperty\n >\n ? //for a shapeset source, we make the current result (a QResult) the value of a parent QResult (created with ToQueryResult)\n CreateQResult<\n ParentSource,\n QResult<\n ShapeType,\n {\n [P in Property]: CreateQResult<ShapeType>[];\n }\n >[],\n SourceProperty,\n {},\n HasName\n >\n : CreateQResult<ShapeType>;\n\n/**\n * Ignores the source and property, and returns the converted value\n */\nexport type ObjectToPlainResult<T> = {\n //passing true as sourceOverwrite will mean that the original source is ignored and so the converted value will not be wrapped in a QResult\n // [P in keyof T]: QueryResponseToResultType<T[P], null, true>;\n [P in keyof T]: QueryResponseToResultType<T[P], null, true>;\n};\n\ntype GetNestedQueryResultType<Response, Source> =\n Source extends QueryBuilderObject\n ? //if the linked query originates from within another query (like with select())\n //then we turn the source into a result. And then pass the selected properties as \"SubProperties\"\n //regardless of whether the response type is an array or object, it gets converted into a result value object\n GetQueryObjectResultType<Source, QueryResponseToResultType<Response>>\n : //by default: we just convert the response type into a result value object\n QueryResponseToResultType<Response>[];\n\n//https://stackoverflow.com/a/50375286/977206\ntype UnionToIntersection<U> = (U extends any ? (x: U) => void : never) extends (\n x: infer I,\n) => void\n ? I\n : never;\n\n\n/**\n * ###################################\n * #### QUERY BUILDING CLASSES ####\n * ###################################\n */\n\nexport class QueryBuilderObject<\n OriginalValue = any,\n Source = any,\n Property extends string | number | symbol = any,\n> {\n //is null by default to avoid warnings when trying to access wherePath when its undefined\n wherePath?: WherePath = null;\n protected originalValue?: OriginalValue;\n protected source: Source;\n protected prop: Property;\n\n constructor(\n public property?: PropertyShapeData,\n public subject?: QueryShape<any> | QueryShapeSet<any> | QueryPrimitiveSet,\n ) {}\n\n /**\n * Create a Query Builder Object based on the requested PropertyShapeData\n */\n static generatePathValue(\n // originalValue: AccessorReturnValue,\n property: PropertyShapeData,\n subject: QueryShape<any> | QueryShapeSet<any> | QueryShape<any>,\n ): QueryBuilderObject {\n let datatype = property.datatype;\n let valueShape = property.valueShape;\n let singleValue = property.maxCount <= 1;\n if (datatype) {\n if (singleValue) {\n if (isSameRef(datatype, xsd.integer)) {\n return wrapWithExpressionProxy(new QueryPrimitive<number>(0, property, subject));\n } else if (isSameRef(datatype, xsd.boolean)) {\n return wrapWithExpressionProxy(new QueryPrimitive<boolean>(false, property, subject));\n } else if (\n isSameRef(datatype, xsd.dateTime) ||\n isSameRef(datatype, xsd.date)\n ) {\n return wrapWithExpressionProxy(new QueryPrimitive<Date>(new Date(), property, subject));\n } else if (isSameRef(datatype, xsd.string)) {\n return wrapWithExpressionProxy(new QueryPrimitive<string>('', property, subject));\n }\n } else {\n //TODO review this, do we need property & subject in both of these? currently yes, but why\n return new QueryPrimitiveSet([''], property, subject, [\n new QueryPrimitive<string>('', property, subject),\n ]);\n }\n }\n if (valueShape) {\n const shapeClass = resolveShapeConstructor(valueShape);\n if(!shapeClass) {\n //TODO: getShapeClassAsync -> which will lazy load the shape class\n // but Im not sure if that's even possible with dynamic import paths, that are only known at runtime\n //UPDATE: we should not need to load shapeclasses. We just need to be able to access shapes.\n // but the problem remains that the ImageObject shape needs to be available, but thats easier, as its data\n throw new Error(`Shape class not found for ${valueShape.id}`);\n }\n const shapeValue = createShapeTarget(shapeClass);\n if (singleValue) {\n return QueryShape.create(shapeValue, property, subject);\n } else {\n return QueryShapeSet.create(\n new ShapeSet([shapeValue]),\n property,\n subject,\n );\n }\n }\n\n //no value shape and no data type.\n //Lets look at the node kind\n if (\n isSameRef(property.nodeKind, shacl.Literal) ||\n isSameRef(property.nodeKind, shacl.BlankNodeOrLiteral)\n ) {\n if (singleValue) {\n //default to string if no datatype is set\n return wrapWithExpressionProxy(new QueryPrimitive<string>('', property, subject));\n } else {\n //TODO review this, do we need property & subject in both of these? currently yes, but why\n return new QueryPrimitiveSet([''], property, subject, [\n new QueryPrimitive<string>('', property, subject),\n ]);\n }\n }\n\n // An object-valued property with no value shape and a non-Literal node kind\n // (e.g. `sh:path` — a raw predicate IRI, or any bare IRI reference). Project\n // it as a generic node reference via the base `Shape`, so the query returns\n // the value's IRI `{id}` — identical to how a *shaped* object property\n // resolves (cf. `sh:targetClass`, registered `shape: Shape`). This lets the\n // DSL read raw IRI predicates back out of a store (SHACL shape catalog etc.).\n //\n // NOTE: a polymorphic value (an `rdf:List` sequence path or a `PathNode`\n // operator) resolves to its *node reference* here, not its structure. Full\n // structural projection (\"if List → members, if PathNode → operands\") is the\n // `byShape` polymorphic-projection follow-up — see\n // packages/core/docs/backlog/031-byshape-polymorphic-projection.md.\n // Build a constructor-less generic node-reference target on the base `Shape`\n // (like the `valueShape` branch above, but for the shapeless base). `Shape`'s\n // constructor throws, so we use `createShapeTarget` (Object.create) — the\n // target is only a proxy metadata carrier, never a live instance.\n const genericShape = createShapeTarget(Shape);\n return singleValue\n ? QueryShape.create(genericShape, property, subject)\n : QueryShapeSet.create(new ShapeSet([genericShape]), property, subject);\n }\n\n getOriginalValue() {\n return this.originalValue;\n }\n\n getPropertyStep(): QueryStep {\n return {\n property: this.property,\n where: this.wherePath,\n };\n }\n\n preloadFor<ShapeType extends Shape, CompQueryRes>(\n component: QueryComponentLike<ShapeType, CompQueryRes>,\n ): BoundComponent<this, CompQueryRes> {\n return new BoundComponent<this, CompQueryRes>(component, this);\n }\n\n /**\n * Pagination is applied to a nested *select*, not to a bare traversal — use\n * `p.friends.select(f => f.name).limit(n)`. Calling `.limit()` directly on a\n * traversal would silently do nothing, so we fail loudly instead.\n * (Top-level result pagination lives on the outer query builder.)\n */\n limit(lim: number): never {\n throw new Error(\n `.limit(${lim}) is not supported directly on a traversal — use ` +\n '.select(...).limit(n) on the nested collection (single-subject queries only).',\n );\n }\n\n /**\n * Returns the path of properties that were requested to reach this value\n */\n getPropertyPath(currentPath?: QueryPropertyPath): QueryPropertyPath {\n let path: QueryPropertyPath = currentPath || [];\n //add the step of this object to the beginning of the path (so that the next parent will always before the current item)\n if (this.property || this.wherePath) {\n path.unshift(this.getPropertyStep());\n }\n if (this.subject) {\n return this.subject.getPropertyPath(path);\n }\n //when query context is used as the first step, then the first step is just a pointer to the subject it represents\n if ((this.originalValue as Shape)?.__queryContextId) {\n path.unshift(convertQueryContext(this as any as QueryShape));\n }\n return path;\n }\n}\n\nexport class BoundComponent<\n Source extends QueryBuilderObject,\n CompQueryResult = any,\n> extends QueryBuilderObject {\n constructor(\n public originalValue: QueryComponentLike<any, CompQueryResult>,\n public source: Source,\n ) {\n super(null, null);\n }\n\n}\n\n/**\n * Converts query context to a ShapeReferenceValue\n */\nconst convertQueryContext = (shape: QueryShape): ShapeReferenceValue => {\n return {\n id: (shape.originalValue as Shape).__queryContextId,\n shape: {\n id: shape.originalValue.nodeShape.id,\n },\n } as ShapeReferenceValue;\n};\n\nexport const processWhereClause = (\n validation: WhereClause<any>,\n shape?,\n): WherePath => {\n if (validation instanceof Function) {\n if (!shape) {\n throw new Error('Cannot process where clause without shape');\n }\n const proxy = createProxiedPathBuilder(shape);\n const result = validation(proxy);\n if (isExpressionNode(result)) {\n return {expressionNode: result};\n }\n if (isExistsCondition(result)) {\n return {existsCondition: result};\n }\n throw new Error('WHERE callback must return ExpressionNode or ExistsCondition');\n } else if (isExpressionNode(validation)) {\n return {expressionNode: validation};\n } else if (isExistsCondition(validation)) {\n return {existsCondition: validation};\n } else {\n throw new Error('WHERE clause must be ExpressionNode, ExistsCondition, or a callback');\n }\n};\n\n// ---------------------------------------------------------------------------\n// Expression method proxy for QueryPrimitive\n// ---------------------------------------------------------------------------\n\nconst EXPRESSION_METHODS = new Set([\n 'plus', 'minus', 'times', 'divide', 'abs', 'round', 'ceil', 'floor', 'power',\n 'equals', 'eq', 'neq', 'notEquals', 'gt', 'greaterThan', 'gte', 'greaterThanOrEqual',\n 'lt', 'lessThan', 'lte', 'lessThanOrEqual', 'oneOf', 'notOneOf',\n 'concat', 'contains', 'startsWith', 'endsWith', 'substr', 'before', 'after',\n 'replace', 'ucase', 'lcase', 'strlen', 'encodeForUri', 'matches',\n 'year', 'month', 'day', 'hours', 'minutes', 'seconds', 'timezone', 'tz',\n 'and', 'or', 'not',\n 'isDefined', 'isNotDefined', 'defaultTo',\n 'lang', 'datatype', 'str', 'iri', 'isIri', 'isLiteral', 'isBlank', 'isNumeric',\n 'md5', 'sha256', 'sha512',\n]);\n\n/**\n * Convert a QueryBuilderObject to a traced ExpressionNode by extracting its\n * property path segments and creating a property expression reference.\n * This is the bridge between the query proxy world and the expression IR world.\n */\nfunction toExpressionNode(qbo: QueryBuilderObject): ExpressionNode {\n // Check if this is a query context reference. We carry the context *name*\n // (not the resolved id): it serializes as `{@ctx}` and is resolved by `lower()`.\n const contextName = findContextName(qbo);\n if (contextName) {\n const segments = FieldSet.collectPropertySegments(qbo);\n if (segments.length > 0) {\n // Context property access (e.g. getQueryContext('user').name) → context_property_expr\n const lastSegment = segments[segments.length - 1].id;\n const ir = {kind: 'context_property_expr' as const, contextName, property: lastSegment};\n return new ExpressionNode(ir);\n }\n // Context root reference (e.g. getQueryContext('user')) → reference_expr\n const ir = {kind: 'reference_expr' as const, contextName};\n return new ExpressionNode(ir);\n }\n\n const segments = FieldSet.collectPropertySegments(qbo);\n if (segments.length === 0) {\n // Root shape or entity reference — produce alias expression (the entity itself)\n return tracedAliasExpression([]);\n }\n const segmentIds = segments.map((s) => s.id);\n return tracedPropertyExpression(segmentIds);\n}\n\n/** Walk up the QueryBuilderObject chain to find a query context *name* (for `{@ctx}`). */\nfunction findContextName(qbo: QueryBuilderObject): string | undefined {\n let current: QueryBuilderObject | undefined = qbo;\n while (current) {\n if (current instanceof QueryShape && (current.originalValue as any)?.__queryContextName) {\n return (current.originalValue as any).__queryContextName;\n }\n current = current.subject as QueryBuilderObject | undefined;\n }\n return undefined;\n}\n\n/**\n * A wrapper for inline `.where()` on primitives that produces alias-based expressions.\n * When `p.hobby.where(h => h.equals('Jogging'))` is called, `h` should reference\n * the hobby variable itself (alias), not traverse to a sub-property.\n */\nclass InlineWhereProxy extends QueryBuilderObject {\n constructor(public readonly source: QueryPrimitive<any>) {\n super(source.property, source.subject);\n }\n\n equals(otherValue: any): ExpressionNode {\n // Empty traversal = \"the current alias\" — resolved by lowering\n // against the property's own alias scope\n const self = tracedAliasExpression([]);\n return self.eq(otherValue);\n }\n}\n\n/**\n * Wrap a QueryPrimitive in a Proxy that intercepts expression method calls.\n * When an expression method (e.g., `.plus()`, `.gt()`, `.equals()`) is accessed,\n * creates a traced ExpressionNode based on the QueryPrimitive's property path.\n */\nfunction wrapWithExpressionProxy<T>(qp: QueryPrimitive<T>): QueryPrimitive<T> {\n return new Proxy(qp, {\n get(target, key, receiver) {\n if (typeof key === 'string' && EXPRESSION_METHODS.has(key)) {\n const segments = FieldSet.collectPropertySegments(target);\n // Only intercept if we have valid property segments to trace\n if (segments.length > 0) {\n // Use toExpressionNode so a context property as the *self* of an\n // expression (e.g. getQueryContext('user').name.equals(x)) becomes a\n // context_property_expr, not a root-entity property_expr.\n const baseNode = toExpressionNode(target as unknown as QueryBuilderObject);\n return (...args: any[]) => {\n // Convert QueryBuilderObject arguments to ExpressionNode\n const convertedArgs = args.map((arg) =>\n arg instanceof QueryBuilderObject ? (toExpressionNode(arg) ?? arg) : arg,\n );\n return (baseNode as any)[key](...convertedArgs);\n };\n }\n }\n return Reflect.get(target, key, receiver);\n },\n }) as QueryPrimitive<T>;\n}\n\n/**\n * Evaluate a sort callback through the proxy and extract a SortByPath.\n * This is a standalone helper that replaces the need for the former SelectQueryFactory.sortBy().\n */\nexport const evaluateSortCallback = <S extends Shape>(\n shape: ShapeConstructor<S>,\n sortFn: (p: any) => any,\n direction: 'ASC' | 'DESC' = 'ASC',\n): SortByPath => {\n const proxy = createProxiedPathBuilder(shape);\n const response = sortFn(proxy);\n const nodeShape = shape.shape;\n const paths: PropertyPath[] = [];\n if (response instanceof QueryBuilderObject || response instanceof QueryPrimitiveSet) {\n paths.push(new PropertyPath(nodeShape, FieldSet.collectPropertySegments(response)));\n } else if (Array.isArray(response)) {\n for (const item of response) {\n if (item instanceof QueryBuilderObject) {\n paths.push(new PropertyPath(nodeShape, FieldSet.collectPropertySegments(item)));\n }\n }\n }\n // The DSL callback carries a single direction for all its paths; per-path\n // directions come from the wire form (deserializeSortByPath).\n return {paths, directions: paths.map(() => direction)};\n};\n\nexport class QueryShapeSet<\n S extends Shape = Shape,\n Source = any,\n Property extends string | number | symbol = any,\n> extends QueryBuilderObject<ShapeSet<S>, Source, Property> {\n public queryShapes: CoreSet<QueryShape>;\n private proxy;\n\n constructor(\n _originalValue?: ShapeSet<S>,\n property?: PropertyShapeData,\n subject?: QueryShape<any> | QueryShapeSet<any>,\n ) {\n super(property, subject);\n this.originalValue = _originalValue;\n\n //Note that QueryShapeSet intentionally does not store the _originalValue shape set, because it manipulates this.queryShapes\n // and then recreates the original shape set when getOriginalValue() is called\n this.queryShapes = new CoreSet(\n _originalValue?.map((shape) =>\n QueryShape.create(shape, property, subject),\n ),\n );\n }\n\n static create<S extends Shape = Shape>(\n originalValue: ShapeSet<S>,\n property: PropertyShapeData,\n subject: QueryShape<any> | QueryShapeSet<any>,\n ) {\n let instance = new QueryShapeSet<S>(originalValue, property, subject);\n\n let proxy = this.proxifyShapeSet<S>(instance);\n return proxy;\n }\n\n static proxifyShapeSet<T extends Shape = Shape>(\n queryShapeSet: QueryShapeSet<T>,\n ) {\n let originalShapeSet = queryShapeSet.getOriginalValue();\n\n queryShapeSet.proxy = new Proxy(queryShapeSet, {\n get(target, key, receiver) {\n //if the key is a string\n if (typeof key === 'string') {\n //if this is a get method that is implemented by the QueryShapeSet, then use that\n if (key in queryShapeSet) {\n //if it's a function, then bind it to the queryShape and return it so it can be called\n if (typeof queryShapeSet[key] === 'function') {\n return target[key].bind(target);\n }\n //if it's a get method, then return that\n //NOTE: we may not need this if we don't use any get methods in QueryValue classes?\n return queryShapeSet[key];\n }\n\n //if not, then a method/accessor was called that likely fits with the methods of the original SHAPE of the items in the shape set\n //As in Shape.friends.name -> key would be name, which is requested from (each item in!) a ShapeSet of Shapes\n //So here we find back the shape that all items have in common, and then find the property shape that matches the key\n //NOTE: this will only work if the key corresponds with an accessor in the shape that uses a @linkedProperty decorator\n let leastSpecificShape = queryShapeSet\n .getOriginalValue()\n .getLeastSpecificShape();\n let valueShape = leastSpecificShape ? leastSpecificShape.shape : null;\n if (!valueShape && queryShapeSet.property?.valueShape) {\n const shapeClass = getShapeClass(queryShapeSet.property.valueShape);\n valueShape = shapeClass?.shape;\n }\n let propertyShape: PropertyShapeData = valueShape\n ? getPropertyShapes(valueShape, true).find(\n (propertyShape) => propertyShape.label === key,\n )\n : undefined;\n\n //if the property shape is found\n if (propertyShape) {\n return queryShapeSet.callPropertyShapeAccessor(propertyShape);\n } else if (\n //else if a genuine collection method of the ShapeSet is called\n //(.forEach()/.map()/… — including symbol methods like iteration)\n originalShapeSet[key] &&\n typeof originalShapeSet[key] === 'function'\n ) {\n //then return that method and bind the original value as 'this'\n return originalShapeSet[key].bind(originalShapeSet);\n } else if (typeof key === 'string' && !INTEROP_PASSTHROUGH_KEYS.has(key)) {\n // Same policy as the single-node proxy: an undecorated string key\n // is a genuine misuse (it would silently return a broken path over\n // the set → silently-wrong results). Throw. Interop/framework keys\n // and symbols pass through.\n throw new Error(\n `${valueShape?.label ?? 'shape'}.${key} is accessed in a query, but it does not have a @linkedProperty decorator. Queries can only access decorated get/set methods (@objectProperty / @literalProperty).`,\n );\n }\n }\n //otherwise return the value of the property on the original shape\n return originalShapeSet[key];\n },\n });\n return queryShapeSet.proxy;\n }\n\n as<ShapeClass extends typeof Shape>(\n shape: ShapeClass,\n ): QShapeSet<InstanceType<ShapeClass>, Source, Property> {\n //if the shape is not the same as the original value, then we need to create a new query shape\n // `getLeastSpecificShape()` is `undefined` for an empty set; `?.` avoids a\n // TypeError and `nodeShapeEquals(_, undefined)` is false, so we rebuild as needed.\n if (!nodeShapeEquals(shape.shape, this.originalValue.getLeastSpecificShape()?.shape)) {\n let newOriginal = new ShapeSet(\n this.originalValue.map((existing) =>\n createShapeTarget(shape as any, existing?.id),\n ),\n );\n return QueryShapeSet.create(\n newOriginal,\n this.property,\n this.subject as any,\n );\n }\n // else return this\n return this as any as QShapeSet<InstanceType<ShapeClass>, Source, Property>;\n }\n\n add(item) {\n this.queryShapes.add(item);\n }\n\n concat(other: QueryShapeSet): QueryShapeSet {\n if (other) {\n if (other instanceof QueryShapeSet) {\n (other as QueryShapeSet).queryShapes.forEach(\n this.queryShapes.add.bind(this.queryShapes),\n );\n } else {\n throw new Error('Unknown type: ' + other);\n }\n }\n return this;\n }\n\n getOriginalValue() {\n return new ShapeSet(\n this.queryShapes.map((shape) => {\n return shape.originalValue;\n }),\n ) as ShapeSet<S>;\n }\n\n callPropertyShapeAccessor(\n propertyShape: PropertyShapeData,\n ): QueryShapeSet | QueryPrimitiveSet {\n //call the get method for that property shape on each item in the shape set\n //and return the result as a new shape set\n let result: QueryPrimitiveSet | QueryShapeSet; //QueryValueSetOfSets;\n\n //if we expect the accessor to return a Primitive (string,number,boolean,Date)\n if (isSameRef(propertyShape.nodeKind, shacl.Literal)) {\n //then return a Set of QueryPrimitives\n result = new QueryPrimitiveSet(null, propertyShape, this);\n } else {\n // result = QueryValueSetOfSets.create(propertyShape, this); //QueryShapeSet.create(null, propertyShape, this);\n result = QueryShapeSet.create(null, propertyShape, this);\n }\n let expectSingleValues =\n typeof propertyShape.maxCount === 'number' && propertyShape.maxCount <= 1;\n\n this.queryShapes.forEach((shape) => {\n //access the propertyShapes accessor,\n // since the shape should already be converted to a QueryShape, the result is a QueryValue also\n let shapeQueryValue = shape[propertyShape.label];\n\n //only add results if something was actually returned, if the property is not defined for this shape the result can be undefined\n if (shapeQueryValue) {\n if (expectSingleValues) {\n (result as any).add(shapeQueryValue);\n } else {\n //if each of the shapes in a set return a new shapeset for the request accessor\n //then we merge all the returned values into a single shapeset\n (result as QueryShapeSet).concat(shapeQueryValue);\n }\n }\n });\n return result;\n }\n\n //countable?, resultKey?: string\n size(): SetSize<this> {\n //when count() is called we want to count the number of items in the entire query path\n return new SetSize(this); //countable, resultKey\n }\n\n // get testItem() {}\n where(validation: WhereClause<S>): this {\n if (\n (this.getPropertyPath() as QueryStep[]).some(\n (step) => (step as PropertyQueryStep).where,\n )\n ) {\n throw new Error(\n 'You cannot call where() from within a where() clause. Consider using some() or every() instead',\n );\n }\n let leastSpecificShape = this.getOriginalValue().getLeastSpecificShape();\n this.wherePath = processWhereClause(validation, leastSpecificShape);\n //return this.proxy because after Shape.friends.where() we can call other methods of Shape.friends\n //and for that we need the proxy\n return this.proxy;\n }\n\n select<QF = unknown>(\n subQueryFn: QueryBuildFn<S, QF>,\n ): FieldSet<QF, QueryShapeSet<S, Source, Property>> {\n const leastSpecificShape = this.getOriginalValue().getLeastSpecificShape();\n const parentSegments = FieldSet.collectPropertySegments(this);\n const fs = FieldSet.forSubSelect<QF, QueryShapeSet<S, Source, Property>>(\n leastSpecificShape,\n subQueryFn as any,\n parentSegments,\n this,\n );\n return fs;\n }\n\n selectAll(): FieldSet<\n SelectAllQueryResponse<S>,\n QueryShapeSet<S, Source, Property>\n > {\n let leastSpecificShape = this.getOriginalValue().getLeastSpecificShape();\n const propertyLabels = getUniquePropertyShapes(leastSpecificShape.shape)\n .map((propertyShape) => propertyShape.label);\n return this.select((shape) =>\n propertyLabels.map((label) => (shape as any)[label]),\n );\n }\n\n some(validation: WhereClause<S>): ExistsCondition {\n const predicate = this.buildPredicateExpression(validation);\n const pathSegmentIds = FieldSet.collectPropertySegments(this).map(s => s.id);\n return new ExistsCondition(pathSegmentIds, predicate, false);\n }\n\n every(validation: WhereClause<S>): ExistsCondition {\n // every(fn) = NOT EXISTS(path WHERE NOT(fn))\n const predicate = this.buildPredicateExpression(validation);\n const pathSegmentIds = FieldSet.collectPropertySegments(this).map(s => s.id);\n return new ExistsCondition(pathSegmentIds, predicate.not(), true);\n }\n\n none(validation: WhereClause<S>): ExistsCondition {\n // none(fn) = NOT EXISTS(path WHERE fn) = some(fn).not()\n const predicate = this.buildPredicateExpression(validation);\n const pathSegmentIds = FieldSet.collectPropertySegments(this).map(s => s.id);\n return new ExistsCondition(pathSegmentIds, predicate, true);\n }\n\n private buildPredicateExpression(validation: WhereClause<S>): ExpressionNode {\n const leastSpecificShape = this.getOriginalValue().getLeastSpecificShape();\n if (validation instanceof Function) {\n const proxy = createProxiedPathBuilder(leastSpecificShape) as any;\n const result = validation(proxy);\n if (isExpressionNode(result)) {\n return result;\n }\n throw new Error('Validation callback must return an ExpressionNode or ExistsCondition');\n }\n if (isExpressionNode(validation)) {\n return validation;\n }\n throw new Error('Expected a callback or ExpressionNode for some/every/none');\n }\n}\n\nexport class QueryShape<\n S extends Shape = Shape,\n Source = any,\n Property extends string | number | symbol = any,\n> extends QueryBuilderObject<S, Source, Property> {\n private proxy;\n\n constructor(\n public originalValue: S,\n property?: PropertyShapeData,\n subject?: QueryShape<any> | QueryShapeSet<any>,\n ) {\n super(property, subject);\n }\n\n get id() {\n return (\n (this.originalValue as Shape).__queryContextId ||\n this.originalValue['id']\n );\n }\n\n static create(\n original: Shape,\n property?: PropertyShapeData,\n subject?: QueryShape<any> | QueryShapeSet<any>,\n ) {\n let instance = new QueryShape(original, property, subject);\n let proxy = this.proxifyQueryShape(instance);\n return proxy;\n }\n\n private static proxifyQueryShape<T extends Shape>(queryShape: QueryShape<T>) {\n let originalShape = queryShape.originalValue;\n queryShape.proxy = new Proxy(queryShape, {\n get(target, key, receiver) {\n //if the key is a string\n if (typeof key === 'string') {\n //if this is a get method that is implemented by the QueryShape, then use that\n if (key in queryShape) {\n //if it's a function, then bind it to the queryShape and return it so it can be called\n if (typeof queryShape[key] === 'function') {\n return target[key].bind(target);\n }\n //if it's a get method, then return that\n //NOTE: we may not need this if we don't use any get methods in QueryValue classes?\n return queryShape[key];\n }\n\n //if not, then a method/accessor of the original shape was called\n //then check if we have indexed any property shapes with that name for this shapes NodeShapeData\n //NOTE: this will only work with a @linkedProperty decorator\n let propertyShape = getPropertyShapeByLabel(\n originalShape.constructor as typeof Shape,\n key,\n );\n if (propertyShape) {\n return QueryBuilderObject.generatePathValue(propertyShape, target);\n }\n }\n // A string key that is neither a QueryShape member nor a decorated\n // property is a genuine misuse: it would silently return the raw value\n // and the query would run with a broken path (silently-wrong results).\n // Throw. Symbols and framework/interop keys pass through untouched so\n // promise-awaiting, React, and serializers can still introspect the proxy.\n if (typeof key === 'string' && !INTEROP_PASSTHROUGH_KEYS.has(key)) {\n throw new Error(\n `${originalShape.constructor.name}.${key} is accessed in a query, but it does not have a @linkedProperty decorator. Queries can only access decorated get/set methods (@objectProperty / @literalProperty).`,\n );\n }\n return originalShape[key];\n },\n });\n return queryShape.proxy;\n }\n\n as<ShapeClass extends typeof Shape>(\n shape: ShapeClass,\n ): QShape<InstanceType<ShapeClass>, Source, Property> {\n //if the shape is not the same as the original value, then we need to create a new query shape\n if (!nodeShapeEquals(shape.shape, this.originalValue.nodeShape)) {\n const newOriginal = createShapeTarget(shape as any, this.originalValue.id);\n return QueryShape.create(newOriginal, this.property, this.subject as any);\n }\n return this as any as QShape<InstanceType<ShapeClass>, Source, Property>;\n }\n\n equals(otherValue: NodeReferenceValue | QShape<any> | PendingQueryContext): ExpressionNode {\n const self = toExpressionNode(this);\n // An unresolved query-context reference (`getQueryContext('user')` before it\n // is set) carries no `.id` yet — keep it as a `{@ctx}` ref, resolved at lower.\n if (otherValue instanceof PendingQueryContext) {\n return self.eq(otherValue as any);\n }\n //validate the value is formed correctly\n if(!otherValue.id) {\n throw Error(`Invalid value for .equals(). ${JSON.stringify(otherValue)}`);\n }\n const arg = otherValue instanceof QueryBuilderObject\n ? toExpressionNode(otherValue)\n : otherValue;\n return self.eq(arg as any);\n }\n\n oneOf(values: (NodeReferenceValue | QShape<any>)[]): ExpressionNode {\n return toExpressionNode(this).oneOf(\n values.map((v) => (v instanceof QueryBuilderObject ? toExpressionNode(v) : v)) as any,\n );\n }\n notOneOf(values: (NodeReferenceValue | QShape<any>)[]): ExpressionNode {\n return toExpressionNode(this).notOneOf(\n values.map((v) => (v instanceof QueryBuilderObject ? toExpressionNode(v) : v)) as any,\n );\n }\n\n select<QF = unknown>(\n subQueryFn: QueryBuildFn<S, QF>,\n ): FieldSet<QF, QueryShape<S, Source, Property>> {\n // A sub-select on a project-authored value shape has no authored class, so fall\n // back to the metadata-derived constructor. Without it this returned undefined and\n // FieldSet.forSubSelect failed reading `.shape` off it, far from the cause.\n const leastSpecificShape = resolveShapeConstructor(\n (this.getOriginalValue() as Shape).nodeShape.id,\n );\n const parentSegments = FieldSet.collectPropertySegments(this);\n const fs = FieldSet.forSubSelect<QF, QueryShape<S, Source, Property>>(\n leastSpecificShape,\n subQueryFn as any,\n parentSegments,\n this,\n );\n return fs;\n }\n\n selectAll(): FieldSet<\n SelectAllQueryResponse<S>,\n QueryShape<S, Source, Property>\n > {\n // Same as `select()` above: runtime shapes resolve through the adapter.\n const shapeId = (this.getOriginalValue() as Shape).nodeShape.id;\n const leastSpecificShape = resolveShapeConstructor(shapeId);\n // An IRI that is registered nowhere resolves to nothing, and reading `.shape` off\n // it produced a bare \"Cannot read properties of undefined\" from inside the field\n // walk — a message that named neither the shape nor this call. Say which shape.\n if (!leastSpecificShape) {\n throw new Error(\n `selectAll() cannot resolve a shape for '${shapeId}'. It is registered neither ` +\n `as a class nor as metadata, so its properties are unknown.`,\n );\n }\n const propertyLabels = getUniquePropertyShapes(leastSpecificShape.shape)\n .map((propertyShape) => propertyShape.label);\n return this.select((shape) =>\n propertyLabels.map((label) => (shape as any)[label]),\n );\n }\n\n // count(countable: QueryBuilderObject, resultKey?: string): SetSize<this> {\n // return new SetSize(this, countable, resultKey);\n // // return this._count;\n // }\n}\n\n\n/**\n * Concrete query wrapper for JS primitive values (string, number, boolean, Date).\n *\n * Replaces the former abstract class + subclasses (QueryString, QueryNumber,\n * QueryBoolean, QueryDate) — the type parameter T carries the primitive type,\n * so separate subclasses are unnecessary.\n */\nexport class QueryPrimitive<\n T,\n Source = any,\n Property extends string | number | symbol = any,\n> extends QueryBuilderObject<T, Source, Property> {\n constructor(\n public originalValue?: T,\n public property?: PropertyShapeData,\n public subject?: QueryShape<any> | QueryShapeSet<any> | QueryPrimitiveSet,\n ) {\n super(property, subject);\n }\n\n equals(otherValue: ComparisonValue): ExpressionNode {\n const self = toExpressionNode(this);\n const arg = otherValue instanceof QueryBuilderObject\n ? toExpressionNode(otherValue)\n : otherValue;\n return self.eq(arg as any);\n }\n\n oneOf(values: ComparisonValue[]): ExpressionNode {\n return toExpressionNode(this).oneOf(\n values.map((v) => (v instanceof QueryBuilderObject ? toExpressionNode(v) : v)) as any,\n );\n }\n notOneOf(values: ComparisonValue[]): ExpressionNode {\n return toExpressionNode(this).notOneOf(\n values.map((v) => (v instanceof QueryBuilderObject ? toExpressionNode(v) : v)) as any,\n );\n }\n\n where(validation: WhereClause<string>): this {\n // For inline where on a primitive (p.hobby.where(h => h.equals(...))),\n // pass a clone that produces alias expressions (the bound value itself)\n // rather than property traversals\n const selfAsAlias = new InlineWhereProxy(this);\n this.wherePath = processWhereClause(validation, selfAsAlias as any);\n //return this because after Shape.friends.where() we can call other methods of Shape.friends\n return this as any;\n }\n}\n\n\nexport class QueryPrimitiveSet<\n QPrimitive extends QueryPrimitive<any> = null,\n> extends QueryBuilderObject<any, any, any> {\n public contents: CoreSet<QPrimitive>;\n\n constructor(\n public originalValue?: JSNonNullPrimitive[],\n public property?: PropertyShapeData,\n public subject?: QueryShapeSet<any> | QueryShape<any>,\n items?,\n ) {\n super(property, subject);\n this.contents = new CoreSet(items);\n }\n\n add(item) {\n this.contents.add(item);\n }\n\n values() {\n return [...this.contents.values()];\n }\n\n //this is needed because we extend CoreSet which has a createNew method but does not expect the constructor to have arguments\n createNew(...args): this {\n return new (<any>this.constructor)(\n this.property,\n this.subject,\n ...args,\n ) as this;\n }\n\n //TODO: see if we can merge these methods of QueryPrimitive and QueryPrimitiveSet\n // so that they're only defined once\n equals(other): ExpressionNode {\n return toExpressionNode(this).eq(other);\n }\n\n getPropertyStep(): QueryStep {\n if (this.contents.size > 1) {\n throw new Error(\n 'This should never happen? Not implemented: get property path for a QueryPrimitiveSet with multiple values',\n );\n }\n return this.contents.first().getPropertyStep();\n }\n\n getPropertyPath(): QueryPropertyPath {\n if (this.contents.size > 1) {\n throw new Error(\n 'This should never happen? Not implemented: get property path for a QueryPrimitiveSet with multiple values',\n );\n }\n //here we let the first item in the set return its property path, because all items will be the same\n //however, sometimes the path goes through the subject of this SET rather than the individual items (which have an individual shape as subject)\n //so we pass the subject of this set so it can be used\n let first = this.contents.first();\n if (first) {\n (first.subject as QueryShapeSet).wherePath =\n (first.subject as QueryShapeSet).wherePath || this.subject.wherePath;\n return first.getPropertyPath();\n } else {\n console.warn(\n `QueryPrimitiveSet without items. From ${this.subject.getOriginalValue().nodeShape.label}.${this.property.label}. What to return as property path?`,\n );\n return this.subject.getPropertyPath();\n }\n }\n\n //countable, resultKey?: string\n size(): SetSize<this> {\n return new SetSize(this as QueryPrimitiveSet);\n //countable, resultKey\n }\n}\n\nexport class SetSize<Source = null> extends QueryPrimitive<number, Source> {\n constructor(\n public subject: QueryShapeSet | QueryShape | QueryPrimitiveSet,\n public countable?: QueryBuilderObject,\n public label?: string,\n ) {\n super();\n }\n\n // Build an aggregate_expr(count, …) ExpressionNode for the counted property.\n private toCountExpr(): ExpressionNode {\n const countedSegments = FieldSet.collectPropertySegments(this.subject);\n const countedIds = countedSegments.map((s) => s.id);\n const countedNode = tracedPropertyExpression(countedIds);\n return new ExpressionNode(\n {kind: 'aggregate_expr', name: 'count', args: [countedNode.ir]} as any,\n countedNode._refs,\n );\n }\n\n // Comparisons on the count (lowered to a HAVING clause on COUNT(…)).\n equals(v: any): ExpressionNode { return this.toCountExpr().eq(v); }\n eq(v: any): ExpressionNode { return this.toCountExpr().eq(v); }\n neq(v: any): ExpressionNode { return this.toCountExpr().neq(v); }\n notEquals(v: any): ExpressionNode { return this.toCountExpr().neq(v); }\n gt(v: any): ExpressionNode { return this.toCountExpr().gt(v); }\n greaterThan(v: any): ExpressionNode { return this.toCountExpr().gt(v); }\n gte(v: any): ExpressionNode { return this.toCountExpr().gte(v); }\n greaterThanOrEqual(v: any): ExpressionNode { return this.toCountExpr().gte(v); }\n lt(v: any): ExpressionNode { return this.toCountExpr().lt(v); }\n lessThan(v: any): ExpressionNode { return this.toCountExpr().lt(v); }\n lte(v: any): ExpressionNode { return this.toCountExpr().lte(v); }\n lessThanOrEqual(v: any): ExpressionNode { return this.toCountExpr().lte(v); }\n\n as(label: string) {\n this.label = label;\n return this;\n }\n\n getPropertyPath(): QueryPropertyPath {\n //count the last property in the path\n //use the label of the last property as the label of the count step\n let countable = this.subject.getPropertyStep();\n let self: SizeStep = {\n count: [countable],\n label: this.label || this.subject.property.label,\n };\n\n //request the path of the subject's subject (the parent of the parent)\n //and add the SizeStep to that path, since we already used the subject as the thing that's counted\n if (this.subject.subject) {\n let path = this.subject.subject.getPropertyPath();\n path.push(self);\n return path;\n }\n return [self];\n }\n}\n\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"UpdateBuilder.js","sourceRoot":"","sources":["../../../src/queries/UpdateBuilder.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAC,YAAY,EAAC,MAAM,mBAAmB,CAAC;AAE/C,OAAO,EAAC,oBAAoB,EAAC,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAC,gBAAgB,EAAC,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAC,uBAAuB,EAAC,MAAM,oBAAoB,CAAC;AAE3D,OAAO,EAAC,YAAY,EAAE,iBAAiB,EAAC,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAC,mBAAmB,EAAE,eAAe,EAAE,sBAAsB,EAAC,MAAM,mBAAmB,CAAC;AAC/F,OAAO,EAAC,gBAAgB,EAAE,gBAAgB,EAAC,MAAM,iBAAiB,CAAC;AAEnE,OAAO,EAAmC,kBAAkB,EAAC,MAAM,kBA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","sourcesContent":["import {Shape, type ShapeConstructor} from '../shapes/Shape.js';\nimport {resolveShape} from './resolveShape.js';\nimport {type AddId, type UpdatePartial, NodeReferenceValue} from './QueryFactory.js';\nimport {MutationQueryFactory} from './MutationQuery.js';\nimport {MutationThenable} from './MutationThenable.js';\nimport {resolveMutationDispatch} from './queryDispatch.js';\nimport type {IDataset} from '../interfaces/IDataset.js';\nimport {WIRE_VERSION, assertWireVersion} from './wireVersion.js';\nimport {PendingQueryContext, getQueryContext, UnresolvedContextError} from './QueryContext.js';\nimport {encodeContextRef, isContextRefJSON} from './ContextRef.js';\nimport type {NodeShapeData} from '../shapes/SHACL.js';\nimport {type WhereClause, type WherePath, processWhereClause} from './SelectQuery.js';\nimport type {ExpressionUpdateProxy, ExpressionUpdateResult} from '../expressions/ExpressionMethods.js';\nimport {\n encodeNodeData,\n decodeNodeDataToRaw,\n type UpdateMutationJSON,\n type UpsertMutationJSON,\n} from './MutationSerialization.js';\nimport {serializeWherePath, deserializeWherePath} from './QueryBuilderSerialization.js';\nimport type {UpdateLowerSpec} from './mutationLowerSpec.js';\n\ntype UpdateMode = 'for' | 'forAll' | 'where';\n\n/**\n * Internal state bag for UpdateBuilder.\n */\ninterface UpdateBuilderInit<S extends Shape> {\n shape: ShapeConstructor<S>;\n data?: UpdatePartial<S>;\n targetId?: string;\n mode?: UpdateMode;\n whereFn?: WhereClause<S>;\n /** A pre-resolved where path (used by fromJSON; no live callback). */\n where?: WherePath;\n /** A query-context name used as the target subject (resolved at lowering). */\n targetContextName?: string;\n /**\n * Upsert mode — create-or-replace against a known id. Set by `Shape.upsert()`.\n * The builder is otherwise identical to an update, which is why it reuses this class;\n * only the lowered IR kind and the `.where()`/`.forAll()` guards differ.\n */\n upsert?: boolean;\n}\n\n/**\n * An immutable, fluent builder for update mutations.\n *\n * Every mutation method returns a new UpdateBuilder — the original is never modified.\n *\n * Implements PromiseLike so mutations execute on `await`:\n * ```ts\n * const result = await UpdateBuilder.from(Person).for({id: '...'}).set({name: 'Bob'});\n * await UpdateBuilder.from(Person).set({hobby: 'x'}).forAll(); // returns void\n * ```\n *\n * R is the resolved type: AddId<U> for ID-based, void for bulk operations.\n */\nexport class UpdateBuilder<S extends Shape = Shape, U extends UpdatePartial<S> = UpdatePartial<S>, R = AddId<U>>\n extends MutationThenable<R>\n{\n protected readonly _tag = 'UpdateBuilder';\n private readonly _shape: ShapeConstructor<S>;\n private readonly _data?: UpdatePartial<S>;\n private readonly _targetId?: string;\n private readonly _mode?: UpdateMode;\n private readonly _whereFn?: WhereClause<S>;\n private readonly _where?: WherePath;\n private readonly _targetContextName?: string;\n private readonly _upsert: boolean;\n\n private constructor(init: UpdateBuilderInit<S>) {\n super();\n this._shape = init.shape;\n this._data = init.data;\n this._targetId = init.targetId;\n this._mode = init.mode;\n this._whereFn = init.whereFn;\n this._where = init.where;\n this._targetContextName = init.targetContextName;\n this._upsert = init.upsert ?? false;\n }\n\n private clone(overrides: Partial<UpdateBuilderInit<S>> = {}): UpdateBuilder<S, any, any> {\n return new UpdateBuilder<S, any>({\n shape: this._shape,\n data: this._data,\n targetId: this._targetId,\n mode: this._mode,\n whereFn: this._whereFn,\n where: this._where,\n targetContextName: this._targetContextName,\n upsert: this._upsert,\n ...overrides,\n });\n }\n\n // ---------------------------------------------------------------------------\n // Static constructors\n // ---------------------------------------------------------------------------\n\n static from<S extends Shape>(shape: ShapeConstructor<S> | string): UpdateBuilder<S> {\n const resolved = resolveShape<S>(shape);\n return new UpdateBuilder<S>({shape: resolved});\n }\n\n /** Builder for a create-or-replace against a known id. See `Shape.upsert()`. */\n static upsertFrom<S extends Shape>(shape: ShapeConstructor<S> | string): UpdateBuilder<S> {\n const resolved = resolveShape<S>(shape);\n return new UpdateBuilder<S>({shape: resolved, upsert: true});\n }\n\n /** Reconstruct an UpdateBuilder from its DSL-JSON (inverse of `toJSON`). */\n static fromJSON(json: UpdateMutationJSON | UpsertMutationJSON): UpdateBuilder {\n assertWireVersion(json.v);\n const resolved = resolveShape(json.shape);\n const data = decodeNodeDataToRaw(json.data, resolved.shape) as any;\n\n // Branch on `op` first so each envelope keeps its own narrowed type; an upsert has\n // only the `for` form, so its modes are not the update modes.\n if (json.op === 'upsert') {\n // The type says `mode: 'for'`, but an inbound envelope is untrusted data — the\n // cast keeps the runtime check that the type alone cannot enforce.\n if ((json.mode as string) !== 'for') {\n throw new Error(\n `upsert mode \"${String(json.mode)}\" is invalid — an upsert targets one known id.`,\n );\n }\n if (isContextRefJSON(json.targetId)) {\n return new UpdateBuilder({\n shape: resolved, data, targetContextName: json.targetId['@ctx'], mode: 'for', upsert: true,\n });\n }\n return new UpdateBuilder({shape: resolved, data, targetId: json.targetId, mode: 'for', upsert: true});\n }\n\n if (json.mode === 'for') {\n if (isContextRefJSON(json.targetId)) {\n return new UpdateBuilder({shape: resolved, data, targetContextName: json.targetId['@ctx'], mode: 'for'});\n }\n return new UpdateBuilder({shape: resolved, data, targetId: json.targetId, mode: 'for'});\n }\n if (json.mode === 'forAll') {\n return new UpdateBuilder({shape: resolved, data, mode: 'forAll'});\n }\n const where = deserializeWherePath(resolved.shape, json.where!);\n return new UpdateBuilder({shape: resolved, data, mode: 'where', where});\n }\n\n // ---------------------------------------------------------------------------\n // Fluent API\n // ---------------------------------------------------------------------------\n\n /** Target a specific entity by ID. */\n for(id: string | NodeReferenceValue | PendingQueryContext): UpdateBuilder<S, U, AddId<U>> {\n if (id instanceof PendingQueryContext) {\n return this.clone({targetContextName: id.contextName, targetId: undefined, mode: 'for'}) as unknown as UpdateBuilder<S, U, AddId<U>>;\n }\n const resolvedId = typeof id === 'string' ? id : id.id;\n return this.clone({targetId: resolvedId, targetContextName: undefined, mode: 'for'}) as unknown as UpdateBuilder<S, U, AddId<U>>;\n }\n\n /** Update all instances of this shape type. Returns void. */\n forAll(): UpdateBuilder<S, U, void> {\n this._assertNotUpsert('forAll()');\n return this.clone({mode: 'forAll', targetId: undefined, whereFn: undefined}) as unknown as UpdateBuilder<S, U, void>;\n }\n\n /** Update instances matching a condition. Returns void. */\n where(fn: WhereClause<S>): UpdateBuilder<S, U, void> {\n this._assertNotUpsert('where()');\n return this.clone({mode: 'where', whereFn: fn, targetId: undefined}) as unknown as UpdateBuilder<S, U, void>;\n }\n\n /**\n * An upsert has to know which node to create, so it only makes sense against a single\n * known id. `forAll()` and `where()` select existing nodes — there is nothing to create\n * when they match nothing, and no single id to create it under.\n */\n private _assertNotUpsert(method: string): void {\n if (this._upsert) {\n throw new Error(\n `upsert does not support .${method} — an upsert targets one known id, ` +\n `so use .for(id). (.${method} selects existing nodes, which is what update does.)`,\n );\n }\n }\n\n /** Replace the update data. */\n set(fn: (p: ExpressionUpdateProxy<S>) => ExpressionUpdateResult<S>): UpdateBuilder<S, any, R>;\n set<NewU extends UpdatePartial<S>>(data: NewU): UpdateBuilder<S, NewU, R>;\n set(data: any): any {\n return this.clone({data}) as any;\n }\n\n // ---------------------------------------------------------------------------\n // Build & execute\n // ---------------------------------------------------------------------------\n\n /** Discriminator for the free `lower()` function and dataset routing. */\n readonly __queryKind = 'update' as const;\n\n /** The shape this query targets — the routing key datasets/`LinkedStorage` use. */\n get shape(): NodeShapeData {\n return this._shape.shape;\n }\n\n /** @internal The IR-free lowering spec consumed by `lower()`. Validates inputs. */\n _lowerSpec(): UpdateLowerSpec<S> {\n if (!this._data) {\n throw new Error(\n 'UpdateBuilder requires .set(data) before it can be lowered. Specify what to update.',\n );\n }\n\n const mode = this._mode || (this._targetId ? 'for' : undefined);\n\n if (mode === 'forAll') {\n return {shapeClass: this._shape, data: this._data, mode: 'forAll'};\n }\n\n if (mode === 'where') {\n if (!this._whereFn && !this._where) {\n throw new Error('UpdateBuilder.where() requires a condition callback.');\n }\n const wherePath =\n this._where ?? processWhereClause(this._whereFn!, this._shape);\n return {shapeClass: this._shape, data: this._data, mode: 'where', wherePath};\n }\n\n // Default: ID-based update (target id may come from a query context)\n const targetId = this._resolveTargetId();\n if (!targetId) {\n if (this._targetContextName) {\n throw new UnresolvedContextError(this._targetContextName);\n }\n // A caller arriving from `create({__id: id, ...values})` — which upsert is meant to\n // replace — naturally writes the id into the data object. That form is rejected\n // further down (\"cannot use id in the top level\"), but only once a target exists;\n // without one they would otherwise get a bare \"requires .for(id)\" that never\n // mentions the id they did pass. Name it here instead.\n const strayId = this._strayTopLevelId();\n if (strayId) {\n throw new Error(\n `${this._upsert ? 'upsert' : 'update'} takes the target id in .for(id), not in the data: ` +\n `move \"${strayId}\" out of the data object — ` +\n `${this._upsert ? 'upsert' : 'update'}(values).for({id}). ` +\n `(create() is the one that takes an id in its data, because there it names the node being created.)`,\n );\n }\n throw new Error(\n this._upsert\n ? 'upsert requires .for(id) before it can be lowered — an upsert targets one known id.'\n : 'UpdateBuilder requires .for(id), .forAll(), or .where() before it can be lowered.',\n );\n }\n return {\n shapeClass: this._shape,\n data: this._data,\n mode: 'for',\n targetId,\n ...(this._upsert ? {upsert: true} : {}),\n };\n }\n\n /**\n * The key name of a top-level `id`/`__id` in the update data, if present. Used only to\n * improve the missing-target error; the data object itself is validated downstream.\n */\n private _strayTopLevelId(): string | undefined {\n const data = this._data as Record<string, unknown> | undefined;\n if (!data || typeof data !== 'object') return undefined;\n return ['id', '__id'].find((k) => k in data);\n }\n\n /** Resolve the target id from an explicit id or a query-context reference. */\n private _resolveTargetId(): string | undefined {\n if (this._targetId) return this._targetId;\n if (this._targetContextName) return getQueryContext(this._targetContextName)?.id;\n return undefined;\n }\n\n /**\n * Serialize this update mutation to lightweight DSL-JSON. Normalizes the update\n * data through the IR-free factory base (handles the expression-callback form\n * of `.set()`), and serializes the where clause for `where`-mode updates.\n */\n toJSON(): UpdateMutationJSON | UpsertMutationJSON {\n if (!this._data) {\n throw new Error('UpdateBuilder requires .set(data) before .toJSON().');\n }\n const mode = this._mode || (this._targetId ? 'for' : undefined);\n if (!mode) {\n throw new Error(\n 'UpdateBuilder requires .for(id), .forAll(), or .where() before .toJSON().',\n );\n }\n const fields = new MutationQueryFactory().describe(\n this._shape.shape,\n this._data,\n {validate: 'partial'},\n );\n if (this._upsert && mode !== 'for') {\n throw new Error('upsert requires .for(id) before it can be serialized.');\n }\n const json = {\n v: WIRE_VERSION,\n op: this._upsert ? 'upsert' : 'update',\n shape: this._shape.shape.id,\n mode,\n data: encodeNodeData(fields, this._shape.shape),\n } as UpdateMutationJSON | UpsertMutationJSON;\n if (mode === 'for') {\n if (this._targetContextName) json.targetId = encodeContextRef(this._targetContextName);\n else json.targetId = this._targetId;\n }\n if (mode === 'where') {\n const wherePath = this._where ?? (this._whereFn ? processWhereClause(this._whereFn, this._shape) : undefined);\n if (!wherePath) {\n throw new Error('UpdateBuilder.where() requires a condition callback.');\n }\n // `mode === 'where'` is unreachable for an upsert (guarded in `.where()` and again\n // above), so this branch is always the update envelope.\n (json as UpdateMutationJSON).where = serializeWherePath(wherePath, this._shape.shape);\n }\n return json;\n }\n\n /**\n * Execute the mutation.\n *\n * @param target Optional explicit dataset (a store or a router) to run against. Omitted →\n * the global query dispatch. A `target` runs on that dataset only; the global router is\n * untouched. Rejects if the target dataset doesn't implement update.\n */\n async exec(target?: IDataset): Promise<R> {\n const mode = this._mode || (this._targetId ? 'for' : undefined);\n const result = resolveMutationDispatch('update', target).updateQuery(this);\n // Bulk (forAll/where) resolves to void; id-based resolves to the updated node.\n if (mode === 'forAll' || mode === 'where') {\n return result.then(() => undefined) as Promise<R>;\n }\n return result as Promise<R>;\n }\n\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"UpdateQuery.js","sourceRoot":"","sources":["../../../src/queries/UpdateQuery.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"UpdateQuery.js","sourceRoot":"","sources":["../../../src/queries/UpdateQuery.ts"],"names":[],"mappings":"","sourcesContent":["import type {AddId} from './QueryFactory.js';\nimport type {\n IRUpdateMutation,\n IRUpdateWhereMutation,\n IRUpsertMutation,\n} from './IntermediateRepresentation.js';\nimport type {NodeShapeData} from '../shapes/SHACL.js';\nimport type {UpdateMutationJSON, UpsertMutationJSON} from './MutationSerialization.js';\nimport type {UpdateLowerSpec} from './mutationLowerSpec.js';\n\n/**\n * The closed, read-only update query a dataset receives (implemented by\n * `UpdateBuilder`). The IR is `IRUpdateQuery`, produced by `lower(query)` — the\n * IR construction lives in the IR tier, not here, so this module stays IR-free.\n */\nexport interface UpdateQuery {\n readonly __queryKind: 'update';\n readonly shape: NodeShapeData;\n toJSON(): UpdateMutationJSON | UpsertMutationJSON;\n /** @internal IR-free lowering spec consumed by `lower()`. */\n _lowerSpec(): UpdateLowerSpec;\n}\n\n/** The lowered IR for an update mutation (what `lower()` produces). */\nexport type IRUpdateQuery =\n | IRUpdateMutation\n | IRUpdateWhereMutation\n | IRUpsertMutation;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"fromJSON.js","sourceRoot":"","sources":["../../../src/queries/fromJSON.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;GAOG;AACH,OAAO,EAAC,aAAa,EAAwB,MAAM,mBAAmB,CAAC;AACvE,OAAO,EAAC,aAAa,EAAC,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAC,aAAa,EAAC,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAC,aAAa,EAAC,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAC,UAAU,EAAC,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAC,YAAY,EAAC,MAAM,mBAAmB,CAAC;AAI/C,OAAO,EAAC,iBAAiB,EAAC,MAAM,kBAAkB,CAAC;AASnD,MAAM,UAAU,QAAQ,CACtB,IAAe;IAQf,iBAAiB,CAAE,IAAsB,aAAtB,IAAI,uBAAJ,IAAI,CAAoB,CAAC,CAAC,CAAC;IAC9C,IAAI,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,IAAI,IAAI,EAAE,CAAC;QACrD,QAAQ,IAAI,CAAC,EAAE,EAAE,CAAC;YAChB,KAAK,KAAK;gBACR,OAAO,UAAU,CAAC,QAAQ,CAAC,IAAoB,CAA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IAAI,IAAI,IAAI,EAAE,CAAC;QACrD,QAAQ,IAAI,CAAC,EAAE,EAAE,CAAC;YAChB,KAAK,KAAK;gBACR,OAAO,UAAU,CAAC,QAAQ,CAAC,IAAoB,CAAC,CAAC;YACnD,KAAK,OAAO;gBACV,OAAO,YAAY,CAAC,QAAQ,CAAC,IAAsB,CAAC,CAAC;YACvD,KAAK,QAAQ;gBACX,OAAO,aAAa,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACtC,KAAK,QAAQ,CAAC;YACd,KAAK,QAAQ;gBACX,wEAAwE;gBACxE,OAAO,aAAa,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACtC,KAAK,QAAQ;gBACX,OAAO,aAAa,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACtC;gBACE,oEAAoE;gBACpE,qEAAqE;gBACrE,uCAAuC;gBACvC,MAAM,IAAI,KAAK,CACb,qBAAqB,MAAM,CAAE,IAAsB,CAAC,EAAE,CAAC,yBAAyB,CACjF,CAAC;QACN,CAAC;IACH,CAAC;IACD,OAAO,aAAa,CAAC,QAAQ,CAAC,IAAwB,CAAC,CAAC;AAC1D,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 * Kind-detecting `fromJSON` — rehydrate any query DSL-JSON back into its builder.\n *\n * Ask, count and mutation envelopes carry an `op` discriminator; select envelopes\n * (`QueryBuilderJSON`) do not. This is the inbound boundary helper: a receiving\n * process turns wire JSON into a live query with `fromJSON(json).exec()` (the\n * existing generic dispatch), no per-op routing needed.\n */\nimport {SelectBuilder, type QueryBuilderJSON} from './QueryBuilder.js';\nimport {CreateBuilder} from './CreateBuilder.js';\nimport {UpdateBuilder} from './UpdateBuilder.js';\nimport {DeleteBuilder} from './DeleteBuilder.js';\nimport {AskBuilder} from './AskBuilder.js';\nimport {CountBuilder} from './CountBuilder.js';\nimport type {AskQueryJSON} from './AskQuery.js';\nimport type {CountQueryJSON} from './CountQuery.js';\nimport type {MutationJSON} from './MutationSerialization.js';\nimport {assertWireVersion} from './wireVersion.js';\n\n/** Any query in its wire (DSL-JSON) form. */\nexport type QueryJSON =\n | QueryBuilderJSON\n | AskQueryJSON\n | CountQueryJSON\n | MutationJSON;\n\nexport function fromJSON(\n json: QueryJSON,\n):\n | SelectBuilder\n | AskBuilder\n | CountBuilder\n | CreateBuilder\n | UpdateBuilder\n | DeleteBuilder {\n assertWireVersion((json as {v?: unknown})?.v);\n if (json && typeof json === 'object' && 'op' in json) {\n switch (json.op) {\n case 'ask':\n return AskBuilder.fromJSON(json as AskQueryJSON);\n case 'count':\n return CountBuilder.fromJSON(json as CountQueryJSON);\n case 'create':\n return CreateBuilder.fromJSON(json);\n case 'update':\n case 'upsert':\n // Both reconstruct an UpdateBuilder; the op selects upsert mode inside.\n return UpdateBuilder.fromJSON(json);\n case 'delete':\n return DeleteBuilder.fromJSON(json);\n default:\n // An `op` is present but not one we know — a malformed/corrupted or\n // future-versioned mutation envelope. Fail loud rather than silently\n // reinterpreting it as a select query.\n throw new Error(\n `Unknown query op \"${String((json as {op: unknown}).op)}\" in DSL-JSON envelope.`,\n );\n }\n }\n return SelectBuilder.fromJSON(json as QueryBuilderJSON);\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"lower.js","sourceRoot":"","sources":["../../../src/queries/lower.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;;;GAWG;AACH,OAAO,EAAC,gBAAgB,EAAC,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAC,oBAAoB,EAAC,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAC,sBAAsB,EAA4B,MAAM,mBAAmB,CAAC;AACpF,OAAO,EAAC,mBAAmB,EAAC,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAC,gBAAgB,EAAC,MAAM,iBAAiB,CAAC;AACjD,OAAO,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,EAAE,CAAC,CAAC;QACzC,KAAK,QAAQ;YACX,OAAO,WAAW,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC,CAAC;IAC3C,CAAC;AACH,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 * `lower(query)` — turn a live query (builder) into its canonical IR algebra.\n *\n * This is the single, **free** lowering entry point, and the *only* place the\n * canonical-IR pipeline (`IRPipeline` / `IRMutation` / `IRLower` / …) is reached\n * from. The builders are deliberately IR-free: they hand `lower()` a plain\n * \"lowering spec\" (`mutationLowerSpec`) or raw select input, and all IR\n * construction happens here. A client that authors/serializes/forwards queries\n * but never calls `lower()` therefore tree-shakes the entire IR pipeline away.\n * The IR is an implementation detail of stores that want it (e.g. SPARQL) — not\n * the contract.\n */\nimport {buildSelectQuery} from './IRPipeline.js';\nimport {MutationQueryFactory} from './MutationQuery.js';\nimport {isSetModificationValue, type NodeDescriptionValue} from './QueryFactory.js';\nimport {PendingQueryContext} from './QueryContext.js';\nimport {resolveContextId} from './ContextRef.js';\nimport {\n buildCanonicalCreateMutationIR,\n buildCanonicalUpdateMutationIR,\n buildCanonicalUpsertMutationIR,\n buildCanonicalUpdateWhereMutationIR,\n buildCanonicalDeleteMutationIR,\n buildCanonicalDeleteAllMutationIR,\n buildCanonicalDeleteWhereMutationIR,\n} from './IRMutation.js';\nimport {toWhere} from './IRDesugar.js';\nimport {lowerWhereToIR} from './IRLower.js';\nimport type {WherePath} from './SelectQuery.js';\nimport type {\n IRAskQuery,\n IRCountQuery,\n IRSelectQuery,\n} from './IntermediateRepresentation.js';\nimport type {RawAskInput} from './AskQuery.js';\nimport type {RawCountInput} from './CountQuery.js';\nimport type {IRCreateQuery} from './CreateQuery.js';\nimport type {IRUpdateQuery} from './UpdateQuery.js';\nimport type {IRDeleteQuery} from './DeleteQuery.js';\nimport type {\n CreateLowerSpec,\n UpdateLowerSpec,\n DeleteLowerSpec,\n} from './mutationLowerSpec.js';\n\n/** A select query that can be lowered (the select builder). */\nexport type LowerableSelect = {readonly __queryKind: 'select'; toRawInput(): any};\n/** An ask query that can be lowered (the ask builder). */\nexport type LowerableAsk = {readonly __queryKind: 'ask'; toRawInput(): RawAskInput};\n/** A count query that can be lowered (the count builder). */\nexport type LowerableCount = {readonly __queryKind: 'count'; toRawInput(): RawCountInput};\n/** A mutation query that can be lowered (the mutation builders). */\nexport type LowerableCreate = {readonly __queryKind: 'create'; _lowerSpec(): CreateLowerSpec};\nexport type LowerableUpdate = {readonly __queryKind: 'update'; _lowerSpec(): UpdateLowerSpec};\nexport type LowerableDelete = {readonly __queryKind: 'delete'; _lowerSpec(): DeleteLowerSpec};\nexport type LowerableQuery =\n | LowerableSelect\n | LowerableAsk\n | LowerableCount\n | LowerableCreate\n | LowerableUpdate\n | LowerableDelete;\n\n/** Lower a pre-evaluated where path to its canonical IR fragment. */\nfunction lowerWherePath(where: WherePath) {\n return lowerWhereToIR(toWhere(where));\n}\n\n/**\n * Resolve any query-context reference carried as a mutation field value. The\n * builder preserves a live `PendingQueryContext` through normalization (so it can\n * serialize as `{@ctx}`); at lowering a mutation must hit a concrete node, so the\n * context is resolved here and an unset one throws `UnresolvedContextError`.\n */\nfunction resolveValueContexts(val: unknown): unknown {\n if (val instanceof PendingQueryContext) {\n return {id: resolveContextId(val.contextName, true)!};\n }\n if (Array.isArray(val)) {\n return val.map(resolveValueContexts);\n }\n if (val && typeof val === 'object') {\n if (isSetModificationValue(val)) {\n const mod = val as {$add?: unknown[]; $remove?: unknown[]};\n const out: {$add?: unknown[]; $remove?: unknown[]} = {};\n if (mod.$add) out.$add = mod.$add.map(resolveValueContexts);\n if (mod.$remove) out.$remove = mod.$remove.map(resolveValueContexts);\n return out;\n }\n if ('fields' in val) {\n return resolveDescriptionContexts(val as NodeDescriptionValue);\n }\n }\n return val;\n}\n\n/** Deep-resolve context references in a normalized node description (returns a new copy). */\nfunction resolveDescriptionContexts(desc: NodeDescriptionValue): NodeDescriptionValue {\n return {\n ...desc,\n fields: desc.fields.map((f) => ({...f, val: resolveValueContexts(f.val) as typeof f.val})),\n };\n}\n\nfunction lowerCreate(spec: CreateLowerSpec): IRCreateQuery {\n const description = resolveDescriptionContexts(\n new MutationQueryFactory().describe(spec.shapeClass.shape, spec.data, {\n allowTopLevelId: true,\n validate: 'complete',\n }),\n );\n return buildCanonicalCreateMutationIR({shape: spec.shapeClass.shape, description});\n}\n\nfunction lowerUpdate(spec: UpdateLowerSpec): IRUpdateQuery {\n const shape = spec.shapeClass.shape;\n const updates = resolveDescriptionContexts(\n new MutationQueryFactory().describe(shape, spec.data, {validate: 'partial'}),\n );\n if (spec.mode === 'for') {\n return spec.upsert\n ? buildCanonicalUpsertMutationIR({id: spec.targetId!, shape, updates})\n : buildCanonicalUpdateMutationIR({id: spec.targetId!, shape, updates});\n }\n // forAll / where\n const lowered = spec.wherePath ? lowerWherePath(spec.wherePath) : undefined;\n return buildCanonicalUpdateWhereMutationIR({\n shape,\n updates,\n where: lowered?.where,\n wherePatterns: lowered?.wherePatterns,\n });\n}\n\nfunction lowerDelete(spec: DeleteLowerSpec): IRDeleteQuery {\n const shape = spec.shapeClass.shape;\n if (spec.mode === 'all') {\n return buildCanonicalDeleteAllMutationIR({shape});\n }\n if (spec.mode === 'where') {\n const {where, wherePatterns} = lowerWherePath(spec.wherePath!);\n return buildCanonicalDeleteWhereMutationIR({shape, where, wherePatterns});\n }\n // Resolve any context-ref ids ({@ctx}) against the live map — a delete must hit\n // a concrete node, so an unresolved one throws (never a silent `{id: undefined}`).\n const resolvedIds = spec.ids!.map((id) =>\n id instanceof PendingQueryContext\n ? {id: resolveContextId(id.contextName, true)!}\n : id,\n );\n const ids = new MutationQueryFactory().normalizeNodeRefs(resolvedIds);\n return buildCanonicalDeleteMutationIR({shape, ids});\n}\n\n/**\n * Lower an ask to its canonical IR.\n *\n * The shaped case reuses the select pipeline to build the pattern — one\n * implementation of shape scans, traversals, filters and minus — and then keeps\n * only the pattern-bearing part. The rootless (shapeless) case has no pattern to\n * build: it is a bare subject.\n */\nfunction lowerAsk(input: RawAskInput): IRAskQuery {\n if (input.nullSubject) {\n // \"Does the node with no id exist?\" is answered `false` without querying —\n // `AskBuilder.exec` does that before dispatching. Reaching lowering means a\n // store took the builder off the normal path; a subject-less pattern would\n // match every instance of the shape and answer `true`, so refuse it loudly.\n throw new Error(\n 'Cannot lower an ask query with no subject (`.for(null)`). It resolves to ' +\n '`false` without querying — execute it through `exec()` rather than lowering it.',\n );\n }\n const subject = input.subject;\n if (!input.shape) {\n // Shapeless: no rdf:type constraint, so no shape scan and no property refs.\n const id =\n subject instanceof PendingQueryContext\n ? resolveContextId(subject.contextName, true)!\n : (subject as {id?: string} | undefined)?.id;\n return {kind: 'ask', patterns: [], subjectId: id};\n }\n const selected = buildSelectQuery({\n entries: [],\n shape: input.shape,\n subject,\n subjects: input.subjects,\n where: input.where,\n minusEntries: input.minusEntries,\n });\n return {\n kind: 'ask',\n root: selected.root,\n patterns: selected.patterns,\n where: selected.where,\n subjectId: selected.subjectId,\n subjectIds: selected.subjectIds,\n };\n}\n\n/**\n * The variable a root count binds its `COUNT` to.\n *\n * Chosen not to collide with the `a<N>` alias scheme the pipeline generates for\n * the root and every traversal, so it never needs the collision rename\n * `selectToAlgebra` applies to aggregate aliases.\n */\nexport const COUNT_ALIAS = 'count';\n\n/**\n * Lower a count to its canonical IR.\n *\n * Reuses the select pipeline to build the pattern — one implementation of shape\n * scans, traversals, filters and minus — and then keeps only the pattern-bearing\n * part, exactly as {@link lowerAsk} does. The `entries: []` is why nothing is\n * projected: a count has no projection to build.\n */\nfunction lowerCount(input: RawCountInput): IRCountQuery {\n if (input.nullSubject) {\n // \"How many nodes with no id match?\" is answered `0` without querying —\n // `CountBuilder.exec` does that before dispatching. Reaching lowering means a\n // store took the builder off the normal path; a subject-less pattern would\n // count every instance of the shape and report it as the count of one node.\n throw new Error(\n 'Cannot lower a count query with no subject (`.for(null)`). It resolves to ' +\n '`0` without querying — execute it through `exec()` rather than lowering it.',\n );\n }\n if (!input.shape) {\n throw new Error(\n 'Cannot lower a count query with no shape. A shapeless count would count ' +\n 'every node in the store, under any type or none.',\n );\n }\n // A `{\"@ctx\": name}` subject arrives here as a live PendingQueryContext, and\n // `buildSelectQuery` narrows a subject with `'id' in subject` — so an UNRESOLVED\n // one would quietly yield `subjectId: undefined` and the count would be of every\n // instance of the shape, reported as the count of one node. `CountBuilder.exec`\n // answers `0` for that case before dispatching, but this path is reached without\n // it: a receiver that rehydrates an envelope with `fromJSON` and hands the builder\n // straight to a store. Resolve it here, which throws `UnresolvedContextError` when\n // the context is unset — the same \"not ready\" a where-clause reference raises, and\n // never a plausible number.\n const subject =\n input.subject instanceof PendingQueryContext\n ? {id: resolveContextId(input.subject.contextName, true)!}\n : input.subject;\n const selected = buildSelectQuery({\n entries: [],\n shape: input.shape,\n subject,\n subjects: input.subjects,\n where: input.where,\n minusEntries: input.minusEntries,\n });\n return {\n kind: 'count',\n root: selected.root,\n patterns: selected.patterns,\n where: selected.where,\n subjectId: selected.subjectId,\n subjectIds: selected.subjectIds,\n alias: COUNT_ALIAS,\n };\n}\n\nexport function lower(query: LowerableSelect): IRSelectQuery;\nexport function lower(query: LowerableAsk): IRAskQuery;\nexport function lower(query: LowerableCount): IRCountQuery;\nexport function lower(query: LowerableCreate): IRCreateQuery;\nexport function lower(query: LowerableUpdate): IRUpdateQuery;\nexport function lower(query: LowerableDelete): IRDeleteQuery;\nexport function lower(\n query: LowerableQuery,\n):\n | IRSelectQuery\n | IRAskQuery\n | IRCountQuery\n | IRCreateQuery\n | IRUpdateQuery\n | IRDeleteQuery {\n switch (query.__queryKind) {\n case 'select':\n return buildSelectQuery(query.toRawInput());\n case 'ask':\n return lowerAsk(query.toRawInput());\n case 'count':\n return lowerCount(query.toRawInput());\n case 'create':\n return lowerCreate(query._lowerSpec());\n case 'update':\n return lowerUpdate(query._lowerSpec());\n case 'delete':\n return lowerDelete(query._lowerSpec());\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"lowerMutationJSON.js","sourceRoot":"","sources":["../../../src/queries/lowerMutationJSON.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAYH,OAAO,EAAC,gBAAgB,EAAC,MAAM,4BAA4B,CAAC;AAQ5D,OAAO,EAAC,cAAc,EAAC,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAC,YAAY,EAAE,aAAa,EAAC,MAAM,wBAAwB,CAAC;AAEnE,OAAO,EACL,oBAAoB,GAErB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAC,OAAO,EAAC,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAC,cAAc,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,EACL,8BAA8B,EAC9B,8BAA8B,EAC9B,8BAA8B,EAC9B,mCAAmC,EACnC,8BAA8B,EAC9B,iCAAiC,EACjC,mCAAmC,GACpC,MAAM,iBAAiB,CAAC;AAIzB,OAAO,EAAC,gBAAgB,EAAE,gBAAgB,EAAC,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAC,iBAAiB,EAAC,MAAM,kBAAkB,CAAC;AACnD,OAAO,EACL,mBAAmB,EACnB,YAAY,GAIb,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAC,WAAW,EAAsB,MAAM,yBAAyB,CAAC;AACzE,OAAO,EAAC,eAAe,EAAoB,MAAM,wBAAwB,CAAC;AAG1E,SAAS,YAAY,CAAC,OAAe;;IACnC,mFAAmF;IACnF,+EAA+E;IAC/E,MAAM,KAAK,GAAG,MAAA,MAAA,aAAa,CAAC,OAAO,CAAC,0CAAE,KAAK,mCAAI,YAAY,CAAC,OAAO,CAAC,CAAC;IACrE,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CACb,UAAU,OAAO,oGAAoG,CACtH,CAAC;IACJ,CAAC;IACD,OAAO,KAAK,CAAC;AACf,C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AC,CAAC,EAAC,EAAE,EAAC,CACxE;iBACF,CAAC,CAAC;YACL,CAAC;YACD,IAAI,IAAI,CAAC,IAAI,KAAK,KAAK,EAAE,CAAC;gBACxB,OAAO,iCAAiC,CAAC,EAAC,KAAK,EAAC,CAAC,CAAC;YACpD,CAAC;YACD,MAAM,EAAC,KAAK,EAAE,aAAa,EAAC,GAAG,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;YAC7D,OAAO,mCAAmC,CAAC,EAAC,KAAK,EAAE,KAAK,EAAE,aAAa,EAAC,CAAC,CAAC;QAC5E,CAAC;IACH,CAAC;AACH,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 * Lower mutation DSL-JSON to canonical IR.\n *\n * This is the **IR side** of mutation (de)serialization, kept deliberately\n * separate from the IR-free wire codec in `MutationSerialization.ts`. The\n * canonical-IR builders (`IRMutation` / `IRLower` / …) are reachable only from\n * here and from `lower()`, so a client that serializes mutations to JSON and\n * forwards them (without ever lowering) tree-shakes the whole IR pipeline away.\n */\nimport type {NodeShapeData} from '../shapes/SHACL.js';\nimport {getPropertyShape} from '../shapes/nodeShapeData.js';\nimport {\n type NodeDescriptionValue,\n type PropUpdateValue,\n type SetModificationValue,\n type SinglePropertyUpdateValue,\n type UpdateNodePropertyValue,\n} from './QueryFactory.js';\nimport {ExpressionNode} from '../expressions/ExpressionNode.js';\nimport {getNodeShape, getShapeClass} from '../utils/ShapeClass.js';\nimport type {IRExpression, IRGraphPattern} from './IntermediateRepresentation.js';\nimport {\n deserializeWherePath,\n type WherePathJSON,\n} from './QueryBuilderSerialization.js';\nimport {toWhere} from './IRDesugar.js';\nimport {lowerWhereToIR} from './IRLower.js';\nimport {\n buildCanonicalCreateMutationIR,\n buildCanonicalUpdateMutationIR,\n buildCanonicalUpsertMutationIR,\n buildCanonicalUpdateWhereMutationIR,\n buildCanonicalDeleteMutationIR,\n buildCanonicalDeleteAllMutationIR,\n buildCanonicalDeleteWhereMutationIR,\n} from './IRMutation.js';\nimport type {IRCreateQuery} from './CreateQuery.js';\nimport type {IRUpdateQuery} from './UpdateQuery.js';\nimport type {IRDeleteQuery} from './DeleteQuery.js';\nimport {isContextRefJSON, resolveContextId} from './ContextRef.js';\nimport {assertWireVersion} from './wireVersion.js';\nimport {\n decodeNodeDataToRaw,\n valueShapeOf,\n type MutationJSON,\n type MutationNodeDataJSON,\n type MutationValueJSON,\n} from './MutationSerialization.js';\nimport {assertValid, type ValidationMode} from '../shapes/validation.js';\nimport {decodeValueExpr, type DslJsonValue} from './DslJsonExpression.js';\nimport type {PropertyShapeData} from '../shapes/SHACL.js';\n\nfunction requireShape(shapeId: string): NodeShapeData {\n // Either registry: a project-authored shape arrives as metadata with no class, and\n // requiring a class here made every mutation against one fail at the boundary.\n const shape = getShapeClass(shapeId)?.shape ?? getNodeShape(shapeId);\n if (!shape) {\n throw new Error(\n `Shape '${shapeId}' is not registered. The receiving side must have the shape registered to lower mutation DSL-JSON.`,\n );\n }\n return shape;\n}\n\n// Bound the DSL-JSON decode recursion so a deeply-nested payload from\n// `fromJSON()` cannot exhaust the stack (RangeError DoS). Normal mutation data\n// nests only a handful of levels; 128 is far above any real query.\nconst MAX_DECODE_DEPTH = 128;\nlet _decodeDepth = 0;\n\n/**\n * Decode a DSL-JSON value to the normalized form the canonical-IR builders consume.\n * `currentShape` resolves computed `{@path}`/S-expr; `prop` gives a nested node's shape.\n * Depth-guarded wrapper around {@link decodeValueInner}.\n */\nfunction decodeValue(\n json: MutationValueJSON,\n currentShape: NodeShapeData,\n prop?: PropertyShapeData,\n): PropUpdateValue {\n if (++_decodeDepth > MAX_DECODE_DEPTH) {\n _decodeDepth = 0;\n throw new Error('DSL-JSON value nested too deeply');\n }\n try {\n return decodeValueInner(json, currentShape, prop);\n } finally {\n _decodeDepth--;\n }\n}\n\nfunction decodeValueInner(\n json: MutationValueJSON,\n currentShape: NodeShapeData,\n prop?: PropertyShapeData,\n): PropUpdateValue {\n // S-expr computed value (no IR on the wire)\n if (Array.isArray(json)) {\n const {ir, refs} = decodeValueExpr(json as DslJsonValue, currentShape);\n return new ExpressionNode(ir, refs) as unknown as PropUpdateValue;\n }\n if (json === null) return null as unknown as PropUpdateValue;\n if (typeof json !== 'object') return json as PropUpdateValue; // bare scalar literal\n const o = json as Record<string, unknown>;\n if ('@unset' in o) return undefined;\n if ('@date' in o) return new Date(o['@date'] as string) as unknown as PropUpdateValue;\n if ('@ctx' in o) {\n // Lowering path: a mutation must hit a concrete node, so resolve the\n // context now and throw if it isn't set.\n const id = resolveContextId(o['@ctx'] as string, true)!;\n return {id} as PropUpdateValue;\n }\n if ('@id' in o) return {id: o['@id']} as PropUpdateValue;\n if ('@list' in o) {\n return (o['@list'] as MutationValueJSON[]).map(\n (item) => decodeValue(item, currentShape, prop) as SinglePropertyUpdateValue,\n );\n }\n if ('@add' in o || '@remove' in o) {\n const mod: SetModificationValue = {};\n if (o['@add']) {\n mod.$add = (o['@add'] as MutationValueJSON[]).map((v) =>\n decodeValue(v, currentShape, prop),\n ) as SetModificationValue['$add'];\n }\n if (o['@remove']) mod.$remove = (o['@remove'] as string[]).map((id) => ({id}));\n return mod as PropUpdateValue;\n }\n if ('@path' in o) {\n const {ir, refs} = decodeValueExpr(json as DslJsonValue, currentShape);\n return new ExpressionNode(ir, refs) as unknown as PropUpdateValue;\n }\n // Otherwise: a bare path-keyed nested-node create.\n return decodeNodeData(\n o as MutationNodeDataJSON,\n valueShapeOf(prop) ?? currentShape,\n ) as unknown as PropUpdateValue;\n}\n\n/**\n * Rebuild a normalized node description from path-keyed JSON, resolving labels via the\n * shape. `shape` is the shape inferred from context; `__shape` overrides it.\n */\nexport function decodeNodeData(\n json: MutationNodeDataJSON,\n shape?: NodeShapeData,\n): NodeDescriptionValue {\n const nodeShape =\n typeof json.__shape === 'string' ? requireShape(json.__shape) : shape!;\n const fields: UpdateNodePropertyValue[] = [];\n for (const [key, val] of Object.entries(json)) {\n if (key === '__id' || key === '__shape' || val === undefined) continue;\n const prop = getPropertyShape(nodeShape, key);\n if (!prop) {\n throw new Error(\n `Property '${key}' not found on shape '${nodeShape.label || nodeShape.id}'`,\n );\n }\n fields.push({prop, val: decodeValue(val as MutationValueJSON, nodeShape, prop)} as UpdateNodePropertyValue);\n }\n const desc: NodeDescriptionValue = {shape: nodeShape, fields};\n if (typeof json.__id === 'string') desc.__id = json.__id;\n return desc;\n}\n\nfunction lowerWhere(\n shape: NodeShapeData,\n json: WherePathJSON,\n): {where: IRExpression; wherePatterns: IRGraphPattern[]} {\n const wherePath = deserializeWherePath(shape, json);\n return lowerWhereToIR(toWhere(wherePath));\n}\n\n/**\n * Lower a mutation DSL-JSON envelope to the canonical IR mutation the dataset\n * expects. Mirrors the IR that `lower()` produces from the live builder.\n */\n/**\n * Validate inbound node data against its shape before it becomes IR.\n *\n * The builders validate through `describe()`, which sees raw DSL data. This path\n * never touches a builder, so without this an inbound mutation would be held to\n * a weaker standard than a locally-built one — on the *less* trusted input, at\n * that. `decodeNodeDataToRaw` produces exactly the raw form `describe()` would\n * have validated (it is what `CreateBuilder.fromJSON` feeds through `.set()`),\n * so both paths run the same checks. The second decode is the cost of validating\n * at a boundary; it happens once per inbound mutation.\n */\nfunction assertInboundDataValid(\n json: MutationNodeDataJSON,\n shape: NodeShapeData,\n mode: ValidationMode,\n): void {\n assertValid(shape, decodeNodeDataToRaw(json, shape), {mode});\n}\n\nexport function lowerMutationJSON(\n json: MutationJSON,\n): IRCreateQuery | IRUpdateQuery | IRDeleteQuery {\n assertWireVersion(json.v);\n switch (json.op) {\n case 'create': {\n const shape = requireShape(json.shape);\n assertInboundDataValid(json.data, shape, 'complete');\n return buildCanonicalCreateMutationIR({\n shape,\n description: decodeNodeData(json.data, shape),\n });\n }\n case 'upsert': {\n const shape = requireShape(json.shape);\n assertInboundDataValid(json.data, shape, 'partial');\n const updates = decodeNodeData(json.data, shape);\n const id = isContextRefJSON(json.targetId)\n ? resolveContextId(json.targetId['@ctx'], true)\n : json.targetId;\n if (!id) {\n throw new Error('upsert requires a targetId');\n }\n return buildCanonicalUpsertMutationIR({id, shape, updates});\n }\n case 'update': {\n const shape = requireShape(json.shape);\n assertInboundDataValid(json.data, shape, 'partial');\n const updates = decodeNodeData(json.data, shape);\n if (json.mode === 'for') {\n // A `{@ctx}` target resolves against the current context map; a mutation\n // must hit a concrete subject, so an unresolved context throws.\n const id = isContextRefJSON(json.targetId)\n ? resolveContextId(json.targetId['@ctx'], true)\n : json.targetId;\n if (!id) {\n throw new Error('update mode \"for\" requires a targetId');\n }\n return buildCanonicalUpdateMutationIR({id, shape, updates});\n }\n let where: IRExpression | undefined;\n let wherePatterns: IRGraphPattern[] | undefined;\n if (json.mode === 'where') {\n if (!json.where) throw new Error('update mode \"where\" requires a where clause');\n ({where, wherePatterns} = lowerWhere(shape, json.where));\n }\n return buildCanonicalUpdateWhereMutationIR({shape, updates, where, wherePatterns});\n }\n case 'delete': {\n const shape = requireShape(json.shape);\n if (json.mode === 'ids') {\n return buildCanonicalDeleteMutationIR({\n shape,\n // A `{@ctx}` id resolves against the live map; a delete must hit a\n // concrete node, so an unresolved context throws.\n ids: json.ids.map((id) =>\n isContextRefJSON(id) ? {id: resolveContextId(id['@ctx'], true)!} : {id},\n ),\n });\n }\n if (json.mode === 'all') {\n return buildCanonicalDeleteAllMutationIR({shape});\n }\n const {where, wherePatterns} = lowerWhere(shape, json.where);\n return buildCanonicalDeleteWhereMutationIR({shape, where, wherePatterns});\n }\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"mutationLowerSpec.js","sourceRoot":"","sources":["../../../src/queries/mutationLowerSpec.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
1
+ {"version":3,"file":"mutationLowerSpec.js","sourceRoot":"","sources":["../../../src/queries/mutationLowerSpec.ts"],"names":[],"mappings":"AAAA;;;;GAIG","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 * IR-free \"lowering specs\" — the minimal, plain description each mutation\n * builder hands to `lower()` so the canonical-IR construction can live entirely\n * in the IR tier. The builders depend only on these types (no IR), keeping the\n * IR pipeline reachable solely through `lower()`.\n */\nimport type {Shape, ShapeConstructor} from '../shapes/Shape.js';\nimport type {UpdatePartial} from './QueryFactory.js';\nimport type {WherePath} from './SelectQuery.js';\nimport type {NodeId} from './MutationQuery.js';\nimport type {PendingQueryContext} from './QueryContext.js';\n\nexport interface CreateLowerSpec<S extends Shape = Shape> {\n shapeClass: ShapeConstructor<S>;\n /** The create data, with any fixed id already injected as `__id`. */\n data: UpdatePartial<S>;\n}\n\nexport interface UpdateLowerSpec<S extends Shape = Shape> {\n shapeClass: ShapeConstructor<S>;\n data: UpdatePartial<S>;\n mode: 'for' | 'forAll' | 'where';\n /** Resolved target id (id-based update); the builder already resolved any context. */\n targetId?: string;\n /** A pre-evaluated where path (where-mode). */\n wherePath?: WherePath;\n /** Create-or-replace: lowers to an upsert mutation. Only valid with mode 'for'. */\n upsert?: boolean;\n}\n\nexport interface DeleteLowerSpec<S extends Shape = Shape> {\n shapeClass: ShapeConstructor<S>;\n /** Ids to delete: concrete ids/`{id}` refs, or unresolved context refs (resolved at lower). */\n ids?: (NodeId | PendingQueryContext)[];\n mode: 'ids' | 'all' | 'where';\n wherePath?: WherePath;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"queryDispatch.js","sourceRoot":"","sources":["../../../src/queries/queryDispatch.ts"],"names":[],"mappings":";;;;;;;;;AAkCA;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAgB,gBAAgB,CACpC,MAAuB,EACvB,KAAe;;QAEf,IAAI,OAAO,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,QAAQ,CAAA,KAAK,UAAU,EAA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AC5C,CAAC","sourcesContent":["import type {SelectQuery} from './SelectQuery.js';\nimport type {CreateQuery} from './CreateQuery.js';\nimport type {UpdateQuery} from './UpdateQuery.js';\nimport type {DeleteQuery, DeleteResponse} from './DeleteQuery.js';\nimport type {IDataset} from '../interfaces/IDataset.js';\nimport type {AskQuery} from './AskQuery.js';\nimport type {CountQuery} from './CountQuery.js';\n\n/**\n * Abstraction boundary between the DSL layer (Shape) and the storage layer\n * (LinkedStorage / IDataset). Both sides import this leaf module; neither\n * imports the other.\n *\n * Return types are intentionally `any` — the DSL layer threads precise\n * result types through its own generics; the dispatch is a runtime bridge.\n */\nexport interface QueryDispatch {\n /**\n * Answer a select query — **and a count**, which travels this channel too: a\n * count is a select with an aggregate projection, not a query form of its own, so\n * it needs no method here and no router has to grow an arm for it. It arrives as a\n * {@link CountQuery} and resolves to a `number`; see {@link resolveCount}.\n */\n selectQuery<R = any>(query: SelectQuery | CountQuery): Promise<R>;\n /** Answer an ask query — a boolean, not a result set. */\n askQuery(query: AskQuery): Promise<boolean>;\n createQuery<R = any>(query: CreateQuery): Promise<R>;\n updateQuery<R = any>(query: UpdateQuery): Promise<R>;\n deleteQuery(query: DeleteQuery): Promise<DeleteResponse>;\n}\n\n/** A target that can answer an ask query. */\ntype ExistenceTarget = {askQuery(query: AskQuery): Promise<boolean>};\n\n/**\n * Answer an ask query against `target` — the single entry point for every\n * boolean-answered query in the library. `AskBuilder.exec()` and\n * `LinkedStorage.askQuery` both come here rather than calling `askQuery`\n * directly, so the contract below is enforced once for every store.\n *\n * There is deliberately **no translation to a select query anywhere in this\n * package.** An ask goes to `IDataset.askQuery` and a SPARQL-backed store turns\n * it into `ASK`. A store that lacks a boolean primitive implements `askQuery`\n * itself, in whatever way its backend allows — that decision belongs to the\n * store, and making it here would hide it.\n *\n * `askQuery` must resolve to a real boolean: anything else rejects rather than\n * being coerced, since a truthy non-boolean would read as \"exists\". Errors\n * propagate for the same reason — \"could not ask\" is never `false`.\n */\nexport async function resolveExistence(\n target: ExistenceTarget,\n query: AskQuery,\n): Promise<boolean> {\n if (typeof target?.askQuery !== 'function') {\n throw new Error(\n 'This dataset does not implement the required IDataset.askQuery(query). ' +\n 'An ask query is answered with a boolean — a SPARQL store emits ASK — and is ' +\n 'never rewritten as a select on its behalf.',\n );\n }\n const answer = await target.askQuery(query);\n if (typeof answer !== 'boolean') {\n throw new Error(\n `askQuery must resolve to a boolean; got ${answer === null ? 'null' : typeof answer}. ` +\n 'An ask query will not coerce a non-boolean into an answer — a truthy ' +\n 'value would silently read as \"exists\".',\n );\n }\n return answer;\n}\n\n/**\n * A target that can answer a count query — which is to say, any target that can\n * answer a select. There is no count-specific member to look for.\n */\ntype CountTarget = {selectQuery?(query: any): Promise<any>};\n\n/**\n * Answer a count query against `target` — the single entry point for every\n * number-answered query in the library, as {@link resolveExistence} is for boolean\n * ones. `CountBuilder.exec()` comes here rather than calling the store directly, so\n * the contract below is enforced once for every store.\n *\n * **A count is dispatched over the SELECT channel.** It is not a separate query\n * form: `SELECT (COUNT(DISTINCT ?s) AS ?count) WHERE { … }` is a select with an\n * aggregate projection, run over the same transport and answered with the same\n * result-set response — which is exactly why an ask, which really is a different\n * form (`ASK WHERE { … }`), has its own `IDataset.askQuery` and a count does not.\n * Riding `selectQuery` is what lets a count reach a store through every router that\n * already forwards a select, rather than needing a new arm in each of them (the\n * arm `LinkedStorage` never grew, which is how a count came to fail on every\n * application path while passing against a store held directly).\n *\n * There is still deliberately **no translation to a row query anywhere in this\n * package.** A store receives the count query itself and decides how to answer it;\n * one extending `SparqlDataset` branches on the lowered IR and emits the aggregate.\n * Nothing here fetches every row and measures the array — that would hide an\n * unbounded read behind a call that looks cheap.\n *\n * The answer must be a **finite, non-negative integer**: anything else rejects\n * rather than being coerced. That validation lives here, at the dispatch, because\n * this is where the count result is read — and it is load-bearing. Errors propagate\n * for the same reason a failed ask is never `false`, and more sharply, because `0`\n * is a *plausible* count: a count that reported an unreachable store as `0` would\n * render an empty table that looks exactly like real data. A store that ignored the\n * count and answered with rows is caught by the same check.\n */\nexport async function resolveCount(\n target: CountTarget,\n query: CountQuery,\n): Promise<number> {\n if (typeof target?.selectQuery !== 'function') {\n throw new Error(\n 'This dataset does not implement IDataset.selectQuery(query), which is how a ' +\n 'count query is dispatched: a count is a select with an aggregate projection ' +\n '(a SPARQL store emits SELECT (COUNT(DISTINCT ?s) AS ?count)), not a query ' +\n 'form of its own.',\n );\n }\n const answer = await target.selectQuery(query);\n if (typeof answer !== 'number' || !Number.isInteger(answer) || answer < 0) {\n throw new Error(\n `A count query must be answered with a non-negative integer; got ${\n answer === null\n ? 'null'\n : typeof answer === 'number'\n ? String(answer)\n : Array.isArray(answer)\n ? 'an array of rows'\n : typeof answer\n }. It is not coerced — a NaN or a missing value that fell through as 0 would ` +\n 'silently read as \"no matches\". A store that answered with rows ran the ' +\n 'pattern as a row query instead of counting it: it must branch on the lowered ' +\n \"IR's `kind === 'count'` and emit an aggregate.\",\n );\n }\n return answer;\n}\n\n// Global-backed so it is SHARED across duplicate copies of this module. In dev,\n// `@_linked/core` can be evaluated twice (Vite/`src` + Node/`lib` — an accepted\n// 2-instance state, see report-011). The module REGISTRY already lives on the\n// shared global; the query dispatch must too, or `setDefaultDataset()` on one\n// copy is invisible to queries on the other (\"No query dispatch configured\").\n// Whichever copy runs the storage config sets it; every copy reads it.\nconst dispatchGlobal: any =\n typeof globalThis !== 'undefined' ? globalThis : ({} as any);\nif (!('__linkedQueryDispatch' in dispatchGlobal)) {\n dispatchGlobal.__linkedQueryDispatch = {current: null as QueryDispatch | null};\n}\n\nexport function setQueryDispatch(d: QueryDispatch): void {\n dispatchGlobal.__linkedQueryDispatch.current = d;\n}\n\nexport function getQueryDispatch(): QueryDispatch {\n const dispatch = dispatchGlobal.__linkedQueryDispatch.current as QueryDispatch | null;\n if (!dispatch) {\n throw new Error(\n 'No query dispatch configured. Call LinkedStorage.setDefaultDataset() first.',\n );\n }\n return dispatch;\n}\n\n/** The mutating query kinds — the `IDataset` methods that are optional per-store. */\nexport type MutationKind = 'create' | 'update' | 'delete';\n\n/**\n * Pick the object a mutation `exec(target?)` dispatches through: the explicit `target`\n * dataset (validated to implement the op) when a target is given, otherwise the global\n * dispatch. Unlike `selectQuery`, a store's mutation methods are optional on `IDataset`,\n * so a target that can't perform `kind` is a caller error.\n *\n * Throws synchronously if the target lacks the method — callers invoke this from within an\n * `async exec`, so the throw surfaces as a rejected promise rather than a synchronous throw.\n */\nexport function resolveMutationDispatch(\n kind: MutationKind,\n target?: IDataset,\n): QueryDispatch {\n if (!target) return getQueryDispatch();\n if (typeof target[`${kind}Query`] !== 'function') {\n throw new Error(`The target dataset does not support ${kind} queries.`);\n }\n return target as unknown as QueryDispatch;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"reservedQueryNames.js","sourceRoot":"","sources":["../../../src/queries/reservedQueryNames.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAwB,IAAI,GAAG,CAAC;IACnE,mEAAmE;IACnE,KAAK;IACL,IAAI;IACJ,0BAA0B;IAC1B,2BAA2B;IAC3B,QAAQ;IACR,aAAa;IACb,QAAQ;IACR,OAAO;IACP,kBAAkB;IAClB,iBAAiB;IACjB,iBAAiB;IACjB,IAAI;IACJ,OAAO;IACP,MAAM;IACN,UAAU;IACV,OAAO;IACP,YAAY;IACZ,QAAQ;IACR,WAAW;IACX,MAAM;IACN,MAAM;IACN,OAAO;IACP,4CAA4C;IAC5C,eAAe;IACf,MAAM;IACN,UAAU;IACV,OAAO;IACP,aAAa;IACb,QAAQ;IACR,SAAS;IACT,WAAW;CACZ,CAAC,CAAC;AAEH;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAwB,IAAI,GAAG,CAAC;IACjE,KAAK;IACL,0BAA0B;IAC1B,2BAA2B;IAC3B,QAAQ;IACR,OAAO;IACP,MAAM;IACN,MAAM;IACN,MAAM;IAC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AI,KAAK,4BAA4B,KAAK,6BAA6B;QACtF,+BAA+B,KAAK,kDAAkD;QACtF,6CAA6C,MAAM,EAAE,CACxD,CAAC;AACJ,CAAC;AAED,gEAAgE;AAChE,MAAM,UAAU,kCAAkC;IAChD,QAAQ,CAAC,KAAK,EAAE,CAAC;AACnB,CAAC"}
1
+ {"version":3,"file":"reservedQueryNames.js","sourceRoot":"","sources":["../../../src/queries/reservedQueryNames.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAwB,IAAI,GAAG,CAAC;IACnE,mEAAmE;IACnE,KAAK;IACL,IAAI;IACJ,0BAA0B;IAC1B,2BAA2B;IAC3B,QAAQ;IACR,aAAa;IACb,QAAQ;IACR,OAAO;IACP,kBAAkB;IAClB,iBAAiB;IACjB,iBAAiB;IACjB,IAAI;IACJ,OAAO;IACP,MAAM;IACN,UAAU;IACV,OAAO;IACP,YAAY;IACZ,QAAQ;IACR,WAAW;IACX,MAAM;IACN,MAAM;IACN,OAAO;IACP,4CAA4C;IAC5C,eAAe;IACf,MAAM;IACN,UAAU;IACV,OAAO;IACP,aAAa;IACb,QAAQ;IACR,SAAS;IACT,WAAW;CACZ,CAAC,CAAC;AAEH;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAwB,IAAI,GAAG,CAAC;IACjE,KAAK;IACL,0BAA0B;IAC1B,2BAA2B;IAC3B,QAAQ;IACR,OAAO;IACP,MAAM;IACN,MAAM;IACN,MAAM;IACN,OAAO;CACR,CAAC,CAAC;AAEH,MAAM,UAAU,sBAAsB,CAAC,KAAyB;IAC9D,OAAO,CAAC,CAAC,KAAK,IAAI,wBAAwB,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACxD,CAAC;AAED,8EAA8E;AAC9E,MAAM,UAAU,oBAAoB,CAAC,KAAyB;IAC5D,OAAO,CAAC,CAAC,KAAK,IAAI,sBAAsB,CAAC,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the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/.\n */\n\n/**\n * The names the query proxies answer themselves.\n *\n * `QueryShape`/`QueryShapeSet` resolve a key against their own surface (`key in\n * queryShape`) before they look for a property shape with that label, so a property\n * named after one of these is unreachable through the builder: the caller gets the DSL\n * method, and the field tracer then fails on a native function. Registration warns about\n * such a label (see `warnOnReservedPropertyLabel`).\n *\n * Deliberately a literal, not derived from the classes: the shape registry must not\n * import the query builder (that edge would close an import cycle through `SHACL.ts`).\n * `dsl-property-name-collisions.test.ts` compares this list against the live prototypes,\n * so a DSL method added later cannot drift out of it unnoticed.\n */\nexport const RESERVED_QUERY_DSL_NAMES: ReadonlySet<string> = new Set([\n // prototype surface of QueryShape / QueryShapeSet (and their base)\n 'add',\n 'as',\n 'buildPredicateExpression',\n 'callPropertyShapeAccessor',\n 'concat',\n 'constructor',\n 'equals',\n 'every',\n 'getOriginalValue',\n 'getPropertyPath',\n 'getPropertyStep',\n 'id',\n 'limit',\n 'none',\n 'notOneOf',\n 'oneOf',\n 'preloadFor',\n 'select',\n 'selectAll',\n 'size',\n 'some',\n 'where',\n // instance fields — `in` sees these as well\n 'originalValue',\n 'prop',\n 'property',\n 'proxy',\n 'queryShapes',\n 'source',\n 'subject',\n 'wherePath',\n]);\n\n/**\n * The subset that only bites through a MULTI-VALUED hop.\n *\n * These are on `QueryShapeSet` but not on `QueryShape`, so `widget.size` resolves to the\n * property perfectly well — it is `article.widgets.size` that returns the set's size\n * instead. Which matters because `size`, `some`, `every` and `where` are among the most\n * ordinary names a domain model has, and warning about them as if they were always broken\n * trains people to ignore the warning.\n */\nexport const SET_CONTEXT_ONLY_NAMES: ReadonlySet<string> = new Set([\n 'add',\n 'buildPredicateExpression',\n 'callPropertyShapeAccessor',\n 'concat',\n 'every',\n 'none',\n 'size',\n 'some',\n 'where',\n]);\n\nexport function isReservedQueryDslName(label: string | undefined): boolean {\n return !!label && RESERVED_QUERY_DSL_NAMES.has(label);\n}\n\n/** True when the name is only shadowed when the shape is reached as a set. */\nexport function isSetContextOnlyName(label: string | undefined): boolean {\n return !!label && SET_CONTEXT_ONLY_NAMES.has(label);\n}\n\n/** One warning per shape + label; a shape re-registered on hot reload must not spam. */\nconst reported = new Set<string>();\n\n/**\n * Tell the model author about a colliding label while they can still rename it.\n *\n * A warning rather than a throw, on purpose. `size`, `id` and `some` are legitimate\n * names for a domain property, and the property still works everywhere except the\n * proxy-traced builder. Throwing here would break existing apps on upgrade over a property\n * they may never select through the builder. (Contrast `RESERVED_PROPERTY_LABELS` in\n * `SHACL.ts`, which does throw: a DSL-JSON combinator name has no escape hatch at all.)\n *\n * Two messages, because the two cases are genuinely different: a `QueryShape` member is\n * always shadowed, while a set-only member is fine until the shape is reached through a\n * multi-valued property. Saying \"broken\" about the second kind is how a warning gets\n * ignored.\n *\n * Both name the way out. The escape hatch already exists and is easy to miss:\n * `select(['size'])` takes the label as a string and never touches the proxy, so it\n * resolves the property whatever it is called. It accepts dot-paths too.\n */\nexport function warnOnReservedPropertyLabel(\n label: string | undefined,\n shapeLabel: string | undefined,\n shapeId?: string,\n): void {\n if (!isReservedQueryDslName(label)) return;\n const key = `${shapeId ?? shapeLabel ?? ''}#${label}`;\n if (reported.has(key)) return;\n reported.add(key);\n const owner = shapeLabel ?? shapeId ?? 'shape';\n const escape = `Use \\`select(['${label}'])\\`, which takes the label as a string and never touches the proxy. Renaming the property also works; the RDF predicate can stay the same.`;\n\n if (isSetContextOnlyName(label)) {\n console.warn(\n `[linked] ${owner}.${label} is shadowed when ${owner} is reached through a ` +\n `multi-valued property: '${label}' is a method of the query builder's SET proxy, so ` +\n `\\`parent.${owner.toLowerCase()}s.${label}\\` returns that method. Reading it directly ` +\n `(\\`select(s => s.${label})\\`) is fine. ${escape}`,\n );\n return;\n }\n\n console.warn(\n `[linked] ${owner}.${label} shadows the query DSL: '${label}' is a method of the query ` +\n `builder, so \\`select(s => s.${label})\\` returns that method instead of the property ` +\n `and the query fails while tracing fields. ${escape}`,\n );\n}\n\n/** Test seam: forget which collisions were already reported. */\nexport function resetReservedPropertyLabelWarnings(): void {\n reported.clear();\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"resolveShape.js","sourceRoot":"","sources":["../../../src/queries/resolveShape.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,uBAAuB,EAAE,aAAa,EAAC,MAAM,wBAAwB,CAAC;AAE9E;;;;;;;GAOG;AACH,MAAM,UAAU,YAAY,CAC1B,KAAmC;;IAEnC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,+EAA+E;QAC/E,+EAA+E;QAC/E,MAAM,UAAU,GAAG,MAAA,aAAa,CAAC,KAAK,CAAC,mCAAI,uBAAuB,CAAC,KAAK,CAAC,CAAC;QAC1E,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,MAAM,IAAI,KAAK,CAAC,6BAA6B,KAAK,GAAG,CAAC,CAAC;QACzD,CAAC;QACD,OAAO,UAAiC,CAAC;IAC3C,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
1
+ {"version":3,"file":"resolveShape.js","sourceRoot":"","sources":["../../../src/queries/resolveShape.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,uBAAuB,EAAE,aAAa,EAAC,MAAM,wBAAwB,CAAC;AAE9E;;;;;;;GAOG;AACH,MAAM,UAAU,YAAY,CAC1B,KAAmC;;IAEnC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,+EAA+E;QAC/E,+EAA+E;QAC/E,MAAM,UAAU,GAAG,MAAA,aAAa,CAAC,KAAK,CAAC,mCAAI,uBAAuB,CAAC,KAAK,CAAC,CAAC;QAC1E,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,MAAM,IAAI,KAAK,CAAC,6BAA6B,KAAK,GAAG,CAAC,CAAC;QACzD,CAAC;QACD,OAAO,UAAiC,CAAC;IAC3C,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["import {Shape, type ShapeConstructor} from '../shapes/Shape.js';\nimport {getOrCreateShapeAdapter, getShapeClass} from '../utils/ShapeClass.js';\n\n/**\n * Resolve a shape class or IRI string to a ShapeConstructor.\n *\n * Shared utility used by QueryBuilder, CreateBuilder, UpdateBuilder, and DeleteBuilder\n * to normalize their shape input.\n *\n * @throws If a string IRI cannot be resolved via the shape registry.\n */\nexport function resolveShape<S extends Shape>(\n shape: ShapeConstructor<S> | string,\n): ShapeConstructor<S> {\n if (typeof shape === 'string') {\n // An authored class first; otherwise a constructor derived from the registered\n // metadata, so a project-authored shape that exists only as data resolves too.\n const shapeClass = getShapeClass(shape) ?? getOrCreateShapeAdapter(shape);\n if (!shapeClass) {\n throw new Error(`Cannot resolve shape for '${shape}'`);\n }\n return shapeClass as ShapeConstructor<S>;\n }\n return shape;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"wireVersion.js","sourceRoot":"","sources":["../../../src/queries/wireVersion.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,yFAAyF;AACzF,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,CAAC;AAElC;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,CAAU;IAC1C,IAAI,CAAC,KAAK,SAAS,IAAI,CAAC,KAAK,IAAI;QAAE,OAAO;IAC1C,MAAM,aAAa,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9C,MAAM,QAAQ,GAAG,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5C,IAAI,aAAa,KAAK,QAAQ,EAAE,CAAC;QAC/B,MAAM,IAAI,KAAK,CACb,sCAAsC,CAAC,wBAAwB,YAAY,GAAG,CAC/E,CAAC;IACJ,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"wireVersion.js","sourceRoot":"","sources":["../../../src/queries/wireVersion.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,yFAAyF;AACzF,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,CAAC;AAElC;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,CAAU;IAC1C,IAAI,CAAC,KAAK,SAAS,IAAI,CAAC,KAAK,IAAI;QAAE,OAAO;IAC1C,MAAM,aAAa,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9C,MAAM,QAAQ,GAAG,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5C,IAAI,aAAa,KAAK,QAAQ,EAAE,CAAC;QAC/B,MAAM,IAAI,KAAK,CACb,sCAAsC,CAAC,wBAAwB,YAAY,GAAG,CAC/E,CAAC;IACJ,CAAC;AACH,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/** Current DSL-JSON wire-format version, stamped onto every `toJSON` envelope as `v`. */\nexport const WIRE_VERSION = '1.1';\n\n/**\n * Validate an incoming envelope's `v`. A missing `v` is tolerated (pre-versioned /\n * assumed current). A different MAJOR version is rejected — the structures may differ.\n */\nexport function assertWireVersion(v: unknown): void {\n if (v === undefined || v === null) return;\n const incomingMajor = String(v).split('.')[0];\n const ourMajor = WIRE_VERSION.split('.')[0];\n if (incomingMajor !== ourMajor) {\n throw new Error(\n `Unsupported DSL-JSON wire version \"${v}\". This build speaks ${WIRE_VERSION}.`,\n );\n }\n}\n"]}