@comunica/actor-query-operation-update-load 4.4.0 → 4.4.2-alpha.49.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.
- package/components/ActorQueryOperationLoad.jsonld +11 -1
- package/components/components.jsonld +0 -0
- package/components/context.jsonld +0 -0
- package/lib/ActorQueryOperationLoad.d.ts +1 -1
- package/lib/ActorQueryOperationLoad.js +3 -3
- package/lib/ActorQueryOperationLoad.js.map +1 -1
- package/lib/index.d.ts +0 -0
- package/lib/index.js +0 -0
- package/lib/index.js.map +0 -0
- package/package.json +10 -10
|
@@ -15,7 +15,17 @@
|
|
|
15
15
|
"@type": "GenericComponentExtension",
|
|
16
16
|
"component": "cbqo:components/ActorQueryOperationTypedMediated.jsonld#ActorQueryOperationTypedMediated",
|
|
17
17
|
"genericTypeInstances": [
|
|
18
|
-
|
|
18
|
+
{
|
|
19
|
+
"@type": "ParameterRangeIntersection",
|
|
20
|
+
"parameterRangeElements": [
|
|
21
|
+
{
|
|
22
|
+
"@type": "ParameterRangeWildcard"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"@type": "ParameterRangeWildcard"
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
}
|
|
19
29
|
]
|
|
20
30
|
}
|
|
21
31
|
],
|
|
File without changes
|
|
File without changes
|
|
@@ -4,7 +4,7 @@ import type { MediatorQuerySourceIdentify } from '@comunica/bus-query-source-ide
|
|
|
4
4
|
import type { MediatorRdfUpdateQuads } from '@comunica/bus-rdf-update-quads';
|
|
5
5
|
import type { IActorTest, TestResult } from '@comunica/core';
|
|
6
6
|
import type { IActionContext, IQueryOperationResult } from '@comunica/types';
|
|
7
|
-
import
|
|
7
|
+
import { Algebra } from '@comunica/utils-algebra';
|
|
8
8
|
/**
|
|
9
9
|
* A [Query Operation](https://github.com/comunica/comunica/tree/master/packages/bus-query-operation) actor
|
|
10
10
|
* that handles SPARQL load operations.
|
|
@@ -3,22 +3,22 @@ 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 utils_algebra_1 = require("@comunica/utils-algebra");
|
|
6
7
|
const utils_query_operation_1 = require("@comunica/utils-query-operation");
|
|
7
|
-
const sparqlalgebrajs_1 = require("sparqlalgebrajs");
|
|
8
8
|
/**
|
|
9
9
|
* A [Query Operation](https://github.com/comunica/comunica/tree/master/packages/bus-query-operation) actor
|
|
10
10
|
* that handles SPARQL load operations.
|
|
11
11
|
*/
|
|
12
12
|
class ActorQueryOperationLoad extends bus_query_operation_1.ActorQueryOperationTypedMediated {
|
|
13
13
|
constructor(args) {
|
|
14
|
-
super(args,
|
|
14
|
+
super(args, utils_algebra_1.Algebra.Types.LOAD);
|
|
15
15
|
}
|
|
16
16
|
async testOperation(operation, context) {
|
|
17
17
|
return (0, utils_query_operation_1.testReadOnly)(context);
|
|
18
18
|
}
|
|
19
19
|
async runOperation(operation, context) {
|
|
20
20
|
const dataFactory = context.getSafe(context_entries_1.KeysInitQuery.dataFactory);
|
|
21
|
-
const algebraFactory = new
|
|
21
|
+
const algebraFactory = new utils_algebra_1.AlgebraFactory(dataFactory);
|
|
22
22
|
// Determine query source
|
|
23
23
|
let subContext = context;
|
|
24
24
|
if (operation.silent) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActorQueryOperationLoad.js","sourceRoot":"","sources":["ActorQueryOperationLoad.ts"],"names":[],"mappings":";;;AACA,uEAAiF;AAGjF,+DAA0D;AAG1D,2EAAoG;AAEpG
|
|
1
|
+
{"version":3,"file":"ActorQueryOperationLoad.js","sourceRoot":"","sources":["ActorQueryOperationLoad.ts"],"names":[],"mappings":";;;AACA,uEAAiF;AAGjF,+DAA0D;AAG1D,2DAAkE;AAClE,2EAAoG;AAEpG;;;GAGG;AACH,MAA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G,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 { Algebra, AlgebraFactory } from '@comunica/utils-algebra';\nimport { assignOperationSource, getSafeQuads, testReadOnly } from '@comunica/utils-query-operation';\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, Algebra.Types.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 AlgebraFactory(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/lib/index.d.ts
CHANGED
|
File without changes
|
package/lib/index.js
CHANGED
|
File without changes
|
package/lib/index.js.map
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@comunica/actor-query-operation-update-load",
|
|
3
|
-
"version": "4.4.0",
|
|
3
|
+
"version": "4.4.2-alpha.49.0",
|
|
4
4
|
"description": "A load query-operation actor",
|
|
5
5
|
"lsd:module": true,
|
|
6
6
|
"license": "MIT",
|
|
@@ -41,14 +41,14 @@
|
|
|
41
41
|
"build:components": "componentsjs-generator"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@comunica/bus-query-operation": "
|
|
45
|
-
"@comunica/bus-query-source-identify": "
|
|
46
|
-
"@comunica/bus-rdf-update-quads": "
|
|
47
|
-
"@comunica/context-entries": "
|
|
48
|
-
"@comunica/core": "
|
|
49
|
-
"@comunica/types": "
|
|
50
|
-
"@comunica/utils-
|
|
51
|
-
"
|
|
44
|
+
"@comunica/bus-query-operation": "4.4.2-alpha.49.0",
|
|
45
|
+
"@comunica/bus-query-source-identify": "4.4.2-alpha.49.0",
|
|
46
|
+
"@comunica/bus-rdf-update-quads": "4.4.2-alpha.49.0",
|
|
47
|
+
"@comunica/context-entries": "4.4.2-alpha.49.0",
|
|
48
|
+
"@comunica/core": "4.4.2-alpha.49.0",
|
|
49
|
+
"@comunica/types": "4.4.2-alpha.49.0",
|
|
50
|
+
"@comunica/utils-algebra": "4.4.2-alpha.49.0",
|
|
51
|
+
"@comunica/utils-query-operation": "4.4.2-alpha.49.0"
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "ef6f96cfd8faf7c37955bb7e0fe9f6fc6a994bdf"
|
|
54
54
|
}
|