@comunica/actor-rdf-update-quads-rdfjs-store 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
@@ -25,7 +25,7 @@ After installing, this package can be added to your engine's configuration as fo
25
25
  {
26
26
  "@context": [
27
27
  ...
28
- "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-rdf-update-quads-rdfjs-store/^4.0.0/components/context.jsonld"
28
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-rdf-update-quads-rdfjs-store/^5.0.0/components/context.jsonld"
29
29
  ],
30
30
  "actors": [
31
31
  ...
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "@context": [
3
- "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-rdf-update-quads-rdfjs-store/^4.0.0/components/context.jsonld",
4
- "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-rdf-update-quads/^4.0.0/components/context.jsonld",
5
- "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/core/^4.0.0/components/context.jsonld"
3
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-rdf-update-quads-rdfjs-store/^5.0.0/components/context.jsonld",
4
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-rdf-update-quads/^5.0.0/components/context.jsonld",
5
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/core/^5.0.0/components/context.jsonld"
6
6
  ],
7
7
  "@id": "npmd:@comunica/actor-rdf-update-quads-rdfjs-store",
8
8
  "components": [
@@ -35,37 +35,37 @@
35
35
  "genericTypeInstances": [
36
36
  {
37
37
  "@type": "ParameterRangeGenericTypeReference",
38
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
38
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
39
39
  },
40
40
  {
41
41
  "@type": "ParameterRangeGenericTypeReference",
42
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
42
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
43
43
  },
44
44
  {
45
45
  "@type": "ParameterRangeGenericTypeReference",
46
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
46
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
47
47
  },
48
48
  {
49
49
  "@type": "ParameterRangeGenericTypeReference",
50
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
50
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
51
51
  }
52
52
  ]
53
53
  },
54
54
  {
55
55
  "@type": "ParameterRangeGenericTypeReference",
56
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
56
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
57
57
  },
58
58
  {
59
59
  "@type": "ParameterRangeGenericTypeReference",
60
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
60
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
61
61
  },
62
62
  {
63
63
  "@type": "ParameterRangeGenericTypeReference",
64
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
64
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
65
65
  },
66
66
  {
67
67
  "@type": "ParameterRangeGenericTypeReference",
68
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
68
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
69
69
  }
70
70
  ]
71
71
  },
@@ -102,19 +102,19 @@
102
102
  "genericTypeInstances": [
103
103
  {
104
104
  "@type": "ParameterRangeGenericTypeReference",
105
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
105
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
106
106
  },
107
107
  {
108
108
  "@type": "ParameterRangeGenericTypeReference",
109
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
109
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
110
110
  },
111
111
  {
112
112
  "@type": "ParameterRangeGenericTypeReference",
113
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
113
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
114
114
  },
115
115
  {
116
116
  "@type": "ParameterRangeGenericTypeReference",
117
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
117
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
118
118
  }
119
119
  ]
120
120
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "@context": [
3
- "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-rdf-update-quads-rdfjs-store/^4.0.0/components/context.jsonld"
3
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-rdf-update-quads-rdfjs-store/^5.0.0/components/context.jsonld"
4
4
  ],
5
5
  "@id": "npmd:@comunica/actor-rdf-update-quads-rdfjs-store",
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
- "caruqrs": "npmd:@comunica/actor-rdf-update-quads-rdfjs-store/^4.0.0/",
6
+ "caruqrs": "npmd:@comunica/actor-rdf-update-quads-rdfjs-store/^5.0.0/",
7
7
  "ActorRdfUpdateQuadsRdfJsStore": {
8
8
  "@id": "caruqrs:components/ActorRdfUpdateQuadsRdfJsStore.jsonld#ActorRdfUpdateQuadsRdfJsStore",
9
9
  "@prefix": true,
File without changes
@@ -4,6 +4,7 @@ exports.ActorRdfUpdateQuadsRdfJsStore = void 0;
4
4
  const bus_rdf_update_quads_1 = require("@comunica/bus-rdf-update-quads");
5
5
  const context_entries_1 = require("@comunica/context-entries");
6
6
  const core_1 = require("@comunica/core");
7
+ const utils_query_operation_1 = require("@comunica/utils-query-operation");
7
8
  const RdfJsQuadDestination_1 = require("./RdfJsQuadDestination");
8
9
  /**
9
10
  * A comunica RDFJS Store RDF Update Quads Actor.
@@ -13,7 +14,7 @@ class ActorRdfUpdateQuadsRdfJsStore extends bus_rdf_update_quads_1.ActorRdfUpdat
13
14
  super(args);
14
15
  }
15
16
  async test(action) {
16
- const destination = (0, bus_rdf_update_quads_1.getContextDestination)(action.context);
17
+ const destination = (0, utils_query_operation_1.getContextDestination)(action.context);
17
18
  if (!destination || typeof destination === 'string' ||
18
19
  (!('remove' in destination) && 'value' in destination && !destination.value?.remove)) {
19
20
  return (0, core_1.failTest)(`${this.name} received an invalid rdfjsStore.`);
@@ -21,7 +22,7 @@ class ActorRdfUpdateQuadsRdfJsStore extends bus_rdf_update_quads_1.ActorRdfUpdat
21
22
  return (0, core_1.passTestVoid)();
22
23
  }
23
24
  async getDestination(context) {
24
- const destination = (0, bus_rdf_update_quads_1.getContextDestination)(context);
25
+ const destination = (0, utils_query_operation_1.getContextDestination)(context);
25
26
  return new RdfJsQuadDestination_1.RdfJsQuadDestination(context.getSafe(context_entries_1.KeysInitQuery.dataFactory), 'remove' in destination ? destination : destination.value);
26
27
  }
27
28
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ActorRdfUpdateQuadsRdfJsStore.js","sourceRoot":"","sources":["ActorRdfUpdateQuadsRdfJsStore.ts"],"names":[],"mappings":";;;AAKA,yEAAuG;AACvG,+DAA0D;AAE1D,yCAAwD;AAGxD,iEAA8D;AAE9D;;GAEG;AACH,MAAa,6BAA8B,SAAQ,qDAA8B;IAC/E,YAAmB,IAA8B;QAC/C,KAAK,CAAC,IAAI,CAAC,CAAC;IACd,CAAC;IAEe,KAAK,CAAC,IAAI,CAAC,MAA6B;QACtD,MAAM,WAAW,GAAG,IAAA,4CAAqB,EAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAC1D,IAAI,CAAC,WAAW,IAAI,OAAO,WAAW,KAAK,QAAQ;YACjD,CAAC,CAAC,CAAC,QAAQ,IAAI,WAAW,CAAC,IAAI,OAAO,IAAI,WAAW,IAAI,CAAc,WAAW,CAAC,KAAM,EAAE,MAAM,CAAC,EAAE,CAAC;YACrG,OAAO,IAAA,eAAQ,EAAC,GAAG,IAAI,CAAC,IAAI,kCAAkC,CAAC,CAAC;QAClE,CAAC;QACD,OAAO,IAAA,mBAAY,GAAE,CAAC;IACxB,CAAC;IAES,KAAK,CAAC,cAAc,CAAC,OAAuB;QACpD,MAAM,WAAW,GAAc,IAAA,4CAAqB,EAAC,OAAO,CAAC,CAAC;QAC9D,OAAO,IAAI,2CAAoB,CAC7B,OAAO,CAAC,OAAO,CAAC,+BAAa,CAAC,WAAW,CAAC,EAC1C,QAAQ,IAAI,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,CAC1D,CAAC;IACJ,CAAC;CACF;AArBD,sEAqBC","sourcesContent":["import type {\n IActionRdfUpdateQuads,\n IActorRdfUpdateQuadsArgs,\n IQuadDestination,\n} from '@comunica/bus-rdf-update-quads';\nimport { ActorRdfUpdateQuadsDestination, getContextDestination } from '@comunica/bus-rdf-update-quads';\nimport { KeysInitQuery } from '@comunica/context-entries';\nimport type { IActorTest, TestResult } from '@comunica/core';\nimport { failTest, passTestVoid } from '@comunica/core';\nimport type { IActionContext } from '@comunica/types';\nimport type * as RDF from '@rdfjs/types';\nimport { RdfJsQuadDestination } from './RdfJsQuadDestination';\n\n/**\n * A comunica RDFJS Store RDF Update Quads Actor.\n */\nexport class ActorRdfUpdateQuadsRdfJsStore extends ActorRdfUpdateQuadsDestination {\n public constructor(args: IActorRdfUpdateQuadsArgs) {\n super(args);\n }\n\n public override async test(action: IActionRdfUpdateQuads): Promise<TestResult<IActorTest>> {\n const destination = getContextDestination(action.context);\n if (!destination || typeof destination === 'string' ||\n (!('remove' in destination) && 'value' in destination && !(<RDF.Store> destination.value)?.remove)) {\n return failTest(`${this.name} received an invalid rdfjsStore.`);\n }\n return passTestVoid();\n }\n\n protected async getDestination(context: IActionContext): Promise<IQuadDestination> {\n const destination: any = <any> getContextDestination(context);\n return new RdfJsQuadDestination(\n context.getSafe(KeysInitQuery.dataFactory),\n 'remove' in destination ? destination : destination.value,\n );\n }\n}\n"]}
1
+ {"version":3,"file":"ActorRdfUpdateQuadsRdfJsStore.js","sourceRoot":"","sources":["ActorRdfUpdateQuadsRdfJsStore.ts"],"names":[],"mappings":";;;AAKA,yEAAgF;AAChF,+DAA0D;AAE1D,yCAAwD;AAExD,2EAAwE;AAExE,iEAA8D;AAE9D;;GAEG;AACH,MAAa,6BAA8B,SAAQ,qDAA8B;IAC/E,YAAmB,IAA8B;QAC/C,KAAK,CAAC,IAAI,CAAC,CAAC;IACd,CAAC;IAEe,KAAK,CAAC,IAAI,CAAC,MAA6B;QACtD,MAAM,WAAW,GAAG,IAAA,6CAAqB,EAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAC1D,IAAI,CAAC,WAAW,IAAI,OAAO,WAAW,KAAK,QAAQ;YACjD,CAAC,CAAC,CAAC,QAAQ,IAAI,WAAW,CAAC,IAAI,OAAO,IAAI,WAAW,IAAI,CAAc,WAAW,CAAC,KAAM,EAAE,MAAM,CAAC,EAAE,CAAC;YACrG,OAAO,IAAA,eAAQ,EAAC,GAAG,IAAI,CAAC,IAAI,kCAAkC,CAAC,CAAC;QAClE,CAAC;QACD,OAAO,IAAA,mBAAY,GAAE,CAAC;IACxB,CAAC;IAES,KAAK,CAAC,cAAc,CAAC,OAAuB;QACpD,MAAM,WAAW,GAAc,IAAA,6CAAqB,EAAC,OAAO,CAAC,CAAC;QAC9D,OAAO,IAAI,2CAAoB,CAC7B,OAAO,CAAC,OAAO,CAAC,+BAAa,CAAC,WAAW,CAAC,EAC1C,QAAQ,IAAI,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,CAC1D,CAAC;IACJ,CAAC;CACF;AArBD,sEAqBC","sourcesContent":["import type {\n IActionRdfUpdateQuads,\n IActorRdfUpdateQuadsArgs,\n IQuadDestination,\n} from '@comunica/bus-rdf-update-quads';\nimport { ActorRdfUpdateQuadsDestination } from '@comunica/bus-rdf-update-quads';\nimport { KeysInitQuery } from '@comunica/context-entries';\nimport type { IActorTest, TestResult } from '@comunica/core';\nimport { failTest, passTestVoid } from '@comunica/core';\nimport type { IActionContext } from '@comunica/types';\nimport { getContextDestination } from '@comunica/utils-query-operation';\nimport type * as RDF from '@rdfjs/types';\nimport { RdfJsQuadDestination } from './RdfJsQuadDestination';\n\n/**\n * A comunica RDFJS Store RDF Update Quads Actor.\n */\nexport class ActorRdfUpdateQuadsRdfJsStore extends ActorRdfUpdateQuadsDestination {\n public constructor(args: IActorRdfUpdateQuadsArgs) {\n super(args);\n }\n\n public override async test(action: IActionRdfUpdateQuads): Promise<TestResult<IActorTest>> {\n const destination = getContextDestination(action.context);\n if (!destination || typeof destination === 'string' ||\n (!('remove' in destination) && 'value' in destination && !(<RDF.Store> destination.value)?.remove)) {\n return failTest(`${this.name} received an invalid rdfjsStore.`);\n }\n return passTestVoid();\n }\n\n protected async getDestination(context: IActionContext): Promise<IQuadDestination> {\n const destination: any = <any> getContextDestination(context);\n return new RdfJsQuadDestination(\n context.getSafe(KeysInitQuery.dataFactory),\n 'remove' in destination ? destination : destination.value,\n );\n }\n}\n"]}
File without changes
@@ -7,6 +7,8 @@ const rdf_string_1 = require("rdf-string");
7
7
  * A quad destination that wraps around an {@link RDF.Store}.
8
8
  */
9
9
  class RdfJsQuadDestination {
10
+ dataFactory;
11
+ store;
10
12
  constructor(dataFactory, store) {
11
13
  this.dataFactory = dataFactory;
12
14
  this.store = store;
@@ -1 +1 @@
1
- {"version":3,"file":"RdfJsQuadDest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,KAAK,uBAAuB,CAAC,CAAC,CAAC;oBAClF,CAAC,CAAC,CAAC;oBACH,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;oBAChC,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;gBACnC,CAAC,CAAC,CAAC;YACL,CAAC;QACH,CAAC;IACH,CAAC;CACF;AA/ED,oDA+EC","sourcesContent":["import type { IQuadDestination } from '@comunica/bus-rdf-update-quads';\nimport type { ComunicaDataFactory } from '@comunica/types';\nimport type * as RDF from '@rdfjs/types';\nimport type { AsyncIterator } from 'asynciterator';\nimport { promisifyEventEmitter } from 'event-emitter-promisify';\nimport { stringToTerm, termToString } from 'rdf-string';\n\n/**\n * A quad destination that wraps around an {@link RDF.Store}.\n */\nexport class RdfJsQuadDestination implements IQuadDestination {\n private readonly dataFactory: ComunicaDataFactory;\n private readonly store: RDF.Store;\n\n public constructor(\n dataFactory: ComunicaDataFactory,\n store: RDF.Store,\n ) {\n this.dataFactory = dataFactory;\n this.store = store;\n }\n\n public async update(\n quadStreams: { insert?: AsyncIterator<RDF.Quad>; delete?: AsyncIterator<RDF.Quad> },\n ): Promise<void> {\n if (quadStreams.delete) {\n await promisifyEventEmitter(this.store.remove(quadStreams.delete));\n }\n if (quadStreams.insert) {\n await promisifyEventEmitter(this.store.import(quadStreams.insert));\n }\n }\n\n public async deleteGraphs(\n graphs: RDF.DefaultGraph | 'NAMED' | 'ALL' | RDF.NamedNode[],\n _requireExistence: boolean,\n _dropGraphs: boolean,\n ): Promise<void> {\n switch (graphs) {\n case 'ALL':\n /* eslint-disable no-fallthrough */\n // Remove the default graph\n await promisifyEventEmitter(this.store.deleteGraph(this.dataFactory.defaultGraph()));\n // Drop through to remove all named graphs\n case 'NAMED':\n /* eslint-enable no-fallthrough */\n // Warning: this is sub-optimal!\n // Query ALL quads to determine all named graphs\n // eslint-disable-next-line no-case-declarations\n const allQuads = this.store.match();\n // eslint-disable-next-line no-case-declarations\n const namedGraphs: Record<string, boolean> = {};\n allQuads.on('data', (quad: RDF.Quad) => {\n if (quad.graph.termType !== 'DefaultGraph') {\n namedGraphs[termToString(quad.graph)] = true;\n }\n });\n await promisifyEventEmitter(allQuads);\n\n // Delete all named graphs\n await Promise.all(Object.keys(namedGraphs)\n .map(namedGraph => promisifyEventEmitter(this.store\n .deleteGraph(<RDF.NamedNode> stringToTerm(namedGraph, this.dataFactory)))));\n break;\n default:\n // Delete the default graph or a named graph\n for (const graph of Array.isArray(graphs) ? graphs : [ graphs ]) {\n await promisifyEventEmitter(this.store.deleteGraph(graph));\n }\n }\n }\n\n public async createGraphs(graphs: RDF.NamedNode[], requireNonExistence: boolean): Promise<void> {\n // We don't have to create anything, since RDF/JS stores don't record empty graphs.\n\n // The only check we have to do is error on existence\n if (requireNonExistence) {\n for (const graph of graphs) {\n const eventEmitter = this.store.match(undefined, undefined, undefined, graph);\n await new Promise<void>((resolve, reject) => {\n eventEmitter.once('data', () => {\n reject(new Error(`Unable to create graph ${graph.value} as it already exists`));\n });\n eventEmitter.on('end', resolve);\n eventEmitter.on('error', reject);\n });\n }\n }\n }\n}\n"]}
1
+ {"version":3,"file":"RdfJsQuadDestination.js","sourceRoot":"","sources":["RdfJsQuadDestination.ts"],"names":[],"mappings":";;;AAIA,qEAAgE;AAChE,2CAAwD;AAExD;;GAEG;AACH,MAAa,oBAAoB;IACd,WAAW,CAAsB;IACjC,KAAK,CAAY;IAElC,YACE,WAAgC,EAChC,KAAgB;QAEhB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAEM,KAAK,CAAC,MAAM,CACjB,WAAmF;QAEnF,IAAI,WAAW,CAAC,MAAM,EAAE,CAAC;YACvB,MAAM,IAAA,+CAAqB,EAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC;QACrE,CAAC;QACD,IA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,CAAC,CAAC;gBAChF,MAAM;YACR;gBACE,4CAA4C;gBAC5C,KAAK,MAAM,KAAK,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAE,MAAM,CAAE,EAAE,CAAC;oBAChE,MAAM,IAAA,+CAAqB,EAAC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC;gBAC7D,CAAC;QACL,CAAC;IACH,CAAC;IAEM,KAAK,CAAC,YAAY,CAAC,MAAuB,EAAE,mBAA4B;QAC7E,mFAAmF;QAEnF,qDAAqD;QACrD,IAAI,mBAAmB,EAAE,CAAC;YACxB,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;gBAC3B,MAAM,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;gBAC9E,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;oBAC1C,YAAY,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE;wBAC7B,MAAM,CAAC,IAAI,KAAK,CAAC,0BAA0B,KAAK,CAAC,KAAK,uBAAuB,CAAC,CAAC,CAAC;oBAClF,CAAC,CAAC,CAAC;oBACH,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;oBAChC,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;gBACnC,CAAC,CAAC,CAAC;YACL,CAAC;QACH,CAAC;IACH,CAAC;CACF;AA/ED,oDA+EC","sourcesContent":["import type { IQuadDestination } from '@comunica/bus-rdf-update-quads';\nimport type { ComunicaDataFactory } from '@comunica/types';\nimport type * as RDF from '@rdfjs/types';\nimport type { AsyncIterator } from 'asynciterator';\nimport { promisifyEventEmitter } from 'event-emitter-promisify';\nimport { stringToTerm, termToString } from 'rdf-string';\n\n/**\n * A quad destination that wraps around an {@link RDF.Store}.\n */\nexport class RdfJsQuadDestination implements IQuadDestination {\n private readonly dataFactory: ComunicaDataFactory;\n private readonly store: RDF.Store;\n\n public constructor(\n dataFactory: ComunicaDataFactory,\n store: RDF.Store,\n ) {\n this.dataFactory = dataFactory;\n this.store = store;\n }\n\n public async update(\n quadStreams: { insert?: AsyncIterator<RDF.Quad>; delete?: AsyncIterator<RDF.Quad> },\n ): Promise<void> {\n if (quadStreams.delete) {\n await promisifyEventEmitter(this.store.remove(quadStreams.delete));\n }\n if (quadStreams.insert) {\n await promisifyEventEmitter(this.store.import(quadStreams.insert));\n }\n }\n\n public async deleteGraphs(\n graphs: RDF.DefaultGraph | 'NAMED' | 'ALL' | RDF.NamedNode[],\n _requireExistence: boolean,\n _dropGraphs: boolean,\n ): Promise<void> {\n switch (graphs) {\n case 'ALL':\n /* eslint-disable no-fallthrough */\n // Remove the default graph\n await promisifyEventEmitter(this.store.deleteGraph(this.dataFactory.defaultGraph()));\n // Drop through to remove all named graphs\n case 'NAMED':\n /* eslint-enable no-fallthrough */\n // Warning: this is sub-optimal!\n // Query ALL quads to determine all named graphs\n // eslint-disable-next-line no-case-declarations\n const allQuads = this.store.match();\n // eslint-disable-next-line no-case-declarations\n const namedGraphs: Record<string, boolean> = {};\n allQuads.on('data', (quad: RDF.Quad) => {\n if (quad.graph.termType !== 'DefaultGraph') {\n namedGraphs[termToString(quad.graph)] = true;\n }\n });\n await promisifyEventEmitter(allQuads);\n\n // Delete all named graphs\n await Promise.all(Object.keys(namedGraphs)\n .map(namedGraph => promisifyEventEmitter(this.store\n .deleteGraph(<RDF.NamedNode> stringToTerm(namedGraph, this.dataFactory)))));\n break;\n default:\n // Delete the default graph or a named graph\n for (const graph of Array.isArray(graphs) ? graphs : [ graphs ]) {\n await promisifyEventEmitter(this.store.deleteGraph(graph));\n }\n }\n }\n\n public async createGraphs(graphs: RDF.NamedNode[], requireNonExistence: boolean): Promise<void> {\n // We don't have to create anything, since RDF/JS stores don't record empty graphs.\n\n // The only check we have to do is error on existence\n if (requireNonExistence) {\n for (const graph of graphs) {\n const eventEmitter = this.store.match(undefined, undefined, undefined, graph);\n await new Promise<void>((resolve, reject) => {\n eventEmitter.once('data', () => {\n reject(new Error(`Unable to create graph ${graph.value} as it already exists`));\n });\n eventEmitter.on('end', resolve);\n eventEmitter.on('error', reject);\n });\n }\n }\n }\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-rdf-update-quads-rdfjs-store",
3
- "version": "4.5.0",
3
+ "version": "5.0.0",
4
4
  "description": "A rdfjs-store rdf-update-quads actor",
5
5
  "lsd:module": true,
6
6
  "license": "MIT",
@@ -41,14 +41,15 @@
41
41
  "build:components": "componentsjs-generator"
42
42
  },
43
43
  "dependencies": {
44
- "@comunica/bus-rdf-update-quads": "^4.5.0",
45
- "@comunica/context-entries": "^4.5.0",
46
- "@comunica/core": "^4.5.0",
47
- "@comunica/types": "^4.5.0",
44
+ "@comunica/bus-rdf-update-quads": "^5.0.0",
45
+ "@comunica/context-entries": "^5.0.0",
46
+ "@comunica/core": "^5.0.0",
47
+ "@comunica/types": "^5.0.0",
48
+ "@comunica/utils-query-operation": "^5.0.0",
48
49
  "@rdfjs/types": "*",
49
- "asynciterator": "^3.9.0",
50
+ "asynciterator": "^3.10.0",
50
51
  "event-emitter-promisify": "^1.1.0",
51
- "rdf-string": "^1.6.1"
52
+ "rdf-string": "^2.0.1"
52
53
  },
53
- "gitHead": "2bcd98c387a021fc5c08d375793c205ca3d1bf0d"
54
+ "gitHead": "0b1756fdb9bef014133432489627c1bd71779bd0"
54
55
  }