@_linked/core 2.12.0 → 2.13.0-next.20260706164859
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/lib/esm/queries/IRPipeline.d.ts +7 -1
- package/lib/esm/queries/IRPipeline.js +20 -6
- package/lib/esm/queries/IRPipeline.js.map +1 -1
- package/lib/esm/queries/queryDispatch.js +12 -2
- package/lib/esm/queries/queryDispatch.js.map +1 -1
- package/package.json +10 -13
- package/lib/cjs/collections/CoreSet.d.ts +0 -47
- package/lib/cjs/collections/CoreSet.js +0 -136
- package/lib/cjs/collections/CoreSet.js.map +0 -1
- package/lib/cjs/collections/ShapeSet.d.ts +0 -6
- package/lib/cjs/collections/ShapeSet.js +0 -20
- package/lib/cjs/collections/ShapeSet.js.map +0 -1
- package/lib/cjs/expressions/Expr.d.ts +0 -29
- package/lib/cjs/expressions/Expr.js +0 -80
- package/lib/cjs/expressions/Expr.js.map +0 -1
- package/lib/cjs/expressions/ExpressionMethods.d.ts +0 -85
- package/lib/cjs/expressions/ExpressionMethods.js +0 -3
- package/lib/cjs/expressions/ExpressionMethods.js.map +0 -1
- package/lib/cjs/expressions/ExpressionNode.d.ts +0 -144
- package/lib/cjs/expressions/ExpressionNode.js +0 -432
- package/lib/cjs/expressions/ExpressionNode.js.map +0 -1
- package/lib/cjs/index.d.ts +0 -29
- package/lib/cjs/index.js +0 -65
- package/lib/cjs/index.js.map +0 -1
- package/lib/cjs/interfaces/ICoreIterable.d.ts +0 -14
- package/lib/cjs/interfaces/ICoreIterable.js +0 -3
- package/lib/cjs/interfaces/ICoreIterable.js.map +0 -1
- package/lib/cjs/interfaces/IDataset.d.ts +0 -26
- package/lib/cjs/interfaces/IDataset.js +0 -3
- package/lib/cjs/interfaces/IDataset.js.map +0 -1
- package/lib/cjs/interfaces/IFileStore.d.ts +0 -16
- package/lib/cjs/interfaces/IFileStore.js +0 -3
- package/lib/cjs/interfaces/IFileStore.js.map +0 -1
- package/lib/cjs/ontologies/linked-core.d.ts +0 -15
- package/lib/cjs/ontologies/linked-core.js +0 -38
- package/lib/cjs/ontologies/linked-core.js.map +0 -1
- package/lib/cjs/ontologies/npm.d.ts +0 -6
- package/lib/cjs/ontologies/npm.js +0 -15
- package/lib/cjs/ontologies/npm.js.map +0 -1
- package/lib/cjs/ontologies/owl.d.ts +0 -14
- package/lib/cjs/ontologies/owl.js +0 -21
- package/lib/cjs/ontologies/owl.js.map +0 -1
- package/lib/cjs/ontologies/rdf.d.ts +0 -13
- package/lib/cjs/ontologies/rdf.js +0 -27
- package/lib/cjs/ontologies/rdf.js.map +0 -1
- package/lib/cjs/ontologies/rdfs.d.ts +0 -16
- package/lib/cjs/ontologies/rdfs.js +0 -33
- package/lib/cjs/ontologies/rdfs.js.map +0 -1
- package/lib/cjs/ontologies/shacl.d.ts +0 -103
- package/lib/cjs/ontologies/shacl.js +0 -152
- package/lib/cjs/ontologies/shacl.js.map +0 -1
- package/lib/cjs/ontologies/xsd.d.ts +0 -19
- package/lib/cjs/ontologies/xsd.js +0 -41
- package/lib/cjs/ontologies/xsd.js.map +0 -1
- package/lib/cjs/package.d.ts +0 -4
- package/lib/cjs/package.js +0 -6
- package/lib/cjs/package.js.map +0 -1
- package/lib/cjs/package.json +0 -9
- package/lib/cjs/paths/PropertyPathExpr.d.ts +0 -38
- package/lib/cjs/paths/PropertyPathExpr.js +0 -221
- package/lib/cjs/paths/PropertyPathExpr.js.map +0 -1
- package/lib/cjs/paths/normalizePropertyPath.d.ts +0 -23
- package/lib/cjs/paths/normalizePropertyPath.js +0 -75
- package/lib/cjs/paths/normalizePropertyPath.js.map +0 -1
- package/lib/cjs/paths/pathExprToSparql.d.ts +0 -14
- package/lib/cjs/paths/pathExprToSparql.js +0 -136
- package/lib/cjs/paths/pathExprToSparql.js.map +0 -1
- package/lib/cjs/queries/ContextRef.d.ts +0 -32
- package/lib/cjs/queries/ContextRef.js +0 -69
- package/lib/cjs/queries/ContextRef.js.map +0 -1
- package/lib/cjs/queries/CreateBuilder.d.ts +0 -59
- package/lib/cjs/queries/CreateBuilder.js +0 -138
- package/lib/cjs/queries/CreateBuilder.js.map +0 -1
- package/lib/cjs/queries/CreateQuery.d.ts +0 -20
- package/lib/cjs/queries/CreateQuery.js +0 -3
- package/lib/cjs/queries/CreateQuery.js.map +0 -1
- package/lib/cjs/queries/DeleteBuilder.d.ts +0 -56
- package/lib/cjs/queries/DeleteBuilder.js +0 -172
- package/lib/cjs/queries/DeleteBuilder.js.map +0 -1
- package/lib/cjs/queries/DeleteQuery.d.ts +0 -37
- package/lib/cjs/queries/DeleteQuery.js +0 -3
- package/lib/cjs/queries/DeleteQuery.js.map +0 -1
- package/lib/cjs/queries/DslJsonExpression.d.ts +0 -68
- package/lib/cjs/queries/DslJsonExpression.js +0 -427
- package/lib/cjs/queries/DslJsonExpression.js.map +0 -1
- package/lib/cjs/queries/FieldSet.d.ts +0 -310
- package/lib/cjs/queries/FieldSet.js +0 -802
- package/lib/cjs/queries/FieldSet.js.map +0 -1
- package/lib/cjs/queries/IRAliasScope.d.ts +0 -20
- package/lib/cjs/queries/IRAliasScope.js +0 -52
- package/lib/cjs/queries/IRAliasScope.js.map +0 -1
- package/lib/cjs/queries/IRCanonicalize.d.ts +0 -19
- package/lib/cjs/queries/IRCanonicalize.js +0 -19
- package/lib/cjs/queries/IRCanonicalize.js.map +0 -1
- package/lib/cjs/queries/IRDesugar.d.ts +0 -123
- package/lib/cjs/queries/IRDesugar.js +0 -261
- package/lib/cjs/queries/IRDesugar.js.map +0 -1
- package/lib/cjs/queries/IRLower.d.ts +0 -25
- package/lib/cjs/queries/IRLower.js +0 -398
- package/lib/cjs/queries/IRLower.js.map +0 -1
- package/lib/cjs/queries/IRMutation.d.ts +0 -53
- package/lib/cjs/queries/IRMutation.js +0 -130
- package/lib/cjs/queries/IRMutation.js.map +0 -1
- package/lib/cjs/queries/IRPipeline.d.ts +0 -8
- package/lib/cjs/queries/IRPipeline.js +0 -25
- package/lib/cjs/queries/IRPipeline.js.map +0 -1
- package/lib/cjs/queries/IRProjection.d.ts +0 -39
- package/lib/cjs/queries/IRProjection.js +0 -105
- package/lib/cjs/queries/IRProjection.js.map +0 -1
- package/lib/cjs/queries/IntermediateRepresentation.d.ts +0 -282
- package/lib/cjs/queries/IntermediateRepresentation.js +0 -3
- package/lib/cjs/queries/IntermediateRepresentation.js.map +0 -1
- package/lib/cjs/queries/MutationQuery.d.ts +0 -50
- package/lib/cjs/queries/MutationQuery.js +0 -334
- package/lib/cjs/queries/MutationQuery.js.map +0 -1
- package/lib/cjs/queries/MutationSerialization.d.ts +0 -102
- package/lib/cjs/queries/MutationSerialization.js +0 -207
- package/lib/cjs/queries/MutationSerialization.js.map +0 -1
- package/lib/cjs/queries/MutationThenable.d.ts +0 -18
- package/lib/cjs/queries/MutationThenable.js +0 -32
- package/lib/cjs/queries/MutationThenable.js.map +0 -1
- package/lib/cjs/queries/PropertyPath.d.ts +0 -38
- package/lib/cjs/queries/PropertyPath.js +0 -82
- package/lib/cjs/queries/PropertyPath.js.map +0 -1
- package/lib/cjs/queries/ProxiedPathBuilder.d.ts +0 -14
- package/lib/cjs/queries/ProxiedPathBuilder.js +0 -29
- package/lib/cjs/queries/ProxiedPathBuilder.js.map +0 -1
- package/lib/cjs/queries/QueryBuilder.d.ts +0 -193
- package/lib/cjs/queries/QueryBuilder.js +0 -519
- package/lib/cjs/queries/QueryBuilder.js.map +0 -1
- package/lib/cjs/queries/QueryBuilderSerialization.d.ts +0 -31
- package/lib/cjs/queries/QueryBuilderSerialization.js +0 -68
- package/lib/cjs/queries/QueryBuilderSerialization.js.map +0 -1
- package/lib/cjs/queries/QueryContext.d.ts +0 -50
- package/lib/cjs/queries/QueryContext.js +0 -147
- package/lib/cjs/queries/QueryContext.js.map +0 -1
- package/lib/cjs/queries/QueryFactory.d.ts +0 -80
- package/lib/cjs/queries/QueryFactory.js +0 -21
- package/lib/cjs/queries/QueryFactory.js.map +0 -1
- package/lib/cjs/queries/SelectQuery.d.ts +0 -302
- package/lib/cjs/queries/SelectQuery.js +0 -761
- package/lib/cjs/queries/SelectQuery.js.map +0 -1
- package/lib/cjs/queries/UpdateBuilder.d.ts +0 -69
- package/lib/cjs/queries/UpdateBuilder.js +0 -199
- package/lib/cjs/queries/UpdateBuilder.js.map +0 -1
- package/lib/cjs/queries/UpdateQuery.d.ts +0 -18
- package/lib/cjs/queries/UpdateQuery.js +0 -3
- package/lib/cjs/queries/UpdateQuery.js.map +0 -1
- package/lib/cjs/queries/fromJSON.d.ts +0 -16
- package/lib/cjs/queries/fromJSON.js +0 -41
- package/lib/cjs/queries/fromJSON.js.map +0 -1
- package/lib/cjs/queries/lower.d.ts +0 -28
- package/lib/cjs/queries/lower.js +0 -114
- package/lib/cjs/queries/lower.js.map +0 -1
- package/lib/cjs/queries/lowerMutationJSON.d.ts +0 -25
- package/lib/cjs/queries/lowerMutationJSON.js +0 -173
- package/lib/cjs/queries/lowerMutationJSON.js.map +0 -1
- package/lib/cjs/queries/mutationLowerSpec.d.ts +0 -32
- package/lib/cjs/queries/mutationLowerSpec.js +0 -8
- package/lib/cjs/queries/mutationLowerSpec.js.map +0 -1
- package/lib/cjs/queries/queryDispatch.d.ts +0 -33
- package/lib/cjs/queries/queryDispatch.js +0 -33
- package/lib/cjs/queries/queryDispatch.js.map +0 -1
- package/lib/cjs/queries/resolveShape.d.ts +0 -10
- package/lib/cjs/queries/resolveShape.js +0 -23
- package/lib/cjs/queries/resolveShape.js.map +0 -1
- package/lib/cjs/queries/wireVersion.d.ts +0 -7
- package/lib/cjs/queries/wireVersion.js +0 -25
- package/lib/cjs/queries/wireVersion.js.map +0 -1
- package/lib/cjs/shapes/List.d.ts +0 -35
- package/lib/cjs/shapes/List.js +0 -72
- package/lib/cjs/shapes/List.js.map +0 -1
- package/lib/cjs/shapes/PathNode.d.ts +0 -20
- package/lib/cjs/shapes/PathNode.js +0 -68
- package/lib/cjs/shapes/PathNode.js.map +0 -1
- package/lib/cjs/shapes/SHACL.d.ts +0 -300
- package/lib/cjs/shapes/SHACL.js +0 -612
- package/lib/cjs/shapes/SHACL.js.map +0 -1
- package/lib/cjs/shapes/Shape.d.ts +0 -74
- package/lib/cjs/shapes/Shape.js +0 -124
- package/lib/cjs/shapes/Shape.js.map +0 -1
- package/lib/cjs/shapes/serializePathToNodeData.d.ts +0 -24
- package/lib/cjs/shapes/serializePathToNodeData.js +0 -67
- package/lib/cjs/shapes/serializePathToNodeData.js.map +0 -1
- package/lib/cjs/shapes/syncShapes.d.ts +0 -38
- package/lib/cjs/shapes/syncShapes.js +0 -214
- package/lib/cjs/shapes/syncShapes.js.map +0 -1
- package/lib/cjs/sparql/SparqlAlgebra.d.ts +0 -190
- package/lib/cjs/sparql/SparqlAlgebra.js +0 -4
- package/lib/cjs/sparql/SparqlAlgebra.js.map +0 -1
- package/lib/cjs/sparql/SparqlDataset.d.ts +0 -60
- package/lib/cjs/sparql/SparqlDataset.js +0 -117
- package/lib/cjs/sparql/SparqlDataset.js.map +0 -1
- package/lib/cjs/sparql/algebraToString.d.ts +0 -13
- package/lib/cjs/sparql/algebraToString.js +0 -385
- package/lib/cjs/sparql/algebraToString.js.map +0 -1
- package/lib/cjs/sparql/index.d.ts +0 -9
- package/lib/cjs/sparql/index.js +0 -41
- package/lib/cjs/sparql/index.js.map +0 -1
- package/lib/cjs/sparql/irToAlgebra.d.ts +0 -79
- package/lib/cjs/sparql/irToAlgebra.js +0 -2042
- package/lib/cjs/sparql/irToAlgebra.js.map +0 -1
- package/lib/cjs/sparql/resultMapping.d.ts +0 -36
- package/lib/cjs/sparql/resultMapping.js +0 -563
- package/lib/cjs/sparql/resultMapping.js.map +0 -1
- package/lib/cjs/sparql/sparqlUtils.d.ts +0 -53
- package/lib/cjs/sparql/sparqlUtils.js +0 -154
- package/lib/cjs/sparql/sparqlUtils.js.map +0 -1
- package/lib/cjs/utils/LinkedErrorLogging.d.ts +0 -13
- package/lib/cjs/utils/LinkedErrorLogging.js +0 -22
- package/lib/cjs/utils/LinkedErrorLogging.js.map +0 -1
- package/lib/cjs/utils/LinkedFileStorage.d.ts +0 -23
- package/lib/cjs/utils/LinkedFileStorage.js +0 -62
- package/lib/cjs/utils/LinkedFileStorage.js.map +0 -1
- package/lib/cjs/utils/LinkedStorage.d.ts +0 -40
- package/lib/cjs/utils/LinkedStorage.js +0 -148
- package/lib/cjs/utils/LinkedStorage.js.map +0 -1
- package/lib/cjs/utils/NameSpace.d.ts +0 -2
- package/lib/cjs/utils/NameSpace.js +0 -8
- package/lib/cjs/utils/NameSpace.js.map +0 -1
- package/lib/cjs/utils/NodeReference.d.ts +0 -30
- package/lib/cjs/utils/NodeReference.js +0 -54
- package/lib/cjs/utils/NodeReference.js.map +0 -1
- package/lib/cjs/utils/Package.d.ts +0 -153
- package/lib/cjs/utils/Package.js +0 -419
- package/lib/cjs/utils/Package.js.map +0 -1
- package/lib/cjs/utils/Prefix.d.ts +0 -22
- package/lib/cjs/utils/Prefix.js +0 -104
- package/lib/cjs/utils/Prefix.js.map +0 -1
- package/lib/cjs/utils/ShapeClass.d.ts +0 -30
- package/lib/cjs/utils/ShapeClass.js +0 -180
- package/lib/cjs/utils/ShapeClass.js.map +0 -1
- package/lib/cjs/utils/URI.d.ts +0 -18
- package/lib/cjs/utils/URI.js +0 -42
- package/lib/cjs/utils/URI.js.map +0 -1
- package/lib/cjs/utils/cached.d.ts +0 -14
- package/lib/cjs/utils/cached.js +0 -71
- package/lib/cjs/utils/cached.js.map +0 -1
- package/lib/cjs/utils/loadStores.d.ts +0 -34
- package/lib/cjs/utils/loadStores.js +0 -105
- package/lib/cjs/utils/loadStores.js.map +0 -1
- package/lib/cjs/utils/parseDatasetsConfig.d.ts +0 -49
- package/lib/cjs/utils/parseDatasetsConfig.js +0 -110
- package/lib/cjs/utils/parseDatasetsConfig.js.map +0 -1
- package/lib/esm/package.json +0 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.13.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#149](https://github.com/linked-cm/core/pull/149) [`a875dc5`](https://github.com/linked-cm/core/commit/a875dc536bc0100063a865c31f8a9e3d87a38aa4) Thanks [@flyon](https://github.com/flyon)! - ESM-only — drops the CommonJS build (`type: module`, no `require` export condition, no `lib/cjs`); global-backed query dispatch shared across duplicate module copies; ESM-safe dir resolution; root `types` field fix.
|
|
8
|
+
|
|
3
9
|
## 2.12.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import { type RawSelectInput } from './IRDesugar.js';
|
|
2
2
|
import type { IRSelectQuery } from './IntermediateRepresentation.js';
|
|
3
|
+
type BuildSelectQuery = (query: RawSelectInput | IRSelectQuery) => IRSelectQuery;
|
|
4
|
+
/** The unhooked pipeline entry point — tests wrap this to observe input. */
|
|
5
|
+
export declare const buildSelectQueryImpl: BuildSelectQuery;
|
|
3
6
|
/**
|
|
4
7
|
* Runs the full select pipeline: desugar → canonicalize → lower.
|
|
5
8
|
* Accepts either a RawSelectInput (from a query factory) or an already-built
|
|
6
9
|
* IRSelectQuery (returned as-is).
|
|
7
10
|
*/
|
|
8
|
-
export declare const buildSelectQuery:
|
|
11
|
+
export declare const buildSelectQuery: BuildSelectQuery;
|
|
12
|
+
/** Test-only seam: override the pipeline entry point. Returns a restore fn. */
|
|
13
|
+
export declare const setBuildSelectQueryHook: (fn: BuildSelectQuery) => (() => void);
|
|
14
|
+
export {};
|
|
@@ -5,12 +5,8 @@ const isIRSelectQuery = (query) => !!query &&
|
|
|
5
5
|
typeof query === 'object' &&
|
|
6
6
|
'kind' in query &&
|
|
7
7
|
query.kind === 'select';
|
|
8
|
-
/**
|
|
9
|
-
|
|
10
|
-
* Accepts either a RawSelectInput (from a query factory) or an already-built
|
|
11
|
-
* IRSelectQuery (returned as-is).
|
|
12
|
-
*/
|
|
13
|
-
export const buildSelectQuery = (query) => {
|
|
8
|
+
/** The unhooked pipeline entry point — tests wrap this to observe input. */
|
|
9
|
+
export const buildSelectQueryImpl = (query) => {
|
|
14
10
|
if (isIRSelectQuery(query)) {
|
|
15
11
|
return query;
|
|
16
12
|
}
|
|
@@ -18,4 +14,22 @@ export const buildSelectQuery = (query) => {
|
|
|
18
14
|
const canonical = canonicalizeDesugaredSelectQuery(desugared);
|
|
19
15
|
return lowerSelectQuery(canonical);
|
|
20
16
|
};
|
|
17
|
+
// Indirection so the build step can be intercepted under ESM (where the module
|
|
18
|
+
// namespace is frozen and `jest.spyOn` can't reassign the export). Tests swap the
|
|
19
|
+
// hook via `setBuildSelectQueryHook`; production always uses `buildSelectQueryImpl`.
|
|
20
|
+
let buildSelectQueryHook = buildSelectQueryImpl;
|
|
21
|
+
/**
|
|
22
|
+
* Runs the full select pipeline: desugar → canonicalize → lower.
|
|
23
|
+
* Accepts either a RawSelectInput (from a query factory) or an already-built
|
|
24
|
+
* IRSelectQuery (returned as-is).
|
|
25
|
+
*/
|
|
26
|
+
export const buildSelectQuery = (query) => buildSelectQueryHook(query);
|
|
27
|
+
/** Test-only seam: override the pipeline entry point. Returns a restore fn. */
|
|
28
|
+
export const setBuildSelectQueryHook = (fn) => {
|
|
29
|
+
const previous = buildSelectQueryHook;
|
|
30
|
+
buildSelectQueryHook = fn;
|
|
31
|
+
return () => {
|
|
32
|
+
buildSelectQueryHook = previous;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
21
35
|
//# sourceMappingURL=IRPipeline.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IRPipeline.js","sourceRoot":"","sources":["../../../src/queries/IRPipeline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,kBAAkB,EAAsB,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAC,gCAAgC,EAAC,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAC,gBAAgB,EAAC,MAAM,cAA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5E,MAAM,QAAQ,GAAG,oBAAoB,CAAC;IACtC,oBAAoB,GAAG,EAAE,CAAC;IAC1B,OAAO,GAAG,EAAE;QACV,oBAAoB,GAAG,QAAQ,CAAC;IAClC,CAAC,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,8 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
// Global-backed so it is SHARED across duplicate copies of this module. In dev,
|
|
2
|
+
// `@_linked/core` can be evaluated twice (Vite/`src` + Node/`lib` — an accepted
|
|
3
|
+
// 2-instance state, see report-011). The module REGISTRY already lives on the
|
|
4
|
+
// shared global; the query dispatch must too, or `setDefaultDataset()` on one
|
|
5
|
+
// copy is invisible to queries on the other ("No query dispatch configured").
|
|
6
|
+
// Whichever copy runs the storage config sets it; every copy reads it.
|
|
7
|
+
const dispatchGlobal = typeof globalThis !== 'undefined' ? globalThis : {};
|
|
8
|
+
if (!('__linkedQueryDispatch' in dispatchGlobal)) {
|
|
9
|
+
dispatchGlobal.__linkedQueryDispatch = { current: null };
|
|
10
|
+
}
|
|
2
11
|
export function setQueryDispatch(d) {
|
|
3
|
-
|
|
12
|
+
dispatchGlobal.__linkedQueryDispatch.current = d;
|
|
4
13
|
}
|
|
5
14
|
export function getQueryDispatch() {
|
|
15
|
+
const dispatch = dispatchGlobal.__linkedQueryDispatch.current;
|
|
6
16
|
if (!dispatch) {
|
|
7
17
|
throw new Error('No query dispatch configured. Call LinkedStorage.setDefaultDataset() first.');
|
|
8
18
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queryDispatch.js","sourceRoot":"","sources":["../../../src/queries/queryDispatch.ts"],"names":[],"mappings":"AAqBA,IAAI,
|
|
1
|
+
{"version":3,"file":"queryDispatch.js","sourceRoot":"","sources":["../../../src/queries/queryDispatch.ts"],"names":[],"mappings":"AAqBA,gFAAgF;AAChF,gFAAgF;AAChF,8EAA8E;AAC9E,8EAA8E;AAC9E,8EAA8E;AAC9E,uEAAuE;AACvE,MAAM,cAAc,GAClB,OAAO,UAAU,KAAK,WAAW,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAE,EAAU,CAAC;AAC/D,IAAI,CAAC,CAAC,uBAAuB,IAAI,cAAc,CAAC,EAAE,CAAC;IACjD,cAAc,CAAC,qBAAqB,GAAG,EAAC,OAAO,EAAE,IAA4B,EAAC,CAAC;AACjF,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,CAAgB;IAC/C,cAAc,CAAC,qBAAqB,CAAC,OAAO,GAAG,CAAC,CAAC;AACnD,CAAC;AAED,MAAM,UAAU,gBAAgB;IAC9B,MAAM,QAAQ,GAAG,cAAc,CAAC,qBAAqB,CAAC,OAA+B,CAAC;IACtF,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CACb,6EAA6E,CAC9E,CAAC;IACJ,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAKD;;;;;;;;GAQG;AACH,MAAM,UAAU,uBAAuB,CACrC,IAAkB,EAClB,MAAiB;IAEjB,IAAI,CAAC,MAAM;QAAE,OAAO,gBAAgB,EAAE,CAAC;IACvC,IAAI,OAAO,MAAM,CAAC,GAAG,IAAI,OAAO,CAAC,KAAK,UAAU,EAAE,CAAC;QACjD,MAAM,IAAI,KAAK,CAAC,uCAAuC,IAAI,WAAW,CAAC,CAAC;IAC1E,CAAC;IACD,OAAO,MAAkC,CAAC;AAC5C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@_linked/core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.13.0-next.20260706164859",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"linkedPackage": true,
|
|
6
|
+
"type": "module",
|
|
6
7
|
"description": "Linked.js core query and SHACL shape DSL (copy-then-prune baseline)",
|
|
7
8
|
"repository": {
|
|
8
9
|
"type": "git",
|
|
9
10
|
"url": "git+https://github.com/linked-cm/core.git"
|
|
10
11
|
},
|
|
11
|
-
"main": "lib/
|
|
12
|
+
"main": "lib/esm/index.js",
|
|
12
13
|
"module": "lib/esm/index.js",
|
|
13
14
|
"sideEffects": [
|
|
14
15
|
"**/ontologies/*.js",
|
|
@@ -20,20 +21,17 @@
|
|
|
20
21
|
".": {
|
|
21
22
|
"types": "./lib/esm/index.d.ts",
|
|
22
23
|
"development": "./src/index.ts",
|
|
23
|
-
"import": "./lib/esm/index.js"
|
|
24
|
-
"require": "./lib/cjs/index.js"
|
|
24
|
+
"import": "./lib/esm/index.js"
|
|
25
25
|
},
|
|
26
26
|
"./sparql": {
|
|
27
27
|
"types": "./lib/esm/sparql/index.d.ts",
|
|
28
28
|
"development": "./src/sparql/index.ts",
|
|
29
|
-
"import": "./lib/esm/sparql/index.js"
|
|
30
|
-
"require": "./lib/cjs/sparql/index.js"
|
|
29
|
+
"import": "./lib/esm/sparql/index.js"
|
|
31
30
|
},
|
|
32
31
|
"./*": {
|
|
33
32
|
"types": "./lib/esm/*.d.ts",
|
|
34
33
|
"development": "./src/*.ts",
|
|
35
|
-
"import": "./lib/esm/*.js"
|
|
36
|
-
"require": "./lib/cjs/*.js"
|
|
34
|
+
"import": "./lib/esm/*.js"
|
|
37
35
|
}
|
|
38
36
|
},
|
|
39
37
|
"publishConfig": {
|
|
@@ -47,14 +45,13 @@
|
|
|
47
45
|
"LICENSE"
|
|
48
46
|
],
|
|
49
47
|
"scripts": {
|
|
50
|
-
"build": "npx rimraf ./lib && npx tsc -p tsconfig-
|
|
51
|
-
"compile": "echo '💫 Compiling
|
|
52
|
-
"dual-package": "node ./scripts/dual-package.js",
|
|
48
|
+
"build": "npx rimraf ./lib && npx tsc -p tsconfig-esm.json",
|
|
49
|
+
"compile": "echo '💫 Compiling ESM' && npx tsc -p tsconfig-esm.json",
|
|
53
50
|
"sync:agents": "node packages/skills/sync.mjs",
|
|
54
51
|
"setup": "npx semantu-agents",
|
|
55
52
|
"typecheck": "npx tsc -p tsconfig-tests.json",
|
|
56
|
-
"test": "npx jest --config jest.config.
|
|
57
|
-
"test:fuseki": "docker compose -f src/tests/docker-compose.test.yml up -d --wait && npx jest --config jest.config.
|
|
53
|
+
"test": "NODE_OPTIONS=--experimental-vm-modules npx jest --config jest.config.cjs --runInBand && npm run typecheck",
|
|
54
|
+
"test:fuseki": "docker compose -f src/tests/docker-compose.test.yml up -d --wait && NODE_OPTIONS=--experimental-vm-modules npx jest --config jest.config.cjs --testPathPattern='sparql-fuseki' --verbose; EXIT=$?; docker compose -f src/tests/docker-compose.test.yml down; exit $EXIT"
|
|
58
55
|
},
|
|
59
56
|
"devDependencies": {
|
|
60
57
|
"@changesets/changelog-github": "^0.5.2",
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import type { ICoreIterable } from '../interfaces/ICoreIterable.js';
|
|
2
|
-
export declare class CoreSet<R> extends Set<R> implements ICoreIterable<R> {
|
|
3
|
-
createNew(...args: any[]): this;
|
|
4
|
-
filter(fn: (value: R, index: any, thisInstance: any) => any): this;
|
|
5
|
-
reduce<U>(fn: (previousValue: U, currentValue: R, currentIndex: number, thisInstance: any) => U, initialValue: U): U;
|
|
6
|
-
/**
|
|
7
|
-
* Returns the value of the first element in the Set where predicate is true, and undefined
|
|
8
|
-
* otherwise.
|
|
9
|
-
*/
|
|
10
|
-
find(predicate: (value: R, index: R, obj: CoreSet<R>) => boolean, thisArg?: any): R | undefined;
|
|
11
|
-
first(): R | undefined;
|
|
12
|
-
/**
|
|
13
|
-
* Returns the last element added to the set
|
|
14
|
-
*/
|
|
15
|
-
last(): R;
|
|
16
|
-
getFirst(n: number): this;
|
|
17
|
-
slice(start?: number, end?: number): this;
|
|
18
|
-
sort(compareFn?: (a: R, b: R) => number, thisArg?: any): this;
|
|
19
|
-
/**
|
|
20
|
-
* Determines whether all the members of an array satisfy the specified test.
|
|
21
|
-
* @param callbackfn A function that accepts up to three arguments. The every method calls the callbackfn function for each element in array1 until the callbackfn returns false, or until the end of the array.
|
|
22
|
-
* @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
|
|
23
|
-
*/
|
|
24
|
-
every(callbackfn: (item: R, set: CoreSet<R>) => boolean, thisArg?: any): boolean;
|
|
25
|
-
/**
|
|
26
|
-
* Determines whether the specified callback function returns true for any element of an array.
|
|
27
|
-
* @param callbackfn A function that accepts up to three arguments. The some method calls the callbackfn function for each element in array1 until the callbackfn returns true, or until the end of the array.
|
|
28
|
-
* @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
|
|
29
|
-
*/
|
|
30
|
-
some(callbackfn: (item: R, set: CoreSet<R>) => boolean, thisArg?: any): boolean;
|
|
31
|
-
/**
|
|
32
|
-
* Calls a defined callback function on each element of the set, and returns an ARRAY that contains the results.
|
|
33
|
-
* Note that this method returns an array so that sets can be more easily used with for example JSX
|
|
34
|
-
* @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.
|
|
35
|
-
* @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
|
|
36
|
-
*/
|
|
37
|
-
map<U>(callbackfn: (item: R, set: CoreSet<R>) => U, thisArg?: any): U[];
|
|
38
|
-
concat(...sets: ICoreIterable<R>[]): this;
|
|
39
|
-
clone(): this;
|
|
40
|
-
reverse(): this;
|
|
41
|
-
print(): void;
|
|
42
|
-
/**
|
|
43
|
-
* Similar to concat, but adds all items to THIS set instead of creating a new one
|
|
44
|
-
* @param sets
|
|
45
|
-
*/
|
|
46
|
-
addFrom(...sets: ICoreIterable<R>[]): this;
|
|
47
|
-
}
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CoreSet = void 0;
|
|
4
|
-
class CoreSet extends Set {
|
|
5
|
-
createNew(...args) {
|
|
6
|
-
return new this.constructor(...args);
|
|
7
|
-
}
|
|
8
|
-
filter(fn) {
|
|
9
|
-
var res = this.createNew();
|
|
10
|
-
for (var item of this) {
|
|
11
|
-
if (fn(item, item, this)) {
|
|
12
|
-
res.add(item);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
return res;
|
|
16
|
-
}
|
|
17
|
-
reduce(fn, initialValue) {
|
|
18
|
-
let i = 0;
|
|
19
|
-
let res = initialValue;
|
|
20
|
-
for (let item of this) {
|
|
21
|
-
res = fn(res, item, i++, this);
|
|
22
|
-
}
|
|
23
|
-
return res;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Returns the value of the first element in the Set where predicate is true, and undefined
|
|
27
|
-
* otherwise.
|
|
28
|
-
*/
|
|
29
|
-
find(predicate, thisArg) {
|
|
30
|
-
for (let item of this) {
|
|
31
|
-
if (predicate.apply(thisArg, [item, item, this])) {
|
|
32
|
-
return item;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
return undefined;
|
|
36
|
-
}
|
|
37
|
-
first() {
|
|
38
|
-
return this.values().next().value;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Returns the last element added to the set
|
|
42
|
-
*/
|
|
43
|
-
last() {
|
|
44
|
-
//unfortunately there is no efficient way to do this. Either we convert the set to an array or we loop over all values to discover the last
|
|
45
|
-
let item;
|
|
46
|
-
for (item of this)
|
|
47
|
-
;
|
|
48
|
-
return item;
|
|
49
|
-
}
|
|
50
|
-
getFirst(n) {
|
|
51
|
-
return this.createNew([...this].slice(0, n));
|
|
52
|
-
}
|
|
53
|
-
slice(start, end) {
|
|
54
|
-
return this.createNew([...this].slice(start, end));
|
|
55
|
-
}
|
|
56
|
-
sort(compareFn, thisArg) {
|
|
57
|
-
//convert this set to an array, sort it with provided parameters, create a new set of the same type and provide the sorted array as content
|
|
58
|
-
var sortedArray = thisArg
|
|
59
|
-
? [...this].sort.apply(thisArg, [compareFn])
|
|
60
|
-
: [...this].sort(compareFn);
|
|
61
|
-
return this.createNew(sortedArray);
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Determines whether all the members of an array satisfy the specified test.
|
|
65
|
-
* @param callbackfn A function that accepts up to three arguments. The every method calls the callbackfn function for each element in array1 until the callbackfn returns false, or until the end of the array.
|
|
66
|
-
* @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
|
|
67
|
-
*/
|
|
68
|
-
every(callbackfn, thisArg) {
|
|
69
|
-
for (let item of this) {
|
|
70
|
-
if (!callbackfn.apply(thisArg, [item, this])) {
|
|
71
|
-
return false;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
return true;
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Determines whether the specified callback function returns true for any element of an array.
|
|
78
|
-
* @param callbackfn A function that accepts up to three arguments. The some method calls the callbackfn function for each element in array1 until the callbackfn returns true, or until the end of the array.
|
|
79
|
-
* @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
|
|
80
|
-
*/
|
|
81
|
-
some(callbackfn, thisArg) {
|
|
82
|
-
for (let item of this) {
|
|
83
|
-
if (callbackfn.apply(thisArg, [item, this])) {
|
|
84
|
-
return true;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
return false;
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* Calls a defined callback function on each element of the set, and returns an ARRAY that contains the results.
|
|
91
|
-
* Note that this method returns an array so that sets can be more easily used with for example JSX
|
|
92
|
-
* @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.
|
|
93
|
-
* @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
|
|
94
|
-
*/
|
|
95
|
-
map(callbackfn, thisArg) {
|
|
96
|
-
//NOTE: we changed this method so that it returns an array because it
|
|
97
|
-
// causes trouble in ES5 when we create a new CoreSet and try to add the mapped results which may not have a unique toString() implementation (like in React)
|
|
98
|
-
//create the result map, whos values will be 'mapped' into new values from the current values of this map
|
|
99
|
-
var mapped = [];
|
|
100
|
-
for (let item of this) {
|
|
101
|
-
//do the mapping
|
|
102
|
-
mapped.push(callbackfn.apply(thisArg, [item, this]));
|
|
103
|
-
}
|
|
104
|
-
return mapped;
|
|
105
|
-
}
|
|
106
|
-
concat(...sets) {
|
|
107
|
-
var res = this.createNew(this);
|
|
108
|
-
for (var set of sets) {
|
|
109
|
-
set.forEach(res.add.bind(res));
|
|
110
|
-
}
|
|
111
|
-
return res;
|
|
112
|
-
}
|
|
113
|
-
clone() {
|
|
114
|
-
return this.createNew(this);
|
|
115
|
-
}
|
|
116
|
-
reverse() {
|
|
117
|
-
return this.createNew([...this].reverse());
|
|
118
|
-
}
|
|
119
|
-
print() {
|
|
120
|
-
console.log(this.toString());
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* Similar to concat, but adds all items to THIS set instead of creating a new one
|
|
124
|
-
* @param sets
|
|
125
|
-
*/
|
|
126
|
-
addFrom(...sets) {
|
|
127
|
-
for (var set of sets) {
|
|
128
|
-
if (set) {
|
|
129
|
-
set.forEach(this.add.bind(this));
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
return this;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
exports.CoreSet = CoreSet;
|
|
136
|
-
//# sourceMappingURL=CoreSet.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CoreSet.js","sourceRoot":"","sources":["../../../src/collections/CoreSet.ts"],"names":[],"mappings":";;;AAOA,MAAa,OAAW,SAAQ,GAAM;IACpC,SAAS,CAAC,GAAG,IAAI;QACf,OAAO,IAAU,IAAI,CAAC,WAAY,CAAC,GAAG,IAAI,CAAS,CAAC;IACtD,CAAC;IAED,MAAM,CAAC,EAAoD;QACzD,IAAI,GAAG,GAAS,IAAI,CAAC,SAAS,EAAE,CAAC;QACjC,KAAK,IAAI,IAAI,IAAI,IAAI,EAAE,CAAC;YACtB,IAAI,EAAE,CAAC,IA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AC,CAAC,CAAC;QACvD,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,MAAM,CAAC,GAAG,IAAwB;QAChC,IAAI,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QAC/B,KAAK,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;YACrB,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;QACjC,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC;IAED,KAAK;QACH,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC;IAED,OAAO;QACL,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;IAC7C,CAAC;IAED,KAAK;QACH,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC/B,CAAC;IAED;;;OAGG;IACH,OAAO,CAAC,GAAG,IAAwB;QACjC,KAAK,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;YACrB,IAAI,GAAG,EAAE,CAAC;gBACR,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;YACnC,CAAC;QACH,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAnKD,0BAmKC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ShapeSet = void 0;
|
|
4
|
-
/*
|
|
5
|
-
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
6
|
-
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
7
|
-
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
8
|
-
*/
|
|
9
|
-
const CoreSet_js_1 = require("./CoreSet.js");
|
|
10
|
-
const ShapeClass_js_1 = require("../utils/ShapeClass.js");
|
|
11
|
-
class ShapeSet extends CoreSet_js_1.CoreSet {
|
|
12
|
-
constructor(iterable) {
|
|
13
|
-
super(iterable);
|
|
14
|
-
}
|
|
15
|
-
getLeastSpecificShape() {
|
|
16
|
-
return (0, ShapeClass_js_1.getLeastSpecificShapeClasses)(this).shift();
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
exports.ShapeSet = ShapeSet;
|
|
20
|
-
//# sourceMappingURL=ShapeSet.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ShapeSet.js","sourceRoot":"","sources":["../../../src/collections/ShapeSet.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,6CAAqC;AAErC,0DAAoE;AAEpE,MAAa,QAAkC,SAAQ,oBAAU;IAC/D,YAAY,QAAsB;QAChC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAClB,CAAC;IAED,qBAAqB;QACnB,OAAO,IAAA,4CAA4B,EAAC,IAAI,CAAC,CAAC,KAAK,EAAE,CAAC;IACpD,CAAC;CACF;AARD,4BAQC"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { ExpressionNode } from './ExpressionNode.js';
|
|
2
|
-
import type { ExpressionInput } from './ExpressionNode.js';
|
|
3
|
-
/**
|
|
4
|
-
* `Expr` — static builders for expressions that have **no natural fluent host**.
|
|
5
|
-
*
|
|
6
|
-
* The fluent form (`p.age.plus(1)`, `p.name.matches(/^A/)`) is the one true way to
|
|
7
|
-
* build a *property-first* expression; every arithmetic/comparison/string/date/hash
|
|
8
|
-
* operation lives there. `Expr` deliberately does **not** mirror them — that
|
|
9
|
-
* duplication is what drifted (two names for one op). `Expr` carries only the
|
|
10
|
-
* operations that can't start from a property proxy:
|
|
11
|
-
*
|
|
12
|
-
* - `now()` — nullary; there is nothing to chain off.
|
|
13
|
-
* - `ifThen(c,t,e)`— ternary conditional; the condition is not a natural receiver.
|
|
14
|
-
* - `firstDefined(…)` — variadic COALESCE; no natural first operand.
|
|
15
|
-
* - `concat(…)` — variadic; also reads best literal-first (`Expr.concat('Hi ', p.name)`).
|
|
16
|
-
* - `not(x)` — prefix negation; `Expr.not(cond)` reads better than `cond.not()`.
|
|
17
|
-
*/
|
|
18
|
-
export declare const Expr: {
|
|
19
|
-
/** SPARQL `NOW()` — the current dateTime. */
|
|
20
|
-
readonly now: () => ExpressionNode;
|
|
21
|
-
/** SPARQL `CONCAT(...)` — string concatenation of two or more parts. */
|
|
22
|
-
readonly concat: (...parts: ExpressionInput[]) => ExpressionNode;
|
|
23
|
-
/** SPARQL `COALESCE(...)` — the first bound/defined value among two or more. */
|
|
24
|
-
readonly firstDefined: (...args: ExpressionInput[]) => ExpressionNode;
|
|
25
|
-
/** SPARQL `IF(cond, then, else)`. */
|
|
26
|
-
readonly ifThen: (cond: ExpressionInput, thenVal: ExpressionInput, elseVal: ExpressionInput) => ExpressionNode;
|
|
27
|
-
/** Prefix logical negation — `Expr.not(p.name.equals('Alice'))`. */
|
|
28
|
-
readonly not: (a: ExpressionInput) => ExpressionNode;
|
|
29
|
-
};
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Expr = void 0;
|
|
4
|
-
const ExpressionNode_js_1 = require("./ExpressionNode.js");
|
|
5
|
-
function wrap(input) {
|
|
6
|
-
return input instanceof ExpressionNode_js_1.ExpressionNode
|
|
7
|
-
? input
|
|
8
|
-
: new ExpressionNode_js_1.ExpressionNode((0, ExpressionNode_js_1.toIRExpression)(input));
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Merge the unresolved property-ref maps of all ExpressionNode inputs, so
|
|
12
|
-
* proxy-traced references (e.g. `p.name`) inside a directly-constructed
|
|
13
|
-
* function expression still resolve to real aliases during lowering.
|
|
14
|
-
*/
|
|
15
|
-
function mergedRefs(inputs) {
|
|
16
|
-
const merged = new Map();
|
|
17
|
-
for (const input of inputs) {
|
|
18
|
-
if (input instanceof ExpressionNode_js_1.ExpressionNode) {
|
|
19
|
-
for (const [k, v] of input._refs)
|
|
20
|
-
merged.set(k, v);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
return merged;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* `Expr` — static builders for expressions that have **no natural fluent host**.
|
|
27
|
-
*
|
|
28
|
-
* The fluent form (`p.age.plus(1)`, `p.name.matches(/^A/)`) is the one true way to
|
|
29
|
-
* build a *property-first* expression; every arithmetic/comparison/string/date/hash
|
|
30
|
-
* operation lives there. `Expr` deliberately does **not** mirror them — that
|
|
31
|
-
* duplication is what drifted (two names for one op). `Expr` carries only the
|
|
32
|
-
* operations that can't start from a property proxy:
|
|
33
|
-
*
|
|
34
|
-
* - `now()` — nullary; there is nothing to chain off.
|
|
35
|
-
* - `ifThen(c,t,e)`— ternary conditional; the condition is not a natural receiver.
|
|
36
|
-
* - `firstDefined(…)` — variadic COALESCE; no natural first operand.
|
|
37
|
-
* - `concat(…)` — variadic; also reads best literal-first (`Expr.concat('Hi ', p.name)`).
|
|
38
|
-
* - `not(x)` — prefix negation; `Expr.not(cond)` reads better than `cond.not()`.
|
|
39
|
-
*/
|
|
40
|
-
exports.Expr = {
|
|
41
|
-
/** SPARQL `NOW()` — the current dateTime. */
|
|
42
|
-
now() {
|
|
43
|
-
return new ExpressionNode_js_1.ExpressionNode({ kind: 'function_expr', name: 'NOW', args: [] });
|
|
44
|
-
},
|
|
45
|
-
/** SPARQL `CONCAT(...)` — string concatenation of two or more parts. */
|
|
46
|
-
concat(...parts) {
|
|
47
|
-
if (parts.length < 2) {
|
|
48
|
-
throw new Error('Expr.concat() requires at least 2 arguments');
|
|
49
|
-
}
|
|
50
|
-
return new ExpressionNode_js_1.ExpressionNode({
|
|
51
|
-
kind: 'function_expr',
|
|
52
|
-
name: 'CONCAT',
|
|
53
|
-
args: parts.map(ExpressionNode_js_1.toIRExpression),
|
|
54
|
-
}, mergedRefs(parts));
|
|
55
|
-
},
|
|
56
|
-
/** SPARQL `COALESCE(...)` — the first bound/defined value among two or more. */
|
|
57
|
-
firstDefined(...args) {
|
|
58
|
-
if (args.length < 2) {
|
|
59
|
-
throw new Error('Expr.firstDefined() requires at least 2 arguments');
|
|
60
|
-
}
|
|
61
|
-
return new ExpressionNode_js_1.ExpressionNode({
|
|
62
|
-
kind: 'function_expr',
|
|
63
|
-
name: 'COALESCE',
|
|
64
|
-
args: args.map(ExpressionNode_js_1.toIRExpression),
|
|
65
|
-
}, mergedRefs(args));
|
|
66
|
-
},
|
|
67
|
-
/** SPARQL `IF(cond, then, else)`. */
|
|
68
|
-
ifThen(cond, thenVal, elseVal) {
|
|
69
|
-
return new ExpressionNode_js_1.ExpressionNode({
|
|
70
|
-
kind: 'function_expr',
|
|
71
|
-
name: 'IF',
|
|
72
|
-
args: [(0, ExpressionNode_js_1.toIRExpression)(cond), (0, ExpressionNode_js_1.toIRExpression)(thenVal), (0, ExpressionNode_js_1.toIRExpression)(elseVal)],
|
|
73
|
-
}, mergedRefs([cond, thenVal, elseVal]));
|
|
74
|
-
},
|
|
75
|
-
/** Prefix logical negation — `Expr.not(p.name.equals('Alice'))`. */
|
|
76
|
-
not(a) {
|
|
77
|
-
return wrap(a).not();
|
|
78
|
-
},
|
|
79
|
-
};
|
|
80
|
-
//# sourceMappingURL=Expr.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Expr.js","sourceRoot":"","sources":["../../../src/expressions/Expr.ts"],"names":[],"mappings":";;;AAAA,2DAAmE;AAGnE,SAAS,IAAI,CAAC,KAAsB;IAClC,OAAO,KAAK,YAAY,kCAAc;QACpC,CAAC,CAAC,KAAK;QACP,CAAC,CAAC,IAAI,kCAAc,CAAC,IAAA,kCAAc,EAAC,KAAK,CAAC,CAAC,CAAC;AAChD,CAAC;AAED;;;;GAIG;AACH,SAAS,UAAU,CAAC,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,CACjB,CAAC;IACJ,CAAC;IAED,qCAAqC;IACrC,MAAM,CACJ,IAAqB,EACrB,OAAwB,EACxB,OAAwB;QAExB,OAAO,IAAI,kCAAc,CACvB;YACE,IAAI,EAAE,eAAe;YACrB,IAAI,EAAE,IAAI;YACV,IAAI,EAAE,CAAC,IAAA,kCAAc,EAAC,IAAI,CAAC,EAAE,IAAA,kCAAc,EAAC,OAAO,CAAC,EAAE,IAAA,kCAAc,EAAC,OAAO,CAAC,CAAC;SAC/E,EACD,UAAU,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CACrC,CAAC;IACJ,CAAC;IAED,oEAAoE;IACpE,GAAG,CAAC,CAAkB;QACpB,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;IACvB,CAAC;CACO,CAAC"}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { type ExpressionInput, ExpressionNode } from './ExpressionNode.js';
|
|
2
|
-
import { Shape } from '../shapes/Shape.js';
|
|
3
|
-
import { ShapeSet } from '../collections/ShapeSet.js';
|
|
4
|
-
export interface BaseExpressionMethods {
|
|
5
|
-
eq(v: ExpressionInput): ExpressionNode;
|
|
6
|
-
equals(v: ExpressionInput): ExpressionNode;
|
|
7
|
-
neq(v: ExpressionInput): ExpressionNode;
|
|
8
|
-
notEquals(v: ExpressionInput): ExpressionNode;
|
|
9
|
-
/** Membership: this value is one of `values` (SPARQL `IN`). */
|
|
10
|
-
oneOf(values: ExpressionInput[]): ExpressionNode;
|
|
11
|
-
/** Membership: this value is not one of `values` (SPARQL `NOT IN`). */
|
|
12
|
-
notOneOf(values: ExpressionInput[]): ExpressionNode;
|
|
13
|
-
isDefined(): ExpressionNode;
|
|
14
|
-
isNotDefined(): ExpressionNode;
|
|
15
|
-
defaultTo(fallback: ExpressionInput): ExpressionNode;
|
|
16
|
-
str(): ExpressionNode;
|
|
17
|
-
}
|
|
18
|
-
export interface NumericExpressionMethods extends BaseExpressionMethods {
|
|
19
|
-
plus(n: ExpressionInput): ExpressionNode;
|
|
20
|
-
minus(n: ExpressionInput): ExpressionNode;
|
|
21
|
-
times(n: ExpressionInput): ExpressionNode;
|
|
22
|
-
divide(n: ExpressionInput): ExpressionNode;
|
|
23
|
-
abs(): ExpressionNode;
|
|
24
|
-
round(): ExpressionNode;
|
|
25
|
-
ceil(): ExpressionNode;
|
|
26
|
-
floor(): ExpressionNode;
|
|
27
|
-
power(n: number): ExpressionNode;
|
|
28
|
-
gt(v: ExpressionInput): ExpressionNode;
|
|
29
|
-
greaterThan(v: ExpressionInput): ExpressionNode;
|
|
30
|
-
gte(v: ExpressionInput): ExpressionNode;
|
|
31
|
-
greaterThanOrEqual(v: ExpressionInput): ExpressionNode;
|
|
32
|
-
lt(v: ExpressionInput): ExpressionNode;
|
|
33
|
-
lessThan(v: ExpressionInput): ExpressionNode;
|
|
34
|
-
lte(v: ExpressionInput): ExpressionNode;
|
|
35
|
-
lessThanOrEqual(v: ExpressionInput): ExpressionNode;
|
|
36
|
-
}
|
|
37
|
-
export interface StringExpressionMethods extends BaseExpressionMethods {
|
|
38
|
-
concat(...parts: ExpressionInput[]): ExpressionNode;
|
|
39
|
-
contains(s: ExpressionInput): ExpressionNode;
|
|
40
|
-
startsWith(s: ExpressionInput): ExpressionNode;
|
|
41
|
-
endsWith(s: ExpressionInput): ExpressionNode;
|
|
42
|
-
substr(start: number, len?: number): ExpressionNode;
|
|
43
|
-
before(s: ExpressionInput): ExpressionNode;
|
|
44
|
-
after(s: ExpressionInput): ExpressionNode;
|
|
45
|
-
replace(pat: string, rep: string, flags?: string): ExpressionNode;
|
|
46
|
-
ucase(): ExpressionNode;
|
|
47
|
-
lcase(): ExpressionNode;
|
|
48
|
-
strlen(): ExpressionNode;
|
|
49
|
-
encodeForUri(): ExpressionNode;
|
|
50
|
-
matches(pat: string, flags?: string): ExpressionNode;
|
|
51
|
-
gt(v: ExpressionInput): ExpressionNode;
|
|
52
|
-
lt(v: ExpressionInput): ExpressionNode;
|
|
53
|
-
gte(v: ExpressionInput): ExpressionNode;
|
|
54
|
-
lte(v: ExpressionInput): ExpressionNode;
|
|
55
|
-
}
|
|
56
|
-
export interface DateExpressionMethods extends BaseExpressionMethods {
|
|
57
|
-
year(): ExpressionNode;
|
|
58
|
-
month(): ExpressionNode;
|
|
59
|
-
day(): ExpressionNode;
|
|
60
|
-
hours(): ExpressionNode;
|
|
61
|
-
minutes(): ExpressionNode;
|
|
62
|
-
seconds(): ExpressionNode;
|
|
63
|
-
timezone(): ExpressionNode;
|
|
64
|
-
tz(): ExpressionNode;
|
|
65
|
-
gt(v: ExpressionInput): ExpressionNode;
|
|
66
|
-
lt(v: ExpressionInput): ExpressionNode;
|
|
67
|
-
gte(v: ExpressionInput): ExpressionNode;
|
|
68
|
-
lte(v: ExpressionInput): ExpressionNode;
|
|
69
|
-
}
|
|
70
|
-
export interface BooleanExpressionMethods extends BaseExpressionMethods {
|
|
71
|
-
and(expr: ExpressionInput): ExpressionNode;
|
|
72
|
-
or(expr: ExpressionInput): ExpressionNode;
|
|
73
|
-
not(): ExpressionNode;
|
|
74
|
-
}
|
|
75
|
-
type DataKeys<S> = {
|
|
76
|
-
[K in keyof S]: K extends 'node' | 'nodeShape' | 'namedNode' | 'targetClass' | 'toString' | 'id' | 'uri' | '__queryContextId' ? never : S[K] extends (...args: any[]) => any ? never : K;
|
|
77
|
-
}[keyof S];
|
|
78
|
-
type ToExpressionProxy<T> = T extends number ? number & NumericExpressionMethods : T extends string ? string & StringExpressionMethods : T extends Date ? Date & DateExpressionMethods : T extends boolean ? boolean & BooleanExpressionMethods : T extends Shape ? ExpressionUpdateProxy<T> : T;
|
|
79
|
-
export type ExpressionUpdateProxy<S> = {
|
|
80
|
-
readonly [P in DataKeys<S>]: S[P] extends ShapeSet<any> ? never : ToExpressionProxy<S[P]>;
|
|
81
|
-
};
|
|
82
|
-
export type ExpressionUpdateResult<S> = {
|
|
83
|
-
[P in DataKeys<S>]?: S[P] extends Shape ? never : S[P] extends ShapeSet<any> ? never : S[P] | ExpressionNode;
|
|
84
|
-
};
|
|
85
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ExpressionMethods.js","sourceRoot":"","sources":["../../../src/expressions/ExpressionMethods.ts"],"names":[],"mappings":""}
|