@comunica/actor-query-operation-wrap-stream 4.4.1 → 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/ActorQueryOperationWrapStream.jsonld +0 -0
- package/components/components.jsonld +0 -0
- package/components/context.jsonld +0 -0
- package/lib/ActorQueryOperationWrapStream.d.ts +2 -2
- package/lib/ActorQueryOperationWrapStream.js +0 -0
- package/lib/ActorQueryOperationWrapStream.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 +7 -7
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -4,7 +4,7 @@ import { ActorQueryOperation } from '@comunica/bus-query-operation';
|
|
|
4
4
|
import { ActionContextKey } from '@comunica/core';
|
|
5
5
|
import type { TestResult, IActorTest } from '@comunica/core';
|
|
6
6
|
import type { IActionContext, IQueryOperationResult } from '@comunica/types';
|
|
7
|
-
import type { Algebra } from '
|
|
7
|
+
import type { Algebra } from '@comunica/utils-algebra';
|
|
8
8
|
/**
|
|
9
9
|
* A comunica Wrap Stream Query Operation Actor.
|
|
10
10
|
*/
|
|
@@ -35,4 +35,4 @@ export interface IActorQueryOperationWrapStreamArgs extends IActorQueryOperation
|
|
|
35
35
|
/**
|
|
36
36
|
* Key that that stores the last executed operation
|
|
37
37
|
*/
|
|
38
|
-
export declare const KEY_CONTEXT_WRAPPED_QUERY_OPERATION: ActionContextKey<Algebra.
|
|
38
|
+
export declare const KEY_CONTEXT_WRAPPED_QUERY_OPERATION: ActionContextKey<Algebra.BaseOperation>;
|
|
File without changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActorQueryOperationWrapStream.js","sourceRoot":"","sources":["ActorQueryOperationWrapStream.ts"],"names":[],"mappings":";;;AAMA,uEAAoE;AACpE,yCAAsE;AAOtE;;GAEG;AACH,MAAa,6BAA8B,SAAQ,yCAAmB;IAIpE,Y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MAAM,IAAI,CAAC,yBAAyB,CAAC,OAAO,CACtE;oBACE,IAAI,EAAE,OAAO;oBACb,SAAS,EAAE,MAAM,CAAC,SAAS,CAAC,IAAI;oBAChC,MAAM,EAAE,MAAM,CAAC,UAAU;oBACzB,QAAQ,EAAE,MAAM,CAAC,QAAQ;oBACzB,OAAO,EAAE,MAAM,CAAC,OAAO;oBACvB,cAAc,EAAE,MAAM;iBACvB,CACF,CAAC;gBACF,MAAM,CAAC,UAAU,GAA6B,mBAAmB,CAAC,MAAM,CAAC;gBACzE,MAAM,CAAC,QAAQ,GAAkC,mBAAmB,CAAC,QAAQ,CAAC;gBAC9E,MAAM;YACR,CAAC;YACD,OAAO,CAAC,CAAC,CAAC;gBACR,MAAM;YACR,CAAC;QACH,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IAED;;;;;OAKG;IACI,iBAAiB,CAAC,SAA4B,EAAE,OAAuB;QAC5E,OAAO,OAAO,CAAC,GAAG,CAAC,2CAAmC,EAAE,SAAS,CAAC,CAAC;IACrE,CAAC;CACF;AAtED,sEAsEC;AAaD;;GAEG;AACU,QAAA,mCAAmC,GAAG,IAAI,uBAAgB,CACrE,yCAAyC,CAC1C,CAAC","sourcesContent":["import type { MediatorIteratorTransform } from '@comunica/bus-iterator-transform';\nimport type {\n IActionQueryOperation,\n IActorQueryOperationArgs,\n MediatorQueryOperation,\n} from '@comunica/bus-query-operation';\nimport { ActorQueryOperation } from '@comunica/bus-query-operation';\nimport { ActionContextKey, failTest, passTest } from '@comunica/core';\nimport type { TestResult, IActorTest } from '@comunica/core';\nimport type { IActionContext, IQueryOperationResult, MetadataBindings, MetadataQuads } from '@comunica/types';\nimport type
|
|
1
|
+
{"version":3,"file":"ActorQueryOperationWrapStream.js","sourceRoot":"","sources":["ActorQueryOperationWrapStream.ts"],"names":[],"mappings":";;;AAMA,uEAAoE;AACpE,yCAAsE;AAOtE;;GAEG;AACH,MAAa,6BAA8B,SAAQ,yCAAmB;IAIpE,YA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AAM,IAAI,CAAC,yBAAyB,CAAC,OAAO,CACtE;oBACE,IAAI,EAAE,OAAO;oBACb,SAAS,EAAE,MAAM,CAAC,SAAS,CAAC,IAAI;oBAChC,MAAM,EAAE,MAAM,CAAC,UAAU;oBACzB,QAAQ,EAAE,MAAM,CAAC,QAAQ;oBACzB,OAAO,EAAE,MAAM,CAAC,OAAO;oBACvB,cAAc,EAAE,MAAM;iBACvB,CACF,CAAC;gBACF,MAAM,CAAC,UAAU,GAA6B,mBAAmB,CAAC,MAAM,CAAC;gBACzE,MAAM,CAAC,QAAQ,GAAkC,mBAAmB,CAAC,QAAQ,CAAC;gBAC9E,MAAM;YACR,CAAC;YACD,OAAO,CAAC,CAAC,CAAC;gBACR,MAAM;YACR,CAAC;QACH,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IAED;;;;;OAKG;IACI,iBAAiB,CAAC,SAA4B,EAAE,OAAuB;QAC5E,OAAO,OAAO,CAAC,GAAG,CAAC,2CAAmC,EAAE,SAAS,CAAC,CAAC;IACrE,CAAC;CACF;AAtED,sEAsEC;AAaD;;GAEG;AACU,QAAA,mCAAmC,GAAG,IAAI,uBAAgB,CACrE,yCAAyC,CAC1C,CAAC","sourcesContent":["import type { MediatorIteratorTransform } from '@comunica/bus-iterator-transform';\nimport type {\n IActionQueryOperation,\n IActorQueryOperationArgs,\n MediatorQueryOperation,\n} from '@comunica/bus-query-operation';\nimport { ActorQueryOperation } from '@comunica/bus-query-operation';\nimport { ActionContextKey, failTest, passTest } from '@comunica/core';\nimport type { TestResult, IActorTest } from '@comunica/core';\nimport type { IActionContext, IQueryOperationResult, MetadataBindings, MetadataQuads } from '@comunica/types';\nimport type { Algebra } from '@comunica/utils-algebra';\nimport type * as RDF from '@rdfjs/types';\nimport type { AsyncIterator } from 'asynciterator';\n\n/**\n * A comunica Wrap Stream Query Operation Actor.\n */\nexport class ActorQueryOperationWrapStream extends ActorQueryOperation {\n public readonly mediatorIteratorTransform: MediatorIteratorTransform;\n public readonly mediatorQueryOperation: MediatorQueryOperation;\n\n public constructor(args: IActorQueryOperationWrapStreamArgs) {\n super(args);\n }\n\n public async test(action: IActionQueryOperation): Promise<TestResult<IActorTest>> {\n if (action.context.get(KEY_CONTEXT_WRAPPED_QUERY_OPERATION) === action.operation) {\n return failTest('Unable to wrap query source multiple times');\n }\n // Ensure this is always run if not already wrapped\n return passTest({ httpRequests: Number.NEGATIVE_INFINITY });\n }\n\n public async run(action: IActionQueryOperation): Promise<IQueryOperationResult> {\n // Prevent infinite recursion. In consequent query operation calls this key should be set to false\n // To allow the operation to wrap ALL query operation runs\n action.context = this.setContextWrapped(action.operation, action.context);\n const output: IQueryOperationResult = await this.mediatorQueryOperation.mediate(action);\n switch (output.type) {\n case 'bindings': {\n const bindingIteratorTransformed = await this.mediatorIteratorTransform.mediate(\n {\n type: 'bindings',\n operation: action.operation.type,\n stream: output.bindingsStream,\n metadata: output.metadata,\n originalAction: action,\n context: action.context,\n },\n );\n output.bindingsStream =\n <AsyncIterator<RDF.Bindings>> bindingIteratorTransformed.stream;\n output.metadata =\n <() => Promise<MetadataBindings>> bindingIteratorTransformed.metadata;\n break;\n }\n case 'quads': {\n const iteratorTransformed = await this.mediatorIteratorTransform.mediate(\n {\n type: 'quads',\n operation: action.operation.type,\n stream: output.quadStream,\n metadata: output.metadata,\n context: action.context,\n originalAction: action,\n },\n );\n output.quadStream = <AsyncIterator<RDF.Quad>> iteratorTransformed.stream;\n output.metadata = <() => Promise<MetadataQuads>> iteratorTransformed.metadata;\n break;\n }\n default: {\n break;\n }\n }\n return output;\n }\n\n /**\n * Sets KEY_CONTEXT_WRAPPED_QUERY_OPERATION to the operation being executed.\n * @param operation The query operation.\n * @param context The current action context.\n * @returns A new action context with the operation marked as wrapped.\n */\n public setContextWrapped(operation: Algebra.Operation, context: IActionContext): IActionContext {\n return context.set(KEY_CONTEXT_WRAPPED_QUERY_OPERATION, operation);\n }\n}\n\nexport interface IActorQueryOperationWrapStreamArgs extends IActorQueryOperationArgs {\n /**\n * Mediator that runs all transforms defined by user over the output stream of the query operation\n */\n mediatorIteratorTransform: MediatorIteratorTransform;\n /**\n * Mediator that runs the next query operation\n */\n mediatorQueryOperation: MediatorQueryOperation;\n}\n\n/**\n * Key that that stores the last executed operation\n */\nexport const KEY_CONTEXT_WRAPPED_QUERY_OPERATION = new ActionContextKey<Algebra.Operation>(\n '@comunica/actor-query-operation:wrapped',\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-wrap-stream",
|
|
3
|
-
"version": "4.4.
|
|
3
|
+
"version": "4.4.2-alpha.49.0",
|
|
4
4
|
"description": "A wrap-stream query-operation actor",
|
|
5
5
|
"lsd:module": true,
|
|
6
6
|
"license": "MIT",
|
|
@@ -41,11 +41,11 @@
|
|
|
41
41
|
"build:components": "componentsjs-generator"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@comunica/bus-iterator-transform": "
|
|
45
|
-
"@comunica/bus-query-operation": "
|
|
46
|
-
"@comunica/core": "
|
|
47
|
-
"@comunica/types": "
|
|
48
|
-
"
|
|
44
|
+
"@comunica/bus-iterator-transform": "4.4.2-alpha.49.0",
|
|
45
|
+
"@comunica/bus-query-operation": "4.4.2-alpha.49.0",
|
|
46
|
+
"@comunica/core": "4.4.2-alpha.49.0",
|
|
47
|
+
"@comunica/types": "4.4.2-alpha.49.0",
|
|
48
|
+
"@comunica/utils-algebra": "4.4.2-alpha.49.0"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "ef6f96cfd8faf7c37955bb7e0fe9f6fc6a994bdf"
|
|
51
51
|
}
|