@comunica/actor-query-operation-ask 1.21.1 → 2.0.1-alpha.6.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
@@ -22,14 +22,14 @@ After installing, this package can be added to your engine's configuration as fo
22
22
  {
23
23
  "@context": [
24
24
  ...
25
- "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-operation-ask/^1.0.0/components/context.jsonld"
25
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-operation-ask/^2.0.0/components/context.jsonld"
26
26
  ],
27
27
  "actors": [
28
28
  ...
29
29
  {
30
- "@id": "config-sets:sparql-queryoperators.json#myAskQueryOperator",
30
+ "@id": "urn:comunica:default:query-operation/actors#ask",
31
31
  "@type": "ActorQueryOperationAsk",
32
- "cbqo:mediatorQueryOperation": { "@id": "config-sets:sparql-queryoperators.json#mediatorQueryOperation" }
32
+ "mediatorQueryOperation": { "@id": "urn:comunica:default:query-operation/mediators#main" }
33
33
  }
34
34
  ]
35
35
  }
@@ -37,4 +37,4 @@ After installing, this package can be added to your engine's configuration as fo
37
37
 
38
38
  ### Config Parameters
39
39
 
40
- * `cbqo:mediatorQueryOperation`: A mediator over the [Query Operation bus](https://github.com/comunica/comunica/tree/master/packages/bus-query-operation).
40
+ * `mediatorQueryOperation`: A mediator over the [Query Operation bus](https://github.com/comunica/comunica/tree/master/packages/bus-query-operation).
@@ -0,0 +1,152 @@
1
+ {
2
+ "@context": [
3
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-operation-ask/^2.0.0/components/context.jsonld",
4
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/core/^2.0.0/components/context.jsonld",
5
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-query-operation/^2.0.0/components/context.jsonld"
6
+ ],
7
+ "@id": "npmd:@comunica/actor-query-operation-ask",
8
+ "components": [
9
+ {
10
+ "@id": "caqoa:components/ActorQueryOperationAsk.jsonld#ActorQueryOperationAsk",
11
+ "@type": "Class",
12
+ "requireElement": "ActorQueryOperationAsk",
13
+ "extends": [
14
+ {
15
+ "@type": "GenericComponentExtension",
16
+ "component": "cbqo:components/ActorQueryOperationTypedMediated.jsonld#ActorQueryOperationTypedMediated",
17
+ "genericTypeInstances": [
18
+ "urn:npm:sparqlalgebrajs:Ask"
19
+ ]
20
+ }
21
+ ],
22
+ "comment": "A comunica Ask Query Operation Actor.",
23
+ "parameters": [
24
+ {
25
+ "@id": "caqoa:components/ActorQueryOperationAsk.jsonld#ActorQueryOperationAsk_args_mediatorQueryOperation",
26
+ "range": "cc:components/Mediator.jsonld#Mediator"
27
+ },
28
+ {
29
+ "@id": "caqoa:components/ActorQueryOperationAsk.jsonld#ActorQueryOperationAsk_args_name",
30
+ "range": "xsd:string",
31
+ "default": {
32
+ "@id": "rdf:subject"
33
+ },
34
+ "comment": "The name for this actor."
35
+ },
36
+ {
37
+ "@id": "caqoa:components/ActorQueryOperationAsk.jsonld#ActorQueryOperationAsk_args_bus",
38
+ "range": {
39
+ "@type": "ParameterRangeGenericComponent",
40
+ "component": "cc:components/Bus.jsonld#Bus",
41
+ "genericTypeInstances": [
42
+ {
43
+ "@type": "ParameterRangeGenericComponent",
44
+ "component": "cc:components/Actor.jsonld#Actor",
45
+ "genericTypeInstances": [
46
+ {
47
+ "@type": "ParameterRangeGenericTypeReference",
48
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^2.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
49
+ },
50
+ {
51
+ "@type": "ParameterRangeGenericTypeReference",
52
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^2.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
53
+ },
54
+ {
55
+ "@type": "ParameterRangeGenericTypeReference",
56
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^2.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
57
+ }
58
+ ]
59
+ },
60
+ {
61
+ "@type": "ParameterRangeGenericTypeReference",
62
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^2.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
63
+ },
64
+ {
65
+ "@type": "ParameterRangeGenericTypeReference",
66
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^2.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
67
+ },
68
+ {
69
+ "@type": "ParameterRangeGenericTypeReference",
70
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^2.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
71
+ }
72
+ ]
73
+ },
74
+ "default": {
75
+ "@id": "cbqo:components/ActorQueryOperation.jsonld#ActorQueryOperation_default_bus",
76
+ "@type": "cc:components/Bus.jsonld#Bus"
77
+ },
78
+ "comment": "The bus this actor subscribes to."
79
+ },
80
+ {
81
+ "@id": "caqoa:components/ActorQueryOperationAsk.jsonld#ActorQueryOperationAsk_args_beforeActors",
82
+ "range": {
83
+ "@type": "ParameterRangeUnion",
84
+ "parameterRangeElements": [
85
+ {
86
+ "@type": "ParameterRangeArray",
87
+ "parameterRangeValue": {
88
+ "@type": "ParameterRangeGenericComponent",
89
+ "component": "cc:components/Actor.jsonld#Actor",
90
+ "genericTypeInstances": [
91
+ {
92
+ "@type": "ParameterRangeGenericTypeReference",
93
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^2.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
94
+ },
95
+ {
96
+ "@type": "ParameterRangeGenericTypeReference",
97
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^2.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
98
+ },
99
+ {
100
+ "@type": "ParameterRangeGenericTypeReference",
101
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^2.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
102
+ }
103
+ ]
104
+ }
105
+ },
106
+ {
107
+ "@type": "ParameterRangeUndefined"
108
+ }
109
+ ]
110
+ },
111
+ "comment": "Actor that must be registered in the bus before this actor."
112
+ }
113
+ ],
114
+ "memberKeys": [
115
+ "constructor",
116
+ "testOperation",
117
+ "runOperation"
118
+ ],
119
+ "constructorArguments": [
120
+ {
121
+ "@id": "caqoa:components/ActorQueryOperationAsk.jsonld#ActorQueryOperationAsk_args__constructorArgument",
122
+ "fields": [
123
+ {
124
+ "keyRaw": "mediatorQueryOperation",
125
+ "value": {
126
+ "@id": "caqoa:components/ActorQueryOperationAsk.jsonld#ActorQueryOperationAsk_args_mediatorQueryOperation"
127
+ }
128
+ },
129
+ {
130
+ "keyRaw": "name",
131
+ "value": {
132
+ "@id": "caqoa:components/ActorQueryOperationAsk.jsonld#ActorQueryOperationAsk_args_name"
133
+ }
134
+ },
135
+ {
136
+ "keyRaw": "bus",
137
+ "value": {
138
+ "@id": "caqoa:components/ActorQueryOperationAsk.jsonld#ActorQueryOperationAsk_args_bus"
139
+ }
140
+ },
141
+ {
142
+ "keyRaw": "beforeActors",
143
+ "value": {
144
+ "@id": "caqoa:components/ActorQueryOperationAsk.jsonld#ActorQueryOperationAsk_args_beforeActors"
145
+ }
146
+ }
147
+ ]
148
+ }
149
+ ]
150
+ }
151
+ ]
152
+ }
@@ -1,9 +1,11 @@
1
1
  {
2
- "@context": "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-operation-ask/^1.0.0/components/context.jsonld",
2
+ "@context": [
3
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-operation-ask/^2.0.0/components/context.jsonld"
4
+ ],
3
5
  "@id": "npmd:@comunica/actor-query-operation-ask",
4
6
  "@type": "Module",
5
7
  "requireName": "@comunica/actor-query-operation-ask",
6
8
  "import": [
7
- "files-caqoa:components/Actor/QueryOperation/Ask.jsonld"
9
+ "caqoa:components/ActorQueryOperationAsk.jsonld"
8
10
  ]
9
- }
11
+ }
@@ -3,10 +3,39 @@
3
3
  "https://linkedsoftwaredependencies.org/bundles/npm/componentsjs/^4.0.0/components/context.jsonld",
4
4
  {
5
5
  "npmd": "https://linkedsoftwaredependencies.org/bundles/npm/",
6
- "caqoa": "npmd:@comunica/actor-query-operation-ask/",
7
- "files-caqoa": "caqoa:^1.0.0/",
8
-
9
- "ActorQueryOperationAsk": "caqoa:Actor/QueryOperation/Ask"
6
+ "caqoa": "npmd:@comunica/actor-query-operation-ask/^2.0.0/",
7
+ "ActorQueryOperationAsk": {
8
+ "@id": "caqoa:components/ActorQueryOperationAsk.jsonld#ActorQueryOperationAsk",
9
+ "@prefix": true,
10
+ "@context": {
11
+ "args_mediatorQueryOperation": {
12
+ "@id": "caqoa:components/ActorQueryOperationAsk.jsonld#ActorQueryOperationAsk_args_mediatorQueryOperation"
13
+ },
14
+ "args_name": {
15
+ "@id": "caqoa:components/ActorQueryOperationAsk.jsonld#ActorQueryOperationAsk_args_name"
16
+ },
17
+ "args_bus": {
18
+ "@id": "caqoa:components/ActorQueryOperationAsk.jsonld#ActorQueryOperationAsk_args_bus"
19
+ },
20
+ "args_beforeActors": {
21
+ "@id": "caqoa:components/ActorQueryOperationAsk.jsonld#ActorQueryOperationAsk_args_beforeActors",
22
+ "@container": "@list"
23
+ },
24
+ "mediatorQueryOperation": {
25
+ "@id": "caqoa:components/ActorQueryOperationAsk.jsonld#ActorQueryOperationAsk_args_mediatorQueryOperation"
26
+ },
27
+ "name": {
28
+ "@id": "caqoa:components/ActorQueryOperationAsk.jsonld#ActorQueryOperationAsk_args_name"
29
+ },
30
+ "bus": {
31
+ "@id": "caqoa:components/ActorQueryOperationAsk.jsonld#ActorQueryOperationAsk_args_bus"
32
+ },
33
+ "beforeActors": {
34
+ "@id": "caqoa:components/ActorQueryOperationAsk.jsonld#ActorQueryOperationAsk_args_beforeActors",
35
+ "@container": "@list"
36
+ }
37
+ }
38
+ }
10
39
  }
11
40
  ]
12
- }
41
+ }
@@ -1,13 +1,13 @@
1
1
  import type { IActorQueryOperationTypedMediatedArgs } from '@comunica/bus-query-operation';
2
2
  import { ActorQueryOperationTypedMediated } from '@comunica/bus-query-operation';
3
- import type { ActionContext, IActorTest } from '@comunica/core';
4
- import type { IActorQueryOperationOutputBoolean } from '@comunica/types';
3
+ import type { IActorTest } from '@comunica/core';
4
+ import type { IActionContext, IQueryOperationResult } from '@comunica/types';
5
5
  import type { Algebra } from 'sparqlalgebrajs';
6
6
  /**
7
7
  * A comunica Ask Query Operation Actor.
8
8
  */
9
9
  export declare class ActorQueryOperationAsk extends ActorQueryOperationTypedMediated<Algebra.Ask> {
10
10
  constructor(args: IActorQueryOperationTypedMediatedArgs);
11
- testOperation(pattern: Algebra.Ask, context: ActionContext): Promise<IActorTest>;
12
- runOperation(pattern: Algebra.Ask, context: ActionContext): Promise<IActorQueryOperationOutputBoolean>;
11
+ testOperation(operation: Algebra.Ask, context: IActionContext): Promise<IActorTest>;
12
+ runOperation(operation: Algebra.Ask, context: IActionContext): Promise<IQueryOperationResult>;
13
13
  }
@@ -9,14 +9,14 @@ class ActorQueryOperationAsk extends bus_query_operation_1.ActorQueryOperationTy
9
9
  constructor(args) {
10
10
  super(args, 'ask');
11
11
  }
12
- async testOperation(pattern, context) {
12
+ async testOperation(operation, context) {
13
13
  return true;
14
14
  }
15
- async runOperation(pattern, context) {
15
+ async runOperation(operation, context) {
16
16
  // Call other query operations like this:
17
- const output = await this.mediatorQueryOperation.mediate({ operation: pattern.input, context });
17
+ const output = await this.mediatorQueryOperation.mediate({ operation: operation.input, context });
18
18
  const bindings = bus_query_operation_1.ActorQueryOperation.getSafeBindings(output);
19
- const booleanResult = new Promise((resolve, reject) => {
19
+ const execute = () => new Promise((resolve, reject) => {
20
20
  // Resolve to true if we find one element, and close immediately
21
21
  bindings.bindingsStream.once('data', () => {
22
22
  resolve(true);
@@ -27,7 +27,7 @@ class ActorQueryOperationAsk extends bus_query_operation_1.ActorQueryOperationTy
27
27
  // Reject if an error occurs in the stream
28
28
  bindings.bindingsStream.on('error', reject);
29
29
  });
30
- return { type: 'boolean', booleanResult };
30
+ return { type: 'boolean', execute };
31
31
  }
32
32
  }
33
33
  exports.ActorQueryOperationAsk = ActorQueryOperationAsk;
package/lib/index.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './ActorQueryOperationAsk';
@@ -10,5 +10,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
10
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
11
  };
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
- __exportStar(require("./lib/ActorQueryOperationAsk"), exports);
13
+ __exportStar(require("./ActorQueryOperationAsk"), exports);
14
14
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@comunica/actor-query-operation-ask",
3
- "version": "1.21.1",
3
+ "version": "2.0.1-alpha.6.0",
4
4
  "description": "A ask query-operation actor",
5
5
  "lsd:module": true,
6
- "main": "index.js",
7
- "typings": "index",
6
+ "main": "lib/index.js",
7
+ "typings": "lib/index",
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "https://github.com/comunica/comunica.git",
@@ -13,6 +13,7 @@
13
13
  "publishConfig": {
14
14
  "access": "public"
15
15
  },
16
+ "sideEffects": false,
16
17
  "keywords": [
17
18
  "comunica",
18
19
  "actor",
@@ -27,42 +28,18 @@
27
28
  "files": [
28
29
  "components",
29
30
  "lib/**/*.d.ts",
30
- "lib/**/*.js",
31
- "index.d.ts",
32
- "index.js"
31
+ "lib/**/*.js"
33
32
  ],
34
33
  "dependencies": {
35
- "@comunica/types": "^1.21.1",
36
- "sparqlalgebrajs": "^2.5.5"
37
- },
38
- "peerDependencies": {
39
- "@comunica/bus-query-operation": "^1.0.0",
40
- "@comunica/core": "^1.0.0"
41
- },
42
- "devDependencies": {
43
- "@comunica/bus-query-operation": "^1.21.1",
44
- "@comunica/core": "^1.21.1"
45
- },
46
- "jest": {
47
- "globals": {
48
- "ts-jest": {
49
- "tsConfig": "../../tsconfig.json"
50
- }
51
- },
52
- "transform": {
53
- "^.+\\.ts$": "ts-jest"
54
- },
55
- "testRegex": "(/test/.*|(\\.|/)(test|spec))\\.ts$",
56
- "moduleFileExtensions": [
57
- "ts",
58
- "js"
59
- ],
60
- "collectCoverage": true
34
+ "@comunica/bus-query-operation": "2.0.1-alpha.6.0",
35
+ "@comunica/core": "2.0.1-alpha.6.0",
36
+ "@comunica/types": "2.0.1-alpha.6.0",
37
+ "sparqlalgebrajs": "^4.0.0"
61
38
  },
62
39
  "scripts": {
63
- "test": "node \"../../node_modules/jest/bin/jest.js\" ${1}",
64
- "test-watch": "node \"../../node_modules/jest/bin/jest.js\" ${1} --watch",
65
- "build": "node \"../../node_modules/typescript/bin/tsc\"",
66
- "validate": "npm ls"
67
- }
40
+ "build": "npm run build:ts && npm run build:components",
41
+ "build:ts": "node \"../../node_modules/typescript/bin/tsc\"",
42
+ "build:components": "componentsjs-generator"
43
+ },
44
+ "gitHead": "bbf46a068e635256495a40e784a4691b22e88bd3"
68
45
  }
@@ -1,21 +0,0 @@
1
- {
2
- "@context": [
3
- "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-operation-ask/^1.0.0/components/context.jsonld",
4
- "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-query-operation/^1.0.0/components/context.jsonld"
5
- ],
6
- "@id": "npmd:@comunica/actor-query-operation-ask",
7
- "components": [
8
- {
9
- "@id": "caqoa:Actor/QueryOperation/Ask",
10
- "@type": "Class",
11
- "extends": "cbqo:Actor/QueryOperationTypedMediated",
12
- "requireElement": "ActorQueryOperationAsk",
13
- "comment": "A comunica Ask Query Operation Actor.",
14
- "constructorArguments": [
15
- {
16
- "extends": "cbqo:Actor/QueryOperationTypedMediated/constructorArgumentsObject"
17
- }
18
- ]
19
- }
20
- ]
21
- }
package/index.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from './lib/ActorQueryOperationAsk';