@comunica/actor-query-operation-leftjoin 3.3.0 → 4.0.1
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/README.md +4 -2
- package/components/ActorQueryOperationLeftJoin.jsonld +52 -22
- package/components/components.jsonld +1 -1
- package/components/context.jsonld +11 -5
- package/lib/ActorQueryOperationLeftJoin.d.ts +6 -9
- package/lib/ActorQueryOperationLeftJoin.js +10 -9
- package/lib/ActorQueryOperationLeftJoin.js.map +1 -1
- package/package.json +14 -10
package/README.md
CHANGED
|
@@ -23,7 +23,7 @@ After installing, this package can be added to your engine's configuration as fo
|
|
|
23
23
|
{
|
|
24
24
|
"@context": [
|
|
25
25
|
...
|
|
26
|
-
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-operation-leftjoin/^
|
|
26
|
+
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-operation-leftjoin/^4.0.0/components/context.jsonld"
|
|
27
27
|
],
|
|
28
28
|
"actors": [
|
|
29
29
|
...
|
|
@@ -32,7 +32,8 @@ After installing, this package can be added to your engine's configuration as fo
|
|
|
32
32
|
"@type": "ActorQueryOperationLeftJoin",
|
|
33
33
|
"mediatorQueryOperation": { "@id": "urn:comunica:default:query-operation/mediators#main" },
|
|
34
34
|
"mediatorJoin": { "@id": "urn:comunica:default:rdf-join/mediators#main" },
|
|
35
|
-
"mediatorMergeBindingsContext": { "@id": "urn:comunica:default:merge-bindings-context/mediators#main" }
|
|
35
|
+
"mediatorMergeBindingsContext": { "@id": "urn:comunica:default:merge-bindings-context/mediators#main" },
|
|
36
|
+
"expressionEvaluatorFactory": { "@id": "urn:comunica:default:expression-evaluator/evaluators#main" }
|
|
36
37
|
}
|
|
37
38
|
]
|
|
38
39
|
}
|
|
@@ -43,3 +44,4 @@ After installing, this package can be added to your engine's configuration as fo
|
|
|
43
44
|
* `mediatorQueryOperation`: A mediator over the [Query Operation bus](https://github.com/comunica/comunica/tree/master/packages/bus-query-operation).
|
|
44
45
|
* `mediatorJoin`: A mediator over the [RDF Join bus](https://github.com/comunica/comunica/tree/master/packages/bus-rdf-join).
|
|
45
46
|
* `mediatorMergeBindingsContext`: A mediator over the [Merge Bindings Context bus](https://github.com/comunica/comunica/tree/master/packages/bus-merge-bindings-context).
|
|
47
|
+
* `expressionEvaluatorFactory`: A factory to create an [Expression Evaluator](https://github.com/comunica/comunica/tree/master/packages/expression-evaluator);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"@context": [
|
|
3
|
-
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-operation-leftjoin/^
|
|
4
|
-
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/core/^
|
|
5
|
-
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-query-operation/^
|
|
3
|
+
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-operation-leftjoin/^4.0.0/components/context.jsonld",
|
|
4
|
+
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/core/^4.0.0/components/context.jsonld",
|
|
5
|
+
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-query-operation/^4.0.0/components/context.jsonld"
|
|
6
6
|
],
|
|
7
7
|
"@id": "npmd:@comunica/actor-query-operation-leftjoin",
|
|
8
8
|
"components": [
|
|
@@ -27,9 +27,8 @@
|
|
|
27
27
|
"comment": "A mediator for joining Bindings streams"
|
|
28
28
|
},
|
|
29
29
|
{
|
|
30
|
-
"@id": "caqol:components/ActorQueryOperationLeftJoin.jsonld#
|
|
31
|
-
"range": "cc:components/Mediator.jsonld#Mediator"
|
|
32
|
-
"comment": "A mediator for creating binding context merge handlers"
|
|
30
|
+
"@id": "caqol:components/ActorQueryOperationLeftJoin.jsonld#ActorQueryOperationLeftJoin_args_mediatorExpressionEvaluatorFactory",
|
|
31
|
+
"range": "cc:components/Mediator.jsonld#Mediator"
|
|
33
32
|
},
|
|
34
33
|
{
|
|
35
34
|
"@id": "caqol:components/ActorQueryOperationLeftJoin.jsonld#ActorQueryOperationLeftJoin_args_mediatorQueryOperation",
|
|
@@ -55,29 +54,37 @@
|
|
|
55
54
|
"genericTypeInstances": [
|
|
56
55
|
{
|
|
57
56
|
"@type": "ParameterRangeGenericTypeReference",
|
|
58
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
57
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
|
|
59
58
|
},
|
|
60
59
|
{
|
|
61
60
|
"@type": "ParameterRangeGenericTypeReference",
|
|
62
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
61
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
|
|
63
62
|
},
|
|
64
63
|
{
|
|
65
64
|
"@type": "ParameterRangeGenericTypeReference",
|
|
66
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
65
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"@type": "ParameterRangeGenericTypeReference",
|
|
69
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
|
|
67
70
|
}
|
|
68
71
|
]
|
|
69
72
|
},
|
|
70
73
|
{
|
|
71
74
|
"@type": "ParameterRangeGenericTypeReference",
|
|
72
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
75
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
|
|
73
76
|
},
|
|
74
77
|
{
|
|
75
78
|
"@type": "ParameterRangeGenericTypeReference",
|
|
76
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
79
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
|
|
77
80
|
},
|
|
78
81
|
{
|
|
79
82
|
"@type": "ParameterRangeGenericTypeReference",
|
|
80
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
83
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"@type": "ParameterRangeGenericTypeReference",
|
|
87
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
|
|
81
88
|
}
|
|
82
89
|
]
|
|
83
90
|
},
|
|
@@ -87,6 +94,20 @@
|
|
|
87
94
|
},
|
|
88
95
|
"comment": "The bus this actor subscribes to."
|
|
89
96
|
},
|
|
97
|
+
{
|
|
98
|
+
"@id": "caqol:components/ActorQueryOperationLeftJoin.jsonld#ActorQueryOperationLeftJoin_args_busFailMessage",
|
|
99
|
+
"range": {
|
|
100
|
+
"@type": "ParameterRangeUnion",
|
|
101
|
+
"parameterRangeElements": [
|
|
102
|
+
"xsd:string",
|
|
103
|
+
{
|
|
104
|
+
"@type": "ParameterRangeUndefined"
|
|
105
|
+
}
|
|
106
|
+
]
|
|
107
|
+
},
|
|
108
|
+
"default": "Query operation processing failed: none of the configured actors were able to handle the operation type ${action.operation.type}",
|
|
109
|
+
"comment": "The message that will be configured in the bus for reporting failures. This message may be a template string that contains references to the executed `action`. For example, the following templated string is allowed: \"RDF dereferencing failed: no actors could handle ${action.handle.mediaType}\""
|
|
110
|
+
},
|
|
90
111
|
{
|
|
91
112
|
"@id": "caqol:components/ActorQueryOperationLeftJoin.jsonld#ActorQueryOperationLeftJoin_args_beforeActors",
|
|
92
113
|
"range": {
|
|
@@ -100,15 +121,19 @@
|
|
|
100
121
|
"genericTypeInstances": [
|
|
101
122
|
{
|
|
102
123
|
"@type": "ParameterRangeGenericTypeReference",
|
|
103
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
124
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
|
|
104
125
|
},
|
|
105
126
|
{
|
|
106
127
|
"@type": "ParameterRangeGenericTypeReference",
|
|
107
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
128
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
|
|
108
129
|
},
|
|
109
130
|
{
|
|
110
131
|
"@type": "ParameterRangeGenericTypeReference",
|
|
111
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
132
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
"@type": "ParameterRangeGenericTypeReference",
|
|
136
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
|
|
112
137
|
}
|
|
113
138
|
]
|
|
114
139
|
}
|
|
@@ -128,9 +153,8 @@
|
|
|
128
153
|
"range": "cc:components/Mediator.jsonld#Mediator"
|
|
129
154
|
},
|
|
130
155
|
{
|
|
131
|
-
"@id": "caqol:components/ActorQueryOperationLeftJoin.jsonld#
|
|
132
|
-
"memberFieldName": "
|
|
133
|
-
"range": "cc:components/Mediator.jsonld#Mediator"
|
|
156
|
+
"@id": "caqol:components/ActorQueryOperationLeftJoin.jsonld#ActorQueryOperationLeftJoin__member_mediatorExpressionEvaluatorFactory",
|
|
157
|
+
"memberFieldName": "mediatorExpressionEvaluatorFactory"
|
|
134
158
|
},
|
|
135
159
|
{
|
|
136
160
|
"@id": "caqol:components/ActorQueryOperationLeftJoin.jsonld#ActorQueryOperationLeftJoin__member_constructor",
|
|
@@ -156,9 +180,9 @@
|
|
|
156
180
|
}
|
|
157
181
|
},
|
|
158
182
|
{
|
|
159
|
-
"keyRaw": "
|
|
183
|
+
"keyRaw": "mediatorExpressionEvaluatorFactory",
|
|
160
184
|
"value": {
|
|
161
|
-
"@id": "caqol:components/ActorQueryOperationLeftJoin.jsonld#
|
|
185
|
+
"@id": "caqol:components/ActorQueryOperationLeftJoin.jsonld#ActorQueryOperationLeftJoin_args_mediatorExpressionEvaluatorFactory"
|
|
162
186
|
}
|
|
163
187
|
},
|
|
164
188
|
{
|
|
@@ -179,6 +203,12 @@
|
|
|
179
203
|
"@id": "caqol:components/ActorQueryOperationLeftJoin.jsonld#ActorQueryOperationLeftJoin_args_bus"
|
|
180
204
|
}
|
|
181
205
|
},
|
|
206
|
+
{
|
|
207
|
+
"keyRaw": "busFailMessage",
|
|
208
|
+
"value": {
|
|
209
|
+
"@id": "caqol:components/ActorQueryOperationLeftJoin.jsonld#ActorQueryOperationLeftJoin_args_busFailMessage"
|
|
210
|
+
}
|
|
211
|
+
},
|
|
182
212
|
{
|
|
183
213
|
"keyRaw": "beforeActors",
|
|
184
214
|
"value": {
|
|
@@ -203,8 +233,8 @@
|
|
|
203
233
|
"memberFieldName": "mediatorJoin"
|
|
204
234
|
},
|
|
205
235
|
{
|
|
206
|
-
"@id": "caqol:components/ActorQueryOperationLeftJoin.jsonld#
|
|
207
|
-
"memberFieldName": "
|
|
236
|
+
"@id": "caqol:components/ActorQueryOperationLeftJoin.jsonld#IActorQueryOperationLeftJoinArgs__member_mediatorExpressionEvaluatorFactory",
|
|
237
|
+
"memberFieldName": "mediatorExpressionEvaluatorFactory"
|
|
208
238
|
}
|
|
209
239
|
],
|
|
210
240
|
"constructorArguments": []
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"@context": [
|
|
3
|
-
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-operation-leftjoin/^
|
|
3
|
+
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-operation-leftjoin/^4.0.0/components/context.jsonld"
|
|
4
4
|
],
|
|
5
5
|
"@id": "npmd:@comunica/actor-query-operation-leftjoin",
|
|
6
6
|
"@type": "Module",
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"https://linkedsoftwaredependencies.org/bundles/npm/componentsjs/^6.0.0/components/context.jsonld",
|
|
4
4
|
{
|
|
5
5
|
"npmd": "https://linkedsoftwaredependencies.org/bundles/npm/",
|
|
6
|
-
"caqol": "npmd:@comunica/actor-query-operation-leftjoin/^
|
|
6
|
+
"caqol": "npmd:@comunica/actor-query-operation-leftjoin/^4.0.0/",
|
|
7
7
|
"ActorQueryOperationLeftJoin": {
|
|
8
8
|
"@id": "caqol:components/ActorQueryOperationLeftJoin.jsonld#ActorQueryOperationLeftJoin",
|
|
9
9
|
"@prefix": true,
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
"args_mediatorJoin": {
|
|
12
12
|
"@id": "caqol:components/ActorQueryOperationLeftJoin.jsonld#ActorQueryOperationLeftJoin_args_mediatorJoin"
|
|
13
13
|
},
|
|
14
|
-
"
|
|
15
|
-
"@id": "caqol:components/ActorQueryOperationLeftJoin.jsonld#
|
|
14
|
+
"args_mediatorExpressionEvaluatorFactory": {
|
|
15
|
+
"@id": "caqol:components/ActorQueryOperationLeftJoin.jsonld#ActorQueryOperationLeftJoin_args_mediatorExpressionEvaluatorFactory"
|
|
16
16
|
},
|
|
17
17
|
"args_mediatorQueryOperation": {
|
|
18
18
|
"@id": "caqol:components/ActorQueryOperationLeftJoin.jsonld#ActorQueryOperationLeftJoin_args_mediatorQueryOperation"
|
|
@@ -23,6 +23,9 @@
|
|
|
23
23
|
"args_bus": {
|
|
24
24
|
"@id": "caqol:components/ActorQueryOperationLeftJoin.jsonld#ActorQueryOperationLeftJoin_args_bus"
|
|
25
25
|
},
|
|
26
|
+
"args_busFailMessage": {
|
|
27
|
+
"@id": "caqol:components/ActorQueryOperationLeftJoin.jsonld#ActorQueryOperationLeftJoin_args_busFailMessage"
|
|
28
|
+
},
|
|
26
29
|
"args_beforeActors": {
|
|
27
30
|
"@id": "caqol:components/ActorQueryOperationLeftJoin.jsonld#ActorQueryOperationLeftJoin_args_beforeActors",
|
|
28
31
|
"@container": "@list"
|
|
@@ -30,8 +33,8 @@
|
|
|
30
33
|
"mediatorJoin": {
|
|
31
34
|
"@id": "caqol:components/ActorQueryOperationLeftJoin.jsonld#ActorQueryOperationLeftJoin_args_mediatorJoin"
|
|
32
35
|
},
|
|
33
|
-
"
|
|
34
|
-
"@id": "caqol:components/ActorQueryOperationLeftJoin.jsonld#
|
|
36
|
+
"mediatorExpressionEvaluatorFactory": {
|
|
37
|
+
"@id": "caqol:components/ActorQueryOperationLeftJoin.jsonld#ActorQueryOperationLeftJoin_args_mediatorExpressionEvaluatorFactory"
|
|
35
38
|
},
|
|
36
39
|
"mediatorQueryOperation": {
|
|
37
40
|
"@id": "caqol:components/ActorQueryOperationLeftJoin.jsonld#ActorQueryOperationLeftJoin_args_mediatorQueryOperation"
|
|
@@ -42,6 +45,9 @@
|
|
|
42
45
|
"bus": {
|
|
43
46
|
"@id": "caqol:components/ActorQueryOperationLeftJoin.jsonld#ActorQueryOperationLeftJoin_args_bus"
|
|
44
47
|
},
|
|
48
|
+
"busFailMessage": {
|
|
49
|
+
"@id": "caqol:components/ActorQueryOperationLeftJoin.jsonld#ActorQueryOperationLeftJoin_args_busFailMessage"
|
|
50
|
+
},
|
|
45
51
|
"beforeActors": {
|
|
46
52
|
"@id": "caqol:components/ActorQueryOperationLeftJoin.jsonld#ActorQueryOperationLeftJoin_args_beforeActors",
|
|
47
53
|
"@container": "@list"
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { MediatorExpressionEvaluatorFactory } from '@comunica/bus-expression-evaluator-factory';
|
|
2
2
|
import type { IActorQueryOperationTypedMediatedArgs } from '@comunica/bus-query-operation';
|
|
3
3
|
import { ActorQueryOperationTypedMediated } from '@comunica/bus-query-operation';
|
|
4
4
|
import type { MediatorRdfJoin } from '@comunica/bus-rdf-join';
|
|
5
|
-
import type { IActorTest } from '@comunica/core';
|
|
6
|
-
import type {
|
|
5
|
+
import type { IActorTest, TestResult } from '@comunica/core';
|
|
6
|
+
import type { IActionContext, IQueryOperationResult } from '@comunica/types';
|
|
7
7
|
import type { Algebra } from 'sparqlalgebrajs';
|
|
8
8
|
/**
|
|
9
9
|
* A comunica LeftJoin Query Operation Actor.
|
|
10
10
|
*/
|
|
11
11
|
export declare class ActorQueryOperationLeftJoin extends ActorQueryOperationTypedMediated<Algebra.LeftJoin> {
|
|
12
12
|
readonly mediatorJoin: MediatorRdfJoin;
|
|
13
|
-
readonly
|
|
13
|
+
private readonly mediatorExpressionEvaluatorFactory;
|
|
14
14
|
constructor(args: IActorQueryOperationLeftJoinArgs);
|
|
15
|
-
testOperation(_operation: Algebra.LeftJoin, _context: IActionContext): Promise<IActorTest
|
|
15
|
+
testOperation(_operation: Algebra.LeftJoin, _context: IActionContext): Promise<TestResult<IActorTest>>;
|
|
16
16
|
runOperation(operationOriginal: Algebra.LeftJoin, context: IActionContext): Promise<IQueryOperationResult>;
|
|
17
17
|
}
|
|
18
18
|
export interface IActorQueryOperationLeftJoinArgs extends IActorQueryOperationTypedMediatedArgs {
|
|
@@ -20,8 +20,5 @@ export interface IActorQueryOperationLeftJoinArgs extends IActorQueryOperationTy
|
|
|
20
20
|
* A mediator for joining Bindings streams
|
|
21
21
|
*/
|
|
22
22
|
mediatorJoin: MediatorRdfJoin;
|
|
23
|
-
|
|
24
|
-
* A mediator for creating binding context merge handlers
|
|
25
|
-
*/
|
|
26
|
-
mediatorMergeBindingsContext: MediatorMergeBindingsContext;
|
|
23
|
+
mediatorExpressionEvaluatorFactory: MediatorExpressionEvaluatorFactory;
|
|
27
24
|
}
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ActorQueryOperationLeftJoin = void 0;
|
|
4
|
-
const bindings_factory_1 = require("@comunica/bindings-factory");
|
|
5
4
|
const bus_query_operation_1 = require("@comunica/bus-query-operation");
|
|
6
|
-
const
|
|
5
|
+
const core_1 = require("@comunica/core");
|
|
6
|
+
const utils_expression_evaluator_1 = require("@comunica/utils-expression-evaluator");
|
|
7
|
+
const utils_query_operation_1 = require("@comunica/utils-query-operation");
|
|
7
8
|
/**
|
|
8
9
|
* A comunica LeftJoin Query Operation Actor.
|
|
9
10
|
*/
|
|
10
11
|
class ActorQueryOperationLeftJoin extends bus_query_operation_1.ActorQueryOperationTypedMediated {
|
|
11
12
|
constructor(args) {
|
|
12
13
|
super(args, 'leftjoin');
|
|
14
|
+
this.mediatorExpressionEvaluatorFactory = args.mediatorExpressionEvaluatorFactory;
|
|
13
15
|
}
|
|
14
16
|
async testOperation(_operation, _context) {
|
|
15
|
-
return
|
|
17
|
+
return (0, core_1.passTestVoid)();
|
|
16
18
|
}
|
|
17
19
|
async runOperation(operationOriginal, context) {
|
|
18
20
|
// Delegate to join bus
|
|
@@ -22,7 +24,7 @@ class ActorQueryOperationLeftJoin extends bus_query_operation_1.ActorQueryOperat
|
|
|
22
24
|
operation: subOperation,
|
|
23
25
|
}))))
|
|
24
26
|
.map(({ output, operation }) => ({
|
|
25
|
-
output:
|
|
27
|
+
output: (0, utils_query_operation_1.getSafeBindings)(output),
|
|
26
28
|
operation,
|
|
27
29
|
}));
|
|
28
30
|
const joined = await this.mediatorJoin.mediate({ type: 'optional', entries, context });
|
|
@@ -30,16 +32,15 @@ class ActorQueryOperationLeftJoin extends bus_query_operation_1.ActorQueryOperat
|
|
|
30
32
|
if (operationOriginal.expression) {
|
|
31
33
|
const rightMetadata = await entries[1].output.metadata();
|
|
32
34
|
const expressionVariables = rightMetadata.variables;
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
const evaluator = new expression_evaluator_1.AsyncEvaluator(operationOriginal.expression, config);
|
|
35
|
+
const evaluator = await this.mediatorExpressionEvaluatorFactory
|
|
36
|
+
.mediate({ algExpr: operationOriginal.expression, context });
|
|
36
37
|
const bindingsStream = joined.bindingsStream
|
|
37
38
|
.transform({
|
|
38
39
|
autoStart: false,
|
|
39
40
|
// eslint-disable-next-line ts/no-misused-promises
|
|
40
41
|
transform: async (bindings, done, push) => {
|
|
41
42
|
// If variables of the right-hand entry are missing, we skip expression evaluation
|
|
42
|
-
if (!expressionVariables.every(variable => bindings.has(variable.value))) {
|
|
43
|
+
if (!expressionVariables.every(variable => bindings.has(variable.variable.value))) {
|
|
43
44
|
push(bindings);
|
|
44
45
|
return done();
|
|
45
46
|
}
|
|
@@ -54,7 +55,7 @@ class ActorQueryOperationLeftJoin extends bus_query_operation_1.ActorQueryOperat
|
|
|
54
55
|
// Other errors (likely programming mistakes) are still propagated.
|
|
55
56
|
// Left Join is defined in terms of Filter (https://www.w3.org/TR/sparql11-query/#defn_algJoin),
|
|
56
57
|
// and Filter requires this (https://www.w3.org/TR/sparql11-query/#expressions).
|
|
57
|
-
if ((0,
|
|
58
|
+
if ((0, utils_expression_evaluator_1.isExpressionError)(error)) {
|
|
58
59
|
// In many cases, this is a user error, where the user should manually cast the variable to a string.
|
|
59
60
|
// In order to help users debug this, we should report these errors via the logger as warnings.
|
|
60
61
|
this.logWarn(context, 'Error occurred while filtering.', () => ({ error, bindings }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActorQueryOperationLeftJoin.js","sourceRoot":"","sources":["ActorQueryOperationLeftJoin.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"ActorQueryOperationLeftJoin.js","sourceRoot":"","sources":["ActorQueryOperationLeftJoin.ts"],"names":[],"mappings":"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","sourcesContent":["import type { MediatorExpressionEvaluatorFactory } from '@comunica/bus-expression-evaluator-factory';\nimport 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 { Bindings, IActionContext, IJoinEntry, IQueryOperationResult } from '@comunica/types';\nimport { isExpressionError } from '@comunica/utils-expression-evaluator';\nimport { getSafeBindings } from '@comunica/utils-query-operation';\nimport type { Algebra } from 'sparqlalgebrajs';\n\n/**\n * A comunica LeftJoin Query Operation Actor.\n */\nexport class ActorQueryOperationLeftJoin extends ActorQueryOperationTypedMediated<Algebra.LeftJoin> {\n public readonly mediatorJoin: MediatorRdfJoin;\n private readonly mediatorExpressionEvaluatorFactory: MediatorExpressionEvaluatorFactory;\n\n public constructor(args: IActorQueryOperationLeftJoinArgs) {\n super(args, 'leftjoin');\n this.mediatorExpressionEvaluatorFactory = args.mediatorExpressionEvaluatorFactory;\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\n const entries: IJoinEntry[] = (await Promise.all(operationOriginal.input\n .map(async subOperation => ({\n output: await this.mediatorQueryOperation.mediate({ operation: subOperation, context }),\n operation: subOperation,\n }))))\n .map(({ output, operation }) => ({\n output: getSafeBindings(output),\n operation,\n }));\n const joined = await this.mediatorJoin.mediate({ type: 'optional', entries, context });\n\n // If the pattern contains an expression, filter the resulting stream\n if (operationOriginal.expression) {\n const rightMetadata = await entries[1].output.metadata();\n const expressionVariables = rightMetadata.variables;\n const evaluator = await this.mediatorExpressionEvaluatorFactory\n .mediate({ algExpr: operationOriginal.expression, context });\n const bindingsStream = joined.bindingsStream\n .transform({\n autoStart: false,\n // eslint-disable-next-line ts/no-misused-promises\n transform: async(bindings: Bindings, done: () => void, push: (item: Bindings) => void) => {\n // If variables of the right-hand entry are missing, we skip expression evaluation\n if (!expressionVariables.every(variable => bindings.has(variable.variable.value))) {\n push(bindings);\n return done();\n }\n\n try {\n const result = await evaluator.evaluateAsEBV(bindings);\n if (result) {\n push(bindings);\n }\n } catch (error: unknown) {\n // We ignore all Expression errors.\n // Other errors (likely programming mistakes) are still propagated.\n // Left Join is defined in terms of Filter (https://www.w3.org/TR/sparql11-query/#defn_algJoin),\n // and Filter requires this (https://www.w3.org/TR/sparql11-query/#expressions).\n if (isExpressionError(<Error>error)) {\n // In many cases, this is a user error, where the user should manually cast the variable to a string.\n // In order to help users debug this, we should report these errors via the logger as warnings.\n this.logWarn(context, 'Error occurred while filtering.', () => ({ error, bindings }));\n } else {\n bindingsStream.emit('error', error);\n }\n }\n done();\n },\n });\n joined.bindingsStream = bindingsStream;\n }\n\n return joined;\n }\n}\n\nexport interface IActorQueryOperationLeftJoinArgs extends IActorQueryOperationTypedMediatedArgs {\n /**\n * A mediator for joining Bindings streams\n */\n mediatorJoin: MediatorRdfJoin;\n mediatorExpressionEvaluatorFactory: MediatorExpressionEvaluatorFactory;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@comunica/actor-query-operation-leftjoin",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.1",
|
|
4
4
|
"description": "A leftjoin query-operation actor",
|
|
5
5
|
"lsd:module": true,
|
|
6
6
|
"license": "MIT",
|
|
7
|
+
"funding": {
|
|
8
|
+
"type": "opencollective",
|
|
9
|
+
"url": "https://opencollective.com/comunica-association"
|
|
10
|
+
},
|
|
7
11
|
"homepage": "https://comunica.dev/",
|
|
8
12
|
"repository": {
|
|
9
13
|
"type": "git",
|
|
@@ -37,14 +41,14 @@
|
|
|
37
41
|
"build:components": "componentsjs-generator"
|
|
38
42
|
},
|
|
39
43
|
"dependencies": {
|
|
40
|
-
"@comunica/
|
|
41
|
-
"@comunica/bus-
|
|
42
|
-
"@comunica/bus-
|
|
43
|
-
"@comunica/
|
|
44
|
-
"@comunica/
|
|
45
|
-
"@comunica/expression-evaluator": "^
|
|
46
|
-
"@comunica/
|
|
47
|
-
"sparqlalgebrajs": "^4.3.
|
|
44
|
+
"@comunica/bus-expression-evaluator-factory": "^4.0.1",
|
|
45
|
+
"@comunica/bus-query-operation": "^4.0.1",
|
|
46
|
+
"@comunica/bus-rdf-join": "^4.0.1",
|
|
47
|
+
"@comunica/core": "^4.0.1",
|
|
48
|
+
"@comunica/types": "^4.0.1",
|
|
49
|
+
"@comunica/utils-expression-evaluator": "^4.0.1",
|
|
50
|
+
"@comunica/utils-query-operation": "^4.0.1",
|
|
51
|
+
"sparqlalgebrajs": "^4.3.8"
|
|
48
52
|
},
|
|
49
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "67831ba79e45ea1ced41fe3f83c5d6e8802dbeaa"
|
|
50
54
|
}
|