@comunica/actor-dereference-fallback 2.0.1-alpha.5.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 ADDED
@@ -0,0 +1,38 @@
1
+ # Comunica Fallback Dereference Actor
2
+
3
+ [![npm version](https://badge.fury.io/js/%40comunica%2Factor-dereference-fallback.svg)](https://www.npmjs.com/package/@comunica/actor-dereference-fallback)
4
+
5
+ A [Dereference](https://github.com/comunica/comunica/tree/master/packages/bus-dereference) actor that always fails.
6
+ This can be used as a fallback actor in the Dereference bus.
7
+ Concretely, it accepts any action in its test phase, but rejects all actions in its run phase.
8
+ If lenient mode is enabled, the rejection will be silenced.
9
+
10
+ This module is part of the [Comunica framework](https://github.com/comunica/comunica),
11
+ and should only be used by [developers that want to build their own query engine](https://comunica.dev/docs/modify/).
12
+
13
+ [Click here if you just want to query with Comunica](https://comunica.dev/docs/query/).
14
+
15
+ ## Install
16
+
17
+ ```bash
18
+ $ yarn add @comunica/actor-dereference-fallback
19
+ ```
20
+
21
+ ## Configure
22
+
23
+ After installing, this package can be added to your engine's configuration as follows:
24
+ ```text
25
+ {
26
+ "@context": [
27
+ ...
28
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-dereference-fallback/^2.0.0/components/context.jsonld"
29
+ ],
30
+ "actors": [
31
+ ...
32
+ {
33
+ "@id": urn:comunica:default:dereference/actors#fallback,
34
+ "@type": "ActorDereferenceFallback"
35
+ }
36
+ ]
37
+ }
38
+ ```
@@ -0,0 +1,145 @@
1
+ {
2
+ "@context": [
3
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-dereference-fallback/^2.0.0/components/context.jsonld",
4
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-dereference/^2.0.0/components/context.jsonld",
5
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/core/^2.0.0/components/context.jsonld"
6
+ ],
7
+ "@id": "npmd:@comunica/actor-dereference-fallback",
8
+ "components": [
9
+ {
10
+ "@id": "cadf:components/ActorDereferenceFallback.jsonld#ActorDereferenceFallback",
11
+ "@type": "Class",
12
+ "requireElement": "ActorDereferenceFallback",
13
+ "extends": [
14
+ "cbd:components/ActorDereference.jsonld#ActorDereference"
15
+ ],
16
+ "comment": "A comunica Fallback Dereference Actor.",
17
+ "parameters": [
18
+ {
19
+ "@id": "cadf:components/ActorDereferenceFallback.jsonld#ActorDereferenceFallback_args_name",
20
+ "range": "xsd:string",
21
+ "default": {
22
+ "@id": "rdf:subject"
23
+ },
24
+ "comment": "The name for this actor."
25
+ },
26
+ {
27
+ "@id": "cadf:components/ActorDereferenceFallback.jsonld#ActorDereferenceFallback_args_bus",
28
+ "range": {
29
+ "@type": "ParameterRangeGenericComponent",
30
+ "component": "cc:components/Bus.jsonld#Bus",
31
+ "genericTypeInstances": [
32
+ {
33
+ "@type": "ParameterRangeGenericComponent",
34
+ "component": "cc:components/Actor.jsonld#Actor",
35
+ "genericTypeInstances": [
36
+ {
37
+ "@type": "ParameterRangeGenericTypeReference",
38
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^2.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
39
+ },
40
+ {
41
+ "@type": "ParameterRangeGenericTypeReference",
42
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^2.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
43
+ },
44
+ {
45
+ "@type": "ParameterRangeGenericTypeReference",
46
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^2.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
47
+ }
48
+ ]
49
+ },
50
+ {
51
+ "@type": "ParameterRangeGenericTypeReference",
52
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^2.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
53
+ },
54
+ {
55
+ "@type": "ParameterRangeGenericTypeReference",
56
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^2.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
57
+ },
58
+ {
59
+ "@type": "ParameterRangeGenericTypeReference",
60
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^2.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
61
+ }
62
+ ]
63
+ },
64
+ "default": {
65
+ "@id": "cbd:components/ActorDereference.jsonld#ActorDereference_default_bus",
66
+ "@type": "cc:components/Bus.jsonld#Bus"
67
+ },
68
+ "comment": "The bus this actor subscribes to."
69
+ },
70
+ {
71
+ "@id": "cadf:components/ActorDereferenceFallback.jsonld#ActorDereferenceFallback_args_beforeActors",
72
+ "range": {
73
+ "@type": "ParameterRangeUnion",
74
+ "parameterRangeElements": [
75
+ {
76
+ "@type": "ParameterRangeArray",
77
+ "parameterRangeValue": {
78
+ "@type": "ParameterRangeGenericComponent",
79
+ "component": "cc:components/Actor.jsonld#Actor",
80
+ "genericTypeInstances": [
81
+ {
82
+ "@type": "ParameterRangeGenericTypeReference",
83
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^2.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
84
+ },
85
+ {
86
+ "@type": "ParameterRangeGenericTypeReference",
87
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^2.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
88
+ },
89
+ {
90
+ "@type": "ParameterRangeGenericTypeReference",
91
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^2.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
92
+ }
93
+ ]
94
+ }
95
+ },
96
+ {
97
+ "@type": "ParameterRangeUndefined"
98
+ }
99
+ ]
100
+ },
101
+ "comment": "Actor that must be registered in the bus before this actor."
102
+ }
103
+ ],
104
+ "memberFields": [
105
+ {
106
+ "@id": "cadf:components/ActorDereferenceFallback.jsonld#ActorDereferenceFallback__member_constructor",
107
+ "memberFieldName": "constructor"
108
+ },
109
+ {
110
+ "@id": "cadf:components/ActorDereferenceFallback.jsonld#ActorDereferenceFallback__member_test",
111
+ "memberFieldName": "test"
112
+ },
113
+ {
114
+ "@id": "cadf:components/ActorDereferenceFallback.jsonld#ActorDereferenceFallback__member_run",
115
+ "memberFieldName": "run"
116
+ }
117
+ ],
118
+ "constructorArguments": [
119
+ {
120
+ "@id": "cadf:components/ActorDereferenceFallback.jsonld#ActorDereferenceFallback_args__constructorArgument",
121
+ "fields": [
122
+ {
123
+ "keyRaw": "name",
124
+ "value": {
125
+ "@id": "cadf:components/ActorDereferenceFallback.jsonld#ActorDereferenceFallback_args_name"
126
+ }
127
+ },
128
+ {
129
+ "keyRaw": "bus",
130
+ "value": {
131
+ "@id": "cadf:components/ActorDereferenceFallback.jsonld#ActorDereferenceFallback_args_bus"
132
+ }
133
+ },
134
+ {
135
+ "keyRaw": "beforeActors",
136
+ "value": {
137
+ "@id": "cadf:components/ActorDereferenceFallback.jsonld#ActorDereferenceFallback_args_beforeActors"
138
+ }
139
+ }
140
+ ]
141
+ }
142
+ ]
143
+ }
144
+ ]
145
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "@context": [
3
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-dereference-fallback/^2.0.0/components/context.jsonld"
4
+ ],
5
+ "@id": "npmd:@comunica/actor-dereference-fallback",
6
+ "@type": "Module",
7
+ "requireName": "@comunica/actor-dereference-fallback",
8
+ "import": [
9
+ "cadf:components/ActorDereferenceFallback.jsonld"
10
+ ]
11
+ }
@@ -0,0 +1,35 @@
1
+ {
2
+ "@context": [
3
+ "https://linkedsoftwaredependencies.org/bundles/npm/componentsjs/^4.0.0/components/context.jsonld",
4
+ {
5
+ "npmd": "https://linkedsoftwaredependencies.org/bundles/npm/",
6
+ "cadf": "npmd:@comunica/actor-dereference-fallback/^2.0.0/",
7
+ "ActorDereferenceFallback": {
8
+ "@id": "cadf:components/ActorDereferenceFallback.jsonld#ActorDereferenceFallback",
9
+ "@prefix": true,
10
+ "@context": {
11
+ "args_name": {
12
+ "@id": "cadf:components/ActorDereferenceFallback.jsonld#ActorDereferenceFallback_args_name"
13
+ },
14
+ "args_bus": {
15
+ "@id": "cadf:components/ActorDereferenceFallback.jsonld#ActorDereferenceFallback_args_bus"
16
+ },
17
+ "args_beforeActors": {
18
+ "@id": "cadf:components/ActorDereferenceFallback.jsonld#ActorDereferenceFallback_args_beforeActors",
19
+ "@container": "@list"
20
+ },
21
+ "name": {
22
+ "@id": "cadf:components/ActorDereferenceFallback.jsonld#ActorDereferenceFallback_args_name"
23
+ },
24
+ "bus": {
25
+ "@id": "cadf:components/ActorDereferenceFallback.jsonld#ActorDereferenceFallback_args_bus"
26
+ },
27
+ "beforeActors": {
28
+ "@id": "cadf:components/ActorDereferenceFallback.jsonld#ActorDereferenceFallback_args_beforeActors",
29
+ "@container": "@list"
30
+ }
31
+ }
32
+ }
33
+ }
34
+ ]
35
+ }
@@ -0,0 +1,11 @@
1
+ import type { IActionDereference, IActorDereferenceOutput, IActorDereferenceArgs } from '@comunica/bus-dereference';
2
+ import { ActorDereference } from '@comunica/bus-dereference';
3
+ import type { IActorTest } from '@comunica/core';
4
+ /**
5
+ * A comunica Fallback Dereference Actor.
6
+ */
7
+ export declare class ActorDereferenceFallback extends ActorDereference {
8
+ constructor(args: IActorDereferenceArgs);
9
+ test(action: IActionDereference): Promise<IActorTest>;
10
+ run(action: IActionDereference): Promise<IActorDereferenceOutput>;
11
+ }
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ActorDereferenceFallback = void 0;
4
+ const bus_dereference_1 = require("@comunica/bus-dereference");
5
+ /**
6
+ * A comunica Fallback Dereference Actor.
7
+ */
8
+ class ActorDereferenceFallback extends bus_dereference_1.ActorDereference {
9
+ constructor(args) {
10
+ super(args);
11
+ }
12
+ async test(action) {
13
+ return true;
14
+ }
15
+ async run(action) {
16
+ return this.handleDereferenceErrors(action, new Error(`Could not dereference '${action.url}'`));
17
+ }
18
+ }
19
+ exports.ActorDereferenceFallback = ActorDereferenceFallback;
20
+ //# sourceMappingURL=ActorDereferenceFallback.js.map
package/lib/index.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './ActorDereferenceFallback';
package/lib/index.js ADDED
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ __exportStar(require("./ActorDereferenceFallback"), exports);
14
+ //# sourceMappingURL=index.js.map
package/package.json ADDED
@@ -0,0 +1,42 @@
1
+ {
2
+ "name": "@comunica/actor-dereference-fallback",
3
+ "version": "2.0.1-alpha.5.0",
4
+ "description": "A fallback dereference actor",
5
+ "lsd:module": true,
6
+ "main": "lib/index.js",
7
+ "typings": "lib/index",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "https://github.com/comunica/comunica.git",
11
+ "directory": "packages/actor-dereference-fallback"
12
+ },
13
+ "publishConfig": {
14
+ "access": "public"
15
+ },
16
+ "keywords": [
17
+ "comunica",
18
+ "actor",
19
+ "dereference",
20
+ "fallback"
21
+ ],
22
+ "license": "MIT",
23
+ "bugs": {
24
+ "url": "https://github.com/comunica/comunica/issues"
25
+ },
26
+ "homepage": "https://comunica.dev/",
27
+ "files": [
28
+ "components",
29
+ "lib/**/*.d.ts",
30
+ "lib/**/*.js"
31
+ ],
32
+ "dependencies": {
33
+ "@comunica/bus-dereference": "2.0.1-alpha.5.0",
34
+ "@comunica/core": "2.0.1-alpha.5.0"
35
+ },
36
+ "scripts": {
37
+ "build": "npm run build:ts && npm run build:components",
38
+ "build:ts": "node \"../../node_modules/typescript/bin/tsc\"",
39
+ "build:components": "componentsjs-generator"
40
+ },
41
+ "gitHead": "e2ae2e9e924bf0656df60cc99774f7e560d47695"
42
+ }