@comunica/actor-query-operation-leftjoin 5.3.0 → 5.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ActorQueryOperationLeftJoin = void 0;
|
|
4
4
|
const bus_query_operation_1 = require("@comunica/bus-query-operation");
|
|
5
|
-
const context_entries_1 = require("@comunica/context-entries");
|
|
6
5
|
const core_1 = require("@comunica/core");
|
|
7
6
|
const utils_algebra_1 = require("@comunica/utils-algebra");
|
|
8
7
|
const utils_query_operation_1 = require("@comunica/utils-query-operation");
|
|
@@ -19,28 +18,19 @@ class ActorQueryOperationLeftJoin extends bus_query_operation_1.ActorQueryOperat
|
|
|
19
18
|
return (0, core_1.passTestVoid)();
|
|
20
19
|
}
|
|
21
20
|
async runOperation(operationOriginal, context) {
|
|
22
|
-
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
const output = (0, utils_query_operation_1.getSafeBindings)(await this.mediatorQueryOperation.mediate({ operation: subOperation, context }));
|
|
28
|
-
// If we have an expression in the left join,
|
|
29
|
-
// we attach the expression to the right-hand operation,
|
|
30
|
-
// and enforce a bind-join.
|
|
31
|
-
if (operationOriginal.expression && index === 1) {
|
|
32
|
-
return {
|
|
33
|
-
output,
|
|
34
|
-
operation: algebraFactory.createFilter(subOperation, operationOriginal.expression),
|
|
35
|
-
operationRequired: true,
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
return {
|
|
39
|
-
output,
|
|
40
|
-
operation: subOperation,
|
|
41
|
-
};
|
|
21
|
+
// Delegate to join bus, which decides how the expression is evaluated
|
|
22
|
+
const entries = await Promise.all(operationOriginal.input
|
|
23
|
+
.map(async (subOperation) => ({
|
|
24
|
+
output: (0, utils_query_operation_1.getSafeBindings)(await this.mediatorQueryOperation.mediate({ operation: subOperation, context })),
|
|
25
|
+
operation: subOperation,
|
|
42
26
|
})));
|
|
43
|
-
|
|
27
|
+
const expression = operationOriginal.expression;
|
|
28
|
+
return await this.mediatorJoin.mediate({
|
|
29
|
+
type: 'optional',
|
|
30
|
+
entries,
|
|
31
|
+
context,
|
|
32
|
+
...expression ? { expression } : {},
|
|
33
|
+
});
|
|
44
34
|
}
|
|
45
35
|
}
|
|
46
36
|
exports.ActorQueryOperationLeftJoin = ActorQueryOperationLeftJoin;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActorQueryOperationLeftJoin.js","sourceRoot":"","sources":["ActorQueryOperationLeftJoin.ts"],"names":[],"mappings":";;;AACA,uEAAiF;
|
|
1
|
+
{"version":3,"file":"ActorQueryOperationLeftJoin.js","sourceRoot":"","sources":["ActorQueryOperationLeftJoin.ts"],"names":[],"mappings":";;;AACA,uEAAiF;AAGjF,yCAA8C;AAE9C,2DAAkD;AAClD,2EAAkE;AAElE;;GAEG;AACH,MAAa,2BAA4B,SAAQ,sDAAkD;IACjF,YAAY,CAAkB;IAE9C,YAAmB,IAAsC;QACvD,KAAK,CAAC,IAAI,EAAE,uBAAO,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QACrC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;IACxC,CAAC;IAEM,KAAK,CAAC,aAAa,CAAC,UAA4B,EAAE,QAAwB;QAC/E,OAAO,IAAA,mBAAY,GAAE,CAAC;IACxB,CAAC;IAEM,KAAK,CAAC,YAAY,CAAC,iBAAmC,EAAE,OAAuB;QAEpF,sEAAsE;QACtE,MAAM,OAAO,GAAiB,MAAM,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,KAAK;aACpE,GAAG,CAAC,KAAK,EAAC,YAAY,EAAC,EAAE,CAAC,CAAC;YAC1B,MAAM,EAAE,IAAA,uCAAe,EAAC,MAAM,IAAI,CAAC,sBAAsB,CAAC,OAAO,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,OAAO,EAAE,CAAC,CAAC;YACxG,SAAS,EAAE,YAAY;SACxB,CAAC,CAAC,CAAC,CAAC;QAEP,MAAM,UAAU,GAAG,iBAAiB,CAAC,UAAU,CAAC;QAChD,OAAO,MAAM,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC;YACrC,IAAI,EAAE,UAAU;YAChB,OAAO;YACP,OAAO;YACP,GAAG,UAAU,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE;SACpC,CAAC,CAAC;IACL,CAAC;CACF;AA7BD,kEA6BC","sourcesContent":["import type { IActorQueryOperationTypedMediatedArgs } from '@comunica/bus-query-operation';\nimport { ActorQueryOperationTypedMediated } from '@comunica/bus-query-operation';\nimport type { MediatorRdfJoin } from '@comunica/bus-rdf-join';\nimport type { IActorTest, TestResult } from '@comunica/core';\nimport { passTestVoid } from '@comunica/core';\nimport type { IActionContext, IJoinEntry, IQueryOperationResult } from '@comunica/types';\nimport { Algebra } from '@comunica/utils-algebra';\nimport { getSafeBindings } from '@comunica/utils-query-operation';\n\n/**\n * A comunica LeftJoin Query Operation Actor.\n */\nexport class ActorQueryOperationLeftJoin extends ActorQueryOperationTypedMediated<Algebra.LeftJoin> {\n public readonly mediatorJoin: MediatorRdfJoin;\n\n public constructor(args: IActorQueryOperationLeftJoinArgs) {\n super(args, Algebra.Types.LEFT_JOIN);\n this.mediatorJoin = args.mediatorJoin;\n }\n\n public async testOperation(_operation: Algebra.LeftJoin, _context: IActionContext): Promise<TestResult<IActorTest>> {\n return passTestVoid();\n }\n\n public async runOperation(operationOriginal: Algebra.LeftJoin, context: IActionContext):\n Promise<IQueryOperationResult> {\n // Delegate to join bus, which decides how the expression is evaluated\n const entries: IJoinEntry[] = await Promise.all(operationOriginal.input\n .map(async subOperation => ({\n output: getSafeBindings(await this.mediatorQueryOperation.mediate({ operation: subOperation, context })),\n operation: subOperation,\n })));\n\n const expression = operationOriginal.expression;\n return await this.mediatorJoin.mediate({\n type: 'optional',\n entries,\n context,\n ...expression ? { expression } : {},\n });\n }\n}\n\nexport interface IActorQueryOperationLeftJoinArgs extends IActorQueryOperationTypedMediatedArgs {\n /**\n * A mediator for joining Bindings streams\n */\n mediatorJoin: MediatorRdfJoin;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@comunica/actor-query-operation-leftjoin",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.5.0",
|
|
4
4
|
"description": "A leftjoin query-operation actor",
|
|
5
5
|
"lsd:module": true,
|
|
6
6
|
"license": "MIT",
|
|
@@ -41,13 +41,12 @@
|
|
|
41
41
|
"build:components": "componentsjs-generator"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@comunica/bus-query-operation": "^5.
|
|
45
|
-
"@comunica/bus-rdf-join": "^5.
|
|
46
|
-
"@comunica/
|
|
47
|
-
"@comunica/
|
|
48
|
-
"@comunica/
|
|
49
|
-
"@comunica/utils-
|
|
50
|
-
"@comunica/utils-query-operation": "^5.3.0"
|
|
44
|
+
"@comunica/bus-query-operation": "^5.5.0",
|
|
45
|
+
"@comunica/bus-rdf-join": "^5.5.0",
|
|
46
|
+
"@comunica/core": "^5.5.0",
|
|
47
|
+
"@comunica/types": "^5.5.0",
|
|
48
|
+
"@comunica/utils-algebra": "^5.5.0",
|
|
49
|
+
"@comunica/utils-query-operation": "^5.5.0"
|
|
51
50
|
},
|
|
52
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "3a258e018a9c5f0b03f531b30ee1cdc659b5b7c9"
|
|
53
52
|
}
|