@comunica/actor-rdf-join-optional-optplus 3.2.1 → 3.2.4-alpha.47.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.
@@ -53,6 +53,10 @@
53
53
  {
54
54
  "@type": "ParameterRangeGenericTypeReference",
55
55
  "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^3.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
56
+ },
57
+ {
58
+ "@type": "ParameterRangeGenericTypeReference",
59
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^3.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
56
60
  }
57
61
  ]
58
62
  },
@@ -67,6 +71,10 @@
67
71
  {
68
72
  "@type": "ParameterRangeGenericTypeReference",
69
73
  "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^3.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
74
+ },
75
+ {
76
+ "@type": "ParameterRangeGenericTypeReference",
77
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^3.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
70
78
  }
71
79
  ]
72
80
  },
@@ -76,6 +84,20 @@
76
84
  },
77
85
  "comment": "The bus this actor subscribes to."
78
86
  },
87
+ {
88
+ "@id": "carjoo:components/ActorRdfJoinOptionalOptPlus.jsonld#ActorRdfJoinOptionalOptPlus_args_busFailMessage",
89
+ "range": {
90
+ "@type": "ParameterRangeUnion",
91
+ "parameterRangeElements": [
92
+ "xsd:string",
93
+ {
94
+ "@type": "ParameterRangeUndefined"
95
+ }
96
+ ]
97
+ },
98
+ "default": "RDF joining failed: none of the configured actors were able to handle the join type ${action.type}",
99
+ "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}\""
100
+ },
79
101
  {
80
102
  "@id": "carjoo:components/ActorRdfJoinOptionalOptPlus.jsonld#ActorRdfJoinOptionalOptPlus_args_beforeActors",
81
103
  "range": {
@@ -98,6 +120,10 @@
98
120
  {
99
121
  "@type": "ParameterRangeGenericTypeReference",
100
122
  "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^3.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
123
+ },
124
+ {
125
+ "@type": "ParameterRangeGenericTypeReference",
126
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^3.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
101
127
  }
102
128
  ]
103
129
  }
@@ -157,6 +183,12 @@
157
183
  "@id": "carjoo:components/ActorRdfJoinOptionalOptPlus.jsonld#ActorRdfJoinOptionalOptPlus_args_bus"
158
184
  }
159
185
  },
186
+ {
187
+ "keyRaw": "busFailMessage",
188
+ "value": {
189
+ "@id": "carjoo:components/ActorRdfJoinOptionalOptPlus.jsonld#ActorRdfJoinOptionalOptPlus_args_busFailMessage"
190
+ }
191
+ },
160
192
  {
161
193
  "keyRaw": "beforeActors",
162
194
  "value": {
@@ -20,6 +20,9 @@
20
20
  "args_bus": {
21
21
  "@id": "carjoo:components/ActorRdfJoinOptionalOptPlus.jsonld#ActorRdfJoinOptionalOptPlus_args_bus"
22
22
  },
23
+ "args_busFailMessage": {
24
+ "@id": "carjoo:components/ActorRdfJoinOptionalOptPlus.jsonld#ActorRdfJoinOptionalOptPlus_args_busFailMessage"
25
+ },
23
26
  "args_beforeActors": {
24
27
  "@id": "carjoo:components/ActorRdfJoinOptionalOptPlus.jsonld#ActorRdfJoinOptionalOptPlus_args_beforeActors",
25
28
  "@container": "@list"
@@ -36,6 +39,9 @@
36
39
  "bus": {
37
40
  "@id": "carjoo:components/ActorRdfJoinOptionalOptPlus.jsonld#ActorRdfJoinOptionalOptPlus_args_bus"
38
41
  },
42
+ "busFailMessage": {
43
+ "@id": "carjoo:components/ActorRdfJoinOptionalOptPlus.jsonld#ActorRdfJoinOptionalOptPlus_args_busFailMessage"
44
+ },
39
45
  "beforeActors": {
40
46
  "@id": "carjoo:components/ActorRdfJoinOptionalOptPlus.jsonld#ActorRdfJoinOptionalOptPlus_args_beforeActors",
41
47
  "@container": "@list"
@@ -1,7 +1,7 @@
1
- import type { IActionRdfJoin, IActorRdfJoinOutputInner, IActorRdfJoinArgs, MediatorRdfJoin } from '@comunica/bus-rdf-join';
1
+ import type { IActionRdfJoin, IActorRdfJoinOutputInner, IActorRdfJoinArgs, MediatorRdfJoin, IActorRdfJoinTestSideData } from '@comunica/bus-rdf-join';
2
2
  import { ActorRdfJoin } from '@comunica/bus-rdf-join';
3
+ import type { TestResult } from '@comunica/core';
3
4
  import type { IMediatorTypeJoinCoefficients } from '@comunica/mediatortype-join-coefficients';
4
- import type { MetadataBindings } from '@comunica/types';
5
5
  /**
6
6
  * A comunica Optional Opt+ RDF Join Actor.
7
7
  */
@@ -9,7 +9,7 @@ export declare class ActorRdfJoinOptionalOptPlus extends ActorRdfJoin {
9
9
  readonly mediatorJoin: MediatorRdfJoin;
10
10
  constructor(args: IActorRdfJoinOptionalOptPlusJoinArgs);
11
11
  getOutput({ entries, context }: IActionRdfJoin): Promise<IActorRdfJoinOutputInner>;
12
- protected getJoinCoefficients(action: IActionRdfJoin, metadatas: MetadataBindings[]): Promise<IMediatorTypeJoinCoefficients>;
12
+ protected getJoinCoefficients(action: IActionRdfJoin, sideData: IActorRdfJoinTestSideData): Promise<TestResult<IMediatorTypeJoinCoefficients, IActorRdfJoinTestSideData>>;
13
13
  }
14
14
  export interface IActorRdfJoinOptionalOptPlusJoinArgs extends IActorRdfJoinArgs {
15
15
  /**
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ActorRdfJoinOptionalOptPlus = void 0;
4
4
  const bus_rdf_join_1 = require("@comunica/bus-rdf-join");
5
+ const core_1 = require("@comunica/core");
5
6
  const asynciterator_1 = require("asynciterator");
6
7
  /**
7
8
  * A comunica Optional Opt+ RDF Join Actor.
@@ -22,27 +23,16 @@ class ActorRdfJoinOptionalOptPlus extends bus_rdf_join_1.ActorRdfJoin {
22
23
  return { result: {
23
24
  type: 'bindings',
24
25
  bindingsStream: new asynciterator_1.UnionIterator([clonedStream, joined.bindingsStream], { autoStart: false }),
25
- metadata: async () => {
26
- const [leftMeta, joinedMeta] = await Promise.all([entries[0].output.metadata(), joined.metadata()]);
27
- return {
28
- variables: joinedMeta.variables,
29
- canContainUndefs: true,
30
- cardinality: {
31
- type: joinedMeta.cardinality.type,
32
- value: leftMeta.cardinality.value + joinedMeta.cardinality.value,
33
- },
34
- state: this.constructState([leftMeta, joinedMeta]),
35
- };
36
- },
26
+ metadata: async () => await this.constructResultMetadata(entries, await bus_rdf_join_1.ActorRdfJoin.getMetadatas(entries), context, {}, true),
37
27
  } };
38
28
  }
39
- async getJoinCoefficients(action, metadatas) {
40
- return {
41
- iterations: metadatas[0].cardinality.value + metadatas[1].cardinality.value,
29
+ async getJoinCoefficients(action, sideData) {
30
+ return (0, core_1.passTestWithSideData)({
31
+ iterations: sideData.metadatas[0].cardinality.value + sideData.metadatas[1].cardinality.value,
42
32
  persistedItems: 0,
43
33
  blockingItems: 0,
44
34
  requestTime: 0,
45
- };
35
+ }, sideData);
46
36
  }
47
37
  }
48
38
  exports.ActorRdfJoinOptionalOptPlus = ActorRdfJoinOptionalOptPlus;
@@ -1 +1 @@
1
- {"version":3,"file":"ActorRdfJoinOptionalOptPlus.js","sourceRoot":"","sources":["ActorRdfJoinOptionalOptPlus.ts"],"names":[],"mappings":";;;AAMA,yDAEgC;AAGhC,iDAA8C;AAE9C;;GAEG;AACH,MAAa,2BAA4B,SAAQ,2BAAY;IAG3D,YAAmB,IAA0C;QAC3D,KAAK,CAAC,IAAI,EAAE;YACV,WAAW,EAAE,UAAU;YAC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,UAAU,CAAE,CAAC;qBACrD,CAAC;gBACJ,CAAC;aACF,EAAC,CAAC;IACL,CAAC;IAES,KAAK,CAAC,mBAAmB,CACjC,MAAsB,EACtB,SAA6B;QAE7B,OAAO;YACL,UAAU,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK;YAC3E,cAAc,EAAE,CAAC;YACjB,aAAa,EAAE,CAAC;YAChB,WAAW,EAAE,CAAC;SACf,CAAC;IACJ,CAAC;CACF;AA7CD,kEA6CC","sourcesContent":["import type {\n IActionRdfJoin,\n IActorRdfJoinOutputInner,\n IActorRdfJoinArgs,\n MediatorRdfJoin,\n} from '@comunica/bus-rdf-join';\nimport {\n ActorRdfJoin,\n} from '@comunica/bus-rdf-join';\nimport type { IMediatorTypeJoinCoefficients } from '@comunica/mediatortype-join-coefficients';\nimport type { MetadataBindings } from '@comunica/types';\nimport { UnionIterator } from 'asynciterator';\n\n/**\n * A comunica Optional Opt+ RDF Join Actor.\n */\nexport class ActorRdfJoinOptionalOptPlus extends ActorRdfJoin {\n public readonly mediatorJoin: MediatorRdfJoin;\n\n public constructor(args: IActorRdfJoinOptionalOptPlusJoinArgs) {\n super(args, {\n logicalType: 'optional',\n physicalName: 'nested-loop',\n limitEntries: 2,\n canHandleUndefs: true,\n });\n }\n\n public async getOutput({ entries, context }: IActionRdfJoin): Promise<IActorRdfJoinOutputInner> {\n const clonedStream = entries[0].output.bindingsStream.clone();\n entries[0].output.bindingsStream = entries[0].output.bindingsStream.clone();\n const joined = await this.mediatorJoin.mediate({ type: 'inner', entries, context });\n return { result: {\n type: 'bindings',\n bindingsStream: new UnionIterator([ clonedStream, joined.bindingsStream ], { autoStart: false }),\n metadata: async(): Promise<MetadataBindings> => {\n const [ leftMeta, joinedMeta ] = await Promise.all([ entries[0].output.metadata(), joined.metadata() ]);\n return {\n variables: joinedMeta.variables,\n canContainUndefs: true,\n cardinality: {\n type: joinedMeta.cardinality.type,\n value: leftMeta.cardinality.value + joinedMeta.cardinality.value,\n },\n state: this.constructState([ leftMeta, joinedMeta ]),\n };\n },\n }};\n }\n\n protected async getJoinCoefficients(\n action: IActionRdfJoin,\n metadatas: MetadataBindings[],\n ): Promise<IMediatorTypeJoinCoefficients> {\n return {\n iterations: metadatas[0].cardinality.value + metadatas[1].cardinality.value,\n persistedItems: 0,\n blockingItems: 0,\n requestTime: 0,\n };\n }\n}\n\nexport interface IActorRdfJoinOptionalOptPlusJoinArgs extends IActorRdfJoinArgs {\n /**\n * A mediator for joining Bindings streams\n */\n mediatorJoin: MediatorRdfJoin;\n}\n"]}
1
+ {"version":3,"file":"ActorRdfJoinOptionalOptPlus.js","sourceRoot":"","sources":["ActorRdfJoinOptionalOptPlus.ts"],"names":[],"mappings":";;;AAOA,yDAEgC;AAEhC,yCAAsD;AAEtD,iDAA8C;AAE9C;;GAEG;AACH,MAAa,2BAA4B,SAAQ,2BAAY;IAG3D,YAAmB,IAA0C;QAC3D,KAAK,CAAC,IAAI,EAAE;YACV,WAAW,EAAE,UAAU;YACvB,YAAY,EAAE,aAAa;YAC3B,YAAY,EAAE,CAAC;YACf,eAAe,EAAE,IAAI;SACtB,CAAC,CAAC;IACL,CAAC;IAEM,KAAK,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,OAAO,EAAkB;QACzD,MAAM,YAAY,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE,CAAC;QAC9D,OAAO,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,cAAc,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE,CAAC;QAC5E,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;QACpF,OAAO,EAAE,MAAM,EAAE;gBACf,IAAI,EAAE,UAAU;gBAChB,cAAc,EAAE,IAAI,6BAAa,CAAC,CAAE,YAAY,EAAE,MAAM,CAAC,cAAc,CAAE,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;gBAChG,QAAQ,EAAE,KAAK,IAAG,EAAE,CAAC,MAAM,IAAI,CAAC,uBAAuB,CACrD,OAAO,EACP,MAAM,2BAAY,CAAC,YAAY,CAAC,OAAO,CAAC,EACxC,OAAO,EACP,EAAE,EACF,IAAI,CACL;aACF,EAAC,CAAC;IACL,CAAC;IAES,KAAK,CAAC,mBAAmB,CACjC,MAAsB,EACtB,QAAmC;QAEnC,OAAO,IAAA,2BAAoB,EAAC;YAC1B,UAAU,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK;YAC7F,cAAc,EAAE,CAAC;YACjB,aAAa,EAAE,CAAC;YAChB,WAAW,EAAE,CAAC;SACf,EAAE,QAAQ,CAAC,CAAC;IACf,CAAC;CACF;AAxCD,kEAwCC","sourcesContent":["import type {\n IActionRdfJoin,\n IActorRdfJoinOutputInner,\n IActorRdfJoinArgs,\n MediatorRdfJoin,\n IActorRdfJoinTestSideData,\n} from '@comunica/bus-rdf-join';\nimport {\n ActorRdfJoin,\n} from '@comunica/bus-rdf-join';\nimport type { TestResult } from '@comunica/core';\nimport { passTestWithSideData } from '@comunica/core';\nimport type { IMediatorTypeJoinCoefficients } from '@comunica/mediatortype-join-coefficients';\nimport { UnionIterator } from 'asynciterator';\n\n/**\n * A comunica Optional Opt+ RDF Join Actor.\n */\nexport class ActorRdfJoinOptionalOptPlus extends ActorRdfJoin {\n public readonly mediatorJoin: MediatorRdfJoin;\n\n public constructor(args: IActorRdfJoinOptionalOptPlusJoinArgs) {\n super(args, {\n logicalType: 'optional',\n physicalName: 'nested-loop',\n limitEntries: 2,\n canHandleUndefs: true,\n });\n }\n\n public async getOutput({ entries, context }: IActionRdfJoin): Promise<IActorRdfJoinOutputInner> {\n const clonedStream = entries[0].output.bindingsStream.clone();\n entries[0].output.bindingsStream = entries[0].output.bindingsStream.clone();\n const joined = await this.mediatorJoin.mediate({ type: 'inner', entries, context });\n return { result: {\n type: 'bindings',\n bindingsStream: new UnionIterator([ clonedStream, joined.bindingsStream ], { autoStart: false }),\n metadata: async() => await this.constructResultMetadata(\n entries,\n await ActorRdfJoin.getMetadatas(entries),\n context,\n {},\n true,\n ),\n }};\n }\n\n protected async getJoinCoefficients(\n action: IActionRdfJoin,\n sideData: IActorRdfJoinTestSideData,\n ): Promise<TestResult<IMediatorTypeJoinCoefficients, IActorRdfJoinTestSideData>> {\n return passTestWithSideData({\n iterations: sideData.metadatas[0].cardinality.value + sideData.metadatas[1].cardinality.value,\n persistedItems: 0,\n blockingItems: 0,\n requestTime: 0,\n }, sideData);\n }\n}\n\nexport interface IActorRdfJoinOptionalOptPlusJoinArgs extends IActorRdfJoinArgs {\n /**\n * A mediator for joining Bindings streams\n */\n mediatorJoin: MediatorRdfJoin;\n}\n"]}
package/package.json CHANGED
@@ -1,9 +1,13 @@
1
1
  {
2
2
  "name": "@comunica/actor-rdf-join-optional-optplus",
3
- "version": "3.2.1",
3
+ "version": "3.2.4-alpha.47.0",
4
4
  "description": "A optional-optplus rdf-join 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,10 +41,10 @@
37
41
  "build:components": "componentsjs-generator"
38
42
  },
39
43
  "dependencies": {
40
- "@comunica/bus-rdf-join": "^3.2.1",
41
- "@comunica/mediatortype-join-coefficients": "^3.2.1",
42
- "@comunica/types": "^3.2.1",
44
+ "@comunica/bus-rdf-join": "3.2.4-alpha.47.0",
45
+ "@comunica/core": "3.2.4-alpha.47.0",
46
+ "@comunica/mediatortype-join-coefficients": "3.2.4-alpha.47.0",
43
47
  "asynciterator": "^3.9.0"
44
48
  },
45
- "gitHead": "f558377c3cefbd1606c51ede80440b862e7dda4f"
49
+ "gitHead": "85bd4c5cf07dfc293ebbc3a1416b70e2db8bfc48"
46
50
  }