@_linked/core 2.22.8 → 2.22.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/CHANGELOG.md +6 -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.js.map +1 -1
  8. package/lib/esm/interfaces/ICoreIterable.js.map +1 -1
  9. package/lib/esm/interfaces/IDataset.js.map +1 -1
  10. package/lib/esm/interfaces/IFileStore.js.map +1 -1
  11. package/lib/esm/ontologies/linked-core.js.map +1 -1
  12. package/lib/esm/ontologies/npm.js.map +1 -1
  13. package/lib/esm/ontologies/owl.js.map +1 -1
  14. package/lib/esm/ontologies/rdf.js.map +1 -1
  15. package/lib/esm/ontologies/rdfs.js.map +1 -1
  16. package/lib/esm/ontologies/shacl.js.map +1 -1
  17. package/lib/esm/ontologies/xsd.js.map +1 -1
  18. package/lib/esm/package.js.map +1 -1
  19. package/lib/esm/paths/PropertyPathExpr.js.map +1 -1
  20. package/lib/esm/paths/normalizePropertyPath.js.map +1 -1
  21. package/lib/esm/paths/pathExprToSparql.js.map +1 -1
  22. package/lib/esm/queries/AskBuilder.js.map +1 -1
  23. package/lib/esm/queries/AskQuery.js.map +1 -1
  24. package/lib/esm/queries/ContextRef.js.map +1 -1
  25. package/lib/esm/queries/CountBuilder.js.map +1 -1
  26. package/lib/esm/queries/CountQuery.js.map +1 -1
  27. package/lib/esm/queries/CreateBuilder.js.map +1 -1
  28. package/lib/esm/queries/CreateQuery.js.map +1 -1
  29. package/lib/esm/queries/DeleteBuilder.js.map +1 -1
  30. package/lib/esm/queries/DeleteQuery.js.map +1 -1
  31. package/lib/esm/queries/DslJsonExpression.js.map +1 -1
  32. package/lib/esm/queries/FieldSet.js.map +1 -1
  33. package/lib/esm/queries/IRAliasScope.js.map +1 -1
  34. package/lib/esm/queries/IRCanonicalize.js.map +1 -1
  35. package/lib/esm/queries/IRDesugar.js.map +1 -1
  36. package/lib/esm/queries/IRLower.js.map +1 -1
  37. package/lib/esm/queries/IRMutation.js.map +1 -1
  38. package/lib/esm/queries/IRPipeline.js.map +1 -1
  39. package/lib/esm/queries/IRProjection.js.map +1 -1
  40. package/lib/esm/queries/IntermediateRepresentation.js.map +1 -1
  41. package/lib/esm/queries/MutationQuery.js.map +1 -1
  42. package/lib/esm/queries/MutationSerialization.js.map +1 -1
  43. package/lib/esm/queries/MutationThenable.js.map +1 -1
  44. package/lib/esm/queries/PropertyPath.js.map +1 -1
  45. package/lib/esm/queries/ProxiedPathBuilder.js.map +1 -1
  46. package/lib/esm/queries/QueryBuilder.js.map +1 -1
  47. package/lib/esm/queries/QueryBuilderSerialization.js.map +1 -1
  48. package/lib/esm/queries/QueryContext.js.map +1 -1
  49. package/lib/esm/queries/QueryFactory.js.map +1 -1
  50. package/lib/esm/queries/SelectQuery.js.map +1 -1
  51. package/lib/esm/queries/UpdateBuilder.js.map +1 -1
  52. package/lib/esm/queries/UpdateQuery.js.map +1 -1
  53. package/lib/esm/queries/fromJSON.js.map +1 -1
  54. package/lib/esm/queries/lower.js.map +1 -1
  55. package/lib/esm/queries/lowerMutationJSON.js.map +1 -1
  56. package/lib/esm/queries/mutationLowerSpec.js.map +1 -1
  57. package/lib/esm/queries/queryDispatch.js.map +1 -1
  58. package/lib/esm/queries/reservedQueryNames.js.map +1 -1
  59. package/lib/esm/queries/resolveShape.js.map +1 -1
  60. package/lib/esm/queries/wireVersion.js.map +1 -1
  61. package/lib/esm/shapes/List.js.map +1 -1
  62. package/lib/esm/shapes/PathNode.js.map +1 -1
  63. package/lib/esm/shapes/SHACL.js.map +1 -1
  64. package/lib/esm/shapes/Shape.js.map +1 -1
  65. package/lib/esm/shapes/nodeShapeData.js.map +1 -1
  66. package/lib/esm/shapes/nodeShapeWire.js.map +1 -1
  67. package/lib/esm/shapes/propertyShapeTerms.js.map +1 -1
  68. package/lib/esm/shapes/registerRuntimeShape.js.map +1 -1
  69. package/lib/esm/shapes/serializePathToNodeData.js.map +1 -1
  70. package/lib/esm/shapes/syncShapes.js.map +1 -1
  71. package/lib/esm/shapes/validation.js.map +1 -1
  72. package/lib/esm/sparql/SparqlAlgebra.js.map +1 -1
  73. package/lib/esm/sparql/SparqlDataset.js.map +1 -1
  74. package/lib/esm/sparql/algebraToString.js.map +1 -1
  75. package/lib/esm/sparql/index.js.map +1 -1
  76. package/lib/esm/sparql/irToAlgebra.js.map +1 -1
  77. package/lib/esm/sparql/resultMapping.js.map +1 -1
  78. package/lib/esm/sparql/sparqlUtils.js.map +1 -1
  79. package/lib/esm/utils/LinkedErrorLogging.js.map +1 -1
  80. package/lib/esm/utils/LinkedFileStorage.js.map +1 -1
  81. package/lib/esm/utils/LinkedStorage.js.map +1 -1
  82. package/lib/esm/utils/NameSpace.js.map +1 -1
  83. package/lib/esm/utils/NodeReference.js.map +1 -1
  84. package/lib/esm/utils/Package.js.map +1 -1
  85. package/lib/esm/utils/Prefix.js.map +1 -1
  86. package/lib/esm/utils/ShapeClass.js.map +1 -1
  87. package/lib/esm/utils/URI.js.map +1 -1
  88. package/lib/esm/utils/cached.js.map +1 -1
  89. package/lib/esm/utils/loadStores.js.map +1 -1
  90. package/lib/esm/utils/parseDatasetsConfig.js.map +1 -1
  91. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"QueryBuilder.js","sourceRoot":"","sources":["../../../src/queries/QueryBuilder.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAC,uBAAuB,EAAC,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAC,YAAY,EAAC,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAOL,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EAAC,YAAY,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AAO,IAAI,CAAC;gBACd,CAAC;gBACD,0EAA0E;gBAC1E,yEAAyE;gBACzE,0EAA0E;gBAC1E,wEAAwE;gBACxE,8DAA8D;gBAC9D,oEAAoE;gBACpE,sEAAsE;gBACtE,4CAA4C;gBAC5C,MAAM,OAAO,GAAG,KAAK,CAAC,gCAAiC,GAAa,CAAC,KAAK,qCAAqC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC;gBAChJ,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE;oBACtC,KAAK,EAAE,GAAG;oBACV,QAAQ,EAAE,IAAI;oBACd,YAAY,EAAE,IAAI;oBAClB,UAAU,EAAE,KAAK;iBAClB,CAAC,CAAC;gBACH,MAAM,OAAO,CAAC;YAChB,CAAC;QACH,CAAC;KAAA;IAED,8EAA8E;IAC9E,+BAA+B;IAC/B,8EAA8E;IAE9E,kCAAkC;IAClC,IAAI,CACF,WAA0E,EAC1E,UAAuE;QAEvE,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;IACnD,CAAC;IAED,2EAA2E;IAC3E,KAAK,CACH,UAAqE;QAErE,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IACvC,CAAC;IAED,+EAA+E;IAC/E,OAAO,CAAC,SAA+B;QACrC,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACxC,CAAC;IAED,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC;QACtB,OAAO,eAAe,CAAC;IACzB,CAAC;CACF;AAED,4FAA4F;AAC5F,OAAO,EAAC,aAAa,IAAI,YAAY,EAAC,CAAC","sourcesContent":["import {Shape, type ShapeConstructor} from '../shapes/Shape.js';\nimport {getUniquePropertyShapes} from '../shapes/nodeShapeData.js';\nimport {resolveShape} from './resolveShape.js';\nimport {\n type QueryBuildFn,\n type WhereClause,\n type QResult,\n type QueryResponseToResultType,\n type SelectAllQueryResponse,\n type QueryComponentLike,\n processWhereClause,\n evaluateSortCallback,\n} from './SelectQuery.js';\nimport type {SortByPath, WherePath} from './SelectQuery.js';\nimport type {PropertyPathSegment, RawMinusEntry, RawSelectInput} from './IRDesugar.js';\nimport {WIRE_VERSION, assertWireVersion} from './wireVersion.js';\nimport {getQueryDispatch} from './queryDispatch.js';\nimport {AskBuilder} from './AskBuilder.js';\nimport {CountBuilder} from './CountBuilder.js';\nimport type {IDataset} from '../interfaces/IDataset.js';\nimport type {NodeShapeData} from '../shapes/SHACL.js';\nimport type {NodeReferenceValue} from './QueryFactory.js';\nimport {resolveUriOrThrow} from '../utils/NodeReference.js';\nimport {FieldSet, type FieldSetFieldJSON, type FieldSetEntry} from './FieldSet.js';\nimport {PendingQueryContext, UnresolvedContextError} from './QueryContext.js';\nimport {encodeContextRef, isContextRefJSON, type ContextRefJSON} from './ContextRef.js';\nimport {createProxiedPathBuilder} from './ProxiedPathBuilder.js';\nimport {\n serializeWherePath,\n serializeSortByPath,\n serializeRawMinusEntry,\n deserializeWherePath,\n deserializeSortByPath,\n deserializeRawMinusEntry,\n type WherePathJSON,\n type SortByPathJSON,\n type RawMinusEntryJSON,\n} from './QueryBuilderSerialization.js';\n\n/** JSON representation of a SelectBuilder. */\nexport type QueryBuilderJSON = {\n /** DSL-JSON wire-format version. */\n v?: string;\n shape: string;\n fields?: FieldSetFieldJSON[];\n limit?: number;\n offset?: number;\n /** A node id, or a `{@ctx: name}` context reference resolved at lowering. */\n subject?: string | ContextRefJSON;\n subjects?: string[];\n /** `.one()` — unwrap a single result. */\n one?: boolean;\n where?: WherePathJSON;\n sortBy?: SortByPathJSON;\n minusEntries?: RawMinusEntryJSON[];\n nullSubject?: boolean;\n};\n\n/** A preload entry binding a property path to a component's query. */\ninterface PreloadEntry {\n path: string;\n component: QueryComponentLike<any, any>;\n}\n\n/** A MINUS entry — either a shape type exclusion or a WHERE-clause condition. */\ninterface MinusEntry<S extends Shape> {\n shapeId?: string;\n whereFn?: WhereClause<S>;\n}\n\n/** Internal state bag for SelectBuilder. */\ninterface QueryBuilderInit<S extends Shape, R> {\n shape: ShapeConstructor<S>;\n selectFn?: QueryBuildFn<S, R>;\n whereFn?: WhereClause<S>;\n sortByFn?: QueryBuildFn<S, any>;\n sortDirection?: 'ASC' | 'DESC';\n limit?: number;\n offset?: number;\n subject?: S | QResult<S> | NodeReferenceValue;\n subjects?: NodeReferenceValue[];\n singleResult?: boolean;\n selectAllLabels?: string[];\n fieldSet?: FieldSet;\n preloads?: PreloadEntry[];\n minusEntries?: MinusEntry<S>[];\n _nullSubject?: boolean;\n _pendingContextName?: string;\n // Pre-evaluated data (restored from JSON; used when callbacks are not available)\n _where?: WherePath;\n _sortBy?: SortByPath;\n _rawMinusEntries?: RawMinusEntry[];\n}\n\n/**\n * An immutable, fluent query builder for select queries.\n *\n * Every mutation method (`.select()`, `.where()`, `.limit()`, etc.) returns\n * a **new** SelectBuilder instance — the original is never modified.\n *\n * Implements `PromiseLike` so queries execute on `await`:\n * ```ts\n * const results = await SelectBuilder.from(Person).select(p => p.name);\n * ```\n *\n * Produces a raw select input (`toRawInput()`) that the free `lower()` function\n * turns into IR; the builder itself carries no dependency on the IR pipeline.\n */\nexport class SelectBuilder<S extends Shape = Shape, R = any, Result = any>\n implements PromiseLike<Result>, Promise<Result>\n{\n private readonly _shape: ShapeConstructor<S>;\n private readonly _selectFn?: QueryBuildFn<S, R>;\n private readonly _whereFn?: WhereClause<S>;\n private readonly _sortByFn?: QueryBuildFn<S, any>;\n private readonly _sortDirection?: 'ASC' | 'DESC';\n private readonly _limit?: number;\n private readonly _offset?: number;\n private readonly _subject?: S | QResult<S> | NodeReferenceValue;\n private readonly _subjects?: NodeReferenceValue[];\n private readonly _singleResult?: boolean;\n private readonly _selectAllLabels?: string[];\n private readonly _fieldSet?: FieldSet;\n private readonly _preloads?: PreloadEntry[];\n private readonly _minusEntries?: MinusEntry<S>[];\n private readonly _nullSubject?: boolean;\n private readonly _pendingContextName?: string;\n // Pre-evaluated data (restored from JSON; used when callbacks are not available)\n private readonly _where?: WherePath;\n private readonly _sortBy?: SortByPath;\n private readonly _rawMinusEntries?: RawMinusEntry[];\n\n private constructor(init: QueryBuilderInit<S, R>) {\n this._shape = init.shape;\n this._selectFn = init.selectFn;\n this._whereFn = init.whereFn;\n this._sortByFn = init.sortByFn;\n this._sortDirection = init.sortDirection;\n this._limit = init.limit;\n this._offset = init.offset;\n this._subject = init.subject;\n this._subjects = init.subjects;\n this._singleResult = init.singleResult;\n this._selectAllLabels = init.selectAllLabels;\n this._fieldSet = init.fieldSet;\n this._preloads = init.preloads;\n this._minusEntries = init.minusEntries;\n this._nullSubject = init._nullSubject;\n this._pendingContextName = init._pendingContextName;\n this._where = init._where;\n this._sortBy = init._sortBy;\n this._rawMinusEntries = init._rawMinusEntries;\n }\n\n /** Create a shallow clone with overrides. */\n private clone<NR = R, NResult = Result>(overrides: Partial<QueryBuilderInit<S, any>> = {}): SelectBuilder<S, NR, NResult> {\n return new SelectBuilder<S, NR, NResult>({\n shape: this._shape,\n selectFn: this._selectFn as any,\n whereFn: this._whereFn,\n sortByFn: this._sortByFn,\n sortDirection: this._sortDirection,\n limit: this._limit,\n offset: this._offset,\n subject: this._subject,\n subjects: this._subjects,\n singleResult: this._singleResult,\n selectAllLabels: this._selectAllLabels,\n fieldSet: this._fieldSet,\n preloads: this._preloads,\n minusEntries: this._minusEntries,\n _nullSubject: this._nullSubject,\n _pendingContextName: this._pendingContextName,\n _where: this._where,\n _sortBy: this._sortBy,\n _rawMinusEntries: this._rawMinusEntries,\n ...overrides,\n });\n }\n\n // ---------------------------------------------------------------------------\n // Static constructors\n // ---------------------------------------------------------------------------\n\n /**\n * Create a SelectBuilder for the given shape.\n *\n * Accepts a shape class (e.g. `Person`), a NodeShapeData instance,\n * or a shape IRI string (resolved via the shape registry).\n */\n static from<S extends Shape>(\n shape: ShapeConstructor<S> | string,\n ): SelectBuilder<S> {\n const resolved = resolveShape<S>(shape);\n return new SelectBuilder<S>({shape: resolved});\n }\n\n // ---------------------------------------------------------------------------\n // Fluent API — each returns a new instance\n // ---------------------------------------------------------------------------\n\n /** Set the select projection via a callback, labels, or FieldSet. */\n select<NewR>(fn: QueryBuildFn<S, NewR>): SelectBuilder<S, NewR, QueryResponseToResultType<NewR, S>[]>;\n select(labels: string[]): SelectBuilder<S>;\n select<NewR>(fieldSet: FieldSet<NewR>): SelectBuilder<S, NewR, QueryResponseToResultType<NewR, S>[]>;\n select<NewR = R>(fnOrLabelsOrFieldSet: QueryBuildFn<S, NewR> | string[] | FieldSet<any>): SelectBuilder<S, NewR, any> {\n if (fnOrLabelsOrFieldSet instanceof FieldSet) {\n const labels = fnOrLabelsOrFieldSet.labels();\n const selectFn = ((p: any) =>\n labels.map((label) => p[label])) as unknown as QueryBuildFn<S, any>;\n return this.clone<NewR, any>({selectFn, selectAllLabels: undefined, fieldSet: fnOrLabelsOrFieldSet});\n }\n if (Array.isArray(fnOrLabelsOrFieldSet)) {\n const labels = fnOrLabelsOrFieldSet;\n const selectFn = ((p: any) =>\n labels.map((label) => p[label])) as unknown as QueryBuildFn<S, any>;\n return this.clone<NewR, any>({selectFn, selectAllLabels: undefined, fieldSet: undefined});\n }\n return this.clone<NewR, any>({selectFn: fnOrLabelsOrFieldSet as any, selectAllLabels: undefined, fieldSet: undefined});\n }\n\n /** Select all decorated properties of the shape. */\n selectAll(): SelectBuilder<S, any, QueryResponseToResultType<SelectAllQueryResponse<S>, S>[]> {\n const propertyLabels = getUniquePropertyShapes(this._shape.shape)\n .map((ps) => ps.label);\n const selectFn = ((p: any) =>\n propertyLabels.map((label) => p[label])) as unknown as QueryBuildFn<S, any>;\n return this.clone({selectFn, selectAllLabels: propertyLabels});\n }\n\n /** Add a where clause. */\n where(fn: WhereClause<S>): SelectBuilder<S, R, Result> {\n return this.clone({whereFn: fn});\n }\n\n /**\n * Exclude results matching a MINUS pattern.\n *\n * Accepts:\n * - A shape constructor to exclude by type: `.minus(Employee)`\n * - A WHERE callback to exclude by condition: `.minus(p => p.hobby.equals('Chess'))`\n * - A callback returning a property or array of properties for existence exclusion:\n * `.minus(p => p.hobby)` or `.minus(p => [p.hobby, p.bestFriend.name])`\n *\n * Chainable: `.minus(A).minus(B)` produces two separate `MINUS { }` blocks.\n */\n minus(shapeOrFn: ShapeConstructor<any> | WhereClause<S> | ((s: any) => any)): SelectBuilder<S, R, Result> {\n const entry: MinusEntry<S> = {};\n if (typeof shapeOrFn === 'function' && 'shape' in shapeOrFn) {\n // ShapeConstructor — has a static .shape property\n entry.shapeId = (shapeOrFn as ShapeConstructor<any>).shape?.id;\n } else {\n // WhereClause callback\n entry.whereFn = shapeOrFn as WhereClause<S>;\n }\n const existing = this._minusEntries || [];\n return this.clone({minusEntries: [...existing, entry]});\n }\n\n /** Set sort order. */\n orderBy<OR>(fn: QueryBuildFn<S, OR>, direction: 'ASC' | 'DESC' = 'ASC'): SelectBuilder<S, R, Result> {\n return this.clone({sortByFn: fn as any, sortDirection: direction});\n }\n\n /**\n * @deprecated Use `orderBy()` instead.\n */\n sortBy<OR>(fn: QueryBuildFn<S, OR>, direction: 'ASC' | 'DESC' = 'ASC'): SelectBuilder<S, R, Result> {\n return this.orderBy(fn, direction);\n }\n\n /** Set result limit. */\n limit(n: number): SelectBuilder<S, R, Result> {\n return this.clone({limit: n});\n }\n\n /** Set result offset. */\n offset(n: number): SelectBuilder<S, R, Result> {\n return this.clone({offset: n});\n }\n\n /** Target a single entity by ID. Implies singleResult; unwraps array Result type. */\n for(id: string | NodeReferenceValue | PendingQueryContext | null | undefined): SelectBuilder<S, R, Result extends (infer E)[] ? E : Result> {\n if (id instanceof PendingQueryContext) {\n // Store the pending context as subject — its .id getter resolves lazily\n // from the global context map when the query is lowered/serialized.\n return this.clone({subject: id as any, subjects: undefined, singleResult: true, _nullSubject: false, _pendingContextName: id.contextName}) as any;\n }\n if (id == null) {\n // Return a builder that resolves to null when executed (no subject = no query).\n // This commonly happens when getQueryContext() returns null before the user is authenticated.\n return this.clone({subject: undefined, subjects: undefined, singleResult: true, _nullSubject: true, _pendingContextName: undefined}) as any;\n }\n const subject: NodeReferenceValue = typeof id === 'string' ? {id: resolveUriOrThrow(id)} : id;\n return this.clone({subject, subjects: undefined, singleResult: true, _pendingContextName: undefined}) as any;\n }\n\n /**\n * Whether the query has a pending (lazy) context that hasn't resolved yet.\n * Returns true when .for() received a PendingQueryContext whose value isn't available yet.\n */\n hasPendingContext(): boolean {\n return !!(this._pendingContextName && !this._subject?.id);\n }\n\n /** Target multiple entities by ID, or all if no ids given. */\n forAll(ids?: (string | NodeReferenceValue)[]): SelectBuilder<S, R, Result> {\n if (!ids) {\n return this.clone({subject: undefined, subjects: undefined, singleResult: false, _pendingContextName: undefined});\n }\n const subjects = ids.map((id) => typeof id === 'string' ? {id: resolveUriOrThrow(id)} : id);\n return this.clone({subject: undefined, subjects, singleResult: false, _pendingContextName: undefined});\n }\n\n /** Limit to one result. Unwraps array Result type to single element. */\n one(): SelectBuilder<S, R, Result extends (infer E)[] ? E : Result> {\n return this.clone<R, Result extends (infer E)[] ? E : Result>({limit: 1, singleResult: true});\n }\n\n /**\n * Whether **any** row matches this query. Executes immediately and resolves to a\n * real `boolean` — never a row, never `null`, never an array the caller has to\n * interpret.\n *\n * ```ts\n * await Person.select().where(p => p.name.equals('Semmy')).exists(); // boolean\n * await Person.exists({id}); // the common case\n * ```\n *\n * ### The query is normalised to its cheapest correct form first\n *\n * **Dropped** — the projection, preloads, sorting *and pagination* (`limit`/`offset`).\n * **Kept** — filters, `minus` entries and the subject: those decide whether a match\n * exists. `LIMIT 1` is then applied.\n *\n * So `.select(…).orderBy(…).offset(10).exists()` costs, and answers, exactly the\n * same as a bare `.exists()`. Against a SPARQL store that goes out as:\n *\n * ```sparql\n * ASK WHERE { ?a0 rdf:type <…> . FILTER(?a0 = <…>) }\n * ```\n *\n * Pagination does not survive, and cannot: `OFFSET` skips rows of a *solution\n * sequence*, and an ask has none. (Nor is it merely dropped — an\n * {@link AskBuilder} has nowhere to hold it.) `exists()` answers a question about\n * the **match set**, not about a page of it.\n *\n * ### Errors are not swallowed\n *\n * A store, transport or lowering failure rejects the returned promise; it is never\n * reported as `false`. That includes an unresolved query-context reference in a\n * where clause, which `exec()` deliberately reports as `null` (\"not ready\") but\n * which `exists()` must not flatten into a boolean — and a store whose `askQuery`\n * resolves to something that is not a boolean, which rejects rather than being\n * coerced into one.\n *\n * The one case that does resolve `false` without querying is a query with **no\n * subject to ask about** — `.for(null)`, `.for(undefined)`, or an unresolved\n * `PendingQueryContext` *as the subject*. \"Does the node with no id exist?\" has a\n * correct total answer, and it is `false`.\n *\n * @param target Optional explicit dataset, as for {@link exec}.\n */\n async exists(target?: IDataset): Promise<boolean> {\n return this._toAsk().exec(target);\n }\n\n /**\n * **How many** rows match this query — the total of the match set, as a real\n * `number`.\n *\n * ```ts\n * await Person.select().where(p => p.name.equals('Semmy')).count(); // number\n * await SelectBuilder.from(shapeIri).where(…).count(); // from an IRI alone\n * ```\n *\n * ### The query is normalised to its cheapest correct form first\n *\n * **Dropped** — the projection, preloads, sorting *and pagination*\n * (`limit`/`offset`). **Kept** — filters, `minus` entries and the subject: those\n * decide membership of the match set. Against a SPARQL store that goes out as:\n *\n * ```sparql\n * SELECT (COUNT(DISTINCT ?a0) AS ?count)\n * WHERE { ?a0 rdf:type <…> . ?a0 <…name> ?a0_name . FILTER(?a0_name = \"Semmy\") }\n * ```\n *\n * ### `limit`/`offset` are dropped, not rejected\n *\n * A count of a windowed query is meaningless — `OFFSET` skips rows of a *solution\n * sequence*, and the number a count answers is a property of the whole match set,\n * not of a page of it. So `.limit(20).offset(40).count()` costs, and answers,\n * exactly the same as a bare `.count()`.\n *\n * Dropping rather than throwing is deliberate: the paging caller holds **one**\n * builder and wants the page *and* its total from the same filter, so rejecting\n * the combination would force it to rebuild the builder by hand for no\n * correctness gain. There is exactly one sensible reading, and it is this one.\n * `.exists()` already made the same call, so the DSL has one rule — *a\n * scalar-answering query drops the solution-sequence modifiers* — not two.\n *\n * Nor is the drop merely a convention: a {@link CountBuilder} has nowhere to hold\n * a window, so it cannot be forgotten or half-applied downstream.\n *\n * `DISTINCT` is likewise not optional. A filter on a multi-valued property yields\n * several rows per subject, so the count is of distinct subjects — \"how many\n * instances match\", which is the question asked.\n *\n * ### Errors are not swallowed\n *\n * A store, transport or lowering failure **rejects**; it is never reported as `0`.\n * `0` is a plausible count: it renders an empty table and looks like data. Do not\n * wrap this in `.catch(() => 0)`.\n *\n * The one case that resolves `0` without querying is a query with no subject to\n * count — `.for(null)`, `.for(undefined)`, or an unresolved `PendingQueryContext`\n * *as the subject*.\n *\n * @param target Optional explicit dataset, as for {@link exec}.\n */\n async count(target?: IDataset): Promise<number> {\n return this.toCount().exec(target);\n }\n\n /**\n * Reduce this select to the count query that answers \"how many match?\".\n *\n * Public, unlike the ask equivalent, because a caller may want to **forward**\n * rather than execute: `builder.toCount().toJSON()` is the `{op: 'count'}` wire\n * envelope a router or RPC boundary sends on, and `fromJSON` turns it back into a\n * `CountBuilder` on the other side.\n *\n * Only the pattern survives — shape, subject(s), filters, `minus`. The projection,\n * preloads, sorting and pagination are not so much \"dropped\" as unrepresentable:\n * {@link CountBuilder} has nowhere to put them. That is the point of it being a\n * separate builder rather than a mode of this one.\n */\n toCount(): CountBuilder {\n return CountBuilder.of({\n shapeClass: this._shape,\n // `.for(null)` rides along in the spec. An unresolved pending context is\n // handled by CountBuilder.exec, which answers `0` without querying.\n ...this._patternSpec(),\n });\n }\n\n /**\n * The pattern-bearing part of this select: shape-membership, subject(s), filters\n * and `minus` — everything that decides which nodes are in the match set, and\n * nothing that shapes or windows the rows describing them.\n *\n * Shared by {@link _toAsk} and {@link toCount} rather than written twice. That is\n * not only about duplication: if the two normalisations drifted, `.exists()` and\n * `.count()` would disagree about what the match set *is* — a count of 0 next to\n * an `exists` of `true`, from the same builder.\n */\n private _patternSpec(): {\n subject?: NodeReferenceValue | PendingQueryContext;\n subjects?: NodeReferenceValue[];\n where?: WherePath;\n minusEntries?: RawMinusEntry[];\n nullSubject?: boolean;\n } {\n let where: WherePath | undefined;\n if (this._whereFn) {\n where = processWhereClause(this._whereFn, this._shape);\n } else if (this._where) {\n where = this._where;\n }\n\n let minusEntries: RawMinusEntry[] | undefined;\n if (this._minusEntries && this._minusEntries.length > 0) {\n minusEntries = this._evaluateMinusEntries();\n } else if (this._rawMinusEntries && this._rawMinusEntries.length > 0) {\n minusEntries = this._rawMinusEntries;\n }\n\n // A PendingQueryContext must survive as itself. It has an `id` *getter*, so\n // narrowing it to `{id}` here would silently resolve it against THIS process's\n // context map — and the query would then travel as a concrete IRI where the\n // equivalent select travels as `{\"@ctx\": name}` for the receiver to resolve.\n const subject =\n this._subject instanceof PendingQueryContext\n ? this._subject\n : this._subject && typeof this._subject === 'object' && 'id' in this._subject\n ? {id: (this._subject as NodeReferenceValue).id}\n : undefined;\n\n return {\n subject,\n subjects: this._subjects,\n where,\n minusEntries,\n nullSubject: this._nullSubject,\n };\n }\n\n /**\n * Reduce this select to the ask query that answers the same existence question.\n *\n * Only the pattern survives — shape, subject(s), filters, `minus`. The\n * projection, preloads, sorting and pagination are not \"dropped\" so much as\n * unrepresentable: {@link AskBuilder} has nowhere to put them. That is the point\n * of it being a separate builder rather than a mode of this one — the\n * normalisation cannot be forgotten or half-applied.\n */\n private _toAsk(): AskBuilder {\n return AskBuilder.of({\n shapeClass: this._shape,\n // `.for(null)` rides along in the spec. An unresolved pending context is\n // handled by AskBuilder.exec, which sees the live context and answers `false`\n // without querying.\n ...this._patternSpec(),\n });\n }\n\n /**\n * Preload a component's query fields at the given property path.\n *\n * This merges the component's query paths into this query's selection,\n * wrapping them in an OPTIONAL block (handled by the IR pipeline).\n *\n * Equivalent to the DSL's `.preloadFor()`:\n * ```ts\n * // DSL style\n * Person.select(p => p.bestFriend.preloadFor(PersonCard))\n * // SelectBuilder style\n * SelectBuilder.from(Person).select(p => [p.name]).preload('bestFriend', PersonCard)\n * ```\n *\n * NOTE: Preloads hold live component references and are not serializable.\n * They are merged into the selection when the field set is evaluated\n * (`_fieldsWithPreloads()`), so changes to preload handling must account for\n * the selectFn wrapping logic.\n */\n preload<CS extends Shape, CR>(\n path: string,\n component: QueryComponentLike<CS, CR>,\n ): SelectBuilder<S, R, Result> {\n const newPreloads = [...(this._preloads || []), {path, component}];\n return this.clone({preloads: newPreloads});\n }\n\n /**\n * Returns the current selection as a FieldSet.\n * If the selection was set via a FieldSet, returns that directly.\n * If set via selectAll labels, constructs a FieldSet from them.\n * If set via a callback, eagerly evaluates it through the proxy to produce a FieldSet.\n */\n fields(): FieldSet | undefined {\n if (this._fieldSet) {\n return this._fieldSet;\n }\n if (this._selectAllLabels) {\n return FieldSet.for(this._shape.shape, this._selectAllLabels);\n }\n if (this._selectFn) {\n // Eagerly evaluate the callback through FieldSet.for(ShapeClass, callback)\n // The callback is pure — same proxy always produces same paths.\n return FieldSet.for(this._shape, this._selectFn as unknown as (p: any) => any[]);\n }\n return undefined;\n }\n\n // ---------------------------------------------------------------------------\n // Internal helpers\n // ---------------------------------------------------------------------------\n\n /** Return the FieldSet with preload entries merged in (if any). */\n private _fieldsWithPreloads(): FieldSet | undefined {\n let fs = this.fields();\n if (this._preloads && this._preloads.length > 0) {\n const preloadFn = (p: any) => {\n return this._preloads!.map((entry) => p[entry.path].preloadFor(entry.component));\n };\n const preloadFs = FieldSet.for(this._shape, preloadFn);\n if (fs) {\n fs = FieldSet.createFromEntries(fs.shape, [\n ...(fs.entries as FieldSetEntry[]),\n ...(preloadFs.entries as FieldSetEntry[]),\n ]);\n } else {\n fs = preloadFs;\n }\n }\n return fs;\n }\n\n /** Evaluate minus entry callbacks into RawMinusEntry[] (plain data). */\n private _evaluateMinusEntries(): RawMinusEntry[] {\n const proxy = createProxiedPathBuilder(this._shape);\n return this._minusEntries!.map((entry) => {\n if (entry.shapeId) {\n return {shapeId: entry.shapeId};\n }\n if (entry.whereFn) {\n const result = (entry.whereFn as Function)(proxy);\n\n if (Array.isArray(result)) {\n const propertyPaths = result.map((item: any) => {\n const segments = FieldSet.collectPropertySegments(item);\n return segments.map((seg): PropertyPathSegment => ({propertyShapeId: seg.id}));\n });\n return {propertyPaths};\n }\n\n if (result && typeof result === 'object' && 'property' in result && 'subject' in result) {\n const segments = FieldSet.collectPropertySegments(result);\n return {propertyPaths: [segments.map((seg): PropertyPathSegment => ({propertyShapeId: seg.id}))]};\n }\n\n // WHERE-based exclusion\n return {where: processWhereClause(entry.whereFn, this._shape)};\n }\n return {};\n });\n }\n\n // ---------------------------------------------------------------------------\n // Serialization\n // ---------------------------------------------------------------------------\n\n /**\n * Serialize this SelectBuilder to a plain JSON object.\n *\n * Selections are serializable regardless of how they were set (FieldSet,\n * string[], selectAll, or callback). Callback-based selections are eagerly\n * evaluated through the proxy to produce a FieldSet.\n *\n * Where, orderBy, and minus clauses are evaluated through the proxy and\n * serialized as plain data structures. Preloads are merged into the FieldSet\n * as subSelect entries, producing identical IR on deserialization.\n */\n toJSON(): QueryBuilderJSON {\n const shapeId = this._shape.shape?.id || '';\n const json: QueryBuilderJSON = {\n v: WIRE_VERSION,\n shape: shapeId,\n };\n\n const fs = this._fieldsWithPreloads();\n if (fs) {\n json.fields = fs.toJSON().fields;\n }\n\n if (this._limit !== undefined) {\n json.limit = this._limit;\n }\n if (this._offset !== undefined) {\n json.offset = this._offset;\n }\n if (this._pendingContextName) {\n // Carry the context reference, not its (possibly unresolved) id, so the\n // receiver resolves it against its own context map at lowering time.\n json.subject = encodeContextRef(this._pendingContextName);\n } else if (this._subject && typeof this._subject === 'object' && 'id' in this._subject) {\n json.subject = (this._subject as NodeReferenceValue).id;\n }\n if (this._subjects && this._subjects.length > 0) {\n json.subjects = this._subjects.map((s) => s.id);\n }\n if (this._singleResult) {\n json.one = true;\n }\n\n if (this._whereFn) {\n json.where = serializeWherePath(processWhereClause(this._whereFn, this._shape), this._shape.shape);\n } else if (this._where) {\n json.where = serializeWherePath(this._where, this._shape.shape);\n }\n\n if (this._sortByFn) {\n json.sortBy = serializeSortByPath(\n evaluateSortCallback(this._shape, this._sortByFn as unknown as (p: any) => any, this._sortDirection || 'ASC'),\n );\n } else if (this._sortBy) {\n json.sortBy = serializeSortByPath(this._sortBy);\n }\n\n if (this._minusEntries && this._minusEntries.length > 0) {\n json.minusEntries = this._evaluateMinusEntries().map((e) =>\n serializeRawMinusEntry(e, this._shape.shape),\n );\n } else if (this._rawMinusEntries && this._rawMinusEntries.length > 0) {\n json.minusEntries = this._rawMinusEntries.map((e) =>\n serializeRawMinusEntry(e, this._shape.shape),\n );\n }\n\n if (this._nullSubject) {\n json.nullSubject = true;\n }\n\n return json;\n }\n\n /**\n * Reconstruct a SelectBuilder from a JSON object.\n * Resolves shape IRI via getShapeClass() and field paths as label selections.\n */\n static fromJSON<S extends Shape = Shape>(json: QueryBuilderJSON): SelectBuilder<S> {\n assertWireVersion(json.v);\n let builder = SelectBuilder.from<S>(json.shape as any);\n\n if (json.fields && json.fields.length > 0) {\n const fieldSet = FieldSet.fromJSON({\n shape: json.shape,\n fields: json.fields,\n });\n builder = builder.select(fieldSet) as SelectBuilder<S>;\n }\n\n if (json.limit !== undefined) {\n builder = builder.limit(json.limit) as SelectBuilder<S>;\n }\n if (json.offset !== undefined) {\n builder = builder.offset(json.offset) as SelectBuilder<S>;\n }\n if (json.subject) {\n // A `{@ctx}` subject rehydrates as a pending context (preserving the name\n // so it re-serializes as a context reference and resolves live).\n const subject = isContextRefJSON(json.subject)\n ? new PendingQueryContext(json.subject['@ctx'])\n : json.subject;\n builder = builder.for(subject) as SelectBuilder<S>;\n }\n if (json.subjects && json.subjects.length > 0) {\n builder = builder.forAll(json.subjects) as SelectBuilder<S>;\n }\n if (json.one && !json.subject) {\n builder = builder.one() as SelectBuilder<S>;\n }\n\n // Restore pre-evaluated data via clone — safe because fromJSON is in the same class.\n const overrides: Partial<QueryBuilderInit<S, any>> = {};\n const nodeShape = builder._shape.shape;\n\n // Restore where clause\n if (json.where && nodeShape) {\n overrides._where = deserializeWherePath(nodeShape, json.where);\n }\n\n // Restore sort key + direction (direction rides on the ordered sortBy array)\n if (json.sortBy && json.sortBy.length > 0 && nodeShape) {\n const sortBy = deserializeSortByPath(nodeShape, json.sortBy);\n overrides._sortBy = sortBy;\n overrides.sortDirection = sortBy.directions[0];\n }\n\n // Restore minus entries\n if (json.minusEntries && json.minusEntries.length > 0 && nodeShape) {\n overrides._rawMinusEntries = json.minusEntries.map((e) =>\n deserializeRawMinusEntry(nodeShape, e),\n );\n }\n\n // Restore nullSubject flag\n if (json.nullSubject) {\n overrides._nullSubject = true;\n }\n\n if (Object.keys(overrides).length > 0) {\n builder = (builder as any).clone(overrides) as SelectBuilder<S>;\n }\n\n return builder;\n }\n\n // ---------------------------------------------------------------------------\n // Build & execute\n // ---------------------------------------------------------------------------\n\n /**\n * Get the raw pipeline input.\n *\n * Constructs RawSelectInput directly from FieldSet entries.\n */\n toRawInput(): RawSelectInput {\n return this._buildDirectRawInput();\n }\n\n /** Build RawSelectInput directly from FieldSet entries. */\n private _buildDirectRawInput(): RawSelectInput {\n const fs = this._fieldsWithPreloads();\n const entries = fs ? fs.entries : [];\n\n let where: WherePath | undefined;\n if (this._whereFn) {\n where = processWhereClause(this._whereFn, this._shape);\n } else if (this._where) {\n where = this._where;\n }\n\n let sortBy: SortByPath | undefined;\n if (this._sortByFn) {\n sortBy = evaluateSortCallback(\n this._shape,\n this._sortByFn as unknown as (p: any) => any,\n this._sortDirection || 'ASC',\n );\n } else if (this._sortBy) {\n sortBy = this._sortBy;\n }\n\n const input: RawSelectInput = {\n entries,\n subject: this._subject,\n limit: this._limit,\n offset: this._offset,\n shape: this._shape,\n sortBy,\n singleResult:\n this._singleResult ||\n !!(\n this._subject &&\n typeof this._subject === 'object' &&\n 'id' in this._subject\n ),\n };\n\n if (where) {\n input.where = where;\n }\n if (this._subjects && this._subjects.length > 0) {\n input.subjects = this._subjects;\n }\n if (this._minusEntries && this._minusEntries.length > 0) {\n input.minusEntries = this._evaluateMinusEntries();\n } else if (this._rawMinusEntries && this._rawMinusEntries.length > 0) {\n input.minusEntries = this._rawMinusEntries;\n }\n\n return input;\n }\n\n /** Discriminator for the free `lower()` function and dataset routing. */\n readonly __queryKind = 'select' 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 /**\n * Execute the query and return results.\n *\n * @param target Optional explicit dataset (a store or a router — a router *is* an\n * `IDataset`) to run against. Omitted → the global query dispatch (the router's\n * shape-based default). A `target` runs on that dataset only; the global router is\n * untouched. `await`ing the builder (the PromiseLike path) always uses the global\n * dispatch — only `.exec(target)` overrides.\n */\n async exec(target?: IDataset): Promise<Result> {\n return this._run(target, true) as Promise<Result>;\n }\n\n /**\n * Shared execution path for {@link exec} and {@link exists}.\n *\n * @param swallowUnresolvedContext When true (the `exec` path), a where-clause\n * context reference that has not resolved yet surfaces as `null` — \"not ready\",\n * which a reactive layer re-runs once the context lands. `exists()` passes\n * false: it must not turn \"could not ask\" into a boolean.\n */\n private async _run(\n target: IDataset | undefined,\n swallowUnresolvedContext: boolean,\n ): Promise<unknown> {\n if (this._nullSubject) {\n // .for(null/undefined) was called — return null instead of executing a broken query.\n return null;\n }\n if (this._pendingContextName && !this._subject?.id) {\n // Pending context hasn't resolved yet — return null rather than querying without a subject.\n return null;\n }\n // Dispatch the live (closed) query; the dataset decides whether to lower it.\n // `async` ensures a missing global dispatch surfaces as a rejected promise, not a sync throw.\n const dispatch = target ?? getQueryDispatch();\n try {\n return await dispatch.selectQuery(this);\n } catch (err) {\n // A where-clause context reference that hasn't resolved yet surfaces as\n // UnresolvedContextError when the dataset lowers the query. For SELECT this\n // means \"not ready\" — return null (a reactive layer re-runs once it lands),\n // mirroring the pending-subject behavior. Mutations still throw.\n if (swallowUnresolvedContext && err instanceof UnresolvedContextError) {\n return null;\n }\n // The message names the query, which is what a human needs. `cause` keeps\n // the ORIGINAL error reachable as an object, which is what code needs: a\n // store error's status/endpoint/class is how a caller tells \"this dataset\n // does not exist\" from \"this query is wrong\", and without the chain the\n // only way left is to pattern-match this string. Written with\n // defineProperty rather than `new Error(msg, {cause})` because this\n // package targets es6, where that overload is not typed; the property\n // shape (own, non-enumerable) is identical.\n const wrapped = Error(`Error while executing query: ${(err as Error).stack}.\\n\\nQuery related to this error: ${JSON.stringify(this.toJSON())}`);\n Object.defineProperty(wrapped, 'cause', {\n value: err,\n writable: true,\n configurable: true,\n enumerable: false,\n });\n throw wrapped;\n }\n }\n\n // ---------------------------------------------------------------------------\n // Promise-compatible interface\n // ---------------------------------------------------------------------------\n\n /** `await` triggers execution. */\n then<TResult1 = Result, TResult2 = never>(\n onfulfilled?: ((value: Result) => TResult1 | PromiseLike<TResult1>) | null,\n onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null,\n ): Promise<TResult1 | TResult2> {\n return this.exec().then(onfulfilled, onrejected);\n }\n\n /** Catch errors from execution. Chain off then() to avoid re-executing. */\n catch<TResult = never>(\n onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | null,\n ): Promise<Result | TResult> {\n return this.then().catch(onrejected);\n }\n\n /** Finally handler after execution. Chain off then() to avoid re-executing. */\n finally(onfinally?: (() => void) | null): Promise<Result> {\n return this.then().finally(onfinally);\n }\n\n get [Symbol.toStringTag](): string {\n return 'SelectBuilder';\n }\n}\n\n/** @deprecated Renamed to `SelectBuilder`. This alias will be removed in a future major. */\nexport {SelectBuilder as QueryBuilder};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"QueryBuilderSerialization.js","sourceRoot":"","sources":["../../../src/queries/QueryBuilderSerialization.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAC,gBAAgB,EAAC,MAAM,mBAAmB,CAAC;AAGnD,OAAO,EACL,eAAe,EACf,eAAe,GAEhB,MAAM,wBAAwB,CAAC;AAmBhC,gFAAgF;AAChF,gBAAg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,MAAM,UAAU,oBAAoB,CAClC,KAAoB,EACpB,IAAmB;IAEnB,OAAO,eAAe,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AACtC,CAAC;AAED,MAAM,UAAU,qBAAqB,CACnC,KAAoB,EACpB,IAAoB;IAEpB,yEAAyE;IACzE,OAAO;QACL,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,gBAAgB,CAAC,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAClE,UAAU,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAuB;KACvE,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,wBAAwB,CACtC,KAAoB,EACpB,IAAuB;IAEvB,MAAM,KAAK,GAAkB,EAAE,CAAC;IAChC,IAAI,IAAI,CAAC,OAAO;QAAE,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;IAC/C,IAAI,IAAI,CAAC,KAAK;QAAE,KAAK,CAAC,KAAK,GAAG,oBAAoB,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;IACtE,IAAI,IAAI,CAAC,aAAa,EAAE,CAAC;QACvB,KAAK,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAClD,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,EAAuB,EAAE,CAAC,CAAC,EAAC,eAAe,EAAE,EAAE,EAAC,CAAC,CAAC,CAC7D,CAAC;IACJ,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["/**\n * Serialization helpers for QueryBuilder fields that contain live object\n * references (where-clauses, sort paths, minus entries).\n *\n * Where-clauses serialize through the DSL-JSON expression codec\n * (`DslJsonExpression.ts`) — the wire form carries no IR. This module wires that\n * codec into the select/mutation envelopes and handles sort + minus.\n */\n\nimport type {NodeShapeData} from '../shapes/SHACL.js';\nimport {walkPropertyPath} from './PropertyPath.js';\nimport type {WherePath, SortByPath} from './SelectQuery.js';\nimport type {RawMinusEntry, PropertyPathSegment} from './IRDesugar.js';\nimport {\n encodeCondition,\n decodeCondition,\n type DslJsonCondition,\n} from './DslJsonExpression.js';\nimport type {ExpressionNode, ExistsCondition} from '../expressions/ExpressionNode.js';\n\n// =============================================================================\n// JSON types\n// =============================================================================\n\n/** A where-clause on the wire is a DSL-JSON condition (see documentation/dsl-json.md). */\nexport type WherePathJSON = DslJsonCondition;\n\n/** An ordered list of `{path: direction}` — element order is sort precedence. */\nexport type SortByPathJSON = Array<{[path: string]: 'ASC' | 'DESC'}>;\n\nexport type RawMinusEntryJSON = {\n shapeId?: string;\n where?: WherePathJSON;\n propertyPaths?: string[][];\n};\n\n// =============================================================================\n// Serialization\n// =============================================================================\n\n/** Serialize a runtime where-clause to its DSL-JSON condition form. */\nexport function serializeWherePath(\n where: WherePath,\n shape: NodeShapeData,\n): WherePathJSON {\n const node: ExpressionNode | ExistsCondition =\n 'existsCondition' in (where as object)\n ? (where as {existsCondition: ExistsCondition}).existsCondition\n : (where as {expressionNode: ExpressionNode}).expressionNode;\n return encodeCondition(node, shape);\n}\n\nexport function serializeSortByPath(sort: SortByPath): SortByPathJSON {\n return sort.paths.map((p, i) => ({[p.toString()]: sort.directions[i]}));\n}\n\nexport function serializeRawMinusEntry(\n entry: RawMinusEntry,\n shape: NodeShapeData,\n): RawMinusEntryJSON {\n const json: RawMinusEntryJSON = {};\n if (entry.shapeId) json.shapeId = entry.shapeId;\n if (entry.where) json.where = serializeWherePath(entry.where, shape);\n if (entry.propertyPaths) {\n json.propertyPaths = entry.propertyPaths.map((pp) =>\n pp.map((seg) => seg.propertyShapeId),\n );\n }\n return json;\n}\n\n// =============================================================================\n// Deserialization\n// =============================================================================\n\n/** Rebuild a runtime where-clause from its DSL-JSON condition form. */\nexport function deserializeWherePath(\n shape: NodeShapeData,\n json: WherePathJSON,\n): WherePath {\n return decodeCondition(json, shape);\n}\n\nexport function deserializeSortByPath(\n shape: NodeShapeData,\n json: SortByPathJSON,\n): SortByPath {\n // Per-path directions: each `{path: dir}` entry keeps its own direction.\n return {\n paths: json.map((e) => walkPropertyPath(shape, Object.keys(e)[0])),\n directions: json.map((e) => Object.values(e)[0]) as ('ASC' | 'DESC')[],\n };\n}\n\nexport function deserializeRawMinusEntry(\n shape: NodeShapeData,\n json: RawMinusEntryJSON,\n): RawMinusEntry {\n const entry: RawMinusEntry = {};\n if (json.shapeId) entry.shapeId = json.shapeId;\n if (json.where) entry.where = deserializeWherePath(shape, json.where);\n if (json.propertyPaths) {\n entry.propertyPaths = json.propertyPaths.map((pp) =>\n pp.map((id): PropertyPathSegment => ({propertyShapeId: id})),\n );\n }\n return entry;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"QueryContext.js","sourceRoot":"","sources":["../../../src/queries/QueryContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,UAAU,EAAC,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAC,KAAK,EAAE,iBAAiB,EAAC,MAAM,oBAAoB,CAAC;AAE5D,MAAM,YAAY,GAAG,IAAI,GAAG,EAAiC,CAAC;AAE9D;;;;GAIG;AACH,MAAM,OAAO,mBAAmB;IAC9B,YAA4B,WAAmB;QAAnB,gBAAW,GAAX,WAAW,CAAQ;IAAG,CAAC;IAEnD,IAAI,EAAE;;QACJ,OAAO,MAAA,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,0CAAE,EAAE,CAAC;IAChD,CAAC;CACF;AAED;;;;;;GAMG;AACH,MAAM,OAAO,sBAAuB,SAAQ,KAAK;IAC/C,YAA4B,WAAmB;QAC7C,KAAK,CACH,kBAAkB,WAAW,0DAA0D,CACxF,CAAC;QAHwB,gBAAW,GAAX,WAAW,CAAQ;QAI7C,IA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CAC9I,CAAC;QACJ,CAAC;QACD,MAAM,KAAK,GAAG,iBAAiB,CAAC,SAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC;QAC5D,KAAK,CAAC,gBAAgB,GAAG,KAAK,CAAC,EAAE,CAAC;QAClC,KAAK,CAAC,kBAAkB,GAAG,IAAI,CAAC;QAChC,YAAY,CAAC,GAAG,CAAC,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,KAAK,CAAQ,CAAC,CAAC;QACxD,mBAAmB,CAAC,IAAI,CAAC,CAAC;QAC1B,OAAO;IACT,CAAC;IAED,MAAM,IAAI,KAAK,CACb,oBAAoB,IAAI,6DAA6D,OAAO,KAAK,wFAAwF,CAC1L,CAAC;AACJ,CAAC","sourcesContent":["import {type QShape, QueryShape} from './SelectQuery.js';\nimport {Shape, createShapeTarget} from '../shapes/Shape.js';\n\nconst queryContext = new Map<string, QShape<any, any, any>>();\n\n/**\n * A live reference returned by getQueryContext when the context hasn't been set yet.\n * Its `id` getter resolves lazily from the global context map, so queries built with\n * a PendingQueryContext will pick up the value once it's set (e.g. after auth completes).\n */\nexport class PendingQueryContext {\n constructor(public readonly contextName: string) {}\n\n get id(): string | undefined {\n return queryContext.get(this.contextName)?.id;\n }\n}\n\n/**\n * Thrown when a query carrying a context reference is lowered but the context\n * isn't set in the current process. A context ref is carried in DSL-JSON and\n * resolves at lowering time against whatever context map is available (e.g.\n * server-side auth); if it can't resolve, lowering throws this rather than\n * silently producing a subject-less query.\n */\nexport class UnresolvedContextError extends Error {\n constructor(public readonly contextName: string) {\n super(\n `Query context \"${contextName}\" is not set and could not be resolved at lowering time.`,\n );\n this.name = 'UnresolvedContextError';\n }\n}\n\n/** Listener notified (with the changed context name) whenever a context is set or cleared. */\nexport type QueryContextListener = (name: string) => void;\nconst contextListeners = new Set<QueryContextListener>();\n\n/**\n * Subscribe to query-context changes. Returns an unsubscribe function.\n *\n * This is the primitive that makes context resolution reactive: a consuming layer\n * (e.g. React components) subscribes and re-runs affected queries when the context\n * lands — so a query that resolved to `null` while the context was unset simply\n * re-runs and resolves once it's available (\"waiting\"), and re-runs again on any\n * later change (\"auto re-resolve\"). Core only emits the change; re-execution is the\n * consumer's responsibility.\n */\nexport function subscribeQueryContext(listener: QueryContextListener): () => void {\n contextListeners.add(listener);\n return () => contextListeners.delete(listener);\n}\n\nfunction notifyContextChange(name: string): void {\n // Snapshot so a listener that (un)subscribes or re-sets a context during\n // notification can't mutate the set mid-iteration.\n for (const listener of [...contextListeners]) listener(name);\n}\n\n/**\n * Normalize any query-context value to a {@link PendingQueryContext} carrying its name,\n * or return `undefined` if the value is not a context reference.\n *\n * A context appears in two runtime forms: a `PendingQueryContext` (the context was unset\n * when `getQueryContext()` was called) or a resolved `QueryShape` stamped with\n * `__queryContextName` (it was already set). Both must be treated as the same `{@ctx}`\n * reference wherever a node value/id is accepted (mutation field values, delete ids), so\n * that context-bound mutations behave identically whether the context is set or unset at\n * build time — resolution always happens at lowering.\n */\nexport function asContextRef(value: unknown): PendingQueryContext | undefined {\n if (value instanceof PendingQueryContext) return value;\n if (!value || typeof value !== 'object') return undefined;\n // A resolved context is a QueryShape proxy wrapping a Shape stamped with\n // `__queryContextName`. Read it via `originalValue` (a known QueryShape field)\n // so we don't trip the proxy's \"undecorated property\" guard (it now throws);\n // a bare Shape\n // carries the stamp directly.\n const v = value as {originalValue?: {__queryContextName?: unknown}; __queryContextName?: unknown};\n const source = v.originalValue ?? v;\n const name = (source as {__queryContextName?: unknown}).__queryContextName;\n if (typeof name === 'string') return new PendingQueryContext(name);\n return undefined;\n}\n\nexport function getQueryContext<T extends Shape>(name: string): QShape<T> {\n if (queryContext.has(name)) {\n return queryContext.get(name);\n }\n // Return a live reference that resolves lazily when the context is set.\n // This avoids the timing issue where module-level queries capture null\n // because the context hasn't been set yet (e.g. useEffect hasn't fired).\n return new PendingQueryContext(name) as any;\n}\n\nexport function setQueryContext(name: string, value: any, shapeType?) {\n // Clearing a context entry\n if (!value) {\n queryContext.delete(name);\n notifyContextChange(name);\n return;\n }\n\n // Already a QShape — stamp the underlying shape and store as-is. (Checked before\n // the plain-`{id}` branch below: a QueryShape's `.id` getter is also a string, so\n // testing for `{id}` first would wrongly require a shapeType and no-op.)\n if (value instanceof QueryShape) {\n const orig = (value as any).originalValue;\n if (orig) {\n orig.__queryContextName = name;\n if (typeof orig.id === 'string') orig.__queryContextId = orig.id;\n }\n queryContext.set(name, value as any);\n notifyContextChange(name);\n return;\n }\n\n // A Shape-shaped value (e.g. a `createShapeTarget` proxy target) — stamp it and\n // wrap as a QShape. Needs no shapeType (it already carries its shape class).\n if (value instanceof Shape) {\n value.__queryContextName = name;\n if (typeof value.id === 'string') value.__queryContextId = value.id;\n queryContext.set(name, new QueryShape(value) as any);\n notifyContextChange(name);\n return;\n }\n\n // A plain QResult `{id}` — materialize a shape (requires shapeType).\n if (typeof value.id === 'string') {\n if (!shapeType) {\n // A silent no-op here is a trap: the context never sets and the caller\n // gets no signal. A `{id}` value cannot be materialized without its shape.\n throw new Error(\n `setQueryContext('${name}'): a {id} value requires a shapeType so the shape can be materialized. Pass the Shape class as the third argument.`,\n );\n }\n const shape = createShapeTarget(shapeType as any, value.id);\n shape.__queryContextId = value.id;\n shape.__queryContextName = name;\n queryContext.set(name, QueryShape.create(shape) as any);\n notifyContextChange(name);\n return;\n }\n\n throw new Error(\n `setQueryContext('${name}'): value is not a QueryShape, Shape, or {id} result. Got ${typeof value}. Pass a Shape instance, a query-context shape, or a {id} result (with its shapeType).`,\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"QueryFactory.js","sourceRoot":"","sources":["../../../src/queries/QueryFactory.ts"],"names":[],"mappings":"AAmKA,OAAO,EAAC,eAAe,EAAC,MAAM,2BAA2B,CAAC;AAG1D,MAAM,OAAgB,YAAY;CAAG;AAErC,MAAM,UAAU,sBAAsB,CACpC,KAAU;IAEV,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAE9D,IAAI,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC;IAC3B,IAAI,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC;IACjC,IAAI,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC;IACxC,mBAAmB;IACnB,OAAO,CACL,CAAC,SAAS,IAAI,YAAY,IAAI,OAAO,KAAK,CAAC,CAAC;QAC5C,CAAC,SAAS,IAAI,OAAO,KAAK,CAAC,CAAC;QAC5B,CAAC,YAAY,IAAI,OAAO,KAAK,CAAC,CAAC,CAChC,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"QueryFactory.js","sourceRoot":"","sources":["../../../src/queries/QueryFactory.ts"],"names":[],"mappings":"AAmKA,OAAO,EAAC,eAAe,EAAC,MAAM,2BAA2B,CAAC;AAG1D,MAAM,OAAgB,YAAY;CAAG;AAErC,MAAM,UAAU,sBAAsB,CACpC,KAAU;IAEV,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAE9D,IAAI,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC;IAC3B,IAAI,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC;IACjC,IAAI,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC;IACxC,mBAAmB;IACnB,OAAO,CACL,CAAC,SAAS,IAAI,YAAY,IAAI,OAAO,KAAK,CAAC,CAAC;QAC5C,CAAC,SAAS,IAAI,OAAO,KAAK,CAAC,CAAC;QAC5B,CAAC,YAAY,IAAI,OAAO,KAAK,CAAC,CAAC,CAChC,CAAC;AACJ,CAAC","sourcesContent":["import type {NodeShapeData, PropertyShapeData} from '../shapes/SHACL.js';\nimport {Shape} from '../shapes/Shape.js';\nimport {ShapeSet} from '../collections/ShapeSet.js';\nimport type {NodeReferenceValue} from '../utils/NodeReference.js';\nimport {ExpressionNode} from '../expressions/ExpressionNode.js';\n\nexport type Prettify<T> = T extends infer R\n ? {\n [K in keyof R]: R[K];\n }\n : never;\n\n/**\n * Recursively adds an id property to all objects in the object.\n * Also makes all keys optional.\n */\ntype _AddId<U> = U extends string | number | boolean | Date | null | undefined\n ? U\n : U extends Array<infer T>\n ? Array<_AddId<T>>\n : WithId<U>;\n\ntype RemoveId<U> = Omit<U, 'id'>;\n\ntype WithId<U> = U & {id: string};\n\ntype UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (\n k: infer I,\n) => void\n ? I\n : never;\n\ntype CombineTypes<T> = {\n [K in keyof UnionToIntersection<T>]: T extends {[P in K]?: infer V}\n ? _AddId<V>\n : never;\n};\n\ntype IsPlainObject<T> = T extends object\n ? T extends any[]\n ? false\n : T extends Function\n ? false\n : T extends Date\n ? false\n : T extends RegExp\n ? false\n : T extends Error\n ? false\n : T extends null\n ? false\n : T extends undefined\n ? false\n : T extends object\n ? true\n : false\n : false;\n\ntype RecursiveTransform<T, IsCreate = false> = T extends\n | string\n | number\n | boolean\n | Date\n | null\n | undefined\n ? T\n : T extends Array<infer U>\n ? UpdatedSet<Prettify<RecursiveTransform<U>>, IsCreate>\n : IsSetModification<T> extends true\n ? ModifiedSet<T, IsCreate>\n : IsPlainObject<T> extends true\n ? // ? WithId<{ [K in keyof T]-?: Prettify<RecursiveTransform<T[K]>> }>\n WithId<{[K in keyof T]: Prettify<RecursiveTransform<T[K], IsCreate>>}>\n : T;\n\n//for update() we use {updatedTo} but for create() we actually just return the array of new values;\ntype UpdatedSet<U, IsCreate> = IsCreate extends true\n ? U[]\n : {\n updatedTo: U[];\n };\ntype IsSetModification<T> = T extends {add?: any; remove?: any} ? true : false;\ntype AddedType<T> = T extends {add: (infer U)[]}\n ? U\n : T extends {add: infer U}\n ? U\n : never;\n\ntype RemovedType<T> = T extends {remove: (infer U)[]}\n ? U\n : T extends {remove: infer U}\n ? U\n : never;\n\ntype ModifiedSet<T, IsCreate = false> = {\n added: AddId<AddedType<T>, IsCreate>[];\n removed: AddId<RemovedType<T>, IsCreate>[];\n};\n\nexport type AddId<T, IsCreate = false> = Prettify<\n RecursiveTransform<T, IsCreate>\n>;\n\nexport type UpdatePartial<S = Shape> =\n | UpdateNodeDescription<S>\n | NodeReferenceValue;\ntype UpdateNodeDescription<Shape> = Partial<\n Omit<\n {\n [P in KeysWithoutFunctions<Shape>]: ShapePropValueToUpdatePartial<\n Shape[P]\n >;\n },\n 'node' | 'nodeShape' | 'namedNode' | 'targetClass'\n >\n>;\ntype KeysWithoutFunctions<T> = {\n [K in keyof T]: T[K] extends Function ? never : K;\n}[keyof T];\n\ntype ShapePropValueToUpdatePartial<ShapeProperty> = ShapeProperty extends Shape\n ? UpdatePartial<ShapeProperty>\n : ShapeProperty extends ShapeSet<infer SSType>\n ? SetUpdateValue<SSType>\n : ShapeProperty | ExpressionNode;\n\ntype SetUpdateValue<SSType> = UpdatePartial<SSType>[] | SetModification<SSType>;\n\nexport type SetModification<SSType> = {\n add?: UpdatePartial<SSType>[] | UpdatePartial<SSType>;\n remove?: UpdatePartial<SSType>[] | UpdatePartial<SSType>;\n};\n\nexport type SetModificationValue = {\n $add?: UpdatePartial[];\n $remove?: NodeReferenceValue[];\n};\n\ntype UnsetValue = undefined;\nexport type LiteralUpdateValue = string | number | boolean | Date;\nexport type PropUpdateValue =\n | SinglePropertyUpdateValue\n | SinglePropertyUpdateValue[]\n | SetModificationValue;\nexport type SinglePropertyUpdateValue =\n | NodeDescriptionValue\n | NodeReferenceValue\n | LiteralUpdateValue\n | UnsetValue;\nexport type NodeDescriptionValue = {\n shape: NodeShapeData;\n fields: UpdateNodePropertyValue[];\n /**\n * The id of the node to be created.\n * Optional, if not provided a new id will be generated.\n */\n __id?: string;\n};\nexport type UpdateNodePropertyValue = {\n prop: PropertyShapeData;\n val: PropUpdateValue;\n};\nexport type ShapeReferenceValue = {id: string; shape: NodeReferenceValue};\nexport {toNodeReference} from '../utils/NodeReference.js';\nexport type {NodeReferenceValue};\n\nexport abstract class QueryFactory {}\n\nexport function isSetModificationValue(\n value: any,\n): value is SetModificationValue {\n if (value === null || typeof value !== 'object') return false;\n\n let hasAddKey = value.$add;\n let hasRemoveKey = value.$remove;\n let numKeys = Object.keys(value).length;\n //has no other keys\n return (\n (hasAddKey && hasRemoveKey && numKeys === 2) ||\n (hasAddKey && numKeys === 1) ||\n (hasRemoveKey && numKeys === 1)\n );\n}\n\n"]}
@@ -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;I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CAAC,QAAQ,CAAC,KAAK;SACjD,CAAC;QAEF,sEAAsE;QACtE,kGAAkG;QAClG,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;YACzB,IAAI,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,eAAe,EAAE,CAAC;YAClD,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"]}