@comunica/actor-query-operation-update-load 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 +1 -1
- package/components/ActorQueryOperationLoad.jsonld +44 -20
- package/components/components.jsonld +1 -1
- package/components/context.jsonld +7 -1
- package/lib/ActorQueryOperationLoad.d.ts +2 -4
- package/lib/ActorQueryOperationLoad.js +9 -8
- package/lib/ActorQueryOperationLoad.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-update-load/^
|
|
26
|
+
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-operation-update-load/^4.0.0/components/context.jsonld"
|
|
27
27
|
],
|
|
28
28
|
"actors": [
|
|
29
29
|
...
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"@context": [
|
|
3
|
-
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-operation-update-load/^
|
|
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-update-load/^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-update-load",
|
|
8
8
|
"components": [
|
|
@@ -55,29 +55,37 @@
|
|
|
55
55
|
"genericTypeInstances": [
|
|
56
56
|
{
|
|
57
57
|
"@type": "ParameterRangeGenericTypeReference",
|
|
58
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
58
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
|
|
59
59
|
},
|
|
60
60
|
{
|
|
61
61
|
"@type": "ParameterRangeGenericTypeReference",
|
|
62
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
62
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
|
|
63
63
|
},
|
|
64
64
|
{
|
|
65
65
|
"@type": "ParameterRangeGenericTypeReference",
|
|
66
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
66
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"@type": "ParameterRangeGenericTypeReference",
|
|
70
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
|
|
67
71
|
}
|
|
68
72
|
]
|
|
69
73
|
},
|
|
70
74
|
{
|
|
71
75
|
"@type": "ParameterRangeGenericTypeReference",
|
|
72
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
76
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
|
|
73
77
|
},
|
|
74
78
|
{
|
|
75
79
|
"@type": "ParameterRangeGenericTypeReference",
|
|
76
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
80
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
|
|
77
81
|
},
|
|
78
82
|
{
|
|
79
83
|
"@type": "ParameterRangeGenericTypeReference",
|
|
80
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
84
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"@type": "ParameterRangeGenericTypeReference",
|
|
88
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
|
|
81
89
|
}
|
|
82
90
|
]
|
|
83
91
|
},
|
|
@@ -87,6 +95,20 @@
|
|
|
87
95
|
},
|
|
88
96
|
"comment": "The bus this actor subscribes to."
|
|
89
97
|
},
|
|
98
|
+
{
|
|
99
|
+
"@id": "caqoul:components/ActorQueryOperationLoad.jsonld#ActorQueryOperationLoad_args_busFailMessage",
|
|
100
|
+
"range": {
|
|
101
|
+
"@type": "ParameterRangeUnion",
|
|
102
|
+
"parameterRangeElements": [
|
|
103
|
+
"xsd:string",
|
|
104
|
+
{
|
|
105
|
+
"@type": "ParameterRangeUndefined"
|
|
106
|
+
}
|
|
107
|
+
]
|
|
108
|
+
},
|
|
109
|
+
"default": "Query operation processing failed: none of the configured actors were able to handle the operation type ${action.operation.type}",
|
|
110
|
+
"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}\""
|
|
111
|
+
},
|
|
90
112
|
{
|
|
91
113
|
"@id": "caqoul:components/ActorQueryOperationLoad.jsonld#ActorQueryOperationLoad_args_beforeActors",
|
|
92
114
|
"range": {
|
|
@@ -100,15 +122,19 @@
|
|
|
100
122
|
"genericTypeInstances": [
|
|
101
123
|
{
|
|
102
124
|
"@type": "ParameterRangeGenericTypeReference",
|
|
103
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
125
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
|
|
104
126
|
},
|
|
105
127
|
{
|
|
106
128
|
"@type": "ParameterRangeGenericTypeReference",
|
|
107
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
129
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
|
|
108
130
|
},
|
|
109
131
|
{
|
|
110
132
|
"@type": "ParameterRangeGenericTypeReference",
|
|
111
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
133
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"@type": "ParameterRangeGenericTypeReference",
|
|
137
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
|
|
112
138
|
}
|
|
113
139
|
]
|
|
114
140
|
}
|
|
@@ -132,14 +158,6 @@
|
|
|
132
158
|
"memberFieldName": "mediatorQuerySourceIdentify",
|
|
133
159
|
"range": "cc:components/Mediator.jsonld#Mediator"
|
|
134
160
|
},
|
|
135
|
-
{
|
|
136
|
-
"@id": "caqoul:components/ActorQueryOperationLoad.jsonld#ActorQueryOperationLoad__member_factory",
|
|
137
|
-
"memberFieldName": "factory"
|
|
138
|
-
},
|
|
139
|
-
{
|
|
140
|
-
"@id": "caqoul:components/ActorQueryOperationLoad.jsonld#ActorQueryOperationLoad__member_constructOperation",
|
|
141
|
-
"memberFieldName": "constructOperation"
|
|
142
|
-
},
|
|
143
161
|
{
|
|
144
162
|
"@id": "caqoul:components/ActorQueryOperationLoad.jsonld#ActorQueryOperationLoad__member_constructor",
|
|
145
163
|
"memberFieldName": "constructor"
|
|
@@ -187,6 +205,12 @@
|
|
|
187
205
|
"@id": "caqoul:components/ActorQueryOperationLoad.jsonld#ActorQueryOperationLoad_args_bus"
|
|
188
206
|
}
|
|
189
207
|
},
|
|
208
|
+
{
|
|
209
|
+
"keyRaw": "busFailMessage",
|
|
210
|
+
"value": {
|
|
211
|
+
"@id": "caqoul:components/ActorQueryOperationLoad.jsonld#ActorQueryOperationLoad_args_busFailMessage"
|
|
212
|
+
}
|
|
213
|
+
},
|
|
190
214
|
{
|
|
191
215
|
"keyRaw": "beforeActors",
|
|
192
216
|
"value": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"@context": [
|
|
3
|
-
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-operation-update-load/^
|
|
3
|
+
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-operation-update-load/^4.0.0/components/context.jsonld"
|
|
4
4
|
],
|
|
5
5
|
"@id": "npmd:@comunica/actor-query-operation-update-load",
|
|
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
|
-
"caqoul": "npmd:@comunica/actor-query-operation-update-load/^
|
|
6
|
+
"caqoul": "npmd:@comunica/actor-query-operation-update-load/^4.0.0/",
|
|
7
7
|
"ActorQueryOperationLoad": {
|
|
8
8
|
"@id": "caqoul:components/ActorQueryOperationLoad.jsonld#ActorQueryOperationLoad",
|
|
9
9
|
"@prefix": true,
|
|
@@ -23,6 +23,9 @@
|
|
|
23
23
|
"args_bus": {
|
|
24
24
|
"@id": "caqoul:components/ActorQueryOperationLoad.jsonld#ActorQueryOperationLoad_args_bus"
|
|
25
25
|
},
|
|
26
|
+
"args_busFailMessage": {
|
|
27
|
+
"@id": "caqoul:components/ActorQueryOperationLoad.jsonld#ActorQueryOperationLoad_args_busFailMessage"
|
|
28
|
+
},
|
|
26
29
|
"args_beforeActors": {
|
|
27
30
|
"@id": "caqoul:components/ActorQueryOperationLoad.jsonld#ActorQueryOperationLoad_args_beforeActors",
|
|
28
31
|
"@container": "@list"
|
|
@@ -42,6 +45,9 @@
|
|
|
42
45
|
"bus": {
|
|
43
46
|
"@id": "caqoul:components/ActorQueryOperationLoad.jsonld#ActorQueryOperationLoad_args_bus"
|
|
44
47
|
},
|
|
48
|
+
"busFailMessage": {
|
|
49
|
+
"@id": "caqoul:components/ActorQueryOperationLoad.jsonld#ActorQueryOperationLoad_args_busFailMessage"
|
|
50
|
+
},
|
|
45
51
|
"beforeActors": {
|
|
46
52
|
"@id": "caqoul:components/ActorQueryOperationLoad.jsonld#ActorQueryOperationLoad_args_beforeActors",
|
|
47
53
|
"@container": "@list"
|
|
@@ -2,7 +2,7 @@ import type { IActorQueryOperationTypedMediatedArgs } from '@comunica/bus-query-
|
|
|
2
2
|
import { ActorQueryOperationTypedMediated } from '@comunica/bus-query-operation';
|
|
3
3
|
import type { MediatorQuerySourceIdentify } from '@comunica/bus-query-source-identify';
|
|
4
4
|
import type { MediatorRdfUpdateQuads } from '@comunica/bus-rdf-update-quads';
|
|
5
|
-
import type { IActorTest } from '@comunica/core';
|
|
5
|
+
import type { IActorTest, TestResult } from '@comunica/core';
|
|
6
6
|
import type { IActionContext, IQueryOperationResult } from '@comunica/types';
|
|
7
7
|
import type { Algebra } from 'sparqlalgebrajs';
|
|
8
8
|
/**
|
|
@@ -12,10 +12,8 @@ import type { Algebra } from 'sparqlalgebrajs';
|
|
|
12
12
|
export declare class ActorQueryOperationLoad extends ActorQueryOperationTypedMediated<Algebra.Load> {
|
|
13
13
|
readonly mediatorUpdateQuads: MediatorRdfUpdateQuads;
|
|
14
14
|
readonly mediatorQuerySourceIdentify: MediatorQuerySourceIdentify;
|
|
15
|
-
private readonly factory;
|
|
16
|
-
private readonly constructOperation;
|
|
17
15
|
constructor(args: IActorQueryOperationLoadArgs);
|
|
18
|
-
testOperation(operation: Algebra.Load, context: IActionContext): Promise<IActorTest
|
|
16
|
+
testOperation(operation: Algebra.Load, context: IActionContext): Promise<TestResult<IActorTest>>;
|
|
19
17
|
runOperation(operation: Algebra.Load, context: IActionContext): Promise<IQueryOperationResult>;
|
|
20
18
|
}
|
|
21
19
|
export interface IActorQueryOperationLoadArgs extends IActorQueryOperationTypedMediatedArgs {
|
|
@@ -3,9 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ActorQueryOperationLoad = void 0;
|
|
4
4
|
const bus_query_operation_1 = require("@comunica/bus-query-operation");
|
|
5
5
|
const context_entries_1 = require("@comunica/context-entries");
|
|
6
|
-
const
|
|
6
|
+
const utils_query_operation_1 = require("@comunica/utils-query-operation");
|
|
7
7
|
const sparqlalgebrajs_1 = require("sparqlalgebrajs");
|
|
8
|
-
const DF = new rdf_data_factory_1.DataFactory();
|
|
9
8
|
/**
|
|
10
9
|
* A [Query Operation](https://github.com/comunica/comunica/tree/master/packages/bus-query-operation) actor
|
|
11
10
|
* that handles SPARQL load operations.
|
|
@@ -13,13 +12,13 @@ const DF = new rdf_data_factory_1.DataFactory();
|
|
|
13
12
|
class ActorQueryOperationLoad extends bus_query_operation_1.ActorQueryOperationTypedMediated {
|
|
14
13
|
constructor(args) {
|
|
15
14
|
super(args, 'load');
|
|
16
|
-
this.factory = new sparqlalgebrajs_1.Factory();
|
|
17
15
|
}
|
|
18
16
|
async testOperation(operation, context) {
|
|
19
|
-
|
|
20
|
-
return true;
|
|
17
|
+
return (0, utils_query_operation_1.testReadOnly)(context);
|
|
21
18
|
}
|
|
22
19
|
async runOperation(operation, context) {
|
|
20
|
+
const dataFactory = context.getSafe(context_entries_1.KeysInitQuery.dataFactory);
|
|
21
|
+
const algebraFactory = new sparqlalgebrajs_1.Factory(dataFactory);
|
|
23
22
|
// Determine query source
|
|
24
23
|
let subContext = context;
|
|
25
24
|
if (operation.silent) {
|
|
@@ -30,14 +29,16 @@ class ActorQueryOperationLoad extends bus_query_operation_1.ActorQueryOperationT
|
|
|
30
29
|
context: subContext,
|
|
31
30
|
});
|
|
32
31
|
// Create CONSTRUCT query on the given source
|
|
33
|
-
const output =
|
|
34
|
-
operation:
|
|
32
|
+
const output = (0, utils_query_operation_1.getSafeQuads)(await this.mediatorQueryOperation.mediate({
|
|
33
|
+
operation: algebraFactory.createConstruct((0, utils_query_operation_1.assignOperationSource)(algebraFactory.createPattern(dataFactory.variable('s'), dataFactory.variable('p'), dataFactory.variable('o')), querySource), [algebraFactory
|
|
34
|
+
.createPattern(dataFactory.variable('s'), dataFactory.variable('p'), dataFactory.variable('o'))]),
|
|
35
35
|
context: subContext,
|
|
36
36
|
}));
|
|
37
37
|
// Determine quad stream to insert
|
|
38
38
|
let quadStream = output.quadStream;
|
|
39
39
|
if (operation.destination) {
|
|
40
|
-
quadStream = quadStream
|
|
40
|
+
quadStream = quadStream
|
|
41
|
+
.map(quad => dataFactory.quad(quad.subject, quad.predicate, quad.object, operation.destination));
|
|
41
42
|
}
|
|
42
43
|
// Insert quad stream
|
|
43
44
|
const { execute } = await this.mediatorUpdateQuads.mediate({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActorQueryOperationLoad.js","sourceRoot":"","sources":["ActorQueryOperationLoad.ts"],"names":[],"mappings":";;;AACA,
|
|
1
|
+
{"version":3,"file":"ActorQueryOperationLoad.js","sourceRoot":"","sources":["ActorQueryOperationLoad.ts"],"names":[],"mappings":";;;AACA,uEAAiF;AAGjF,+DAA0D;AAG1D,2EAAoG;AAEpG,qDAA0C;AAE1C;;;GAGG;AACH,MAAa,uBAAwB,SAAQ,sDAA8C;IAIzF,YAAmB,IAAkC;QACnD,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACtB,CAAC;IAEM,KAAK,CAAC,aAAa,CAAC,SAAuB,EAAE,OAAuB;QACzE,OAAO,IAAA,oCAAY,EAAC,OAAO,CAAC,CAAC;IAC/B,CAAC;IAEM,KAAK,CAAC,YAAY,CAAC,SAAuB,EAAE,OAAuB;QAExE,MAAM,WAAW,GAAwB,OAAO,CAAC,OAAO,CAAC,+BAAa,CAAC,WAAW,CAAC,CAAC;QACpF,MAAM,cAAc,GAAG,IAAI,yBAAO,CAAC,WAAW,CAAC,CAAC;QAEhD,yBAAyB;QACzB,IAAI,UAAU,GAAG,OAAO,CAAC;QACzB,IAAI,SAAS,CAAC,MAAM,EAAE,CAAC;YACrB,UAAU,GAAG,UAAU,CAAC,GAAG,CAAC,+BAAa,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QAC3D,CAAC;QACD,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,IAAI,CAAC,2BAA2B,CAAC,OAAO,CAAC;YACrE,uBAAuB,EAAE,EAAE,KAAK,EAAE,SAAS,CAAC,MAAM,CAAC,KAAK,EAAE;YAC1D,OAAO,EAAE,UAAU;SACpB,CAAC,CAAC;QAEH,6CAA6C;QAC7C,MAAM,MAAM,GAAG,IAAA,oCAAY,EAAC,MAAM,IAAI,CAAC,sBAAsB,CAAC,OAAO,CAAC;YACpE,SAAS,EAAE,cAAc,CAAC,eAAe,CACvC,IAAA,6CAAqB,EACnB,cAAc,CAAC,aAAa,CAAC,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,EAC7G,WAAW,CACZ,EACD,CAAE,cAAc;qBACb,aAAa,CAAC,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAE,CACpG;YACD,OAAO,EAAE,UAAU;SACpB,CAAC,CAAC,CAAC;QAEJ,kCAAkC;QAClC,IAAI,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;QACnC,IAAI,SAAS,CAAC,WAAW,EAAE,CAAC;YAC1B,UAAU,GAAG,UAAU;iBACpB,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,MAAM,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC;QACrG,CAAC;QAED,qBAAqB;QACrB,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC;YACzD,gBAAgB,EAAE,UAAU;YAC5B,OAAO;SACR,CAAC,CAAC;QAEH,OAAO;YACL,IAAI,EAAE,MAAM;YACZ,OAAO;SACR,CAAC;IACJ,CAAC;CACF;AA1DD,0DA0DC","sourcesContent":["import type { IActorQueryOperationTypedMediatedArgs } from '@comunica/bus-query-operation';\nimport { ActorQueryOperationTypedMediated } from '@comunica/bus-query-operation';\nimport type { MediatorQuerySourceIdentify } from '@comunica/bus-query-source-identify';\nimport type { MediatorRdfUpdateQuads } from '@comunica/bus-rdf-update-quads';\nimport { KeysInitQuery } from '@comunica/context-entries';\nimport type { IActorTest, TestResult } from '@comunica/core';\nimport type { ComunicaDataFactory, IActionContext, IQueryOperationResult } from '@comunica/types';\nimport { assignOperationSource, getSafeQuads, testReadOnly } from '@comunica/utils-query-operation';\nimport type { Algebra } from 'sparqlalgebrajs';\nimport { Factory } from 'sparqlalgebrajs';\n\n/**\n * A [Query Operation](https://github.com/comunica/comunica/tree/master/packages/bus-query-operation) actor\n * that handles SPARQL load operations.\n */\nexport class ActorQueryOperationLoad extends ActorQueryOperationTypedMediated<Algebra.Load> {\n public readonly mediatorUpdateQuads: MediatorRdfUpdateQuads;\n public readonly mediatorQuerySourceIdentify: MediatorQuerySourceIdentify;\n\n public constructor(args: IActorQueryOperationLoadArgs) {\n super(args, 'load');\n }\n\n public async testOperation(operation: Algebra.Load, context: IActionContext): Promise<TestResult<IActorTest>> {\n return testReadOnly(context);\n }\n\n public async runOperation(operation: Algebra.Load, context: IActionContext):\n Promise<IQueryOperationResult> {\n const dataFactory: ComunicaDataFactory = context.getSafe(KeysInitQuery.dataFactory);\n const algebraFactory = new Factory(dataFactory);\n\n // Determine query source\n let subContext = context;\n if (operation.silent) {\n subContext = subContext.set(KeysInitQuery.lenient, true);\n }\n const { querySource } = await this.mediatorQuerySourceIdentify.mediate({\n querySourceUnidentified: { value: operation.source.value },\n context: subContext,\n });\n\n // Create CONSTRUCT query on the given source\n const output = getSafeQuads(await this.mediatorQueryOperation.mediate({\n operation: algebraFactory.createConstruct(\n assignOperationSource(\n algebraFactory.createPattern(dataFactory.variable('s'), dataFactory.variable('p'), dataFactory.variable('o')),\n querySource,\n ),\n [ algebraFactory\n .createPattern(dataFactory.variable('s'), dataFactory.variable('p'), dataFactory.variable('o')) ],\n ),\n context: subContext,\n }));\n\n // Determine quad stream to insert\n let quadStream = output.quadStream;\n if (operation.destination) {\n quadStream = quadStream\n .map(quad => dataFactory.quad(quad.subject, quad.predicate, quad.object, operation.destination));\n }\n\n // Insert quad stream\n const { execute } = await this.mediatorUpdateQuads.mediate({\n quadStreamInsert: quadStream,\n context,\n });\n\n return {\n type: 'void',\n execute,\n };\n }\n}\n\nexport interface IActorQueryOperationLoadArgs extends IActorQueryOperationTypedMediatedArgs {\n /**\n * The RDF Update Quads mediator\n */\n mediatorUpdateQuads: MediatorRdfUpdateQuads;\n /**\n * Mediator for identifying load sources.\n */\n mediatorQuerySourceIdentify: MediatorQuerySourceIdentify;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@comunica/actor-query-operation-update-load",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.1",
|
|
4
4
|
"description": "A load 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/bus-query-operation": "^
|
|
41
|
-
"@comunica/bus-query-source-identify": "^
|
|
42
|
-
"@comunica/bus-rdf-update-quads": "^
|
|
43
|
-
"@comunica/context-entries": "^
|
|
44
|
-
"@comunica/core": "^
|
|
45
|
-
"@comunica/types": "^
|
|
46
|
-
"
|
|
47
|
-
"sparqlalgebrajs": "^4.3.
|
|
44
|
+
"@comunica/bus-query-operation": "^4.0.1",
|
|
45
|
+
"@comunica/bus-query-source-identify": "^4.0.1",
|
|
46
|
+
"@comunica/bus-rdf-update-quads": "^4.0.1",
|
|
47
|
+
"@comunica/context-entries": "^4.0.1",
|
|
48
|
+
"@comunica/core": "^4.0.1",
|
|
49
|
+
"@comunica/types": "^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
|
}
|