@lde/pipeline 0.6.9 → 0.6.11
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/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/stage.d.ts +14 -0
- package/dist/stage.d.ts.map +1 -0
- package/dist/stage.js +29 -0
- package/package.json +5 -5
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC"}
|
package/dist/index.js
CHANGED
package/dist/stage.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Quad } from '@rdfjs/types';
|
|
2
|
+
import type { ExecutableDataset, Executor } from './sparql/executor.js';
|
|
3
|
+
import { NotSupported } from './sparql/executor.js';
|
|
4
|
+
export interface StageOptions {
|
|
5
|
+
name: string;
|
|
6
|
+
executors: Executor | Executor[];
|
|
7
|
+
}
|
|
8
|
+
export declare class Stage {
|
|
9
|
+
readonly name: string;
|
|
10
|
+
private readonly executors;
|
|
11
|
+
constructor(options: StageOptions);
|
|
12
|
+
run(dataset: ExecutableDataset): Promise<AsyncIterable<Quad> | NotSupported>;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=stage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stage.d.ts","sourceRoot":"","sources":["../src/stage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,KAAK,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,QAAQ,GAAG,QAAQ,EAAE,CAAC;CAClC;AAED,qBAAa,KAAK;IAChB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAa;gBAE3B,OAAO,EAAE,YAAY;IAO3B,GAAG,CACP,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,GAAG,YAAY,CAAC;CAgB/C"}
|
package/dist/stage.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { NotSupported } from './sparql/executor.js';
|
|
2
|
+
export class Stage {
|
|
3
|
+
name;
|
|
4
|
+
executors;
|
|
5
|
+
constructor(options) {
|
|
6
|
+
this.name = options.name;
|
|
7
|
+
this.executors = Array.isArray(options.executors)
|
|
8
|
+
? options.executors
|
|
9
|
+
: [options.executors];
|
|
10
|
+
}
|
|
11
|
+
async run(dataset) {
|
|
12
|
+
const streams = [];
|
|
13
|
+
for (const executor of this.executors) {
|
|
14
|
+
const result = await executor.execute(dataset);
|
|
15
|
+
if (!(result instanceof NotSupported)) {
|
|
16
|
+
streams.push(result);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
if (streams.length === 0) {
|
|
20
|
+
return new NotSupported('All executors returned NotSupported');
|
|
21
|
+
}
|
|
22
|
+
return mergeStreams(streams);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
async function* mergeStreams(streams) {
|
|
26
|
+
for (const stream of streams) {
|
|
27
|
+
yield* stream;
|
|
28
|
+
}
|
|
29
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lde/pipeline",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.11",
|
|
4
4
|
"repository": {
|
|
5
5
|
"url": "https://github.com/ldengine/lde",
|
|
6
6
|
"directory": "packages/pipeline"
|
|
@@ -35,10 +35,10 @@
|
|
|
35
35
|
"!**/*.tsbuildinfo"
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@lde/dataset": "0.6.
|
|
39
|
-
"@lde/dataset-registry-client": "0.6.
|
|
40
|
-
"@lde/sparql-importer": "0.2.
|
|
41
|
-
"@lde/sparql-server": "0.4.
|
|
38
|
+
"@lde/dataset": "0.6.5",
|
|
39
|
+
"@lde/dataset-registry-client": "0.6.11",
|
|
40
|
+
"@lde/sparql-importer": "0.2.5",
|
|
41
|
+
"@lde/sparql-server": "0.4.5",
|
|
42
42
|
"@rdfjs/types": "^2.0.1",
|
|
43
43
|
"c12": "^3.0.2",
|
|
44
44
|
"fetch-sparql-endpoint": "^6.0.0",
|