@comunica/actor-query-operation-update-create 1.22.0 → 2.0.1-alpha.8.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright © 2017–2018 Ruben Taelman, Joachim Van Herwegen
4
- Ghent University – imec, Belgium
3
+ Copyright © 2017–now Ruben Taelman, Joachim Van Herwegen
4
+ Comunica Association and Ghent University – imec, Belgium
5
5
 
6
6
  Permission is hereby granted, free of charge, to any person obtaining a copy
7
7
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -23,15 +23,15 @@ After installing, this package can be added to your engine's configuration as fo
23
23
  {
24
24
  "@context": [
25
25
  ...
26
- "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-operation-update-create/^1.0.0/components/context.jsonld"
26
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-operation-update-create/^2.0.0/components/context.jsonld"
27
27
  ],
28
28
  "actors": [
29
29
  ...
30
30
  {
31
- "@id": "config-sets:sparql-queryoperators.json#myCreateQueryOperator",
31
+ "@id": "urn:comunica:default:query-operation/actors#update-create",
32
32
  "@type": "ActorQueryOperationCreate",
33
- "cbqo:mediatorQueryOperation": { "@id": "config-sets:sparql-queryoperators.json#mediatorQueryOperation" }
34
- "caqoucr:mediatorUpdateQuads": { "@id": "config-sets:sparql-queryoperator-update.json#mediatorUpdateQuads" }
33
+ "mediatorQueryOperation": { "@id": "urn:comunica:default:query-operation/mediators#main" },
34
+ "mediatorUpdateQuads": { "@id": "urn:comunica:default:rdf-update-quads/mediators#main" }
35
35
  }
36
36
  ]
37
37
  }
@@ -39,5 +39,5 @@ After installing, this package can be added to your engine's configuration as fo
39
39
 
40
40
  ### Config Parameters
41
41
 
42
- * `cbqo:mediatorQueryOperation`: A mediator over the [Query Operation bus](https://github.com/comunica/comunica/tree/master/packages/bus-query-operation).
43
- * `caqoucr:mediatorUpdateQuads`: A mediator over the [RDF Update Quads bus](https://github.com/comunica/comunica/tree/master/packages/bus-rdf-update-quads).
42
+ * `mediatorQueryOperation`: A mediator over the [Query Operation bus](https://github.com/comunica/comunica/tree/master/packages/bus-query-operation).
43
+ * `mediatorUpdateQuads`: A mediator over the [RDF Update Quads bus](https://github.com/comunica/comunica/tree/master/packages/bus-rdf-update-quads).
@@ -0,0 +1,177 @@
1
+ {
2
+ "@context": [
3
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-operation-update-create/^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-update-create",
8
+ "components": [
9
+ {
10
+ "@id": "caqouc:components/ActorQueryOperationCreate.jsonld#ActorQueryOperationCreate",
11
+ "@type": "Class",
12
+ "requireElement": "ActorQueryOperationCreate",
13
+ "extends": [
14
+ {
15
+ "@type": "GenericComponentExtension",
16
+ "component": "cbqo:components/ActorQueryOperationTypedMediated.jsonld#ActorQueryOperationTypedMediated",
17
+ "genericTypeInstances": [
18
+ "urn:npm:sparqlalgebrajs:Create"
19
+ ]
20
+ }
21
+ ],
22
+ "comment": "A [Query Operation](https://github.com/comunica/comunica/tree/master/packages/bus-query-operation) actor that handles SPARQL create operations.",
23
+ "parameters": [
24
+ {
25
+ "@id": "caqouc:components/ActorQueryOperationCreate.jsonld#ActorQueryOperationCreate_args_mediatorUpdateQuads",
26
+ "range": "cc:components/Mediator.jsonld#Mediator",
27
+ "comment": "The RDF Update Quads mediator"
28
+ },
29
+ {
30
+ "@id": "caqouc:components/ActorQueryOperationCreate.jsonld#ActorQueryOperationCreate_args_mediatorQueryOperation",
31
+ "range": "cc:components/Mediator.jsonld#Mediator"
32
+ },
33
+ {
34
+ "@id": "caqouc:components/ActorQueryOperationCreate.jsonld#ActorQueryOperationCreate_args_name",
35
+ "range": "xsd:string",
36
+ "default": {
37
+ "@id": "rdf:subject"
38
+ },
39
+ "comment": "The name for this actor."
40
+ },
41
+ {
42
+ "@id": "caqouc:components/ActorQueryOperationCreate.jsonld#ActorQueryOperationCreate_args_bus",
43
+ "range": {
44
+ "@type": "ParameterRangeGenericComponent",
45
+ "component": "cc:components/Bus.jsonld#Bus",
46
+ "genericTypeInstances": [
47
+ {
48
+ "@type": "ParameterRangeGenericComponent",
49
+ "component": "cc:components/Actor.jsonld#Actor",
50
+ "genericTypeInstances": [
51
+ {
52
+ "@type": "ParameterRangeGenericTypeReference",
53
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^2.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
54
+ },
55
+ {
56
+ "@type": "ParameterRangeGenericTypeReference",
57
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^2.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
58
+ },
59
+ {
60
+ "@type": "ParameterRangeGenericTypeReference",
61
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^2.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
62
+ }
63
+ ]
64
+ },
65
+ {
66
+ "@type": "ParameterRangeGenericTypeReference",
67
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^2.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
68
+ },
69
+ {
70
+ "@type": "ParameterRangeGenericTypeReference",
71
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^2.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
72
+ },
73
+ {
74
+ "@type": "ParameterRangeGenericTypeReference",
75
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^2.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
76
+ }
77
+ ]
78
+ },
79
+ "default": {
80
+ "@id": "cbqo:components/ActorQueryOperation.jsonld#ActorQueryOperation_default_bus",
81
+ "@type": "cc:components/Bus.jsonld#Bus"
82
+ },
83
+ "comment": "The bus this actor subscribes to."
84
+ },
85
+ {
86
+ "@id": "caqouc:components/ActorQueryOperationCreate.jsonld#ActorQueryOperationCreate_args_beforeActors",
87
+ "range": {
88
+ "@type": "ParameterRangeUnion",
89
+ "parameterRangeElements": [
90
+ {
91
+ "@type": "ParameterRangeArray",
92
+ "parameterRangeValue": {
93
+ "@type": "ParameterRangeGenericComponent",
94
+ "component": "cc:components/Actor.jsonld#Actor",
95
+ "genericTypeInstances": [
96
+ {
97
+ "@type": "ParameterRangeGenericTypeReference",
98
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^2.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
99
+ },
100
+ {
101
+ "@type": "ParameterRangeGenericTypeReference",
102
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^2.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
103
+ },
104
+ {
105
+ "@type": "ParameterRangeGenericTypeReference",
106
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^2.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
107
+ }
108
+ ]
109
+ }
110
+ },
111
+ {
112
+ "@type": "ParameterRangeUndefined"
113
+ }
114
+ ]
115
+ },
116
+ "comment": "Actor that must be registered in the bus before this actor."
117
+ }
118
+ ],
119
+ "memberKeys": [
120
+ "mediatorUpdateQuads",
121
+ "constructor",
122
+ "testOperation",
123
+ "runOperation"
124
+ ],
125
+ "constructorArguments": [
126
+ {
127
+ "@id": "caqouc:components/ActorQueryOperationCreate.jsonld#ActorQueryOperationCreate_args__constructorArgument",
128
+ "fields": [
129
+ {
130
+ "keyRaw": "mediatorUpdateQuads",
131
+ "value": {
132
+ "@id": "caqouc:components/ActorQueryOperationCreate.jsonld#ActorQueryOperationCreate_args_mediatorUpdateQuads"
133
+ }
134
+ },
135
+ {
136
+ "keyRaw": "mediatorQueryOperation",
137
+ "value": {
138
+ "@id": "caqouc:components/ActorQueryOperationCreate.jsonld#ActorQueryOperationCreate_args_mediatorQueryOperation"
139
+ }
140
+ },
141
+ {
142
+ "keyRaw": "name",
143
+ "value": {
144
+ "@id": "caqouc:components/ActorQueryOperationCreate.jsonld#ActorQueryOperationCreate_args_name"
145
+ }
146
+ },
147
+ {
148
+ "keyRaw": "bus",
149
+ "value": {
150
+ "@id": "caqouc:components/ActorQueryOperationCreate.jsonld#ActorQueryOperationCreate_args_bus"
151
+ }
152
+ },
153
+ {
154
+ "keyRaw": "beforeActors",
155
+ "value": {
156
+ "@id": "caqouc:components/ActorQueryOperationCreate.jsonld#ActorQueryOperationCreate_args_beforeActors"
157
+ }
158
+ }
159
+ ]
160
+ }
161
+ ]
162
+ },
163
+ {
164
+ "@id": "caqouc:components/ActorQueryOperationCreate.jsonld#IActorQueryOperationCreateArgs",
165
+ "@type": "AbstractClass",
166
+ "requireElement": "IActorQueryOperationCreateArgs",
167
+ "extends": [
168
+ "cbqo:components/ActorQueryOperationTypedMediated.jsonld#IActorQueryOperationTypedMediatedArgs"
169
+ ],
170
+ "parameters": [],
171
+ "memberKeys": [
172
+ "mediatorUpdateQuads"
173
+ ],
174
+ "constructorArguments": []
175
+ }
176
+ ]
177
+ }
@@ -1,9 +1,11 @@
1
1
  {
2
- "@context": "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-operation-update-create/^1.0.0/components/context.jsonld",
2
+ "@context": [
3
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-operation-update-create/^2.0.0/components/context.jsonld"
4
+ ],
3
5
  "@id": "npmd:@comunica/actor-query-operation-update-create",
4
6
  "@type": "Module",
5
7
  "requireName": "@comunica/actor-query-operation-update-create",
6
8
  "import": [
7
- "files-caqoucr:components/Actor/QueryOperation/Create.jsonld"
9
+ "caqouc:components/ActorQueryOperationCreate.jsonld"
8
10
  ]
9
- }
11
+ }
@@ -1,12 +1,52 @@
1
1
  {
2
2
  "@context": [
3
- "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/core/^1.0.0/components/context.jsonld",
3
+ "https://linkedsoftwaredependencies.org/bundles/npm/componentsjs/^4.0.0/components/context.jsonld",
4
4
  {
5
5
  "npmd": "https://linkedsoftwaredependencies.org/bundles/npm/",
6
- "caqoucr": "npmd:@comunica/actor-query-operation-update-create/",
7
- "files-caqoucr": "caqoucr:^1.0.0/",
8
-
9
- "ActorQueryOperationCreate": "caqoucr:Actor/QueryOperation/Create"
6
+ "caqouc": "npmd:@comunica/actor-query-operation-update-create/^2.0.0/",
7
+ "ActorQueryOperationCreate": {
8
+ "@id": "caqouc:components/ActorQueryOperationCreate.jsonld#ActorQueryOperationCreate",
9
+ "@prefix": true,
10
+ "@context": {
11
+ "args_mediatorUpdateQuads": {
12
+ "@id": "caqouc:components/ActorQueryOperationCreate.jsonld#ActorQueryOperationCreate_args_mediatorUpdateQuads"
13
+ },
14
+ "args_mediatorQueryOperation": {
15
+ "@id": "caqouc:components/ActorQueryOperationCreate.jsonld#ActorQueryOperationCreate_args_mediatorQueryOperation"
16
+ },
17
+ "args_name": {
18
+ "@id": "caqouc:components/ActorQueryOperationCreate.jsonld#ActorQueryOperationCreate_args_name"
19
+ },
20
+ "args_bus": {
21
+ "@id": "caqouc:components/ActorQueryOperationCreate.jsonld#ActorQueryOperationCreate_args_bus"
22
+ },
23
+ "args_beforeActors": {
24
+ "@id": "caqouc:components/ActorQueryOperationCreate.jsonld#ActorQueryOperationCreate_args_beforeActors",
25
+ "@container": "@list"
26
+ },
27
+ "mediatorUpdateQuads": {
28
+ "@id": "caqouc:components/ActorQueryOperationCreate.jsonld#ActorQueryOperationCreate_args_mediatorUpdateQuads"
29
+ },
30
+ "mediatorQueryOperation": {
31
+ "@id": "caqouc:components/ActorQueryOperationCreate.jsonld#ActorQueryOperationCreate_args_mediatorQueryOperation"
32
+ },
33
+ "name": {
34
+ "@id": "caqouc:components/ActorQueryOperationCreate.jsonld#ActorQueryOperationCreate_args_name"
35
+ },
36
+ "bus": {
37
+ "@id": "caqouc:components/ActorQueryOperationCreate.jsonld#ActorQueryOperationCreate_args_bus"
38
+ },
39
+ "beforeActors": {
40
+ "@id": "caqouc:components/ActorQueryOperationCreate.jsonld#ActorQueryOperationCreate_args_beforeActors",
41
+ "@container": "@list"
42
+ }
43
+ }
44
+ },
45
+ "IActorQueryOperationCreateArgs": {
46
+ "@id": "caqouc:components/ActorQueryOperationCreate.jsonld#IActorQueryOperationCreateArgs",
47
+ "@prefix": true,
48
+ "@context": {}
49
+ }
10
50
  }
11
51
  ]
12
- }
52
+ }
@@ -1,18 +1,22 @@
1
- import type { IActorQueryOperationOutput, IActorQueryOperationTypedMediatedArgs } from '@comunica/bus-query-operation';
1
+ import type { IActorQueryOperationTypedMediatedArgs } from '@comunica/bus-query-operation';
2
2
  import { ActorQueryOperationTypedMediated } from '@comunica/bus-query-operation';
3
- import type { IActionRdfUpdateQuads, IActorRdfUpdateQuadsOutput } from '@comunica/bus-rdf-update-quads';
4
- import type { ActionContext, Actor, IActorTest, Mediator } from '@comunica/core';
3
+ import type { MediatorRdfUpdateQuads } from '@comunica/bus-rdf-update-quads';
4
+ import type { IActorTest } from '@comunica/core';
5
+ import type { IActionContext, IQueryOperationResult } from '@comunica/types';
5
6
  import type { Algebra } from 'sparqlalgebrajs';
6
7
  /**
7
8
  * A [Query Operation](https://github.com/comunica/comunica/tree/master/packages/bus-query-operation) actor that
8
9
  * handles SPARQL create operations.
9
10
  */
10
11
  export declare class ActorQueryOperationCreate extends ActorQueryOperationTypedMediated<Algebra.Create> {
11
- readonly mediatorUpdateQuads: Mediator<Actor<IActionRdfUpdateQuads, IActorTest, IActorRdfUpdateQuadsOutput>, IActionRdfUpdateQuads, IActorTest, IActorRdfUpdateQuadsOutput>;
12
+ readonly mediatorUpdateQuads: MediatorRdfUpdateQuads;
12
13
  constructor(args: IActorQueryOperationCreateArgs);
13
- testOperation(pattern: Algebra.Create, context: ActionContext): Promise<IActorTest>;
14
- runOperation(pattern: Algebra.Create, context: ActionContext): Promise<IActorQueryOperationOutput>;
14
+ testOperation(operation: Algebra.Create, context: IActionContext): Promise<IActorTest>;
15
+ runOperation(operation: Algebra.Create, context: IActionContext): Promise<IQueryOperationResult>;
15
16
  }
16
17
  export interface IActorQueryOperationCreateArgs extends IActorQueryOperationTypedMediatedArgs {
17
- mediatorUpdateQuads: Mediator<Actor<IActionRdfUpdateQuads, IActorTest, IActorRdfUpdateQuadsOutput>, IActionRdfUpdateQuads, IActorTest, IActorRdfUpdateQuadsOutput>;
18
+ /**
19
+ * The RDF Update Quads mediator
20
+ */
21
+ mediatorUpdateQuads: MediatorRdfUpdateQuads;
18
22
  }
@@ -10,22 +10,22 @@ class ActorQueryOperationCreate extends bus_query_operation_1.ActorQueryOperatio
10
10
  constructor(args) {
11
11
  super(args, 'create');
12
12
  }
13
- async testOperation(pattern, context) {
13
+ async testOperation(operation, context) {
14
14
  bus_query_operation_1.ActorQueryOperation.throwOnReadOnly(context);
15
15
  return true;
16
16
  }
17
- async runOperation(pattern, context) {
17
+ async runOperation(operation, context) {
18
18
  // Delegate to update-quads bus
19
- const { updateResult } = await this.mediatorUpdateQuads.mediate({
19
+ const { execute } = await this.mediatorUpdateQuads.mediate({
20
20
  createGraphs: {
21
- graphs: [pattern.source],
22
- requireNonExistence: !pattern.silent,
21
+ graphs: [operation.source],
22
+ requireNonExistence: !operation.silent,
23
23
  },
24
24
  context,
25
25
  });
26
26
  return {
27
- type: 'update',
28
- updateResult,
27
+ type: 'void',
28
+ execute,
29
29
  };
30
30
  }
31
31
  }
package/lib/index.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './ActorQueryOperationCreate';
@@ -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/ActorQueryOperationCreate"), exports);
13
+ __exportStar(require("./ActorQueryOperationCreate"), exports);
14
14
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@comunica/actor-query-operation-update-create",
3
- "version": "1.22.0",
3
+ "version": "2.0.1-alpha.8.0",
4
4
  "description": "A create 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,39 +28,16 @@
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.19.2",
36
- "@comunica/core": "^1.19.2"
37
- },
38
- "devDependencies": {
39
- "@comunica/bus-query-operation": "^1.22.0",
40
- "@comunica/core": "^1.22.0"
41
- },
42
- "jest": {
43
- "globals": {
44
- "ts-jest": {
45
- "tsConfig": "../../tsconfig.json"
46
- }
47
- },
48
- "transform": {
49
- "^.+\\.ts$": "ts-jest"
50
- },
51
- "testRegex": "(/test/.*|(\\.|/)(test|spec))\\.ts$",
52
- "moduleFileExtensions": [
53
- "ts",
54
- "js"
55
- ],
56
- "collectCoverage": true
33
+ "dependencies": {
34
+ "@comunica/bus-query-operation": "2.0.1-alpha.8.0",
35
+ "@comunica/core": "2.0.1-alpha.8.0"
57
36
  },
58
37
  "scripts": {
59
- "test": "node \"../../node_modules/jest/bin/jest.js\" ${1}",
60
- "test-watch": "node \"../../node_modules/jest/bin/jest.js\" ${1} --watch",
61
- "build": "node \"../../node_modules/typescript/bin/tsc\"",
62
- "validate": "npm ls"
38
+ "build": "npm run build:ts && npm run build:components",
39
+ "build:ts": "node \"../../node_modules/typescript/bin/tsc\"",
40
+ "build:components": "componentsjs-generator"
63
41
  },
64
- "gitHead": "0a249ba341022eb2f1b9922fcf549a9564671d9f"
42
+ "gitHead": "aaf5b7bb8d67de3364618454ed2976fd08052b61"
65
43
  }
@@ -1,35 +0,0 @@
1
- {
2
- "@context": [
3
- "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-operation-update-create/^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-update-create",
7
- "components": [
8
- {
9
- "@id": "caqoucr:Actor/QueryOperation/Create",
10
- "@type": "Class",
11
- "extends": "cbqo:Actor/QueryOperationTypedMediated",
12
- "requireElement": "ActorQueryOperationCreate",
13
- "comment": "A [Query Operation](https://github.com/comunica/comunica/tree/master/packages/bus-query-operation) actor that handles SPARQL create operations.",
14
- "parameters": [
15
- {
16
- "@id": "caqoucr:mediatorUpdateQuads",
17
- "comment": "The RDF Update Quads mediator",
18
- "required": true,
19
- "unique": true
20
- }
21
- ],
22
- "constructorArguments": [
23
- {
24
- "extends": "cbqo:Actor/QueryOperationTypedMediated/constructorArgumentsObject",
25
- "fields": [
26
- {
27
- "keyRaw": "mediatorUpdateQuads",
28
- "value": "caqoucr:mediatorUpdateQuads"
29
- }
30
- ]
31
- }
32
- ]
33
- }
34
- ]
35
- }
package/index.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from './lib/ActorQueryOperationCreate';