@comunica/actor-query-operation-path-seq 2.4.0 → 2.5.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.
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActorQueryOperationPathSeq.js","sourceRoot":"","sources":["ActorQueryOperationPathSeq.ts"],"names":[],"mappings":";;;AAAA,uEAAkE;AAElE,uEAEuC;AAIvC,qDAA0C;AAE1C;;GAEG;AACH,MAAa,0BAA2B,SAAQ,uCAAiB;IAG/D,YAAmB,IAAiC;QAClD,KAAK,CAAC,IAAI,EAAE,yBAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACjC,CAAC;IAEM,KAAK,CAAC,YAAY,CACvB,iBAA+B,EAC/B,OAAuB;QAEvB,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,MAAM,GAAG,CAAC,CAAC,CAAC,CAAgB,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,iBAAiB,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;YAClJ,MAAM,SAAS,GAAG,uCAAiB,CAAC,OAAO;iBACxC,UAAU,CAAC,MAAM,EAAE,YAAY,EAAE,UAAU,EAAE,iBAAiB,CAAC,KAAK,CAAC,CAAC;YACzE,MAAM,MAAM,GAAG,IAAI,CAAC,sBAAsB,CAAC,OAAO,CAAC;gBACjD,OAAO;gBACP,SAAS;aACV,CAAC,CAAC;YAEH,MAAM,GAAG,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AK,CAAC,CAAC,CAAC;gBAClF,OAAO,EAAE,GAAG,YAAY,EAAE,SAAS,EAAE,CAAC;YACxC,CAAC;SACF,CAAC;IACJ,CAAC;CACF;AA9DD,gEA8DC","sourcesContent":["import { ActorAbstractPath } from '@comunica/actor-abstract-path';\nimport type { IActorQueryOperationTypedMediatedArgs } from '@comunica/bus-query-operation';\nimport {\n ActorQueryOperation,\n} from '@comunica/bus-query-operation';\nimport type { MediatorRdfJoin } from '@comunica/bus-rdf-join';\nimport type { Bindings, IActionContext, IQueryOperationResult, IJoinEntry } from '@comunica/types';\nimport type * as RDF from '@rdfjs/types';\nimport { Algebra } from 'sparqlalgebrajs';\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 }\n\n public async runOperation(\n operationOriginal: Algebra.Path,\n context: IActionContext,\n ): Promise<IQueryOperationResult> {\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(operationOriginal, `b${i}`);\n const operation = ActorAbstractPath.FACTORY\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: ActorQueryOperation.getSafeBindings(await output),\n operation,\n })));\n\n const join = ActorQueryOperation.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.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.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+DAA6C","sourcesContent":["export * from './ActorQueryOperationPathSeq';\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@comunica/actor-query-operation-path-seq",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.1",
|
|
4
4
|
"description": "A path-seq query-operation actor",
|
|
5
5
|
"lsd:module": true,
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -28,19 +28,20 @@
|
|
|
28
28
|
"files": [
|
|
29
29
|
"components",
|
|
30
30
|
"lib/**/*.d.ts",
|
|
31
|
-
"lib/**/*.js"
|
|
31
|
+
"lib/**/*.js",
|
|
32
|
+
"lib/**/*.js.map"
|
|
32
33
|
],
|
|
33
34
|
"dependencies": {
|
|
34
|
-
"@comunica/actor-abstract-path": "^2.
|
|
35
|
-
"@comunica/bus-query-operation": "^2.
|
|
36
|
-
"@comunica/bus-rdf-join": "^2.
|
|
37
|
-
"@comunica/types": "^2.
|
|
38
|
-
"sparqlalgebrajs": "^4.0.
|
|
35
|
+
"@comunica/actor-abstract-path": "^2.5.1",
|
|
36
|
+
"@comunica/bus-query-operation": "^2.5.1",
|
|
37
|
+
"@comunica/bus-rdf-join": "^2.5.1",
|
|
38
|
+
"@comunica/types": "^2.5.1",
|
|
39
|
+
"sparqlalgebrajs": "^4.0.5"
|
|
39
40
|
},
|
|
40
41
|
"scripts": {
|
|
41
42
|
"build": "npm run build:ts && npm run build:components",
|
|
42
43
|
"build:ts": "node \"../../node_modules/typescript/bin/tsc\"",
|
|
43
44
|
"build:components": "componentsjs-generator"
|
|
44
45
|
},
|
|
45
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "d64e87fad4a616224c210c2d22b38f6f9b00e1ea"
|
|
46
47
|
}
|