@comunica/actor-query-operation-update-create 3.3.0 → 4.0.1

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/README.md CHANGED
@@ -23,7 +23,7 @@ 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/^3.0.0/components/context.jsonld"
26
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-operation-update-create/^4.0.0/components/context.jsonld"
27
27
  ],
28
28
  "actors": [
29
29
  ...
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "@context": [
3
- "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-operation-update-create/^3.0.0/components/context.jsonld",
4
- "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/core/^3.0.0/components/context.jsonld",
5
- "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-query-operation/^3.0.0/components/context.jsonld"
3
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-operation-update-create/^4.0.0/components/context.jsonld",
4
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/core/^4.0.0/components/context.jsonld",
5
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-query-operation/^4.0.0/components/context.jsonld"
6
6
  ],
7
7
  "@id": "npmd:@comunica/actor-query-operation-update-create",
8
8
  "components": [
@@ -50,29 +50,37 @@
50
50
  "genericTypeInstances": [
51
51
  {
52
52
  "@type": "ParameterRangeGenericTypeReference",
53
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^3.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
53
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
54
54
  },
55
55
  {
56
56
  "@type": "ParameterRangeGenericTypeReference",
57
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^3.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
57
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
58
58
  },
59
59
  {
60
60
  "@type": "ParameterRangeGenericTypeReference",
61
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^3.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
61
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
62
+ },
63
+ {
64
+ "@type": "ParameterRangeGenericTypeReference",
65
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
62
66
  }
63
67
  ]
64
68
  },
65
69
  {
66
70
  "@type": "ParameterRangeGenericTypeReference",
67
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^3.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
71
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
72
+ },
73
+ {
74
+ "@type": "ParameterRangeGenericTypeReference",
75
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
68
76
  },
69
77
  {
70
78
  "@type": "ParameterRangeGenericTypeReference",
71
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^3.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
79
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
72
80
  },
73
81
  {
74
82
  "@type": "ParameterRangeGenericTypeReference",
75
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^3.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
83
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
76
84
  }
77
85
  ]
78
86
  },
@@ -82,6 +90,20 @@
82
90
  },
83
91
  "comment": "The bus this actor subscribes to."
84
92
  },
93
+ {
94
+ "@id": "caqouc:components/ActorQueryOperationCreate.jsonld#ActorQueryOperationCreate_args_busFailMessage",
95
+ "range": {
96
+ "@type": "ParameterRangeUnion",
97
+ "parameterRangeElements": [
98
+ "xsd:string",
99
+ {
100
+ "@type": "ParameterRangeUndefined"
101
+ }
102
+ ]
103
+ },
104
+ "default": "Query operation processing failed: none of the configured actors were able to handle the operation type ${action.operation.type}",
105
+ "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}\""
106
+ },
85
107
  {
86
108
  "@id": "caqouc:components/ActorQueryOperationCreate.jsonld#ActorQueryOperationCreate_args_beforeActors",
87
109
  "range": {
@@ -95,15 +117,19 @@
95
117
  "genericTypeInstances": [
96
118
  {
97
119
  "@type": "ParameterRangeGenericTypeReference",
98
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^3.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
120
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
99
121
  },
100
122
  {
101
123
  "@type": "ParameterRangeGenericTypeReference",
102
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^3.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
124
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
103
125
  },
104
126
  {
105
127
  "@type": "ParameterRangeGenericTypeReference",
106
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^3.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
128
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
129
+ },
130
+ {
131
+ "@type": "ParameterRangeGenericTypeReference",
132
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
107
133
  }
108
134
  ]
109
135
  }
@@ -163,6 +189,12 @@
163
189
  "@id": "caqouc:components/ActorQueryOperationCreate.jsonld#ActorQueryOperationCreate_args_bus"
164
190
  }
165
191
  },
192
+ {
193
+ "keyRaw": "busFailMessage",
194
+ "value": {
195
+ "@id": "caqouc:components/ActorQueryOperationCreate.jsonld#ActorQueryOperationCreate_args_busFailMessage"
196
+ }
197
+ },
166
198
  {
167
199
  "keyRaw": "beforeActors",
168
200
  "value": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "@context": [
3
- "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-operation-update-create/^3.0.0/components/context.jsonld"
3
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-operation-update-create/^4.0.0/components/context.jsonld"
4
4
  ],
5
5
  "@id": "npmd:@comunica/actor-query-operation-update-create",
6
6
  "@type": "Module",
@@ -3,7 +3,7 @@
3
3
  "https://linkedsoftwaredependencies.org/bundles/npm/componentsjs/^6.0.0/components/context.jsonld",
4
4
  {
5
5
  "npmd": "https://linkedsoftwaredependencies.org/bundles/npm/",
6
- "caqouc": "npmd:@comunica/actor-query-operation-update-create/^3.0.0/",
6
+ "caqouc": "npmd:@comunica/actor-query-operation-update-create/^4.0.0/",
7
7
  "ActorQueryOperationCreate": {
8
8
  "@id": "caqouc:components/ActorQueryOperationCreate.jsonld#ActorQueryOperationCreate",
9
9
  "@prefix": true,
@@ -20,6 +20,9 @@
20
20
  "args_bus": {
21
21
  "@id": "caqouc:components/ActorQueryOperationCreate.jsonld#ActorQueryOperationCreate_args_bus"
22
22
  },
23
+ "args_busFailMessage": {
24
+ "@id": "caqouc:components/ActorQueryOperationCreate.jsonld#ActorQueryOperationCreate_args_busFailMessage"
25
+ },
23
26
  "args_beforeActors": {
24
27
  "@id": "caqouc:components/ActorQueryOperationCreate.jsonld#ActorQueryOperationCreate_args_beforeActors",
25
28
  "@container": "@list"
@@ -36,6 +39,9 @@
36
39
  "bus": {
37
40
  "@id": "caqouc:components/ActorQueryOperationCreate.jsonld#ActorQueryOperationCreate_args_bus"
38
41
  },
42
+ "busFailMessage": {
43
+ "@id": "caqouc:components/ActorQueryOperationCreate.jsonld#ActorQueryOperationCreate_args_busFailMessage"
44
+ },
39
45
  "beforeActors": {
40
46
  "@id": "caqouc:components/ActorQueryOperationCreate.jsonld#ActorQueryOperationCreate_args_beforeActors",
41
47
  "@container": "@list"
@@ -1,7 +1,7 @@
1
1
  import type { IActorQueryOperationTypedMediatedArgs } from '@comunica/bus-query-operation';
2
2
  import { ActorQueryOperationTypedMediated } from '@comunica/bus-query-operation';
3
3
  import type { MediatorRdfUpdateQuads } from '@comunica/bus-rdf-update-quads';
4
- import type { IActorTest } from '@comunica/core';
4
+ import type { IActorTest, TestResult } from '@comunica/core';
5
5
  import type { IActionContext, IQueryOperationResult } from '@comunica/types';
6
6
  import type { Algebra } from 'sparqlalgebrajs';
7
7
  /**
@@ -11,7 +11,7 @@ import type { Algebra } from 'sparqlalgebrajs';
11
11
  export declare class ActorQueryOperationCreate extends ActorQueryOperationTypedMediated<Algebra.Create> {
12
12
  readonly mediatorUpdateQuads: MediatorRdfUpdateQuads;
13
13
  constructor(args: IActorQueryOperationCreateArgs);
14
- testOperation(operation: Algebra.Create, context: IActionContext): Promise<IActorTest>;
14
+ testOperation(operation: Algebra.Create, context: IActionContext): Promise<TestResult<IActorTest>>;
15
15
  runOperation(operation: Algebra.Create, context: IActionContext): Promise<IQueryOperationResult>;
16
16
  }
17
17
  export interface IActorQueryOperationCreateArgs extends IActorQueryOperationTypedMediatedArgs {
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ActorQueryOperationCreate = void 0;
4
4
  const bus_query_operation_1 = require("@comunica/bus-query-operation");
5
+ const utils_query_operation_1 = require("@comunica/utils-query-operation");
5
6
  /**
6
7
  * A [Query Operation](https://github.com/comunica/comunica/tree/master/packages/bus-query-operation) actor that
7
8
  * handles SPARQL create operations.
@@ -11,8 +12,7 @@ class ActorQueryOperationCreate extends bus_query_operation_1.ActorQueryOperatio
11
12
  super(args, 'create');
12
13
  }
13
14
  async testOperation(operation, context) {
14
- bus_query_operation_1.ActorQueryOperation.throwOnReadOnly(context);
15
- return true;
15
+ return (0, utils_query_operation_1.testReadOnly)(context);
16
16
  }
17
17
  async runOperation(operation, context) {
18
18
  // Delegate to update-quads bus
@@ -1 +1 @@
1
- {"version":3,"file":"ActorQueryOperationCreate.js","sourceRoot":"","sources":["ActorQueryOperationCreate.ts"],"names":[],"mappings":";;;AACA,uEAAsG;AAMtG;;;GAGG;AACH,MAAa,yBAA0B,SAAQ,sDAAgD;IAG7F,YAAmB,IAAoC;QACrD,KAAK,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IACxB,CAAC;IAEM,KAAK,CAAC,aAAa,CAAC,SAAyB,EAAE,OAAuB;QAC3E,yCAAmB,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;QAC7C,OAAO,IAAI,CAAC;IACd,CAAC;IAEM,KAAK,CAAC,YAAY,CAAC,SAAyB,EAAE,OAAuB;QAE1E,+BAA+B;QAC/B,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC;YACzD,YAAY,EAAE;gBACZ,MAAM,EAAE,CAAE,SAAS,CAAC,MAAM,CAAE;gBAC5B,mBAAmB,EAAE,CAAC,SAAS,CAAC,MAAM;aACvC;YACD,OAAO;SACR,CAAC,CAAC;QAEH,OAAO;YACL,IAAI,EAAE,MAAM;YACZ,OAAO;SACR,CAAC;IACJ,CAAC;CACF;AA5BD,8DA4BC","sourcesContent":["import type { IActorQueryOperationTypedMediatedArgs } from '@comunica/bus-query-operation';\nimport { ActorQueryOperation, ActorQueryOperationTypedMediated } from '@comunica/bus-query-operation';\nimport type { MediatorRdfUpdateQuads } from '@comunica/bus-rdf-update-quads';\nimport type { IActorTest } from '@comunica/core';\nimport type { IActionContext, IQueryOperationResult } from '@comunica/types';\nimport type { Algebra } from 'sparqlalgebrajs';\n\n/**\n * A [Query Operation](https://github.com/comunica/comunica/tree/master/packages/bus-query-operation) actor that\n * handles SPARQL create operations.\n */\nexport class ActorQueryOperationCreate extends ActorQueryOperationTypedMediated<Algebra.Create> {\n public readonly mediatorUpdateQuads: MediatorRdfUpdateQuads;\n\n public constructor(args: IActorQueryOperationCreateArgs) {\n super(args, 'create');\n }\n\n public async testOperation(operation: Algebra.Create, context: IActionContext): Promise<IActorTest> {\n ActorQueryOperation.throwOnReadOnly(context);\n return true;\n }\n\n public async runOperation(operation: Algebra.Create, context: IActionContext):\n Promise<IQueryOperationResult> {\n // Delegate to update-quads bus\n const { execute } = await this.mediatorUpdateQuads.mediate({\n createGraphs: {\n graphs: [ operation.source ],\n requireNonExistence: !operation.silent,\n },\n context,\n });\n\n return {\n type: 'void',\n execute,\n };\n }\n}\n\nexport interface IActorQueryOperationCreateArgs extends IActorQueryOperationTypedMediatedArgs {\n /**\n * The RDF Update Quads mediator\n */\n mediatorUpdateQuads: MediatorRdfUpdateQuads;\n}\n"]}
1
+ {"version":3,"file":"ActorQueryOperationCreate.js","sourceRoot":"","sources":["ActorQueryOperationCreate.ts"],"names":[],"mappings":";;;AACA,uEAAiF;AAIjF,2EAA+D;AAG/D;;;GAGG;AACH,MAAa,yBAA0B,SAAQ,sDAAgD;IAG7F,YAAmB,IAAoC;QACrD,KAAK,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IACxB,CAAC;IAEM,KAAK,CAAC,aAAa,CAAC,SAAyB,EAAE,OAAuB;QAC3E,OAAO,IAAA,oCAAY,EAAC,OAAO,CAAC,CAAC;IAC/B,CAAC;IAEM,KAAK,CAAC,YAAY,CAAC,SAAyB,EAAE,OAAuB;QAE1E,+BAA+B;QAC/B,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC;YACzD,YAAY,EAAE;gBACZ,MAAM,EAAE,CAAE,SAAS,CAAC,MAAM,CAAE;gBAC5B,mBAAmB,EAAE,CAAC,SAAS,CAAC,MAAM;aACvC;YACD,OAAO;SACR,CAAC,CAAC;QAEH,OAAO;YACL,IAAI,EAAE,MAAM;YACZ,OAAO;SACR,CAAC;IACJ,CAAC;CACF;AA3BD,8DA2BC","sourcesContent":["import type { IActorQueryOperationTypedMediatedArgs } from '@comunica/bus-query-operation';\nimport { ActorQueryOperationTypedMediated } from '@comunica/bus-query-operation';\nimport type { MediatorRdfUpdateQuads } from '@comunica/bus-rdf-update-quads';\nimport type { IActorTest, TestResult } from '@comunica/core';\nimport type { IActionContext, IQueryOperationResult } from '@comunica/types';\nimport { testReadOnly } from '@comunica/utils-query-operation';\nimport type { Algebra } from 'sparqlalgebrajs';\n\n/**\n * A [Query Operation](https://github.com/comunica/comunica/tree/master/packages/bus-query-operation) actor that\n * handles SPARQL create operations.\n */\nexport class ActorQueryOperationCreate extends ActorQueryOperationTypedMediated<Algebra.Create> {\n public readonly mediatorUpdateQuads: MediatorRdfUpdateQuads;\n\n public constructor(args: IActorQueryOperationCreateArgs) {\n super(args, 'create');\n }\n\n public async testOperation(operation: Algebra.Create, context: IActionContext): Promise<TestResult<IActorTest>> {\n return testReadOnly(context);\n }\n\n public async runOperation(operation: Algebra.Create, context: IActionContext):\n Promise<IQueryOperationResult> {\n // Delegate to update-quads bus\n const { execute } = await this.mediatorUpdateQuads.mediate({\n createGraphs: {\n graphs: [ operation.source ],\n requireNonExistence: !operation.silent,\n },\n context,\n });\n\n return {\n type: 'void',\n execute,\n };\n }\n}\n\nexport interface IActorQueryOperationCreateArgs extends IActorQueryOperationTypedMediatedArgs {\n /**\n * The RDF Update Quads mediator\n */\n mediatorUpdateQuads: MediatorRdfUpdateQuads;\n}\n"]}
package/package.json CHANGED
@@ -1,9 +1,13 @@
1
1
  {
2
2
  "name": "@comunica/actor-query-operation-update-create",
3
- "version": "3.3.0",
3
+ "version": "4.0.1",
4
4
  "description": "A create 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,11 +41,12 @@
37
41
  "build:components": "componentsjs-generator"
38
42
  },
39
43
  "dependencies": {
40
- "@comunica/bus-query-operation": "^3.3.0",
41
- "@comunica/bus-rdf-update-quads": "^3.3.0",
42
- "@comunica/core": "^3.3.0",
43
- "@comunica/types": "^3.3.0",
44
- "sparqlalgebrajs": "^4.3.7"
44
+ "@comunica/bus-query-operation": "^4.0.1",
45
+ "@comunica/bus-rdf-update-quads": "^4.0.1",
46
+ "@comunica/core": "^4.0.1",
47
+ "@comunica/types": "^4.0.1",
48
+ "@comunica/utils-query-operation": "^4.0.1",
49
+ "sparqlalgebrajs": "^4.3.8"
45
50
  },
46
- "gitHead": "02bde397d206f1f5a523643a6a604c89e792e2f9"
51
+ "gitHead": "67831ba79e45ea1ced41fe3f83c5d6e8802dbeaa"
47
52
  }