@comunica/actor-rdf-join-wrap-stream 5.4.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.
package/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright © 2017–now Ruben Taelman, Joachim Van Herwegen
4
+ Comunica Association and Ghent University – imec, Belgium
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in
14
+ all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
+ THE SOFTWARE.
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![npm version](https://badge.fury.io/js/%40comunica%2Factor-rdf-join-wrap-stream.svg)](https://www.npmjs.com/package/@comunica/actor-rdf-join-wrap-stream)
4
4
 
5
- A comunica Wrap Stream RDF Join Actor. This actor calls the `bus-iterator-transform` for all iterators produced by `query-operation` actors.
5
+ An [RDF Join](https://github.com/comunica/comunica/tree/master/packages/bus-rdf-join) actor that calls the `bus-iterator-transform` for all iterators produced by `query-operation` actors.
6
6
  This actor should only be included if you require the functionality of `bus-iterator-transform` as it may slow down query execution.
7
7
 
8
8
  This module is part of the [Comunica framework](https://github.com/comunica/comunica),
@@ -16,7 +16,6 @@ class ActorRdfJoinWrapStream extends bus_rdf_join_1.ActorRdfJoin {
16
16
  limitEntries: 0,
17
17
  limitEntriesMin: true,
18
18
  canHandleUndefs: true,
19
- isLeaf: false,
20
19
  });
21
20
  this.mediatorJoin = args.mediatorJoin;
22
21
  this.mediatorIteratorTransform = args.mediatorIteratorTransform;
@@ -1 +1 @@
1
- {"version":3,"file":"ActorRdfJoinWrapStream.js","sourceRoot":"","sources":["ActorRdfJoinWrapStream.ts"],"names":[],"mappings":";;;AAQA,yDAAsD;AAEtD,yCAAkF;AAMlF;;GAEG;AACH,MAAa,sBAAuB,SAAQ,2BAAY;IACtC,YAAY,CAAkB;IAC9B,yBAAyB,CAA4B;IAErE,YAAmB,IAAiC;QAClD,KAAK,CAAC,IAAI,EAAE;YACV,WAAW,EAAE,OAAO;YACpB,YAAY,EAAE,aAAa;YAC3B,YAAY,EAAE,CAAC;YACf,eAAe,EAAE,IAAI;YACrB,eAAe,EAAE,IAAI;YACrB,MAAM,EAAE,KAAK;SACd,CAAC,CAAC;QACH,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;QACtC,IAAI,CAAC,yBAAyB,GAAG,IAAI,CAAC,yBAAyB,CAAC;IAClE,CAAC;IAEe,KAAK,CAAC,IAAI,CAAC,MAAsB;QAE/C,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,oCAA4B,CAAC,KAAK,MAAM,CAAC,OAAO,EAAE,CAAC;YACxE,OAAO,IAAA,eAAQ,EAAC,8CAA8C,CAAC,CAAC;QAClE,CAAC;QAED,MAAM,SAAS,GAAG,MAAM,2BAAY,CAAC,YAAY,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAClE,OAAO,MAAM,IAAI,CAAC,mBAAmB,CAAC,MAAM,EAAE,EAA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C9D,kCAAkC,CACnC,CAAC","sourcesContent":["import type { MediatorIteratorTransform } from '@comunica/bus-iterator-transform';\nimport type {\n IActionRdfJoin,\n IActorRdfJoinOutputInner,\n IActorRdfJoinArgs,\n MediatorRdfJoin,\n IActorRdfJoinTestSideData }\n from '@comunica/bus-rdf-join';\nimport { ActorRdfJoin } from '@comunica/bus-rdf-join';\nimport type { TestResult } from '@comunica/core';\nimport { ActionContextKey, failTest, passTestWithSideData } from '@comunica/core';\nimport type { IMediatorTypeJoinCoefficients } from '@comunica/mediatortype-join-coefficients';\nimport type { IActionContext, IJoinEntry, IQueryOperationResultBindings, MetadataBindings } from '@comunica/types';\nimport type * as RDF from '@rdfjs/types';\nimport type { AsyncIterator } from 'asynciterator';\n\n/**\n * A comunica Wrap Stream RDF Join Actor.\n */\nexport class ActorRdfJoinWrapStream extends ActorRdfJoin {\n public readonly mediatorJoin: MediatorRdfJoin;\n public readonly mediatorIteratorTransform: MediatorIteratorTransform;\n\n public constructor(args: IActorRdfJoinWrapStreamArgs) {\n super(args, {\n logicalType: 'inner',\n physicalName: 'wrap-stream',\n limitEntries: 0,\n limitEntriesMin: true,\n canHandleUndefs: true,\n isLeaf: false,\n });\n this.mediatorJoin = args.mediatorJoin;\n this.mediatorIteratorTransform = args.mediatorIteratorTransform;\n }\n\n public override async test(action: IActionRdfJoin):\n Promise<TestResult<IMediatorTypeJoinCoefficients, IActorRdfJoinTestSideData>> {\n if (action.context.get(KEY_CONTEXT_WRAPPED_RDF_JOIN) === action.entries) {\n return failTest('Unable to wrap join operation multiple times');\n }\n\n const metadatas = await ActorRdfJoin.getMetadatas(action.entries);\n return await this.getJoinCoefficients(action, { metadatas });\n }\n\n public override async getOutput(action: IActionRdfJoin): Promise<IActorRdfJoinOutputInner> {\n // Prevent infinite recursion. In consequent query operation calls this key is set to false\n // To allow the operation to wrap ALL rdf-join runs\n action.context = this.setContextWrapped(action, action.context);\n const result: IQueryOperationResultBindings = await this.mediatorJoin.mediate(action);\n\n const { stream, metadata } = (await this.mediatorIteratorTransform.mediate(\n {\n type: result.type,\n operation: action.type,\n stream: result.bindingsStream,\n metadata: result.metadata,\n context: action.context,\n originalAction: action,\n },\n ));\n\n result.bindingsStream = <AsyncIterator<RDF.Bindings>> stream;\n result.metadata = <() => Promise<MetadataBindings>> metadata;\n\n return { result };\n }\n\n protected async getJoinCoefficients(\n _action: IActionRdfJoin,\n sideData: IActorRdfJoinTestSideData,\n ): Promise<TestResult<IMediatorTypeJoinCoefficients, IActorRdfJoinTestSideData>> {\n return passTestWithSideData({\n iterations: -1,\n persistedItems: -1,\n blockingItems: -1,\n requestTime: -1,\n }, sideData);\n }\n\n /**\n * Sets KEY_CONTEXT_WRAPPED_RDF_JOIN key in the context to the entries being joined.\n * @param action The join action being executed\n * @param context The ActionContext\n * @returns The updated ActionContext\n */\n public setContextWrapped(action: IActionRdfJoin, context: IActionContext): IActionContext {\n return context.set(KEY_CONTEXT_WRAPPED_RDF_JOIN, action.entries);\n }\n}\n\nexport interface IActorRdfJoinWrapStreamArgs extends IActorRdfJoinArgs {\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 calls next join to be wrapped\n */\n mediatorJoin: MediatorRdfJoin;\n}\n\n/**\n * Key that shows if the query operation has already been wrapped by a process iterator call\n */\nexport const KEY_CONTEXT_WRAPPED_RDF_JOIN = new ActionContextKey<IJoinEntry[]>(\n '@comunica/actor-rdf-join:wrapped',\n);\n"]}
1
+ {"version":3,"file":"ActorRdfJoinWrapStream.js","sourceRoot":"","sources":["ActorRdfJoinWrapStream.ts"],"names":[],"mappings":";;;AAQA,yDAAsD;AAEtD,yCAAkF;AAMlF;;GAEG;AACH,MAAa,sBAAuB,SAAQ,2BAAY;IACtC,YAAY,CAAkB;IAC9B,yBAAyB,CAA4B;IAErE,YAAmB,IAAiC;QAClD,KAAK,CAAC,IAAI,EAAE;YACV,WAAW,EAAE,OAAO;YACpB,YA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M,CAAC;QAC7D,MAAM,CAAC,QAAQ,GAAqC,QAAQ,CAAC;QAE7D,OAAO,EAAE,MAAM,EAAE,CAAC;IACpB,CAAC;IAES,KAAK,CAAC,mBAAmB,CACjC,OAAuB,EACvB,QAAmC;QAEnC,OAAO,IAAA,2BAAoB,EAAC;YAC1B,UAAU,EAAE,CAAC,CAAC;YACd,cAAc,EAAE,CAAC,CAAC;YAClB,aAAa,EAAE,CAAC,CAAC;YACjB,WAAW,EAAE,CAAC,CAAC;SAChB,EAAE,QAAQ,CAAC,CAAC;IACf,CAAC;IAED;;;;;OAKG;IACI,iBAAiB,CAAC,MAAsB,EAAE,OAAuB;QACtE,OAAO,OAAO,CAAC,GAAG,CAAC,oCAA4B,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;IACnE,CAAC;CACF;AAtED,wDAsEC;AAaD;;GAEG;AACU,QAAA,4BAA4B,GAAG,IAAI,uBAAgB,CAC9D,kCAAkC,CACnC,CAAC","sourcesContent":["import type { MediatorIteratorTransform } from '@comunica/bus-iterator-transform';\nimport type {\n IActionRdfJoin,\n IActorRdfJoinOutputInner,\n IActorRdfJoinArgs,\n MediatorRdfJoin,\n IActorRdfJoinTestSideData }\n from '@comunica/bus-rdf-join';\nimport { ActorRdfJoin } from '@comunica/bus-rdf-join';\nimport type { TestResult } from '@comunica/core';\nimport { ActionContextKey, failTest, passTestWithSideData } from '@comunica/core';\nimport type { IMediatorTypeJoinCoefficients } from '@comunica/mediatortype-join-coefficients';\nimport type { IActionContext, IJoinEntry, IQueryOperationResultBindings, MetadataBindings } from '@comunica/types';\nimport type * as RDF from '@rdfjs/types';\nimport type { AsyncIterator } from 'asynciterator';\n\n/**\n * A comunica Wrap Stream RDF Join Actor.\n */\nexport class ActorRdfJoinWrapStream extends ActorRdfJoin {\n public readonly mediatorJoin: MediatorRdfJoin;\n public readonly mediatorIteratorTransform: MediatorIteratorTransform;\n\n public constructor(args: IActorRdfJoinWrapStreamArgs) {\n super(args, {\n logicalType: 'inner',\n physicalName: 'wrap-stream',\n limitEntries: 0,\n limitEntriesMin: true,\n canHandleUndefs: true,\n });\n this.mediatorJoin = args.mediatorJoin;\n this.mediatorIteratorTransform = args.mediatorIteratorTransform;\n }\n\n public override async test(action: IActionRdfJoin):\n Promise<TestResult<IMediatorTypeJoinCoefficients, IActorRdfJoinTestSideData>> {\n if (action.context.get(KEY_CONTEXT_WRAPPED_RDF_JOIN) === action.entries) {\n return failTest('Unable to wrap join operation multiple times');\n }\n\n const metadatas = await ActorRdfJoin.getMetadatas(action.entries);\n return await this.getJoinCoefficients(action, { metadatas });\n }\n\n public override async getOutput(action: IActionRdfJoin): Promise<IActorRdfJoinOutputInner> {\n // Prevent infinite recursion. In consequent query operation calls this key is set to false\n // To allow the operation to wrap ALL rdf-join runs\n action.context = this.setContextWrapped(action, action.context);\n const result: IQueryOperationResultBindings = await this.mediatorJoin.mediate(action);\n\n const { stream, metadata } = (await this.mediatorIteratorTransform.mediate(\n {\n type: result.type,\n operation: action.type,\n stream: result.bindingsStream,\n metadata: result.metadata,\n context: action.context,\n originalAction: action,\n },\n ));\n\n result.bindingsStream = <AsyncIterator<RDF.Bindings>> stream;\n result.metadata = <() => Promise<MetadataBindings>> metadata;\n\n return { result };\n }\n\n protected async getJoinCoefficients(\n _action: IActionRdfJoin,\n sideData: IActorRdfJoinTestSideData,\n ): Promise<TestResult<IMediatorTypeJoinCoefficients, IActorRdfJoinTestSideData>> {\n return passTestWithSideData({\n iterations: -1,\n persistedItems: -1,\n blockingItems: -1,\n requestTime: -1,\n }, sideData);\n }\n\n /**\n * Sets KEY_CONTEXT_WRAPPED_RDF_JOIN key in the context to the entries being joined.\n * @param action The join action being executed\n * @param context The ActionContext\n * @returns The updated ActionContext\n */\n public setContextWrapped(action: IActionRdfJoin, context: IActionContext): IActionContext {\n return context.set(KEY_CONTEXT_WRAPPED_RDF_JOIN, action.entries);\n }\n}\n\nexport interface IActorRdfJoinWrapStreamArgs extends IActorRdfJoinArgs {\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 calls next join to be wrapped\n */\n mediatorJoin: MediatorRdfJoin;\n}\n\n/**\n * Key that shows if the query operation has already been wrapped by a process iterator call\n */\nexport const KEY_CONTEXT_WRAPPED_RDF_JOIN = new ActionContextKey<IJoinEntry[]>(\n '@comunica/actor-rdf-join:wrapped',\n);\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@comunica/actor-rdf-join-wrap-stream",
3
- "version": "5.4.0",
3
+ "version": "5.5.0",
4
4
  "description": "A wrap-stream rdf-join 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": "^5.4.0",
45
- "@comunica/bus-rdf-join": "^5.4.0",
46
- "@comunica/core": "^5.4.0",
47
- "@comunica/mediatortype-join-coefficients": "^5.4.0",
48
- "@comunica/types": "^5.4.0"
44
+ "@comunica/bus-iterator-transform": "^5.5.0",
45
+ "@comunica/bus-rdf-join": "^5.5.0",
46
+ "@comunica/core": "^5.5.0",
47
+ "@comunica/mediatortype-join-coefficients": "^5.5.0",
48
+ "@comunica/types": "^5.5.0"
49
49
  },
50
- "gitHead": "8a0a10913cb705adda45997210ebbe5502274a60"
50
+ "gitHead": "3a258e018a9c5f0b03f531b30ee1cdc659b5b7c9"
51
51
  }