@comunica/actor-query-process-annotate-source-binding 4.4.2-alpha.49.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.
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "@context": [
3
- "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-process-annotate-source-binding/^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-process/^4.0.0/components/context.jsonld"
3
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-process-annotate-source-binding/^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-process/^5.0.0/components/context.jsonld"
6
6
  ],
7
7
  "@id": "npmd:@comunica/actor-query-process-annotate-source-binding",
8
8
  "components": [
@@ -40,37 +40,37 @@
40
40
  "genericTypeInstances": [
41
41
  {
42
42
  "@type": "ParameterRangeGenericTypeReference",
43
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
43
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
44
44
  },
45
45
  {
46
46
  "@type": "ParameterRangeGenericTypeReference",
47
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
47
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
48
48
  },
49
49
  {
50
50
  "@type": "ParameterRangeGenericTypeReference",
51
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
51
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
52
52
  },
53
53
  {
54
54
  "@type": "ParameterRangeGenericTypeReference",
55
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
55
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
56
56
  }
57
57
  ]
58
58
  },
59
59
  {
60
60
  "@type": "ParameterRangeGenericTypeReference",
61
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
61
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
62
62
  },
63
63
  {
64
64
  "@type": "ParameterRangeGenericTypeReference",
65
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
65
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
66
66
  },
67
67
  {
68
68
  "@type": "ParameterRangeGenericTypeReference",
69
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
69
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
70
70
  },
71
71
  {
72
72
  "@type": "ParameterRangeGenericTypeReference",
73
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
73
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
74
74
  }
75
75
  ]
76
76
  },
@@ -107,19 +107,19 @@
107
107
  "genericTypeInstances": [
108
108
  {
109
109
  "@type": "ParameterRangeGenericTypeReference",
110
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
110
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
111
111
  },
112
112
  {
113
113
  "@type": "ParameterRangeGenericTypeReference",
114
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
114
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
115
115
  },
116
116
  {
117
117
  "@type": "ParameterRangeGenericTypeReference",
118
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
118
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
119
119
  },
120
120
  {
121
121
  "@type": "ParameterRangeGenericTypeReference",
122
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
122
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
123
123
  }
124
124
  ]
125
125
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "@context": [
3
- "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-process-annotate-source-binding/^4.0.0/components/context.jsonld"
3
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-process-annotate-source-binding/^5.0.0/components/context.jsonld"
4
4
  ],
5
5
  "@id": "npmd:@comunica/actor-query-process-annotate-source-binding",
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
- "caqpasb": "npmd:@comunica/actor-query-process-annotate-source-binding/^4.0.0/",
6
+ "caqpasb": "npmd:@comunica/actor-query-process-annotate-source-binding/^5.0.0/",
7
7
  "ActorQueryProcessAnnotateSourceBinding": {
8
8
  "@id": "caqpasb:components/ActorQueryProcessAnnotateSourceBinding.jsonld#ActorQueryProcessAnnotateSourceBinding",
9
9
  "@prefix": true,
@@ -10,9 +10,12 @@ const rdf_data_factory_1 = require("rdf-data-factory");
10
10
  * A comunica Annotate Source Binding Query Process Actor.
11
11
  */
12
12
  class ActorQueryProcessAnnotateSourceBinding extends bus_query_process_1.ActorQueryProcess {
13
+ dataFactory;
14
+ mediatorQueryProcess;
13
15
  constructor(args) {
14
16
  super(args);
15
17
  this.dataFactory = new rdf_data_factory_1.DataFactory();
18
+ this.mediatorQueryProcess = args.mediatorQueryProcess;
16
19
  }
17
20
  async test(action) {
18
21
  if (action.context.get(exports.KEY_CONTEXT_WRAPPED)) {
@@ -1 +1 @@
1
- {"version":3,"file":"Act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jC,6GAA6G;gBAC7G,MAAM,MAAM,GAAe,QAAQ,CAAC,eAAe,CAAC,0CAAwB,CAAC,cAAc,CAAC,CAAC;gBAC7F,MAAM,eAAe,GAAG,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,CAAC;gBAC/E,QAAQ,GAAG,QAAQ,CAAC,GAAG,CAAC,SAAS,EAAE,eAAe,CAAC,CAAC;YACtD,CAAC;YACD,OAAO,QAAQ,CAAC;QAClB,CAAC,CAAC,CAAC;QAEH,OAAO,GAAG,CAAC;IACb,CAAC;CACF;AA1CD,wFA0CC;AASY,QAAA,mBAAmB,GAAG,IAAI,uBAAgB,CACrD,+DAA+D,CAChE,CAAC","sourcesContent":["import type {\n IActionQueryProcess,\n IActorQueryProcessOutput,\n IActorQueryProcessArgs,\n MediatorQueryProcess,\n} from '@comunica/bus-query-process';\nimport { ActorQueryProcess } from '@comunica/bus-query-process';\nimport { KeysMergeBindingsContext } from '@comunica/context-entries';\nimport type { IActorTest, TestResult } from '@comunica/core';\nimport { failTest, passTestVoid, ActionContextKey } from '@comunica/core';\nimport type { BindingsStream } from '@comunica/types';\nimport { Bindings } from '@comunica/utils-bindings-factory';\nimport type * as RDF from '@rdfjs/types';\nimport { DataFactory } from 'rdf-data-factory';\n\n/**\n * A comunica Annotate Source Binding Query Process Actor.\n */\nexport class ActorQueryProcessAnnotateSourceBinding extends ActorQueryProcess {\n private readonly dataFactory: RDF.DataFactory;\n public readonly mediatorQueryProcess: MediatorQueryProcess;\n\n public constructor(args: IActorQueryProcessAnnotateSourceBindingArgs) {\n super(args);\n this.dataFactory = new DataFactory();\n }\n\n public async test(action: IActionQueryProcess): Promise<TestResult<IActorTest>> {\n if (action.context.get(KEY_CONTEXT_WRAPPED)) {\n return failTest('Unable to query process multiple times');\n }\n return passTestVoid();\n }\n\n public async run(action: IActionQueryProcess): Promise<IActorQueryProcessOutput> {\n const context = action.context.set(KEY_CONTEXT_WRAPPED, true);\n action.context = context;\n\n // Run all query processing steps in sequence\n const output = await this.mediatorQueryProcess.mediate(action);\n // Currently this only supports adding source provenance to bindings\n if (output.result.type === 'bindings') {\n output.result.bindingsStream = this.addSourcesToBindings(output.result.bindingsStream);\n }\n return output;\n }\n\n public addSourcesToBindings(iterator: BindingsStream): BindingsStream {\n const ret = iterator.map((bindings) => {\n if (bindings instanceof Bindings) {\n // Get sources from bindings context. If no sources are found, this should produce binding with empty literal\n const source = <string []> bindings.getContextEntry(KeysMergeBindingsContext.sourcesBinding);\n const sourceAsLiteral = this.dataFactory.literal(JSON.stringify(source ?? []));\n bindings = bindings.set('_source', sourceAsLiteral);\n }\n return bindings;\n });\n\n return ret;\n }\n}\n\nexport interface IActorQueryProcessAnnotateSourceBindingArgs extends IActorQueryProcessArgs {\n /**\n * The query process mediator so we can call our wrapped actor\n */\n mediatorQueryProcess: MediatorQueryProcess;\n}\n\nexport const KEY_CONTEXT_WRAPPED = new ActionContextKey<boolean>(\n '@comunica/actor-query-process-annotate-source-binding:wrapped',\n);\n"]}
1
+ {"version":3,"file":"ActorQueryProcessAnnotateSourceBinding.js","sourceRoot":"","sources":["ActorQueryProcessAnnotateSourceBinding.ts"],"names":[],"mappings":";;;AAMA,mEAAgE;AAChE,+DAAqE;AAErE,yCAA0E;AAE1E,6EAA4D;AAE5D,uDAA+C;AAE/C;;GAEG;AACH,MAAa,sCAAuC,SAAQ,qCAAiB;IAC1D,WAAW,CAAkB;IAC9B,oBAAoB,CAAuB;IAE3D,YAAmB,IAAiD;QAClE,KAAK,CAAC,IAAI,CAAC,CAAC;QACZ,IAAI,CAAC,WAAW,GAAG,IAAI,8BAAW,EAAE,CAAC;QACrC,IAAI,CAAC,oBAAoB,GAAG,IAAI,CAAC,oBAAoB,CAAC;IACxD,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,MAA2B;QAC3C,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,2BAAmB,CAAC,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IAAI,uBAAgB,CACrD,+DAA+D,CAChE,CAAC","sourcesContent":["import type {\n IActionQueryProcess,\n IActorQueryProcessOutput,\n IActorQueryProcessArgs,\n MediatorQueryProcess,\n} from '@comunica/bus-query-process';\nimport { ActorQueryProcess } from '@comunica/bus-query-process';\nimport { KeysMergeBindingsContext } from '@comunica/context-entries';\nimport type { IActorTest, TestResult } from '@comunica/core';\nimport { failTest, passTestVoid, ActionContextKey } from '@comunica/core';\nimport type { BindingsStream } from '@comunica/types';\nimport { Bindings } from '@comunica/utils-bindings-factory';\nimport type * as RDF from '@rdfjs/types';\nimport { DataFactory } from 'rdf-data-factory';\n\n/**\n * A comunica Annotate Source Binding Query Process Actor.\n */\nexport class ActorQueryProcessAnnotateSourceBinding extends ActorQueryProcess {\n private readonly dataFactory: RDF.DataFactory;\n public readonly mediatorQueryProcess: MediatorQueryProcess;\n\n public constructor(args: IActorQueryProcessAnnotateSourceBindingArgs) {\n super(args);\n this.dataFactory = new DataFactory();\n this.mediatorQueryProcess = args.mediatorQueryProcess;\n }\n\n public async test(action: IActionQueryProcess): Promise<TestResult<IActorTest>> {\n if (action.context.get(KEY_CONTEXT_WRAPPED)) {\n return failTest('Unable to query process multiple times');\n }\n return passTestVoid();\n }\n\n public async run(action: IActionQueryProcess): Promise<IActorQueryProcessOutput> {\n const context = action.context.set(KEY_CONTEXT_WRAPPED, true);\n action.context = context;\n\n // Run all query processing steps in sequence\n const output = await this.mediatorQueryProcess.mediate(action);\n // Currently this only supports adding source provenance to bindings\n if (output.result.type === 'bindings') {\n output.result.bindingsStream = this.addSourcesToBindings(output.result.bindingsStream);\n }\n return output;\n }\n\n public addSourcesToBindings(iterator: BindingsStream): BindingsStream {\n const ret = iterator.map((bindings) => {\n if (bindings instanceof Bindings) {\n // Get sources from bindings context. If no sources are found, this should produce binding with empty literal\n const source = <string []> bindings.getContextEntry(KeysMergeBindingsContext.sourcesBinding);\n const sourceAsLiteral = this.dataFactory.literal(JSON.stringify(source ?? []));\n bindings = bindings.set('_source', sourceAsLiteral);\n }\n return bindings;\n });\n\n return ret;\n }\n}\n\nexport interface IActorQueryProcessAnnotateSourceBindingArgs extends IActorQueryProcessArgs {\n /**\n * The query process mediator so we can call our wrapped actor\n */\n mediatorQueryProcess: MediatorQueryProcess;\n}\n\nexport const KEY_CONTEXT_WRAPPED = new ActionContextKey<boolean>(\n '@comunica/actor-query-process-annotate-source-binding:wrapped',\n);\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@comunica/actor-query-process-annotate-source-binding",
3
- "version": "4.4.2-alpha.49.0",
3
+ "version": "5.0.0",
4
4
  "description": "A annotate-source-binding query-process actor",
5
5
  "lsd:module": true,
6
6
  "license": "MIT",
@@ -41,12 +41,12 @@
41
41
  "build:components": "componentsjs-generator"
42
42
  },
43
43
  "dependencies": {
44
- "@comunica/bus-query-process": "4.4.2-alpha.49.0",
45
- "@comunica/context-entries": "4.4.2-alpha.49.0",
46
- "@comunica/core": "4.4.2-alpha.49.0",
47
- "@comunica/types": "4.4.2-alpha.49.0",
48
- "@comunica/utils-bindings-factory": "4.4.2-alpha.49.0",
44
+ "@comunica/bus-query-process": "^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-bindings-factory": "^5.0.0",
49
49
  "rdf-data-factory": "^2.0.0"
50
50
  },
51
- "gitHead": "ef6f96cfd8faf7c37955bb7e0fe9f6fc6a994bdf"
51
+ "gitHead": "0b1756fdb9bef014133432489627c1bd71779bd0"
52
52
  }