@_linked/core 2.11.1 → 2.12.0-next.20260706124103
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 +39 -0
- package/README.md +3 -3
- package/lib/cjs/expressions/Expr.d.ts +22 -51
- package/lib/cjs/expressions/Expr.js +24 -176
- package/lib/cjs/expressions/Expr.js.map +1 -1
- package/lib/cjs/expressions/ExpressionMethods.d.ts +4 -0
- package/lib/cjs/expressions/ExpressionNode.d.ts +4 -0
- package/lib/cjs/expressions/ExpressionNode.js +13 -0
- package/lib/cjs/expressions/ExpressionNode.js.map +1 -1
- package/lib/cjs/index.d.ts +2 -2
- package/lib/cjs/index.js +6 -138
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/interfaces/ICoreIterable.d.ts +1 -1
- package/lib/cjs/package.d.ts +2 -2
- package/lib/cjs/queries/ContextRef.d.ts +15 -4
- package/lib/cjs/queries/ContextRef.js +15 -4
- package/lib/cjs/queries/ContextRef.js.map +1 -1
- package/lib/cjs/queries/CreateBuilder.d.ts +3 -5
- package/lib/cjs/queries/CreateBuilder.js +4 -16
- package/lib/cjs/queries/CreateBuilder.js.map +1 -1
- package/lib/cjs/queries/DeleteBuilder.d.ts +3 -5
- package/lib/cjs/queries/DeleteBuilder.js +8 -20
- package/lib/cjs/queries/DeleteBuilder.js.map +1 -1
- package/lib/cjs/queries/DslJsonExpression.d.ts +8 -8
- package/lib/cjs/queries/DslJsonExpression.js +84 -26
- package/lib/cjs/queries/DslJsonExpression.js.map +1 -1
- package/lib/cjs/queries/FieldSet.d.ts +43 -14
- package/lib/cjs/queries/FieldSet.js +142 -77
- package/lib/cjs/queries/FieldSet.js.map +1 -1
- package/lib/cjs/queries/IRCanonicalize.d.ts +5 -9
- package/lib/cjs/queries/IRCanonicalize.js +7 -23
- package/lib/cjs/queries/IRCanonicalize.js.map +1 -1
- package/lib/cjs/queries/IRDesugar.d.ts +2 -1
- package/lib/cjs/queries/IRDesugar.js +1 -1
- package/lib/cjs/queries/IRDesugar.js.map +1 -1
- package/lib/cjs/queries/IRLower.js +7 -7
- package/lib/cjs/queries/IRLower.js.map +1 -1
- package/lib/cjs/queries/IntermediateRepresentation.d.ts +16 -2
- package/lib/cjs/queries/MutationQuery.d.ts +18 -1
- package/lib/cjs/queries/MutationQuery.js +83 -3
- package/lib/cjs/queries/MutationQuery.js.map +1 -1
- package/lib/cjs/queries/MutationSerialization.d.ts +11 -11
- package/lib/cjs/queries/MutationSerialization.js +51 -31
- package/lib/cjs/queries/MutationSerialization.js.map +1 -1
- package/lib/cjs/queries/MutationThenable.d.ts +18 -0
- package/lib/cjs/queries/MutationThenable.js +32 -0
- package/lib/cjs/queries/MutationThenable.js.map +1 -0
- package/lib/cjs/queries/QueryBuilder.d.ts +1 -1
- package/lib/cjs/queries/QueryBuilder.js +3 -3
- package/lib/cjs/queries/QueryBuilder.js.map +1 -1
- package/lib/cjs/queries/QueryBuilderSerialization.js +3 -4
- package/lib/cjs/queries/QueryBuilderSerialization.js.map +1 -1
- package/lib/cjs/queries/QueryContext.d.ts +1 -1
- package/lib/cjs/queries/QueryContext.js +7 -5
- package/lib/cjs/queries/QueryContext.js.map +1 -1
- package/lib/cjs/queries/QueryFactory.d.ts +0 -7
- package/lib/cjs/queries/QueryFactory.js +1 -20
- package/lib/cjs/queries/QueryFactory.js.map +1 -1
- package/lib/cjs/queries/SelectQuery.d.ts +19 -41
- package/lib/cjs/queries/SelectQuery.js +69 -118
- package/lib/cjs/queries/SelectQuery.js.map +1 -1
- package/lib/cjs/queries/UpdateBuilder.d.ts +3 -5
- package/lib/cjs/queries/UpdateBuilder.js +5 -17
- package/lib/cjs/queries/UpdateBuilder.js.map +1 -1
- package/lib/cjs/queries/lower.js +3 -4
- package/lib/cjs/queries/lower.js.map +1 -1
- package/lib/cjs/queries/lowerMutationJSON.js +39 -23
- package/lib/cjs/queries/lowerMutationJSON.js.map +1 -1
- package/lib/cjs/shapes/List.js +2 -9
- package/lib/cjs/shapes/List.js.map +1 -1
- package/lib/cjs/shapes/PathNode.js +5 -18
- package/lib/cjs/shapes/PathNode.js.map +1 -1
- package/lib/cjs/shapes/SHACL.d.ts +10 -0
- package/lib/cjs/shapes/SHACL.js +41 -0
- package/lib/cjs/shapes/SHACL.js.map +1 -1
- package/lib/cjs/shapes/Shape.d.ts +1 -1
- package/lib/cjs/shapes/Shape.js.map +1 -1
- package/lib/cjs/shapes/serializePathToNodeData.js +16 -0
- package/lib/cjs/shapes/serializePathToNodeData.js.map +1 -1
- package/lib/cjs/shapes/syncShapes.js +15 -0
- package/lib/cjs/shapes/syncShapes.js.map +1 -1
- package/lib/cjs/sparql/SparqlAlgebra.d.ts +8 -1
- package/lib/cjs/sparql/algebraToString.js +57 -11
- package/lib/cjs/sparql/algebraToString.js.map +1 -1
- package/lib/cjs/sparql/irToAlgebra.js +89 -31
- package/lib/cjs/sparql/irToAlgebra.js.map +1 -1
- package/lib/cjs/sparql/resultMapping.js +0 -11
- package/lib/cjs/sparql/resultMapping.js.map +1 -1
- package/lib/cjs/sparql/sparqlUtils.d.ts +21 -0
- package/lib/cjs/sparql/sparqlUtils.js +65 -0
- package/lib/cjs/sparql/sparqlUtils.js.map +1 -1
- package/lib/cjs/utils/LinkedStorage.d.ts +1 -2
- package/lib/cjs/utils/LinkedStorage.js +1 -2
- package/lib/cjs/utils/LinkedStorage.js.map +1 -1
- package/lib/cjs/utils/Package.js +11 -4
- package/lib/cjs/utils/Package.js.map +1 -1
- package/lib/cjs/utils/Prefix.d.ts +4 -5
- package/lib/cjs/utils/Prefix.js +13 -7
- package/lib/cjs/utils/Prefix.js.map +1 -1
- package/lib/cjs/utils/ShapeClass.d.ts +0 -11
- package/lib/cjs/utils/ShapeClass.js +0 -83
- package/lib/cjs/utils/ShapeClass.js.map +1 -1
- package/lib/cjs/utils/cached.d.ts +3 -0
- package/lib/cjs/utils/cached.js +26 -16
- package/lib/cjs/utils/cached.js.map +1 -1
- package/lib/cjs/utils/loadStores.js +4 -0
- package/lib/cjs/utils/loadStores.js.map +1 -1
- package/lib/esm/expressions/Expr.d.ts +22 -51
- package/lib/esm/expressions/Expr.js +24 -176
- package/lib/esm/expressions/Expr.js.map +1 -1
- package/lib/esm/expressions/ExpressionMethods.d.ts +4 -0
- package/lib/esm/expressions/ExpressionNode.d.ts +4 -0
- package/lib/esm/expressions/ExpressionNode.js +13 -0
- package/lib/esm/expressions/ExpressionNode.js.map +1 -1
- package/lib/esm/index.d.ts +2 -2
- package/lib/esm/index.js +3 -103
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/interfaces/ICoreIterable.d.ts +1 -1
- package/lib/esm/package.d.ts +2 -2
- package/lib/esm/queries/ContextRef.d.ts +15 -4
- package/lib/esm/queries/ContextRef.js +15 -4
- package/lib/esm/queries/ContextRef.js.map +1 -1
- package/lib/esm/queries/CreateBuilder.d.ts +3 -5
- package/lib/esm/queries/CreateBuilder.js +4 -16
- package/lib/esm/queries/CreateBuilder.js.map +1 -1
- package/lib/esm/queries/DeleteBuilder.d.ts +3 -5
- package/lib/esm/queries/DeleteBuilder.js +8 -20
- package/lib/esm/queries/DeleteBuilder.js.map +1 -1
- package/lib/esm/queries/DslJsonExpression.d.ts +8 -8
- package/lib/esm/queries/DslJsonExpression.js +84 -26
- package/lib/esm/queries/DslJsonExpression.js.map +1 -1
- package/lib/esm/queries/FieldSet.d.ts +43 -14
- package/lib/esm/queries/FieldSet.js +142 -77
- package/lib/esm/queries/FieldSet.js.map +1 -1
- package/lib/esm/queries/IRCanonicalize.d.ts +5 -9
- package/lib/esm/queries/IRCanonicalize.js +6 -21
- package/lib/esm/queries/IRCanonicalize.js.map +1 -1
- package/lib/esm/queries/IRDesugar.d.ts +2 -1
- package/lib/esm/queries/IRDesugar.js +1 -1
- package/lib/esm/queries/IRDesugar.js.map +1 -1
- package/lib/esm/queries/IRLower.js +7 -7
- package/lib/esm/queries/IRLower.js.map +1 -1
- package/lib/esm/queries/IntermediateRepresentation.d.ts +16 -2
- package/lib/esm/queries/MutationQuery.d.ts +18 -1
- package/lib/esm/queries/MutationQuery.js +83 -3
- package/lib/esm/queries/MutationQuery.js.map +1 -1
- package/lib/esm/queries/MutationSerialization.d.ts +11 -11
- package/lib/esm/queries/MutationSerialization.js +51 -31
- package/lib/esm/queries/MutationSerialization.js.map +1 -1
- package/lib/esm/queries/MutationThenable.d.ts +18 -0
- package/lib/esm/queries/MutationThenable.js +28 -0
- package/lib/esm/queries/MutationThenable.js.map +1 -0
- package/lib/esm/queries/QueryBuilder.d.ts +1 -1
- package/lib/esm/queries/QueryBuilder.js +3 -3
- package/lib/esm/queries/QueryBuilder.js.map +1 -1
- package/lib/esm/queries/QueryBuilderSerialization.js +3 -4
- package/lib/esm/queries/QueryBuilderSerialization.js.map +1 -1
- package/lib/esm/queries/QueryContext.d.ts +1 -1
- package/lib/esm/queries/QueryContext.js +7 -5
- package/lib/esm/queries/QueryContext.js.map +1 -1
- package/lib/esm/queries/QueryFactory.d.ts +0 -7
- package/lib/esm/queries/QueryFactory.js +1 -19
- package/lib/esm/queries/QueryFactory.js.map +1 -1
- package/lib/esm/queries/SelectQuery.d.ts +19 -41
- package/lib/esm/queries/SelectQuery.js +69 -118
- package/lib/esm/queries/SelectQuery.js.map +1 -1
- package/lib/esm/queries/UpdateBuilder.d.ts +3 -5
- package/lib/esm/queries/UpdateBuilder.js +5 -17
- package/lib/esm/queries/UpdateBuilder.js.map +1 -1
- package/lib/esm/queries/lower.js +3 -4
- package/lib/esm/queries/lower.js.map +1 -1
- package/lib/esm/queries/lowerMutationJSON.js +39 -23
- package/lib/esm/queries/lowerMutationJSON.js.map +1 -1
- package/lib/esm/shapes/List.js +2 -9
- package/lib/esm/shapes/List.js.map +1 -1
- package/lib/esm/shapes/PathNode.js +5 -18
- package/lib/esm/shapes/PathNode.js.map +1 -1
- package/lib/esm/shapes/SHACL.d.ts +10 -0
- package/lib/esm/shapes/SHACL.js +41 -0
- package/lib/esm/shapes/SHACL.js.map +1 -1
- package/lib/esm/shapes/Shape.d.ts +1 -1
- package/lib/esm/shapes/Shape.js.map +1 -1
- package/lib/esm/shapes/serializePathToNodeData.js +16 -0
- package/lib/esm/shapes/serializePathToNodeData.js.map +1 -1
- package/lib/esm/shapes/syncShapes.js +15 -0
- package/lib/esm/shapes/syncShapes.js.map +1 -1
- package/lib/esm/sparql/SparqlAlgebra.d.ts +8 -1
- package/lib/esm/sparql/algebraToString.js +58 -12
- package/lib/esm/sparql/algebraToString.js.map +1 -1
- package/lib/esm/sparql/irToAlgebra.js +89 -31
- package/lib/esm/sparql/irToAlgebra.js.map +1 -1
- package/lib/esm/sparql/resultMapping.js +0 -11
- package/lib/esm/sparql/resultMapping.js.map +1 -1
- package/lib/esm/sparql/sparqlUtils.d.ts +21 -0
- package/lib/esm/sparql/sparqlUtils.js +62 -0
- package/lib/esm/sparql/sparqlUtils.js.map +1 -1
- package/lib/esm/utils/LinkedStorage.d.ts +1 -2
- package/lib/esm/utils/LinkedStorage.js +1 -2
- package/lib/esm/utils/LinkedStorage.js.map +1 -1
- package/lib/esm/utils/Package.js +11 -4
- package/lib/esm/utils/Package.js.map +1 -1
- package/lib/esm/utils/Prefix.d.ts +4 -5
- package/lib/esm/utils/Prefix.js +13 -7
- package/lib/esm/utils/Prefix.js.map +1 -1
- package/lib/esm/utils/ShapeClass.d.ts +0 -11
- package/lib/esm/utils/ShapeClass.js +0 -79
- package/lib/esm/utils/ShapeClass.js.map +1 -1
- package/lib/esm/utils/cached.d.ts +3 -0
- package/lib/esm/utils/cached.js +26 -16
- package/lib/esm/utils/cached.js.map +1 -1
- package/lib/esm/utils/loadStores.js +4 -0
- package/lib/esm/utils/loadStores.js.map +1 -1
- package/package.json +9 -3
- package/lib/cjs/collections/CoreMap.d.ts +0 -37
- package/lib/cjs/collections/CoreMap.js +0 -101
- package/lib/cjs/collections/CoreMap.js.map +0 -1
- package/lib/cjs/paths/serializePathToSHACL.d.ts +0 -22
- package/lib/cjs/paths/serializePathToSHACL.js +0 -126
- package/lib/cjs/paths/serializePathToSHACL.js.map +0 -1
- package/lib/cjs/queries/WhereCondition.d.ts +0 -18
- package/lib/cjs/queries/WhereCondition.js +0 -3
- package/lib/cjs/queries/WhereCondition.js.map +0 -1
- package/lib/cjs/test-helpers/FusekiStore.d.ts +0 -29
- package/lib/cjs/test-helpers/FusekiStore.js +0 -85
- package/lib/cjs/test-helpers/FusekiStore.js.map +0 -1
- package/lib/cjs/test-helpers/fuseki-test-store.d.ts +0 -46
- package/lib/cjs/test-helpers/fuseki-test-store.js +0 -244
- package/lib/cjs/test-helpers/fuseki-test-store.js.map +0 -1
- package/lib/cjs/test-helpers/query-capture-store.d.ts +0 -11
- package/lib/cjs/test-helpers/query-capture-store.js +0 -109
- package/lib/cjs/test-helpers/query-capture-store.js.map +0 -1
- package/lib/cjs/test-helpers/query-fixtures.d.ts +0 -819
- package/lib/cjs/test-helpers/query-fixtures.js +0 -605
- package/lib/cjs/test-helpers/query-fixtures.js.map +0 -1
- package/lib/cjs/test-helpers/test-utils.d.ts +0 -18
- package/lib/cjs/test-helpers/test-utils.js +0 -47
- package/lib/cjs/test-helpers/test-utils.js.map +0 -1
- package/lib/cjs/utils/Types.d.ts +0 -11
- package/lib/cjs/utils/Types.js +0 -3
- package/lib/cjs/utils/Types.js.map +0 -1
- package/lib/esm/collections/CoreMap.d.ts +0 -37
- package/lib/esm/collections/CoreMap.js +0 -97
- package/lib/esm/collections/CoreMap.js.map +0 -1
- package/lib/esm/paths/serializePathToSHACL.d.ts +0 -22
- package/lib/esm/paths/serializePathToSHACL.js +0 -122
- package/lib/esm/paths/serializePathToSHACL.js.map +0 -1
- package/lib/esm/queries/WhereCondition.d.ts +0 -18
- package/lib/esm/queries/WhereCondition.js +0 -2
- package/lib/esm/queries/WhereCondition.js.map +0 -1
- package/lib/esm/test-helpers/FusekiStore.d.ts +0 -29
- package/lib/esm/test-helpers/FusekiStore.js +0 -81
- package/lib/esm/test-helpers/FusekiStore.js.map +0 -1
- package/lib/esm/test-helpers/fuseki-test-store.d.ts +0 -46
- package/lib/esm/test-helpers/fuseki-test-store.js +0 -232
- package/lib/esm/test-helpers/fuseki-test-store.js.map +0 -1
- package/lib/esm/test-helpers/query-capture-store.d.ts +0 -11
- package/lib/esm/test-helpers/query-capture-store.js +0 -71
- package/lib/esm/test-helpers/query-capture-store.js.map +0 -1
- package/lib/esm/test-helpers/query-fixtures.d.ts +0 -819
- package/lib/esm/test-helpers/query-fixtures.js +0 -602
- package/lib/esm/test-helpers/query-fixtures.js.map +0 -1
- package/lib/esm/test-helpers/test-utils.d.ts +0 -18
- package/lib/esm/test-helpers/test-utils.js +0 -41
- package/lib/esm/test-helpers/test-utils.js.map +0 -1
- package/lib/esm/utils/Types.d.ts +0 -11
- package/lib/esm/utils/Types.js +0 -2
- package/lib/esm/utils/Types.js.map +0 -1
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
export declare const FUSEKI_BASE_URL: string;
|
|
2
|
-
/**
|
|
3
|
-
* Check whether a Fuseki server is reachable.
|
|
4
|
-
* Returns true if a HEAD request to the base URL succeeds with status 200.
|
|
5
|
-
*/
|
|
6
|
-
export declare function isFusekiAvailable(): Promise<boolean>;
|
|
7
|
-
/**
|
|
8
|
-
* Ensure a Fuseki instance is running.
|
|
9
|
-
* If Fuseki is already reachable, returns immediately.
|
|
10
|
-
* Otherwise, starts it via Docker Compose and waits for the healthcheck.
|
|
11
|
-
*
|
|
12
|
-
* Returns true if Fuseki is available after this call.
|
|
13
|
-
* Returns false if Docker is not installed or the compose file can't be found.
|
|
14
|
-
*/
|
|
15
|
-
export declare function ensureFuseki(): Promise<boolean>;
|
|
16
|
-
/**
|
|
17
|
-
* Stop the Fuseki container if it was started by `ensureFuseki()`.
|
|
18
|
-
* No-op if Fuseki was already running before the tests.
|
|
19
|
-
*/
|
|
20
|
-
export declare function stopFuseki(): Promise<void>;
|
|
21
|
-
/**
|
|
22
|
-
* Create the in-memory test dataset on Fuseki.
|
|
23
|
-
* Ignores 409 Conflict (dataset already exists).
|
|
24
|
-
*/
|
|
25
|
-
export declare function createTestDataset(): Promise<void>;
|
|
26
|
-
/**
|
|
27
|
-
* Delete the test dataset from Fuseki.
|
|
28
|
-
*/
|
|
29
|
-
export declare function deleteTestDataset(): Promise<void>;
|
|
30
|
-
/**
|
|
31
|
-
* Load N-Triples data into the test dataset.
|
|
32
|
-
*/
|
|
33
|
-
export declare function loadTestData(ntriples: string): Promise<void>;
|
|
34
|
-
/**
|
|
35
|
-
* Execute a SPARQL SELECT/ASK/CONSTRUCT query against the test dataset.
|
|
36
|
-
* Returns parsed SPARQL JSON results.
|
|
37
|
-
*/
|
|
38
|
-
export declare function executeSparqlQuery(sparql: string): Promise<any>;
|
|
39
|
-
/**
|
|
40
|
-
* Execute a SPARQL UPDATE against the test dataset.
|
|
41
|
-
*/
|
|
42
|
-
export declare function executeSparqlUpdate(sparql: string): Promise<void>;
|
|
43
|
-
/**
|
|
44
|
-
* Remove all triples from the test dataset.
|
|
45
|
-
*/
|
|
46
|
-
export declare function clearAllData(): Promise<void>;
|
|
@@ -1,232 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* Test helper module for Apache Jena Fuseki integration tests.
|
|
12
|
-
*
|
|
13
|
-
* Provides utilities to:
|
|
14
|
-
* - Ensure a Fuseki instance is running (auto-starts via Docker if needed)
|
|
15
|
-
* - Check if a Fuseki instance is available
|
|
16
|
-
* - Create / delete an in-memory test dataset
|
|
17
|
-
* - Load N-Triples data
|
|
18
|
-
* - Execute SPARQL queries and updates
|
|
19
|
-
* - Clear all data
|
|
20
|
-
*
|
|
21
|
-
* Uses native fetch (Node 18+). No external HTTP libraries.
|
|
22
|
-
*/
|
|
23
|
-
import { execSync } from 'node:child_process';
|
|
24
|
-
import { existsSync } from 'node:fs';
|
|
25
|
-
import { resolve } from 'node:path';
|
|
26
|
-
export const FUSEKI_BASE_URL = process.env.FUSEKI_BASE_URL || 'http://localhost:3939';
|
|
27
|
-
const FUSEKI_ADMIN_PASSWORD = process.env.FUSEKI_ADMIN_PASSWORD || 'admin';
|
|
28
|
-
const DATASET_NAME = 'nashville-test';
|
|
29
|
-
/** Whether this process started Fuseki (so we know whether to stop it). */
|
|
30
|
-
let startedByUs = false;
|
|
31
|
-
const adminAuth = `Basic ${Buffer.from(`admin:${FUSEKI_ADMIN_PASSWORD}`).toString('base64')}`;
|
|
32
|
-
/**
|
|
33
|
-
* Check whether a Fuseki server is reachable.
|
|
34
|
-
* Returns true if a HEAD request to the base URL succeeds with status 200.
|
|
35
|
-
*/
|
|
36
|
-
export function isFusekiAvailable() {
|
|
37
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
38
|
-
try {
|
|
39
|
-
const controller = new AbortController();
|
|
40
|
-
const timer = setTimeout(() => controller.abort(), 2000);
|
|
41
|
-
const response = yield fetch(FUSEKI_BASE_URL, {
|
|
42
|
-
method: 'HEAD',
|
|
43
|
-
signal: controller.signal,
|
|
44
|
-
});
|
|
45
|
-
clearTimeout(timer);
|
|
46
|
-
return response.status === 200;
|
|
47
|
-
}
|
|
48
|
-
catch (_a) {
|
|
49
|
-
return false;
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Locate the docker-compose.test.yml for Fuseki.
|
|
55
|
-
* Works from both source (src/) and compiled (lib/esm/) paths.
|
|
56
|
-
*/
|
|
57
|
-
function findComposeFile() {
|
|
58
|
-
// __dirname works in both CJS and ts-jest; for ESM builds the lincd
|
|
59
|
-
// toolchain injects a __dirname shim.
|
|
60
|
-
const candidates = [
|
|
61
|
-
resolve(__dirname, '../tests/docker-compose.test.yml'),
|
|
62
|
-
resolve(__dirname, '../../src/tests/docker-compose.test.yml'),
|
|
63
|
-
// Built helpers live under lib/{cjs,esm}/test-helpers, so we need to
|
|
64
|
-
// climb back to the package root before looking in src/tests.
|
|
65
|
-
resolve(__dirname, '../../../src/tests/docker-compose.test.yml'),
|
|
66
|
-
];
|
|
67
|
-
for (const candidate of candidates) {
|
|
68
|
-
if (existsSync(candidate))
|
|
69
|
-
return candidate;
|
|
70
|
-
}
|
|
71
|
-
return null;
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Ensure a Fuseki instance is running.
|
|
75
|
-
* If Fuseki is already reachable, returns immediately.
|
|
76
|
-
* Otherwise, starts it via Docker Compose and waits for the healthcheck.
|
|
77
|
-
*
|
|
78
|
-
* Returns true if Fuseki is available after this call.
|
|
79
|
-
* Returns false if Docker is not installed or the compose file can't be found.
|
|
80
|
-
*/
|
|
81
|
-
export function ensureFuseki() {
|
|
82
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
83
|
-
if (yield isFusekiAvailable())
|
|
84
|
-
return true;
|
|
85
|
-
const composeFile = findComposeFile();
|
|
86
|
-
if (!composeFile) {
|
|
87
|
-
console.warn('[ensureFuseki] docker-compose.test.yml not found — cannot auto-start Fuseki');
|
|
88
|
-
return false;
|
|
89
|
-
}
|
|
90
|
-
try {
|
|
91
|
-
execSync('docker compose version', { stdio: 'ignore' });
|
|
92
|
-
}
|
|
93
|
-
catch (_a) {
|
|
94
|
-
console.warn('[ensureFuseki] Docker Compose not available — skipping');
|
|
95
|
-
return false;
|
|
96
|
-
}
|
|
97
|
-
console.log('[ensureFuseki] Fuseki not running — starting via Docker...');
|
|
98
|
-
try {
|
|
99
|
-
execSync(`docker compose -f "${composeFile}" up -d --wait`, {
|
|
100
|
-
stdio: 'inherit',
|
|
101
|
-
timeout: 60000,
|
|
102
|
-
});
|
|
103
|
-
startedByUs = true;
|
|
104
|
-
// Verify it came up
|
|
105
|
-
if (yield isFusekiAvailable()) {
|
|
106
|
-
console.log('[ensureFuseki] Fuseki is ready');
|
|
107
|
-
return true;
|
|
108
|
-
}
|
|
109
|
-
console.warn('[ensureFuseki] Fuseki started but not responding');
|
|
110
|
-
return false;
|
|
111
|
-
}
|
|
112
|
-
catch (err) {
|
|
113
|
-
console.warn('[ensureFuseki] Failed to start Fuseki:', err.message);
|
|
114
|
-
return false;
|
|
115
|
-
}
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* Stop the Fuseki container if it was started by `ensureFuseki()`.
|
|
120
|
-
* No-op if Fuseki was already running before the tests.
|
|
121
|
-
*/
|
|
122
|
-
export function stopFuseki() {
|
|
123
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
124
|
-
if (!startedByUs)
|
|
125
|
-
return;
|
|
126
|
-
const composeFile = findComposeFile();
|
|
127
|
-
if (!composeFile)
|
|
128
|
-
return;
|
|
129
|
-
try {
|
|
130
|
-
execSync(`docker compose -f "${composeFile}" down`, {
|
|
131
|
-
stdio: 'inherit',
|
|
132
|
-
timeout: 30000,
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
catch (_a) {
|
|
136
|
-
// Best effort — don't fail the test suite on cleanup
|
|
137
|
-
}
|
|
138
|
-
startedByUs = false;
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
/**
|
|
142
|
-
* Create the in-memory test dataset on Fuseki.
|
|
143
|
-
* Ignores 409 Conflict (dataset already exists).
|
|
144
|
-
*/
|
|
145
|
-
export function createTestDataset() {
|
|
146
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
147
|
-
const response = yield fetch(`${FUSEKI_BASE_URL}/$/datasets`, {
|
|
148
|
-
method: 'POST',
|
|
149
|
-
headers: {
|
|
150
|
-
'Content-Type': 'application/x-www-form-urlencoded',
|
|
151
|
-
Authorization: adminAuth,
|
|
152
|
-
},
|
|
153
|
-
body: `dbName=${DATASET_NAME}&dbType=mem`,
|
|
154
|
-
});
|
|
155
|
-
if (!response.ok && response.status !== 409) {
|
|
156
|
-
throw new Error(`Failed to create test dataset: ${response.status} ${response.statusText}`);
|
|
157
|
-
}
|
|
158
|
-
});
|
|
159
|
-
}
|
|
160
|
-
/**
|
|
161
|
-
* Delete the test dataset from Fuseki.
|
|
162
|
-
*/
|
|
163
|
-
export function deleteTestDataset() {
|
|
164
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
165
|
-
const response = yield fetch(`${FUSEKI_BASE_URL}/$/datasets/${DATASET_NAME}`, { method: 'DELETE', headers: { Authorization: adminAuth } });
|
|
166
|
-
if (!response.ok && response.status !== 404) {
|
|
167
|
-
throw new Error(`Failed to delete test dataset: ${response.status} ${response.statusText}`);
|
|
168
|
-
}
|
|
169
|
-
});
|
|
170
|
-
}
|
|
171
|
-
/**
|
|
172
|
-
* Load N-Triples data into the test dataset.
|
|
173
|
-
*/
|
|
174
|
-
export function loadTestData(ntriples) {
|
|
175
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
176
|
-
const response = yield fetch(`${FUSEKI_BASE_URL}/${DATASET_NAME}`, {
|
|
177
|
-
method: 'POST',
|
|
178
|
-
headers: { 'Content-Type': 'application/n-triples' },
|
|
179
|
-
body: ntriples,
|
|
180
|
-
});
|
|
181
|
-
if (!response.ok) {
|
|
182
|
-
const body = yield response.text();
|
|
183
|
-
throw new Error(`Failed to load test data: ${response.status} ${response.statusText}\n${body}`);
|
|
184
|
-
}
|
|
185
|
-
});
|
|
186
|
-
}
|
|
187
|
-
/**
|
|
188
|
-
* Execute a SPARQL SELECT/ASK/CONSTRUCT query against the test dataset.
|
|
189
|
-
* Returns parsed SPARQL JSON results.
|
|
190
|
-
*/
|
|
191
|
-
export function executeSparqlQuery(sparql) {
|
|
192
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
193
|
-
const response = yield fetch(`${FUSEKI_BASE_URL}/${DATASET_NAME}/sparql`, {
|
|
194
|
-
method: 'POST',
|
|
195
|
-
headers: {
|
|
196
|
-
'Content-Type': 'application/sparql-query',
|
|
197
|
-
Accept: 'application/sparql-results+json',
|
|
198
|
-
},
|
|
199
|
-
body: sparql,
|
|
200
|
-
});
|
|
201
|
-
if (!response.ok) {
|
|
202
|
-
const body = yield response.text();
|
|
203
|
-
throw new Error(`SPARQL query failed: ${response.status} ${response.statusText}\n${sparql}\n${body}`);
|
|
204
|
-
}
|
|
205
|
-
return response.json();
|
|
206
|
-
});
|
|
207
|
-
}
|
|
208
|
-
/**
|
|
209
|
-
* Execute a SPARQL UPDATE against the test dataset.
|
|
210
|
-
*/
|
|
211
|
-
export function executeSparqlUpdate(sparql) {
|
|
212
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
213
|
-
const response = yield fetch(`${FUSEKI_BASE_URL}/${DATASET_NAME}/update`, {
|
|
214
|
-
method: 'POST',
|
|
215
|
-
headers: { 'Content-Type': 'application/sparql-update' },
|
|
216
|
-
body: sparql,
|
|
217
|
-
});
|
|
218
|
-
if (!response.ok) {
|
|
219
|
-
const body = yield response.text();
|
|
220
|
-
throw new Error(`SPARQL update failed: ${response.status} ${response.statusText}\n${sparql}\n${body}`);
|
|
221
|
-
}
|
|
222
|
-
});
|
|
223
|
-
}
|
|
224
|
-
/**
|
|
225
|
-
* Remove all triples from the test dataset.
|
|
226
|
-
*/
|
|
227
|
-
export function clearAllData() {
|
|
228
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
229
|
-
yield executeSparqlUpdate('DELETE WHERE { ?s ?p ?o }');
|
|
230
|
-
});
|
|
231
|
-
}
|
|
232
|
-
//# sourceMappingURL=fuseki-test-store.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fuseki-test-store.js","sourceRo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CAAC;QACD,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC;IACzB,CAAC;CAAA;AAED;;GAEG;AACH,MAAM,UAAgB,mBAAmB,CAAC,MAAc;;QACtD,MAAM,QAAQ,GAAG,MAAM,KAAK,CAC1B,GAAG,eAAe,IAAI,YAAY,SAAS,EAC3C;YACE,MAAM,EAAE,MAAM;YACd,OAAO,EAAE,EAAC,cAAc,EAAE,2BAA2B,EAAC;YACtD,IAAI,EAAE,MAAM;SACb,CACF,CAAC;QACF,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YACjB,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;YACnC,MAAM,IAAI,KAAK,CACb,yBAAyB,QAAQ,CAAC,MAAM,IAAI,QAAQ,CAAC,UAAU,KAAK,MAAM,KAAK,IAAI,EAAE,CACtF,CAAC;QACJ,CAAC;IACH,CAAC;CAAA;AAED;;GAEG;AACH,MAAM,UAAgB,YAAY;;QAChC,MAAM,mBAAmB,CAAC,2BAA2B,CAAC,CAAC;IACzD,CAAC;CAAA"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Execute a query-producing callback and return the built IR
|
|
3
|
-
* (the same object that would reach ILinkedDataset).
|
|
4
|
-
*/
|
|
5
|
-
export declare const captureQuery: (runner: () => Promise<unknown>) => Promise<any>;
|
|
6
|
-
/**
|
|
7
|
-
* Execute a query-producing callback and return the raw pipeline
|
|
8
|
-
* input (RawSelectInput) — the state before the IR build pipeline runs.
|
|
9
|
-
* Only works for select queries.
|
|
10
|
-
*/
|
|
11
|
-
export declare const captureRawQuery: (runner: () => Promise<unknown>) => Promise<any>;
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
import { jest } from '@jest/globals';
|
|
11
|
-
import { setQueryDispatch } from '../queries/queryDispatch';
|
|
12
|
-
import * as IRPipeline from '../queries/IRPipeline';
|
|
13
|
-
import { lower } from '../queries/lower';
|
|
14
|
-
// Datasets now receive the live (closed) query; tests expect the lowered IR, so
|
|
15
|
-
// lower() what we capture. Passing an already-IR object through is tolerated.
|
|
16
|
-
const toIR = (query) => query && typeof query.__queryKind === 'string' ? lower(query) : query;
|
|
17
|
-
/**
|
|
18
|
-
* Test utility that intercepts the query dispatch and captures
|
|
19
|
-
* the built IR query for inspection by test assertions.
|
|
20
|
-
*
|
|
21
|
-
* - `captureQuery` captures the built IR (post-pipeline) — use for
|
|
22
|
-
* full-pipeline and mutation tests.
|
|
23
|
-
* - `captureRawQuery` captures the raw pipeline input (pre-pipeline)
|
|
24
|
-
* — use for tests that feed intermediate pipeline stages.
|
|
25
|
-
*/
|
|
26
|
-
let _lastQuery;
|
|
27
|
-
let _lastRawInput;
|
|
28
|
-
// Spy on buildSelectQuery to capture pre-pipeline raw input
|
|
29
|
-
const originalBuildSelectQuery = IRPipeline.buildSelectQuery;
|
|
30
|
-
jest.spyOn(IRPipeline, 'buildSelectQuery').mockImplementation((raw) => {
|
|
31
|
-
_lastRawInput = raw;
|
|
32
|
-
return originalBuildSelectQuery(raw);
|
|
33
|
-
});
|
|
34
|
-
setQueryDispatch({
|
|
35
|
-
selectQuery: (query) => __awaiter(void 0, void 0, void 0, function* () {
|
|
36
|
-
_lastQuery = toIR(query);
|
|
37
|
-
return [];
|
|
38
|
-
}),
|
|
39
|
-
createQuery: (query) => __awaiter(void 0, void 0, void 0, function* () {
|
|
40
|
-
_lastQuery = toIR(query);
|
|
41
|
-
return {};
|
|
42
|
-
}),
|
|
43
|
-
updateQuery: (query) => __awaiter(void 0, void 0, void 0, function* () {
|
|
44
|
-
_lastQuery = toIR(query);
|
|
45
|
-
return {};
|
|
46
|
-
}),
|
|
47
|
-
deleteQuery: (query) => __awaiter(void 0, void 0, void 0, function* () {
|
|
48
|
-
_lastQuery = toIR(query);
|
|
49
|
-
return { deleted: [], count: 0 };
|
|
50
|
-
}),
|
|
51
|
-
});
|
|
52
|
-
/**
|
|
53
|
-
* Execute a query-producing callback and return the built IR
|
|
54
|
-
* (the same object that would reach ILinkedDataset).
|
|
55
|
-
*/
|
|
56
|
-
export const captureQuery = (runner) => __awaiter(void 0, void 0, void 0, function* () {
|
|
57
|
-
_lastQuery = undefined;
|
|
58
|
-
yield runner();
|
|
59
|
-
return _lastQuery;
|
|
60
|
-
});
|
|
61
|
-
/**
|
|
62
|
-
* Execute a query-producing callback and return the raw pipeline
|
|
63
|
-
* input (RawSelectInput) — the state before the IR build pipeline runs.
|
|
64
|
-
* Only works for select queries.
|
|
65
|
-
*/
|
|
66
|
-
export const captureRawQuery = (runner) => __awaiter(void 0, void 0, void 0, function* () {
|
|
67
|
-
_lastRawInput = undefined;
|
|
68
|
-
yield runner();
|
|
69
|
-
return _lastRawInput;
|
|
70
|
-
});
|
|
71
|
-
//# sourceMappingURL=query-capture-store.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"query-capture-store.js","sourceRoot":"","sources":["../../../src/test-helpers/query-capture-store.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,eAAe,CAAC;AACnC,OAAO,EAAC,gBAAgB,EAAC,MAAM,0BAA0B,CAAC;AAC1D,OAAO,KAAK,UAAU,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAC,KAAK,EAAC,MAAM,kBAAkB,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