@comunica/actor-query-operation-path-seq 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 +1 -1
- package/components/ActorQueryOperationPathSeq.jsonld +16 -16
- package/components/components.jsonld +1 -1
- package/components/context.jsonld +1 -1
- package/lib/ActorQueryOperationPathSeq.d.ts +1 -1
- package/lib/ActorQueryOperationPathSeq.js +5 -3
- package/lib/ActorQueryOperationPathSeq.js.map +1 -1
- package/lib/index.d.ts +0 -0
- package/lib/index.js +0 -0
- package/lib/index.js.map +0 -0
- package/package.json +9 -9
package/README.md
CHANGED
|
@@ -22,7 +22,7 @@ After installing, this package can be added to your engine's configuration as fo
|
|
|
22
22
|
{
|
|
23
23
|
"@context": [
|
|
24
24
|
...
|
|
25
|
-
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-operation-path-seq/^
|
|
25
|
+
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-operation-path-seq/^5.0.0/components/context.jsonld"
|
|
26
26
|
],
|
|
27
27
|
"actors": [
|
|
28
28
|
...
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"@context": [
|
|
3
|
-
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-operation-path-seq/^
|
|
4
|
-
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/core/^
|
|
5
|
-
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-query-operation/^
|
|
6
|
-
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-abstract-path/^
|
|
3
|
+
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-operation-path-seq/^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
|
+
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-abstract-path/^5.0.0/components/context.jsonld"
|
|
7
7
|
],
|
|
8
8
|
"@id": "npmd:@comunica/actor-query-operation-path-seq",
|
|
9
9
|
"components": [
|
|
@@ -45,37 +45,37 @@
|
|
|
45
45
|
"genericTypeInstances": [
|
|
46
46
|
{
|
|
47
47
|
"@type": "ParameterRangeGenericTypeReference",
|
|
48
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
48
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
|
|
49
49
|
},
|
|
50
50
|
{
|
|
51
51
|
"@type": "ParameterRangeGenericTypeReference",
|
|
52
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
52
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
|
|
53
53
|
},
|
|
54
54
|
{
|
|
55
55
|
"@type": "ParameterRangeGenericTypeReference",
|
|
56
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
56
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
|
|
57
57
|
},
|
|
58
58
|
{
|
|
59
59
|
"@type": "ParameterRangeGenericTypeReference",
|
|
60
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
60
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
|
|
61
61
|
}
|
|
62
62
|
]
|
|
63
63
|
},
|
|
64
64
|
{
|
|
65
65
|
"@type": "ParameterRangeGenericTypeReference",
|
|
66
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
66
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
|
|
67
67
|
},
|
|
68
68
|
{
|
|
69
69
|
"@type": "ParameterRangeGenericTypeReference",
|
|
70
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
70
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
|
|
71
71
|
},
|
|
72
72
|
{
|
|
73
73
|
"@type": "ParameterRangeGenericTypeReference",
|
|
74
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
74
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
|
|
75
75
|
},
|
|
76
76
|
{
|
|
77
77
|
"@type": "ParameterRangeGenericTypeReference",
|
|
78
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
78
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
|
|
79
79
|
}
|
|
80
80
|
]
|
|
81
81
|
},
|
|
@@ -112,19 +112,19 @@
|
|
|
112
112
|
"genericTypeInstances": [
|
|
113
113
|
{
|
|
114
114
|
"@type": "ParameterRangeGenericTypeReference",
|
|
115
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
115
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
|
|
116
116
|
},
|
|
117
117
|
{
|
|
118
118
|
"@type": "ParameterRangeGenericTypeReference",
|
|
119
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
119
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
|
|
120
120
|
},
|
|
121
121
|
{
|
|
122
122
|
"@type": "ParameterRangeGenericTypeReference",
|
|
123
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
123
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
|
|
124
124
|
},
|
|
125
125
|
{
|
|
126
126
|
"@type": "ParameterRangeGenericTypeReference",
|
|
127
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
127
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
|
|
128
128
|
}
|
|
129
129
|
]
|
|
130
130
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"@context": [
|
|
3
|
-
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-operation-path-seq/^
|
|
3
|
+
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-operation-path-seq/^5.0.0/components/context.jsonld"
|
|
4
4
|
],
|
|
5
5
|
"@id": "npmd:@comunica/actor-query-operation-path-seq",
|
|
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
|
-
"caqops": "npmd:@comunica/actor-query-operation-path-seq/^
|
|
6
|
+
"caqops": "npmd:@comunica/actor-query-operation-path-seq/^5.0.0/",
|
|
7
7
|
"ActorQueryOperationPathSeq": {
|
|
8
8
|
"@id": "caqops:components/ActorQueryOperationPathSeq.jsonld#ActorQueryOperationPathSeq",
|
|
9
9
|
"@prefix": true,
|
|
@@ -2,7 +2,7 @@ import { ActorAbstractPath } from '@comunica/actor-abstract-path';
|
|
|
2
2
|
import type { IActorQueryOperationTypedMediatedArgs } from '@comunica/bus-query-operation';
|
|
3
3
|
import type { MediatorRdfJoin } from '@comunica/bus-rdf-join';
|
|
4
4
|
import type { IActionContext, IQueryOperationResult } from '@comunica/types';
|
|
5
|
-
import { Algebra } from '
|
|
5
|
+
import { Algebra } from '@comunica/utils-algebra';
|
|
6
6
|
/**
|
|
7
7
|
* A comunica Path Seq Query Operation Actor.
|
|
8
8
|
*/
|
|
@@ -3,18 +3,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ActorQueryOperationPathSeq = void 0;
|
|
4
4
|
const actor_abstract_path_1 = require("@comunica/actor-abstract-path");
|
|
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 comunica Path Seq Query Operation Actor.
|
|
10
10
|
*/
|
|
11
11
|
class ActorQueryOperationPathSeq extends actor_abstract_path_1.ActorAbstractPath {
|
|
12
|
+
mediatorJoin;
|
|
12
13
|
constructor(args) {
|
|
13
|
-
super(args,
|
|
14
|
+
super(args, utils_algebra_1.Algebra.Types.SEQ);
|
|
15
|
+
this.mediatorJoin = args.mediatorJoin;
|
|
14
16
|
}
|
|
15
17
|
async runOperation(operationOriginal, context) {
|
|
16
18
|
const dataFactory = context.getSafe(context_entries_1.KeysInitQuery.dataFactory);
|
|
17
|
-
const algebraFactory = new
|
|
19
|
+
const algebraFactory = new utils_algebra_1.AlgebraFactory(dataFactory);
|
|
18
20
|
const predicate = operationOriginal.predicate;
|
|
19
21
|
let joiner = operationOriginal.subject;
|
|
20
22
|
const generatedVariableNames = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActorQueryOperationPathSeq.js","sourceRoot":"","sources":["ActorQueryOperationPathSeq.ts"],"names":[],"mappings":";;;AAAA,uEAAkE;AAIlE,+DAA0D;AAE1D,
|
|
1
|
+
{"version":3,"file":"ActorQueryOperationPathSeq.js","sourceRoot":"","sources":["ActorQueryOperationPathSeq.ts"],"names":[],"mappings":";;;AAAA,uEAAkE;AAIlE,+DAA0D;AAE1D,2DAAkE;AAClE,2EAAkE;AAGlE;;GAEG;AACH,MAAa,0BAA2B,SAAQ,uCAAiB;IAC/C,YAAY,CAAkB;IAE9C,YAAmB,IAAiC;QAClD,KAAK,CAAC,IAAI,EAAE,uBAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC/B,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;IACxC,CAAC;IAEM,KAAK,CAAC,YAAY,CACvB,iBAA+B,EAC/B,OAAuB;QAEvB,MAAM,WAAW,GAAwB,OAAO,CAAC,OAAO,CAAC,+BAAa,CAAC,WAAW,CAAC,CAAC;QACpF,MAAM,cAAc,GAAG,IAAI,8BAAc,CAAC,WAAW,CAAC,CAAC;QACvD,MAAM,SAAS,GAAiB,iBAAiB,CAAC,SAAS,CAAC;QAE5D,IAAI,MAAM,GAAa,iBAAiB,CAAC,OAAO,CAAC;QACjD,MAAM,sBAAsB,GAAmB,EAAE,CAAC;QAClD,MAAM,OAAO,GAAiB,MAAM,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,KAAK;aAC5D,GAAG,CAAC,CAAC,YAAY,EAAE,CAAC,EAAE,EAAE;YACvB,MAAM,UAAU,GAAG,CAAC,KAAK,SAAS,CAAC,KAAK,CAAC,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AC,IAAI,CAAC,CAAC;gBACX,IAAI,EAAE,CAAC;YACT,CAAC;SACF,CAAC,CAAC;QAEH,2DAA2D;QAC3D,OAAO;YACL,IAAI,EAAE,UAAU;YAChB,cAAc;YACd,KAAK,CAAC,QAAQ;gBACZ,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC;gBAC3C,MAAM,SAAS,GAAG,YAAY,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,sBAAsB;qBAChF,IAAI,CAAC,qBAAqB,CAAC,EAAE,CAAC,qBAAqB,CAAC,KAAK,KAAK,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;gBAC3F,OAAO,EAAE,GAAG,YAAY,EAAE,SAAS,EAAE,CAAC;YACxC,CAAC;SACF,CAAC;IACJ,CAAC;CACF;AAjED,gEAiEC","sourcesContent":["import { ActorAbstractPath } from '@comunica/actor-abstract-path';\nimport type { IActorQueryOperationTypedMediatedArgs } from '@comunica/bus-query-operation';\n\nimport type { MediatorRdfJoin } from '@comunica/bus-rdf-join';\nimport { KeysInitQuery } from '@comunica/context-entries';\nimport type { Bindings, IActionContext, IQueryOperationResult, IJoinEntry, ComunicaDataFactory } from '@comunica/types';\nimport { Algebra, AlgebraFactory } from '@comunica/utils-algebra';\nimport { getSafeBindings } from '@comunica/utils-query-operation';\nimport type * as RDF from '@rdfjs/types';\n\n/**\n * A comunica Path Seq Query Operation Actor.\n */\nexport class ActorQueryOperationPathSeq extends ActorAbstractPath {\n public readonly mediatorJoin: MediatorRdfJoin;\n\n public constructor(args: IActorQueryOperationPathSeq) {\n super(args, Algebra.Types.SEQ);\n this.mediatorJoin = args.mediatorJoin;\n }\n\n public async runOperation(\n operationOriginal: Algebra.Path,\n context: IActionContext,\n ): Promise<IQueryOperationResult> {\n const dataFactory: ComunicaDataFactory = context.getSafe(KeysInitQuery.dataFactory);\n const algebraFactory = new AlgebraFactory(dataFactory);\n const predicate = <Algebra.Seq> operationOriginal.predicate;\n\n let joiner: RDF.Term = operationOriginal.subject;\n const generatedVariableNames: RDF.Variable[] = [];\n const entries: IJoinEntry[] = await Promise.all(predicate.input\n .map((subPredicate, i) => {\n const nextJoiner = i === predicate.input.length - 1 ? <RDF.Variable> operationOriginal.object : this.generateVariable(dataFactory, operationOriginal, `b${i}`);\n const operation = algebraFactory\n .createPath(joiner, subPredicate, nextJoiner, operationOriginal.graph);\n const output = this.mediatorQueryOperation.mediate({\n context,\n operation,\n });\n\n joiner = nextJoiner;\n if (i < predicate.input.length - 1) {\n generatedVariableNames.push(nextJoiner);\n }\n\n return { output, operation };\n })\n .map(async({ output, operation }) => ({\n output: getSafeBindings(await output),\n operation,\n })));\n\n const join = getSafeBindings(await this.mediatorJoin\n .mediate({ type: 'inner', entries, context }));\n // Remove the generated variable from the bindings\n const bindingsStream = join.bindingsStream.transform<Bindings>({\n transform(item, next, push) {\n for (const generatedVariableName of generatedVariableNames) {\n item = item.delete(generatedVariableName);\n }\n push(item);\n next();\n },\n });\n\n // Remove the generated variable from the list of variables\n return {\n type: 'bindings',\n bindingsStream,\n async metadata() {\n const joinMetadata = await join.metadata();\n const variables = joinMetadata.variables.filter(variable => !generatedVariableNames\n .some(generatedVariableName => generatedVariableName.value === variable.variable.value));\n return { ...joinMetadata, variables };\n },\n };\n }\n}\n\nexport interface IActorQueryOperationPathSeq extends IActorQueryOperationTypedMediatedArgs {\n /**\n * A mediator for joining Bindings streams\n */\n mediatorJoin: MediatorRdfJoin;\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-path-seq",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"description": "A path-seq query-operation actor",
|
|
5
5
|
"lsd:module": true,
|
|
6
6
|
"license": "MIT",
|
|
@@ -41,13 +41,13 @@
|
|
|
41
41
|
"build:components": "componentsjs-generator"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@comunica/actor-abstract-path": "^
|
|
45
|
-
"@comunica/bus-query-operation": "^
|
|
46
|
-
"@comunica/bus-rdf-join": "^
|
|
47
|
-
"@comunica/context-entries": "^
|
|
48
|
-
"@comunica/types": "^
|
|
49
|
-
"@comunica/utils-
|
|
50
|
-
"
|
|
44
|
+
"@comunica/actor-abstract-path": "^5.0.0",
|
|
45
|
+
"@comunica/bus-query-operation": "^5.0.0",
|
|
46
|
+
"@comunica/bus-rdf-join": "^5.0.0",
|
|
47
|
+
"@comunica/context-entries": "^5.0.0",
|
|
48
|
+
"@comunica/types": "^5.0.0",
|
|
49
|
+
"@comunica/utils-algebra": "^5.0.0",
|
|
50
|
+
"@comunica/utils-query-operation": "^5.0.0"
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "0b1756fdb9bef014133432489627c1bd71779bd0"
|
|
53
53
|
}
|