@comunica/actor-rdf-join-inner-single 3.2.0 → 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.
@@ -48,6 +48,10 @@
48
48
  {
49
49
  "@type": "ParameterRangeGenericTypeReference",
50
50
  "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^3.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
51
+ },
52
+ {
53
+ "@type": "ParameterRangeGenericTypeReference",
54
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^3.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
51
55
  }
52
56
  ]
53
57
  },
@@ -62,6 +66,10 @@
62
66
  {
63
67
  "@type": "ParameterRangeGenericTypeReference",
64
68
  "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^3.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
69
+ },
70
+ {
71
+ "@type": "ParameterRangeGenericTypeReference",
72
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^3.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
65
73
  }
66
74
  ]
67
75
  },
@@ -71,6 +79,20 @@
71
79
  },
72
80
  "comment": "The bus this actor subscribes to."
73
81
  },
82
+ {
83
+ "@id": "carjisi:components/ActorRdfJoinSingle.jsonld#ActorRdfJoinSingle_args_busFailMessage",
84
+ "range": {
85
+ "@type": "ParameterRangeUnion",
86
+ "parameterRangeElements": [
87
+ "xsd:string",
88
+ {
89
+ "@type": "ParameterRangeUndefined"
90
+ }
91
+ ]
92
+ },
93
+ "default": "RDF joining failed: none of the configured actors were able to handle the join type ${action.type}",
94
+ "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}\""
95
+ },
74
96
  {
75
97
  "@id": "carjisi:components/ActorRdfJoinSingle.jsonld#ActorRdfJoinSingle_args_beforeActors",
76
98
  "range": {
@@ -93,6 +115,10 @@
93
115
  {
94
116
  "@type": "ParameterRangeGenericTypeReference",
95
117
  "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^3.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
118
+ },
119
+ {
120
+ "@type": "ParameterRangeGenericTypeReference",
121
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^3.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
96
122
  }
97
123
  ]
98
124
  }
@@ -145,6 +171,12 @@
145
171
  "@id": "carjisi:components/ActorRdfJoinSingle.jsonld#ActorRdfJoinSingle_args_bus"
146
172
  }
147
173
  },
174
+ {
175
+ "keyRaw": "busFailMessage",
176
+ "value": {
177
+ "@id": "carjisi:components/ActorRdfJoinSingle.jsonld#ActorRdfJoinSingle_args_busFailMessage"
178
+ }
179
+ },
148
180
  {
149
181
  "keyRaw": "beforeActors",
150
182
  "value": {
@@ -17,6 +17,9 @@
17
17
  "args_bus": {
18
18
  "@id": "carjisi:components/ActorRdfJoinSingle.jsonld#ActorRdfJoinSingle_args_bus"
19
19
  },
20
+ "args_busFailMessage": {
21
+ "@id": "carjisi:components/ActorRdfJoinSingle.jsonld#ActorRdfJoinSingle_args_busFailMessage"
22
+ },
20
23
  "args_beforeActors": {
21
24
  "@id": "carjisi:components/ActorRdfJoinSingle.jsonld#ActorRdfJoinSingle_args_beforeActors",
22
25
  "@container": "@list"
@@ -30,6 +33,9 @@
30
33
  "bus": {
31
34
  "@id": "carjisi:components/ActorRdfJoinSingle.jsonld#ActorRdfJoinSingle_args_bus"
32
35
  },
36
+ "busFailMessage": {
37
+ "@id": "carjisi:components/ActorRdfJoinSingle.jsonld#ActorRdfJoinSingle_args_busFailMessage"
38
+ },
33
39
  "beforeActors": {
34
40
  "@id": "carjisi:components/ActorRdfJoinSingle.jsonld#ActorRdfJoinSingle_args_beforeActors",
35
41
  "@container": "@list"
@@ -1,12 +1,13 @@
1
- import type { IActionRdfJoin, IActorRdfJoinOutputInner, IActorRdfJoinArgs } from '@comunica/bus-rdf-join';
1
+ import type { IActionRdfJoin, IActorRdfJoinOutputInner, IActorRdfJoinArgs, 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
5
  /**
5
6
  * A comunica Single RDF Join Actor.
6
7
  */
7
8
  export declare class ActorRdfJoinSingle extends ActorRdfJoin {
8
9
  constructor(args: IActorRdfJoinArgs);
9
- test(action: IActionRdfJoin): Promise<IMediatorTypeJoinCoefficients>;
10
+ test(action: IActionRdfJoin): Promise<TestResult<IMediatorTypeJoinCoefficients, IActorRdfJoinTestSideData>>;
10
11
  protected getOutput(action: IActionRdfJoin): Promise<IActorRdfJoinOutputInner>;
11
- protected getJoinCoefficients(): Promise<IMediatorTypeJoinCoefficients>;
12
+ protected getJoinCoefficients(action: IActionRdfJoin, sideData: IActorRdfJoinTestSideData): Promise<TestResult<IMediatorTypeJoinCoefficients, IActorRdfJoinTestSideData>>;
12
13
  }
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ActorRdfJoinSingle = void 0;
4
4
  const bus_rdf_join_1 = require("@comunica/bus-rdf-join");
5
+ const core_1 = require("@comunica/core");
5
6
  /**
6
7
  * A comunica Single RDF Join Actor.
7
8
  */
@@ -17,22 +18,22 @@ class ActorRdfJoinSingle extends bus_rdf_join_1.ActorRdfJoin {
17
18
  async test(action) {
18
19
  // Allow joining of one or zero streams
19
20
  if (action.entries.length !== 1) {
20
- throw new Error(`Actor ${this.name} can only join a single entry`);
21
+ return (0, core_1.failTest)(`Actor ${this.name} can only join a single entry`);
21
22
  }
22
- return await this.getJoinCoefficients();
23
+ return await this.getJoinCoefficients(action, undefined);
23
24
  }
24
25
  async getOutput(action) {
25
26
  return {
26
27
  result: action.entries[0].output,
27
28
  };
28
29
  }
29
- async getJoinCoefficients() {
30
- return {
30
+ async getJoinCoefficients(action, sideData) {
31
+ return (0, core_1.passTestWithSideData)({
31
32
  iterations: 0,
32
33
  persistedItems: 0,
33
34
  blockingItems: 0,
34
35
  requestTime: 0,
35
- };
36
+ }, sideData);
36
37
  }
37
38
  }
38
39
  exports.ActorRdfJoinSingle = ActorRdfJoinSingle;
@@ -1 +1 @@
1
- {"version":3,"file":"ActorRdfJoinSingle.js","sourceRoot":"","sources":["ActorRdfJoinSingle.ts"],"names":[],"mappings":";;;AACA,yDAAsD;AAGtD;;GAEG;AACH,MAAa,kBAAmB,SAAQ,2BAAY;IAClD,YAAmB,IAAuB;QACxC,KAAK,CAAC,IAAI,EAAE;YACV,WAAW,EAAE,OAAO;YACpB,YAAY,EAAE,QAAQ;YACtB,YAAY,EAAE,CAAC;SAChB,CAAC,CAAC;QACH,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC;IAC7B,CAAC;IAEe,KAAK,CAAC,IAAI,CAAC,MAAsB;QAC/C,uCAAuC;QACvC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAChC,MAAM,IAAI,KAAK,CAAC,SAAS,IAAI,CAAC,IAAI,+BAA+B,CAAC,CAAC;QACrE,CAAC;QACD,OAAO,MAAM,IAAI,CAAC,mBAAmB,EAAE,CAAC;IAC1C,CAAC;IAES,KAAK,CAAC,SAAS,CAAC,MAAsB;QAC9C,OAAO;YACL,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,MAAM;SACjC,CAAC;IACJ,CAAC;IAES,KAAK,CAAC,mBAAmB;QACjC,OAAO;YACL,UAAU,EAAE,CAAC;YACb,cAAc,EAAE,CAAC;YACjB,aAAa,EAAE,CAAC;YAChB,WAAW,EAAE,CAAC;SACf,CAAC;IACJ,CAAC;CACF;AAhCD,gDAgCC","sourcesContent":["import type { IActionRdfJoin, IActorRdfJoinOutputInner, IActorRdfJoinArgs } from '@comunica/bus-rdf-join';\nimport { ActorRdfJoin } from '@comunica/bus-rdf-join';\nimport type { IMediatorTypeJoinCoefficients } from '@comunica/mediatortype-join-coefficients';\n\n/**\n * A comunica Single RDF Join Actor.\n */\nexport class ActorRdfJoinSingle extends ActorRdfJoin {\n public constructor(args: IActorRdfJoinArgs) {\n super(args, {\n logicalType: 'inner',\n physicalName: 'single',\n limitEntries: 1,\n });\n this.includeInLogs = false;\n }\n\n public override async test(action: IActionRdfJoin): Promise<IMediatorTypeJoinCoefficients> {\n // Allow joining of one or zero streams\n if (action.entries.length !== 1) {\n throw new Error(`Actor ${this.name} can only join a single entry`);\n }\n return await this.getJoinCoefficients();\n }\n\n protected async getOutput(action: IActionRdfJoin): Promise<IActorRdfJoinOutputInner> {\n return {\n result: action.entries[0].output,\n };\n }\n\n protected async getJoinCoefficients(): Promise<IMediatorTypeJoinCoefficients> {\n return {\n iterations: 0,\n persistedItems: 0,\n blockingItems: 0,\n requestTime: 0,\n };\n }\n}\n"]}
1
+ {"version":3,"file":"ActorRdfJoinSingle.js","sourceRoot":"","sources":["ActorRdfJoinSingle.ts"],"names":[],"mappings":";;;AAMA,yDAAsD;AAEtD,yCAAgE;AAGhE;;GAEG;AACH,MAAa,kBAAmB,SAAQ,2BAAY;IAClD,YAAmB,IAAuB;QACxC,KAAK,CAAC,IAAI,EAAE;YACV,WAAW,EAAE,OAAO;YACpB,YAAY,EAAE,QAAQ;YACtB,YAAY,EAAE,CAAC;SAChB,CAAC,CAAC;QACH,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC;IAC7B,CAAC;IAEe,KAAK,CAAC,IAAI,CACxB,MAAsB;QAEtB,uCAAuC;QACvC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAChC,OAAO,IAAA,eAAQ,EAAC,SAAS,IAAI,CAAC,IAAI,+BAA+B,CAAC,CAAC;QACrE,CAAC;QACD,OAAO,MAAM,IAAI,CAAC,mBAAmB,CAAC,MAAM,EAAE,SAAU,CAAC,CAAC;IAC5D,CAAC;IAES,KAAK,CAAC,SAAS,CAAC,MAAsB;QAC9C,OAAO;YACL,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,MAAM;SACjC,CAAC;IACJ,CAAC;IAES,KAAK,CAAC,mBAAmB,CACjC,MAAsB,EACtB,QAAmC;QAEnC,OAAO,IAAA,2BAAoB,EAAC;YAC1B,UAAU,EAAE,CAAC;YACb,cAAc,EAAE,CAAC;YACjB,aAAa,EAAE,CAAC;YAChB,WAAW,EAAE,CAAC;SACf,EAAE,QAAQ,CAAC,CAAC;IACf,CAAC;CACF;AArCD,gDAqCC","sourcesContent":["import type {\n IActionRdfJoin,\n IActorRdfJoinOutputInner,\n IActorRdfJoinArgs,\n IActorRdfJoinTestSideData,\n} from '@comunica/bus-rdf-join';\nimport { ActorRdfJoin } from '@comunica/bus-rdf-join';\nimport type { TestResult } from '@comunica/core';\nimport { passTestWithSideData, failTest } from '@comunica/core';\nimport type { IMediatorTypeJoinCoefficients } from '@comunica/mediatortype-join-coefficients';\n\n/**\n * A comunica Single RDF Join Actor.\n */\nexport class ActorRdfJoinSingle extends ActorRdfJoin {\n public constructor(args: IActorRdfJoinArgs) {\n super(args, {\n logicalType: 'inner',\n physicalName: 'single',\n limitEntries: 1,\n });\n this.includeInLogs = false;\n }\n\n public override async test(\n action: IActionRdfJoin,\n ): Promise<TestResult<IMediatorTypeJoinCoefficients, IActorRdfJoinTestSideData>> {\n // Allow joining of one or zero streams\n if (action.entries.length !== 1) {\n return failTest(`Actor ${this.name} can only join a single entry`);\n }\n return await this.getJoinCoefficients(action, undefined!);\n }\n\n protected async getOutput(action: IActionRdfJoin): Promise<IActorRdfJoinOutputInner> {\n return {\n result: action.entries[0].output,\n };\n }\n\n protected async getJoinCoefficients(\n action: IActionRdfJoin,\n sideData: IActorRdfJoinTestSideData,\n ): Promise<TestResult<IMediatorTypeJoinCoefficients, IActorRdfJoinTestSideData>> {\n return passTestWithSideData({\n iterations: 0,\n persistedItems: 0,\n blockingItems: 0,\n requestTime: 0,\n }, sideData);\n }\n}\n"]}
package/package.json CHANGED
@@ -1,9 +1,13 @@
1
1
  {
2
2
  "name": "@comunica/actor-rdf-join-inner-single",
3
- "version": "3.2.0",
3
+ "version": "3.2.4-alpha.47.0",
4
4
  "description": "A single 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,8 +41,9 @@
37
41
  "build:components": "componentsjs-generator"
38
42
  },
39
43
  "dependencies": {
40
- "@comunica/bus-rdf-join": "^3.2.0",
41
- "@comunica/mediatortype-join-coefficients": "^3.2.0"
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"
42
47
  },
43
- "gitHead": "87baf2afed021a254859e64b92f34d9b51c6a7db"
48
+ "gitHead": "85bd4c5cf07dfc293ebbc3a1416b70e2db8bfc48"
44
49
  }