@comunica/actor-query-operation-update-load 4.5.0 → 5.0.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/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-load/^4.0.0/components/context.jsonld"
26
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-operation-update-load/^5.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-load/^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"
3
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-operation-update-load/^5.0.0/components/context.jsonld",
4
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/core/^5.0.0/components/context.jsonld",
5
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-query-operation/^5.0.0/components/context.jsonld"
6
6
  ],
7
7
  "@id": "npmd:@comunica/actor-query-operation-update-load",
8
8
  "components": [
@@ -15,7 +15,17 @@
15
15
  "@type": "GenericComponentExtension",
16
16
  "component": "cbqo:components/ActorQueryOperationTypedMediated.jsonld#ActorQueryOperationTypedMediated",
17
17
  "genericTypeInstances": [
18
- "urn:npm:sparqlalgebrajs:Load"
18
+ {
19
+ "@type": "ParameterRangeIntersection",
20
+ "parameterRangeElements": [
21
+ {
22
+ "@type": "ParameterRangeWildcard"
23
+ },
24
+ {
25
+ "@type": "ParameterRangeWildcard"
26
+ }
27
+ ]
28
+ }
19
29
  ]
20
30
  }
21
31
  ],
@@ -55,37 +65,37 @@
55
65
  "genericTypeInstances": [
56
66
  {
57
67
  "@type": "ParameterRangeGenericTypeReference",
58
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
68
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
59
69
  },
60
70
  {
61
71
  "@type": "ParameterRangeGenericTypeReference",
62
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
72
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
63
73
  },
64
74
  {
65
75
  "@type": "ParameterRangeGenericTypeReference",
66
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
76
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
67
77
  },
68
78
  {
69
79
  "@type": "ParameterRangeGenericTypeReference",
70
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
80
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
71
81
  }
72
82
  ]
73
83
  },
74
84
  {
75
85
  "@type": "ParameterRangeGenericTypeReference",
76
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
86
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
77
87
  },
78
88
  {
79
89
  "@type": "ParameterRangeGenericTypeReference",
80
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
90
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
81
91
  },
82
92
  {
83
93
  "@type": "ParameterRangeGenericTypeReference",
84
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
94
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
85
95
  },
86
96
  {
87
97
  "@type": "ParameterRangeGenericTypeReference",
88
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
98
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
89
99
  }
90
100
  ]
91
101
  },
@@ -122,19 +132,19 @@
122
132
  "genericTypeInstances": [
123
133
  {
124
134
  "@type": "ParameterRangeGenericTypeReference",
125
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
135
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
126
136
  },
127
137
  {
128
138
  "@type": "ParameterRangeGenericTypeReference",
129
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
139
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
130
140
  },
131
141
  {
132
142
  "@type": "ParameterRangeGenericTypeReference",
133
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
143
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
134
144
  },
135
145
  {
136
146
  "@type": "ParameterRangeGenericTypeReference",
137
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
147
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
138
148
  }
139
149
  ]
140
150
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "@context": [
3
- "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-operation-update-load/^4.0.0/components/context.jsonld"
3
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-operation-update-load/^5.0.0/components/context.jsonld"
4
4
  ],
5
5
  "@id": "npmd:@comunica/actor-query-operation-update-load",
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
- "caqoul": "npmd:@comunica/actor-query-operation-update-load/^4.0.0/",
6
+ "caqoul": "npmd:@comunica/actor-query-operation-update-load/^5.0.0/",
7
7
  "ActorQueryOperationLoad": {
8
8
  "@id": "caqoul:components/ActorQueryOperationLoad.jsonld#ActorQueryOperationLoad",
9
9
  "@prefix": true,
@@ -4,7 +4,7 @@ import type { MediatorQuerySourceIdentify } from '@comunica/bus-query-source-ide
4
4
  import type { MediatorRdfUpdateQuads } from '@comunica/bus-rdf-update-quads';
5
5
  import type { IActorTest, TestResult } from '@comunica/core';
6
6
  import type { IActionContext, IQueryOperationResult } from '@comunica/types';
7
- import type { Algebra } from 'sparqlalgebrajs';
7
+ import { Algebra } from '@comunica/utils-algebra';
8
8
  /**
9
9
  * A [Query Operation](https://github.com/comunica/comunica/tree/master/packages/bus-query-operation) actor
10
10
  * that handles SPARQL load operations.
@@ -3,22 +3,26 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ActorQueryOperationLoad = void 0;
4
4
  const bus_query_operation_1 = require("@comunica/bus-query-operation");
5
5
  const context_entries_1 = require("@comunica/context-entries");
6
+ const utils_algebra_1 = require("@comunica/utils-algebra");
6
7
  const utils_query_operation_1 = require("@comunica/utils-query-operation");
7
- const sparqlalgebrajs_1 = require("sparqlalgebrajs");
8
8
  /**
9
9
  * A [Query Operation](https://github.com/comunica/comunica/tree/master/packages/bus-query-operation) actor
10
10
  * that handles SPARQL load operations.
11
11
  */
12
12
  class ActorQueryOperationLoad extends bus_query_operation_1.ActorQueryOperationTypedMediated {
13
+ mediatorUpdateQuads;
14
+ mediatorQuerySourceIdentify;
13
15
  constructor(args) {
14
- super(args, 'load');
16
+ super(args, utils_algebra_1.Algebra.Types.LOAD);
17
+ this.mediatorUpdateQuads = args.mediatorUpdateQuads;
18
+ this.mediatorQuerySourceIdentify = args.mediatorQuerySourceIdentify;
15
19
  }
16
20
  async testOperation(operation, context) {
17
21
  return (0, utils_query_operation_1.testReadOnly)(context);
18
22
  }
19
23
  async runOperation(operation, context) {
20
24
  const dataFactory = context.getSafe(context_entries_1.KeysInitQuery.dataFactory);
21
- const algebraFactory = new sparqlalgebrajs_1.Factory(dataFactory);
25
+ const algebraFactory = new utils_algebra_1.AlgebraFactory(dataFactory);
22
26
  // Determine query source
23
27
  let subContext = context;
24
28
  if (operation.silent) {
@@ -1 +1 @@
1
- {"version":3,"file":"ActorQueryOperationLoad.js","sourceRoot":"","sources":["ActorQueryOperationLoad.ts"],"names":[],"mappings":";;;AACA,uEAAiF;AAGjF,+DAA0D;AAG1D,2EAAoG;AAEpG,qDAA0C;AAE1C;;;GAGG;AACH,MAAa,uBAAwB,SAAQ,sDAA8C;IAIzF,YAAmB,IAAkC;QACnD,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACtB,CAAC;IAEM,KAAK,CAAC,aAAa,CAAC,SAAuB,EAAE,OAAuB;QACzE,OAAO,IAAA,oCAAY,EAAC,OAAO,CAAC,CAAC;IAC/B,CAAC;IAEM,KAAK,CAAC,YAAY,CAAC,SAAuB,EAAE,OAAuB;QAExE,MAAM,WAAW,GAAwB,OAAO,CAAC,OAAO,CAAC,+BAAa,CAAC,WAAW,CAAC,CAAC;QACpF,MAAM,cAAc,GAAG,IAAI,yBAAO,CAAC,WAAW,CAAC,CAAC;QAEhD,yBAAyB;QACzB,IAAI,UAAU,GAAG,OAAO,CAAC;QACzB,IAAI,SAAS,CAAC,MAAM,EAAE,CAAC;YACrB,UAAU,GAAG,UAAU,CAAC,GAAG,CAAC,+BAAa,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QAC3D,CAAC;QACD,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,IAAI,CAAC,2BAA2B,CAAC,OAAO,CAAC;YACrE,uBAAuB,EAAE,EAAE,KAAK,EAAE,SAAS,CAAC,MAAM,CAAC,KAAK,EAAE;YAC1D,OAAO,EAAE,UAAU;SACpB,CAAC,CAAC;QAEH,6CAA6C;QAC7C,MAAM,MAAM,GAAG,IAAA,oCAAY,EAAC,MAAM,IAAI,CAAC,sBAAsB,CAAC,OAAO,CAAC;YACpE,SAAS,EAAE,cAAc,CAAC,eAAe,CACvC,IAAA,6CAAqB,EACnB,cAAc,CAAC,aAAa,CAAC,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,EAC7G,WAAW,CACZ,EACD,CAAE,cAAc;qBACb,aAAa,CAAC,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAE,CACpG;YACD,OAAO,EAAE,UAAU;SACpB,CAAC,CAAC,CAAC;QAEJ,kCAAkC;QAClC,IAAI,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;QACnC,IAAI,SAAS,CAAC,WAAW,EAAE,CAAC;YAC1B,UAAU,GAAG,UAAU;iBACpB,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,MAAM,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC;QACrG,CAAC;QAED,qBAAqB;QACrB,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC;YACzD,gBAAgB,EAAE,UAAU;YAC5B,OAAO;SACR,CAAC,CAAC;QAEH,OAAO;YACL,IAAI,EAAE,MAAM;YACZ,OAAO;SACR,CAAC;IACJ,CAAC;CACF;AA1DD,0DA0DC","sourcesContent":["import type { IActorQueryOperationTypedMediatedArgs } from '@comunica/bus-query-operation';\nimport { ActorQueryOperationTypedMediated } from '@comunica/bus-query-operation';\nimport type { MediatorQuerySourceIdentify } from '@comunica/bus-query-source-identify';\nimport type { MediatorRdfUpdateQuads } from '@comunica/bus-rdf-update-quads';\nimport { KeysInitQuery } from '@comunica/context-entries';\nimport type { IActorTest, TestResult } from '@comunica/core';\nimport type { ComunicaDataFactory, IActionContext, IQueryOperationResult } from '@comunica/types';\nimport { assignOperationSource, getSafeQuads, testReadOnly } from '@comunica/utils-query-operation';\nimport type { Algebra } from 'sparqlalgebrajs';\nimport { Factory } from 'sparqlalgebrajs';\n\n/**\n * A [Query Operation](https://github.com/comunica/comunica/tree/master/packages/bus-query-operation) actor\n * that handles SPARQL load operations.\n */\nexport class ActorQueryOperationLoad extends ActorQueryOperationTypedMediated<Algebra.Load> {\n public readonly mediatorUpdateQuads: MediatorRdfUpdateQuads;\n public readonly mediatorQuerySourceIdentify: MediatorQuerySourceIdentify;\n\n public constructor(args: IActorQueryOperationLoadArgs) {\n super(args, 'load');\n }\n\n public async testOperation(operation: Algebra.Load, context: IActionContext): Promise<TestResult<IActorTest>> {\n return testReadOnly(context);\n }\n\n public async runOperation(operation: Algebra.Load, context: IActionContext):\n Promise<IQueryOperationResult> {\n const dataFactory: ComunicaDataFactory = context.getSafe(KeysInitQuery.dataFactory);\n const algebraFactory = new Factory(dataFactory);\n\n // Determine query source\n let subContext = context;\n if (operation.silent) {\n subContext = subContext.set(KeysInitQuery.lenient, true);\n }\n const { querySource } = await this.mediatorQuerySourceIdentify.mediate({\n querySourceUnidentified: { value: operation.source.value },\n context: subContext,\n });\n\n // Create CONSTRUCT query on the given source\n const output = getSafeQuads(await this.mediatorQueryOperation.mediate({\n operation: algebraFactory.createConstruct(\n assignOperationSource(\n algebraFactory.createPattern(dataFactory.variable('s'), dataFactory.variable('p'), dataFactory.variable('o')),\n querySource,\n ),\n [ algebraFactory\n .createPattern(dataFactory.variable('s'), dataFactory.variable('p'), dataFactory.variable('o')) ],\n ),\n context: subContext,\n }));\n\n // Determine quad stream to insert\n let quadStream = output.quadStream;\n if (operation.destination) {\n quadStream = quadStream\n .map(quad => dataFactory.quad(quad.subject, quad.predicate, quad.object, operation.destination));\n }\n\n // Insert quad stream\n const { execute } = await this.mediatorUpdateQuads.mediate({\n quadStreamInsert: quadStream,\n context,\n });\n\n return {\n type: 'void',\n execute,\n };\n }\n}\n\nexport interface IActorQueryOperationLoadArgs extends IActorQueryOperationTypedMediatedArgs {\n /**\n * The RDF Update Quads mediator\n */\n mediatorUpdateQuads: MediatorRdfUpdateQuads;\n /**\n * Mediator for identifying load sources.\n */\n mediatorQuerySourceIdentify: MediatorQuerySourceIdentify;\n}\n"]}
1
+ {"version":3,"file":"ActorQueryOperationLoad.js","sourceRoot":"","sources":["ActorQueryOperationLoad.ts"],"names":[],"mappings":";;;AACA,uEAAiF;AAGjF,+DAA0D;AAG1D,2DAAkE;AAClE,2EAAoG;AAEpG;;;GAGG;AACH,MAAa,uBAAwB,SAAQ,sDAA8C;IACzE,mBAAmB,CAAyB;IAC5C,2BAA2B,CAA8B;IAEzE,YAAmB,IAAkC;QACnD,KAAK,CAAC,IAAI,EAAE,uBAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAChC,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC,mBAAmB,CAAC;QACpD,IAAI,CAAC,2BAA2B,GAAG,IAAI,CAAC,2BAA2B,CAAC;IACtE,CAAC;IAEM,KAAK,CAAC,aAAa,CAAC,SAAuB,EAAE,OAAuB;QACzE,OAAO,IAAA,oCAAY,EAAC,OAAO,CAAC,CAAC;IAC/B,CAAC;IAEM,KAAK,CAAC,YAAY,CAAC,SAAuB,EAAE,OAAuB;QAExE,MAAM,WAAW,GAAwB,OAAO,CAAC,OAAO,CAAC,+BAAa,CAAC,WAAW,CAAC,CAAC;QACpF,MAAM,cAAc,GAAG,IAAI,8BAAc,CAAC,WAAW,CAAC,CAAC;QAEvD,yBAAyB;QACzB,IAAI,UAAU,GAAG,OAAO,CAAC;QACzB,IAAI,SAAS,CAAC,MAAM,EAAE,CAAC;YACrB,UAAU,GAAG,UAAU,CAAC,GAAG,CAAC,+BAAa,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QAC3D,CAAC;QACD,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,IAAI,CAAC,2BAA2B,CAAC,OAAO,CAAC;YACrE,uBAAuB,EAAE,EAAE,KAAK,EAAE,SAAS,CAAC,MAAM,CAAC,KAAK,EAAE;YAC1D,OAAO,EAAE,UAAU;SACpB,CAAC,CAAC;QAEH,6CAA6C;QAC7C,MAAM,MAAM,GAAG,IAAA,oCAAY,EAAC,MAAM,IAAI,CAAC,sBAAsB,CAAC,OAAO,CAAC;YACpE,SAAS,EAAE,cAAc,CAAC,eAAe,CACvC,IAAA,6CAAqB,EACnB,cAAc,CAAC,aAAa,CAAC,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,EAC7G,WAAW,CACZ,EACD,CAAE,cAAc;qBACb,aAAa,CAAC,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAE,CACpG;YACD,OAAO,EAAE,UAAU;SACpB,CAAC,CAAC,CAAC;QAEJ,kCAAkC;QAClC,IAAI,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;QACnC,IAAI,SAAS,CAAC,WAAW,EAAE,CAAC;YAC1B,UAAU,GAAG,UAAU;iBACpB,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,MAAM,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC;QACrG,CAAC;QAED,qBAAqB;QACrB,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC;YACzD,gBAAgB,EAAE,UAAU;YAC5B,OAAO;SACR,CAAC,CAAC;QAEH,OAAO;YACL,IAAI,EAAE,MAAM;YACZ,OAAO;SACR,CAAC;IACJ,CAAC;CACF;AA5DD,0DA4DC","sourcesContent":["import type { IActorQueryOperationTypedMediatedArgs } from '@comunica/bus-query-operation';\nimport { ActorQueryOperationTypedMediated } from '@comunica/bus-query-operation';\nimport type { MediatorQuerySourceIdentify } from '@comunica/bus-query-source-identify';\nimport type { MediatorRdfUpdateQuads } from '@comunica/bus-rdf-update-quads';\nimport { KeysInitQuery } from '@comunica/context-entries';\nimport type { IActorTest, TestResult } from '@comunica/core';\nimport type { ComunicaDataFactory, IActionContext, IQueryOperationResult } from '@comunica/types';\nimport { Algebra, AlgebraFactory } from '@comunica/utils-algebra';\nimport { assignOperationSource, getSafeQuads, testReadOnly } from '@comunica/utils-query-operation';\n\n/**\n * A [Query Operation](https://github.com/comunica/comunica/tree/master/packages/bus-query-operation) actor\n * that handles SPARQL load operations.\n */\nexport class ActorQueryOperationLoad extends ActorQueryOperationTypedMediated<Algebra.Load> {\n public readonly mediatorUpdateQuads: MediatorRdfUpdateQuads;\n public readonly mediatorQuerySourceIdentify: MediatorQuerySourceIdentify;\n\n public constructor(args: IActorQueryOperationLoadArgs) {\n super(args, Algebra.Types.LOAD);\n this.mediatorUpdateQuads = args.mediatorUpdateQuads;\n this.mediatorQuerySourceIdentify = args.mediatorQuerySourceIdentify;\n }\n\n public async testOperation(operation: Algebra.Load, context: IActionContext): Promise<TestResult<IActorTest>> {\n return testReadOnly(context);\n }\n\n public async runOperation(operation: Algebra.Load, context: IActionContext):\n Promise<IQueryOperationResult> {\n const dataFactory: ComunicaDataFactory = context.getSafe(KeysInitQuery.dataFactory);\n const algebraFactory = new AlgebraFactory(dataFactory);\n\n // Determine query source\n let subContext = context;\n if (operation.silent) {\n subContext = subContext.set(KeysInitQuery.lenient, true);\n }\n const { querySource } = await this.mediatorQuerySourceIdentify.mediate({\n querySourceUnidentified: { value: operation.source.value },\n context: subContext,\n });\n\n // Create CONSTRUCT query on the given source\n const output = getSafeQuads(await this.mediatorQueryOperation.mediate({\n operation: algebraFactory.createConstruct(\n assignOperationSource(\n algebraFactory.createPattern(dataFactory.variable('s'), dataFactory.variable('p'), dataFactory.variable('o')),\n querySource,\n ),\n [ algebraFactory\n .createPattern(dataFactory.variable('s'), dataFactory.variable('p'), dataFactory.variable('o')) ],\n ),\n context: subContext,\n }));\n\n // Determine quad stream to insert\n let quadStream = output.quadStream;\n if (operation.destination) {\n quadStream = quadStream\n .map(quad => dataFactory.quad(quad.subject, quad.predicate, quad.object, operation.destination));\n }\n\n // Insert quad stream\n const { execute } = await this.mediatorUpdateQuads.mediate({\n quadStreamInsert: quadStream,\n context,\n });\n\n return {\n type: 'void',\n execute,\n };\n }\n}\n\nexport interface IActorQueryOperationLoadArgs extends IActorQueryOperationTypedMediatedArgs {\n /**\n * The RDF Update Quads mediator\n */\n mediatorUpdateQuads: MediatorRdfUpdateQuads;\n /**\n * Mediator for identifying load sources.\n */\n mediatorQuerySourceIdentify: MediatorQuerySourceIdentify;\n}\n"]}
package/lib/index.d.ts CHANGED
File without changes
package/lib/index.js CHANGED
File without changes
package/lib/index.js.map CHANGED
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@comunica/actor-query-operation-update-load",
3
- "version": "4.5.0",
3
+ "version": "5.0.0",
4
4
  "description": "A load query-operation actor",
5
5
  "lsd:module": true,
6
6
  "license": "MIT",
@@ -41,14 +41,14 @@
41
41
  "build:components": "componentsjs-generator"
42
42
  },
43
43
  "dependencies": {
44
- "@comunica/bus-query-operation": "^4.5.0",
45
- "@comunica/bus-query-source-identify": "^4.5.0",
46
- "@comunica/bus-rdf-update-quads": "^4.5.0",
47
- "@comunica/context-entries": "^4.5.0",
48
- "@comunica/core": "^4.5.0",
49
- "@comunica/types": "^4.5.0",
50
- "@comunica/utils-query-operation": "^4.5.0",
51
- "sparqlalgebrajs": "^5.0.2"
44
+ "@comunica/bus-query-operation": "^5.0.0",
45
+ "@comunica/bus-query-source-identify": "^5.0.0",
46
+ "@comunica/bus-rdf-update-quads": "^5.0.0",
47
+ "@comunica/context-entries": "^5.0.0",
48
+ "@comunica/core": "^5.0.0",
49
+ "@comunica/types": "^5.0.0",
50
+ "@comunica/utils-algebra": "^5.0.0",
51
+ "@comunica/utils-query-operation": "^5.0.0"
52
52
  },
53
- "gitHead": "2bcd98c387a021fc5c08d375793c205ca3d1bf0d"
53
+ "gitHead": "0b1756fdb9bef014133432489627c1bd71779bd0"
54
54
  }