@comunica/actor-query-operation-ask 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.
@@ -54,6 +54,10 @@
54
54
  {
55
55
  "@type": "ParameterRangeGenericTypeReference",
56
56
  "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^3.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
57
+ },
58
+ {
59
+ "@type": "ParameterRangeGenericTypeReference",
60
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^3.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
57
61
  }
58
62
  ]
59
63
  },
@@ -68,6 +72,10 @@
68
72
  {
69
73
  "@type": "ParameterRangeGenericTypeReference",
70
74
  "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^3.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
75
+ },
76
+ {
77
+ "@type": "ParameterRangeGenericTypeReference",
78
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^3.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
71
79
  }
72
80
  ]
73
81
  },
@@ -77,6 +85,20 @@
77
85
  },
78
86
  "comment": "The bus this actor subscribes to."
79
87
  },
88
+ {
89
+ "@id": "caqoa:components/ActorQueryOperationAsk.jsonld#ActorQueryOperationAsk_args_busFailMessage",
90
+ "range": {
91
+ "@type": "ParameterRangeUnion",
92
+ "parameterRangeElements": [
93
+ "xsd:string",
94
+ {
95
+ "@type": "ParameterRangeUndefined"
96
+ }
97
+ ]
98
+ },
99
+ "default": "Query operation processing failed: none of the configured actors were able to handle the operation type ${action.operation.type}",
100
+ "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}\""
101
+ },
80
102
  {
81
103
  "@id": "caqoa:components/ActorQueryOperationAsk.jsonld#ActorQueryOperationAsk_args_beforeActors",
82
104
  "range": {
@@ -99,6 +121,10 @@
99
121
  {
100
122
  "@type": "ParameterRangeGenericTypeReference",
101
123
  "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^3.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
124
+ },
125
+ {
126
+ "@type": "ParameterRangeGenericTypeReference",
127
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^3.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
102
128
  }
103
129
  ]
104
130
  }
@@ -147,6 +173,12 @@
147
173
  "@id": "caqoa:components/ActorQueryOperationAsk.jsonld#ActorQueryOperationAsk_args_bus"
148
174
  }
149
175
  },
176
+ {
177
+ "keyRaw": "busFailMessage",
178
+ "value": {
179
+ "@id": "caqoa:components/ActorQueryOperationAsk.jsonld#ActorQueryOperationAsk_args_busFailMessage"
180
+ }
181
+ },
150
182
  {
151
183
  "keyRaw": "beforeActors",
152
184
  "value": {
@@ -17,6 +17,9 @@
17
17
  "args_bus": {
18
18
  "@id": "caqoa:components/ActorQueryOperationAsk.jsonld#ActorQueryOperationAsk_args_bus"
19
19
  },
20
+ "args_busFailMessage": {
21
+ "@id": "caqoa:components/ActorQueryOperationAsk.jsonld#ActorQueryOperationAsk_args_busFailMessage"
22
+ },
20
23
  "args_beforeActors": {
21
24
  "@id": "caqoa:components/ActorQueryOperationAsk.jsonld#ActorQueryOperationAsk_args_beforeActors",
22
25
  "@container": "@list"
@@ -30,6 +33,9 @@
30
33
  "bus": {
31
34
  "@id": "caqoa:components/ActorQueryOperationAsk.jsonld#ActorQueryOperationAsk_args_bus"
32
35
  },
36
+ "busFailMessage": {
37
+ "@id": "caqoa:components/ActorQueryOperationAsk.jsonld#ActorQueryOperationAsk_args_busFailMessage"
38
+ },
33
39
  "beforeActors": {
34
40
  "@id": "caqoa:components/ActorQueryOperationAsk.jsonld#ActorQueryOperationAsk_args_beforeActors",
35
41
  "@container": "@list"
@@ -1,6 +1,6 @@
1
1
  import type { IActorQueryOperationTypedMediatedArgs } from '@comunica/bus-query-operation';
2
2
  import { ActorQueryOperationTypedMediated } from '@comunica/bus-query-operation';
3
- import type { IActorTest } from '@comunica/core';
3
+ import type { IActorTest, TestResult } from '@comunica/core';
4
4
  import type { IActionContext, IQueryOperationResult } from '@comunica/types';
5
5
  import type { Algebra } from 'sparqlalgebrajs';
6
6
  /**
@@ -8,6 +8,6 @@ import type { Algebra } from 'sparqlalgebrajs';
8
8
  */
9
9
  export declare class ActorQueryOperationAsk extends ActorQueryOperationTypedMediated<Algebra.Ask> {
10
10
  constructor(args: IActorQueryOperationTypedMediatedArgs);
11
- testOperation(_operation: Algebra.Ask, _context: IActionContext): Promise<IActorTest>;
11
+ testOperation(_operation: Algebra.Ask, _context: IActionContext): Promise<TestResult<IActorTest>>;
12
12
  runOperation(operation: Algebra.Ask, context: IActionContext): Promise<IQueryOperationResult>;
13
13
  }
@@ -2,6 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ActorQueryOperationAsk = void 0;
4
4
  const bus_query_operation_1 = require("@comunica/bus-query-operation");
5
+ const core_1 = require("@comunica/core");
6
+ const utils_query_operation_1 = require("@comunica/utils-query-operation");
5
7
  /**
6
8
  * A comunica Ask Query Operation Actor.
7
9
  */
@@ -10,12 +12,12 @@ class ActorQueryOperationAsk extends bus_query_operation_1.ActorQueryOperationTy
10
12
  super(args, 'ask');
11
13
  }
12
14
  async testOperation(_operation, _context) {
13
- return true;
15
+ return (0, core_1.passTestVoid)();
14
16
  }
15
17
  async runOperation(operation, context) {
16
18
  // Call other query operations like this:
17
19
  const output = await this.mediatorQueryOperation.mediate({ operation: operation.input, context });
18
- const { bindingsStream } = bus_query_operation_1.ActorQueryOperation.getSafeBindings(output);
20
+ const { bindingsStream } = (0, utils_query_operation_1.getSafeBindings)(output);
19
21
  return { type: 'boolean', execute: async () => (await bindingsStream.take(1).toArray()).length === 1 };
20
22
  }
21
23
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ActorQueryOperationAsk.js","sourceRoot":"","sources":["ActorQueryOperationAsk.ts"],"names":[],"mappings":";;;AACA,uEAAsG;AAStG;;GAEG;AACH,MAAa,sBAAuB,SAAQ,sDAA6C;IACvF,YAAmB,IAA2C;QAC5D,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACrB,CAAC;IAEM,KAAK,CAAC,aAAa,CAAC,UAAuB,EAAE,QAAwB;QAC1E,OAAO,IAAI,CAAC;IACd,CAAC;IAEM,KAAK,CAAC,YAAY,CAAC,SAAsB,EAAE,OAAuB;QACvE,yCAAyC;QACzC,MAAM,MAAM,GAA0B,MAAM,IAAI,CAAC,sBAAsB,CAAC,OAAO,CAC7E,EAAE,SAAS,EAAE,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,CACxC,CAAC;QACF,MAAM,EAAE,cAAc,EAAE,GAAkC,yCAAmB,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;QACtG,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,IAAG,EAAE,CAAC,CAAC,MAAM,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;IACxG,CAAC;CACF;AAjBD,wDAiBC","sourcesContent":["import type { IActorQueryOperationTypedMediatedArgs } from '@comunica/bus-query-operation';\nimport { ActorQueryOperation, ActorQueryOperationTypedMediated } from '@comunica/bus-query-operation';\nimport type { IActorTest } from '@comunica/core';\nimport type {\n IActionContext,\n IQueryOperationResult,\n IQueryOperationResultBindings,\n} from '@comunica/types';\nimport type { Algebra } from 'sparqlalgebrajs';\n\n/**\n * A comunica Ask Query Operation Actor.\n */\nexport class ActorQueryOperationAsk extends ActorQueryOperationTypedMediated<Algebra.Ask> {\n public constructor(args: IActorQueryOperationTypedMediatedArgs) {\n super(args, 'ask');\n }\n\n public async testOperation(_operation: Algebra.Ask, _context: IActionContext): Promise<IActorTest> {\n return true;\n }\n\n public async runOperation(operation: Algebra.Ask, context: IActionContext): Promise<IQueryOperationResult> {\n // Call other query operations like this:\n const output: IQueryOperationResult = await this.mediatorQueryOperation.mediate(\n { operation: operation.input, context },\n );\n const { bindingsStream }: IQueryOperationResultBindings = ActorQueryOperation.getSafeBindings(output);\n return { type: 'boolean', execute: async() => (await bindingsStream.take(1).toArray()).length === 1 };\n }\n}\n"]}
1
+ {"version":3,"file":"ActorQueryOperationAsk.js","sourceRoot":"","sources":["ActorQueryOperationAsk.ts"],"names":[],"mappings":";;;AACA,uEAAiF;AAEjF,yCAA8C;AAM9C,2EAAkE;AAGlE;;GAEG;AACH,MAAa,sBAAuB,SAAQ,sDAA6C;IACvF,YAAmB,IAA2C;QAC5D,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACrB,CAAC;IAEM,KAAK,CAAC,aAAa,CAAC,UAAuB,EAAE,QAAwB;QAC1E,OAAO,IAAA,mBAAY,GAAE,CAAC;IACxB,CAAC;IAEM,KAAK,CAAC,YAAY,CAAC,SAAsB,EAAE,OAAuB;QACvE,yCAAyC;QACzC,MAAM,MAAM,GAA0B,MAAM,IAAI,CAAC,sBAAsB,CAAC,OAAO,CAC7E,EAAE,SAAS,EAAE,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,CACxC,CAAC;QACF,MAAM,EAAE,cAAc,EAAE,GAAkC,IAAA,uCAAe,EAAC,MAAM,CAAC,CAAC;QAClF,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,IAAG,EAAE,CAAC,CAAC,MAAM,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;IACxG,CAAC;CACF;AAjBD,wDAiBC","sourcesContent":["import type { IActorQueryOperationTypedMediatedArgs } from '@comunica/bus-query-operation';\nimport { ActorQueryOperationTypedMediated } from '@comunica/bus-query-operation';\nimport type { IActorTest, TestResult } from '@comunica/core';\nimport { passTestVoid } from '@comunica/core';\nimport type {\n IActionContext,\n IQueryOperationResult,\n IQueryOperationResultBindings,\n} from '@comunica/types';\nimport { getSafeBindings } from '@comunica/utils-query-operation';\nimport type { Algebra } from 'sparqlalgebrajs';\n\n/**\n * A comunica Ask Query Operation Actor.\n */\nexport class ActorQueryOperationAsk extends ActorQueryOperationTypedMediated<Algebra.Ask> {\n public constructor(args: IActorQueryOperationTypedMediatedArgs) {\n super(args, 'ask');\n }\n\n public async testOperation(_operation: Algebra.Ask, _context: IActionContext): Promise<TestResult<IActorTest>> {\n return passTestVoid();\n }\n\n public async runOperation(operation: Algebra.Ask, context: IActionContext): Promise<IQueryOperationResult> {\n // Call other query operations like this:\n const output: IQueryOperationResult = await this.mediatorQueryOperation.mediate(\n { operation: operation.input, context },\n );\n const { bindingsStream }: IQueryOperationResultBindings = getSafeBindings(output);\n return { type: 'boolean', execute: async() => (await bindingsStream.take(1).toArray()).length === 1 };\n }\n}\n"]}
package/package.json CHANGED
@@ -1,9 +1,13 @@
1
1
  {
2
2
  "name": "@comunica/actor-query-operation-ask",
3
- "version": "3.2.1",
3
+ "version": "3.2.4-alpha.47.0",
4
4
  "description": "A ask query-operation 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,11 @@
37
41
  "build:components": "componentsjs-generator"
38
42
  },
39
43
  "dependencies": {
40
- "@comunica/bus-query-operation": "^3.2.1",
41
- "@comunica/core": "^3.2.1",
42
- "@comunica/types": "^3.2.1",
43
- "sparqlalgebrajs": "^4.3.7"
44
+ "@comunica/bus-query-operation": "3.2.4-alpha.47.0",
45
+ "@comunica/core": "3.2.4-alpha.47.0",
46
+ "@comunica/types": "3.2.4-alpha.47.0",
47
+ "@comunica/utils-query-operation": "3.2.4-alpha.47.0",
48
+ "sparqlalgebrajs": "^4.3.8"
44
49
  },
45
- "gitHead": "f558377c3cefbd1606c51ede80440b862e7dda4f"
50
+ "gitHead": "85bd4c5cf07dfc293ebbc3a1416b70e2db8bfc48"
46
51
  }