@comunica/actor-query-operation-path-nps 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-path-nps/^1.0.0/components/context.jsonld"
25
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-operation-path-nps/^2.0.0/components/context.jsonld"
26
26
  ],
27
27
  "actors": [
28
28
  ...
29
29
  {
30
- "@id": "config-sets:sparql-queryoperator-path.json#myNpsPathOperator",
30
+ "@id": "urn:comunica:default:query-operation/actors#path-nps",
31
31
  "@type": "ActorQueryOperationPathNps",
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,146 @@
1
+ {
2
+ "@context": [
3
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-operation-path-nps/^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
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-abstract-path/^2.0.0/components/context.jsonld"
7
+ ],
8
+ "@id": "npmd:@comunica/actor-query-operation-path-nps",
9
+ "components": [
10
+ {
11
+ "@id": "caqopn:components/ActorQueryOperationPathNps.jsonld#ActorQueryOperationPathNps",
12
+ "@type": "Class",
13
+ "requireElement": "ActorQueryOperationPathNps",
14
+ "extends": [
15
+ "caap:components/ActorAbstractPath.jsonld#ActorAbstractPath"
16
+ ],
17
+ "comment": "A comunica Path Nps Query Operation Actor.",
18
+ "parameters": [
19
+ {
20
+ "@id": "caqopn:components/ActorQueryOperationPathNps.jsonld#ActorQueryOperationPathNps_args_mediatorQueryOperation",
21
+ "range": "cc:components/Mediator.jsonld#Mediator"
22
+ },
23
+ {
24
+ "@id": "caqopn:components/ActorQueryOperationPathNps.jsonld#ActorQueryOperationPathNps_args_name",
25
+ "range": "xsd:string",
26
+ "default": {
27
+ "@id": "rdf:subject"
28
+ },
29
+ "comment": "The name for this actor."
30
+ },
31
+ {
32
+ "@id": "caqopn:components/ActorQueryOperationPathNps.jsonld#ActorQueryOperationPathNps_args_bus",
33
+ "range": {
34
+ "@type": "ParameterRangeGenericComponent",
35
+ "component": "cc:components/Bus.jsonld#Bus",
36
+ "genericTypeInstances": [
37
+ {
38
+ "@type": "ParameterRangeGenericComponent",
39
+ "component": "cc:components/Actor.jsonld#Actor",
40
+ "genericTypeInstances": [
41
+ {
42
+ "@type": "ParameterRangeGenericTypeReference",
43
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^2.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
44
+ },
45
+ {
46
+ "@type": "ParameterRangeGenericTypeReference",
47
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^2.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
48
+ },
49
+ {
50
+ "@type": "ParameterRangeGenericTypeReference",
51
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^2.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
52
+ }
53
+ ]
54
+ },
55
+ {
56
+ "@type": "ParameterRangeGenericTypeReference",
57
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^2.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
58
+ },
59
+ {
60
+ "@type": "ParameterRangeGenericTypeReference",
61
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^2.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
62
+ },
63
+ {
64
+ "@type": "ParameterRangeGenericTypeReference",
65
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^2.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
66
+ }
67
+ ]
68
+ },
69
+ "default": {
70
+ "@id": "cbqo:components/ActorQueryOperation.jsonld#ActorQueryOperation_default_bus",
71
+ "@type": "cc:components/Bus.jsonld#Bus"
72
+ },
73
+ "comment": "The bus this actor subscribes to."
74
+ },
75
+ {
76
+ "@id": "caqopn:components/ActorQueryOperationPathNps.jsonld#ActorQueryOperationPathNps_args_beforeActors",
77
+ "range": {
78
+ "@type": "ParameterRangeUnion",
79
+ "parameterRangeElements": [
80
+ {
81
+ "@type": "ParameterRangeArray",
82
+ "parameterRangeValue": {
83
+ "@type": "ParameterRangeGenericComponent",
84
+ "component": "cc:components/Actor.jsonld#Actor",
85
+ "genericTypeInstances": [
86
+ {
87
+ "@type": "ParameterRangeGenericTypeReference",
88
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^2.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
89
+ },
90
+ {
91
+ "@type": "ParameterRangeGenericTypeReference",
92
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^2.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
93
+ },
94
+ {
95
+ "@type": "ParameterRangeGenericTypeReference",
96
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^2.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
97
+ }
98
+ ]
99
+ }
100
+ },
101
+ {
102
+ "@type": "ParameterRangeUndefined"
103
+ }
104
+ ]
105
+ },
106
+ "comment": "Actor that must be registered in the bus before this actor."
107
+ }
108
+ ],
109
+ "memberKeys": [
110
+ "constructor",
111
+ "runOperation"
112
+ ],
113
+ "constructorArguments": [
114
+ {
115
+ "@id": "caqopn:components/ActorQueryOperationPathNps.jsonld#ActorQueryOperationPathNps_args__constructorArgument",
116
+ "fields": [
117
+ {
118
+ "keyRaw": "mediatorQueryOperation",
119
+ "value": {
120
+ "@id": "caqopn:components/ActorQueryOperationPathNps.jsonld#ActorQueryOperationPathNps_args_mediatorQueryOperation"
121
+ }
122
+ },
123
+ {
124
+ "keyRaw": "name",
125
+ "value": {
126
+ "@id": "caqopn:components/ActorQueryOperationPathNps.jsonld#ActorQueryOperationPathNps_args_name"
127
+ }
128
+ },
129
+ {
130
+ "keyRaw": "bus",
131
+ "value": {
132
+ "@id": "caqopn:components/ActorQueryOperationPathNps.jsonld#ActorQueryOperationPathNps_args_bus"
133
+ }
134
+ },
135
+ {
136
+ "keyRaw": "beforeActors",
137
+ "value": {
138
+ "@id": "caqopn:components/ActorQueryOperationPathNps.jsonld#ActorQueryOperationPathNps_args_beforeActors"
139
+ }
140
+ }
141
+ ]
142
+ }
143
+ ]
144
+ }
145
+ ]
146
+ }
@@ -1,9 +1,11 @@
1
1
  {
2
- "@context": "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-operation-path-nps/^1.0.0/components/context.jsonld",
2
+ "@context": [
3
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-operation-path-nps/^2.0.0/components/context.jsonld"
4
+ ],
3
5
  "@id": "npmd:@comunica/actor-query-operation-path-nps",
4
6
  "@type": "Module",
5
7
  "requireName": "@comunica/actor-query-operation-path-nps",
6
8
  "import": [
7
- "files-caqopn:components/Actor/QueryOperation/PathNps.jsonld"
9
+ "caqopn:components/ActorQueryOperationPathNps.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
- "caqopn": "npmd:@comunica/actor-query-operation-path-nps/",
7
- "files-caqopn": "caqopn:^1.0.0/",
8
-
9
- "ActorQueryOperationPathNps": "caqopn:Actor/QueryOperation/PathNps"
6
+ "caqopn": "npmd:@comunica/actor-query-operation-path-nps/^2.0.0/",
7
+ "ActorQueryOperationPathNps": {
8
+ "@id": "caqopn:components/ActorQueryOperationPathNps.jsonld#ActorQueryOperationPathNps",
9
+ "@prefix": true,
10
+ "@context": {
11
+ "args_mediatorQueryOperation": {
12
+ "@id": "caqopn:components/ActorQueryOperationPathNps.jsonld#ActorQueryOperationPathNps_args_mediatorQueryOperation"
13
+ },
14
+ "args_name": {
15
+ "@id": "caqopn:components/ActorQueryOperationPathNps.jsonld#ActorQueryOperationPathNps_args_name"
16
+ },
17
+ "args_bus": {
18
+ "@id": "caqopn:components/ActorQueryOperationPathNps.jsonld#ActorQueryOperationPathNps_args_bus"
19
+ },
20
+ "args_beforeActors": {
21
+ "@id": "caqopn:components/ActorQueryOperationPathNps.jsonld#ActorQueryOperationPathNps_args_beforeActors",
22
+ "@container": "@list"
23
+ },
24
+ "mediatorQueryOperation": {
25
+ "@id": "caqopn:components/ActorQueryOperationPathNps.jsonld#ActorQueryOperationPathNps_args_mediatorQueryOperation"
26
+ },
27
+ "name": {
28
+ "@id": "caqopn:components/ActorQueryOperationPathNps.jsonld#ActorQueryOperationPathNps_args_name"
29
+ },
30
+ "bus": {
31
+ "@id": "caqopn:components/ActorQueryOperationPathNps.jsonld#ActorQueryOperationPathNps_args_bus"
32
+ },
33
+ "beforeActors": {
34
+ "@id": "caqopn:components/ActorQueryOperationPathNps.jsonld#ActorQueryOperationPathNps_args_beforeActors",
35
+ "@container": "@list"
36
+ }
37
+ }
38
+ }
10
39
  }
11
40
  ]
12
- }
41
+ }
@@ -1,12 +1,11 @@
1
1
  import { ActorAbstractPath } from '@comunica/actor-abstract-path';
2
2
  import type { IActorQueryOperationTypedMediatedArgs } from '@comunica/bus-query-operation';
3
- import type { ActionContext } from '@comunica/core';
4
- import type { IActorQueryOperationOutputBindings } from '@comunica/types';
3
+ import type { IActionContext, IQueryOperationResult } from '@comunica/types';
5
4
  import { Algebra } from 'sparqlalgebrajs';
6
5
  /**
7
6
  * A comunica Path Nps Query Operation Actor.
8
7
  */
9
8
  export declare class ActorQueryOperationPathNps extends ActorAbstractPath {
10
9
  constructor(args: IActorQueryOperationTypedMediatedArgs);
11
- runOperation(path: Algebra.Path, context: ActionContext): Promise<IActorQueryOperationOutputBindings>;
10
+ runOperation(operation: Algebra.Path, context: IActionContext): Promise<IQueryOperationResult>;
12
11
  }
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ActorQueryOperationPathNps = void 0;
4
4
  const actor_abstract_path_1 = require("@comunica/actor-abstract-path");
5
5
  const bus_query_operation_1 = require("@comunica/bus-query-operation");
6
- const rdf_string_1 = require("rdf-string");
7
6
  const sparqlalgebrajs_1 = require("sparqlalgebrajs");
8
7
  /**
9
8
  * A comunica Path Nps Query Operation Actor.
@@ -12,23 +11,27 @@ class ActorQueryOperationPathNps extends actor_abstract_path_1.ActorAbstractPath
12
11
  constructor(args) {
13
12
  super(args, sparqlalgebrajs_1.Algebra.types.NPS);
14
13
  }
15
- async runOperation(path, context) {
16
- const predicate = path.predicate;
17
- const blank = this.generateVariable(path);
18
- const blankName = rdf_string_1.termToString(blank);
19
- const pattern = actor_abstract_path_1.ActorAbstractPath.FACTORY.createPattern(path.subject, blank, path.object, path.graph);
14
+ async runOperation(operation, context) {
15
+ const predicate = operation.predicate;
16
+ const blank = this.generateVariable(operation);
17
+ const pattern = actor_abstract_path_1.ActorAbstractPath.FACTORY
18
+ .createPattern(operation.subject, blank, operation.object, operation.graph);
20
19
  const output = bus_query_operation_1.ActorQueryOperation.getSafeBindings(await this.mediatorQueryOperation.mediate({ operation: pattern, context }));
21
20
  // Remove the generated blank nodes from the bindings
22
21
  const bindingsStream = output.bindingsStream.transform({
23
22
  filter(bindings) {
24
- return !predicate.iris.some(iri => iri.equals(bindings.get(blankName)));
23
+ return !predicate.iris.some(iri => iri.equals(bindings.get(blank)));
25
24
  },
26
25
  transform(item, next, push) {
27
- push(item.delete(blankName));
26
+ push(item.delete(blank));
28
27
  next();
29
28
  },
30
29
  });
31
- return { type: 'bindings', bindingsStream, variables: output.variables, canContainUndefs: false };
30
+ return {
31
+ type: 'bindings',
32
+ bindingsStream,
33
+ metadata: output.metadata,
34
+ };
32
35
  }
33
36
  }
34
37
  exports.ActorQueryOperationPathNps = ActorQueryOperationPathNps;
package/lib/index.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './ActorQueryOperationPathNps';
@@ -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/ActorQueryOperationPathNps"), exports);
13
+ __exportStar(require("./ActorQueryOperationPathNps"), exports);
14
14
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@comunica/actor-query-operation-path-nps",
3
- "version": "1.21.1",
3
+ "version": "2.0.1-alpha.6.0",
4
4
  "description": "A path-nps 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,44 +28,19 @@
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
- "peerDependencies": {
35
- "@comunica/bus-query-operation": "^1.2.0",
36
- "@comunica/core": "^1.2.0"
37
- },
38
33
  "dependencies": {
39
- "@comunica/actor-abstract-path": "^1.21.1",
40
- "@comunica/types": "^1.21.1",
41
- "rdf-string": "^1.5.0",
42
- "sparqlalgebrajs": "^2.5.5"
43
- },
44
- "devDependencies": {
45
- "@comunica/bus-query-operation": "^1.21.1",
46
- "@comunica/core": "^1.21.1"
47
- },
48
- "jest": {
49
- "globals": {
50
- "ts-jest": {
51
- "tsConfig": "../../tsconfig.json"
52
- }
53
- },
54
- "transform": {
55
- "^.+\\.ts$": "ts-jest"
56
- },
57
- "testRegex": "(/test/.*|(\\.|/)(test|spec))\\.ts$",
58
- "moduleFileExtensions": [
59
- "ts",
60
- "js"
61
- ],
62
- "collectCoverage": true
34
+ "@comunica/actor-abstract-path": "2.0.1-alpha.6.0",
35
+ "@comunica/bus-query-operation": "2.0.1-alpha.6.0",
36
+ "@comunica/core": "2.0.1-alpha.6.0",
37
+ "@comunica/types": "2.0.1-alpha.6.0",
38
+ "sparqlalgebrajs": "^4.0.0"
63
39
  },
64
40
  "scripts": {
65
- "test": "node \"../../node_modules/jest/bin/jest.js\" ${1}",
66
- "test-watch": "node \"../../node_modules/jest/bin/jest.js\" ${1} --watch",
67
- "build": "node \"../../node_modules/typescript/bin/tsc\"",
68
- "validate": "npm ls"
69
- }
41
+ "build": "npm run build:ts && npm run build:components",
42
+ "build:ts": "node \"../../node_modules/typescript/bin/tsc\"",
43
+ "build:components": "componentsjs-generator"
44
+ },
45
+ "gitHead": "bbf46a068e635256495a40e784a4691b22e88bd3"
70
46
  }
@@ -1,22 +0,0 @@
1
- {
2
- "@context": [
3
- "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-operation-path-nps/^1.0.0/components/context.jsonld",
4
- "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-query-operation/^1.0.0/components/context.jsonld",
5
- "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-abstract-path/^1.0.0/components/context.jsonld"
6
- ],
7
- "@id": "npmd:@comunica/actor-query-operation-path-nps",
8
- "components": [
9
- {
10
- "@id": "caqopn:Actor/QueryOperation/PathNps",
11
- "@type": "Class",
12
- "extends": "caap:Actor/AbstractPath",
13
- "requireElement": "ActorQueryOperationPathNps",
14
- "comment": "A comunica Path Nps Query Operation Actor.",
15
- "constructorArguments": [
16
- {
17
- "extends": "cbqo:Actor/QueryOperationTypedMediated/constructorArgumentsObject"
18
- }
19
- ]
20
- }
21
- ]
22
- }
package/index.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from './lib/ActorQueryOperationPathNps';