@comunica/actor-query-operation-distinct-hash 2.4.0 → 2.5.1-alpha.32.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.
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActorQueryOperationDistinctHash.js","sourceRoot":"","sources":["ActorQueryOperationDistinctHash.ts"],"names":[],"mappings":";;;AAEA,uEAGuC;AAMvC;;GAEG;AACH,MAAa,+BAAgC,SAAQ,sDAAkD;IAGrG,YAAmB,IAA0C;QAC3D,KAAK,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IAC1B,CAAC;IAEM,KAAK,CAAC,aAAa,CAAC,SAA2B,EAAE,OAAuB;QAC7E,OAAO,IAAI,CAAC;IACd,CAAC;IAEM,KAAK,CAAC,YAAY,CAAC,SAA2B,EAAE,OAAuB;QAC5E,MAAM,MAAM,GAAkC,yCAAmB,CAAC,eAAe,CAC/E,MAAM,IAAI,CAAC,sBAAsB,CAAC,OAAO,CAAC,EAAE,SAAS,EAAE,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,CAAC,CACnF,CAAC;QACF,MAAM,cAAc,GAAmB,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC;QACvG,OAAO;YACL,IAAI,EAAE,UAAU;YAChB,cAAc;YACd,QAAQ,EAAE,MAAM,CAAC,QAAQ;SAC1B,CAAC;IACJ,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,aAAa,CAAC,OAAuB;QAChD,MAAM,EAAE,YAAY,EAAE,GAAG,MAAM,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,EAAE,mBAAmB,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;QACzG,MAAM,MAAM,GAA4B,EAAE,CAAC;QAC3C,OAAO,CAAC,QAAkB,EAAE,EAAE;YAC5B,MAAM,IAAI,GAAW,YAAY,CAAC,QAAQ,CAAC,CAAC;YAC5C,4CAA4C;YAC5C,OAAO,CAAC,CAAC,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;QACpD,CAAC,CAAC;IACJ,CAAC;CACF;AAtCD,0EAsCC","sourcesContent":["import type { MediatorHashBindings } from '@comunica/bus-hash-bindings';\nimport type { IActorQueryOperationTypedMediatedArgs } from '@comunica/bus-query-operation';\nimport {\n ActorQueryOperation,\n ActorQueryOperationTypedMediated,\n} from '@comunica/bus-query-operation';\nimport type { IActorTest } from '@comunica/core';\nimport type { Bindings, BindingsStream, IActionContext,\n IQueryOperationResult, IQueryOperationResultBindings } from '@comunica/types';\nimport type { Algebra } from 'sparqlalgebrajs';\n\n/**\n * A comunica Distinct Hash Query Operation Actor.\n */\nexport class ActorQueryOperationDistinctHash extends ActorQueryOperationTypedMediated<Algebra.Distinct> {\n public readonly mediatorHashBindings: MediatorHashBindings;\n\n public constructor(args: IActorQueryOperationDistinctHashArgs) {\n super(args, 'distinct');\n }\n\n public async testOperation(operation: Algebra.Distinct, context: IActionContext): Promise<IActorTest> {\n return true;\n }\n\n public async runOperation(operation: Algebra.Distinct, context: IActionContext): Promise<IQueryOperationResult> {\n const output: IQueryOperationResultBindings = ActorQueryOperation.getSafeBindings(\n await this.mediatorQueryOperation.mediate({ operation: operation.input, context }),\n );\n const bindingsStream: BindingsStream = output.bindingsStream.filter(await this.newHashFilter(context));\n return {\n type: 'bindings',\n bindingsStream,\n metadata: output.metadata,\n };\n }\n\n /**\n * Create a new distinct filter function.\n * This will maintain an internal hash datastructure so that every bindings object only returns true once.\n * @param context The action context.\n * @return {(bindings: Bindings) => boolean} A distinct filter for bindings.\n */\n public async newHashFilter(context: IActionContext): Promise<(bindings: Bindings) => boolean> {\n const { hashFunction } = await this.mediatorHashBindings.mediate({ allowHashCollisions: true, context });\n const hashes: Record<string, boolean> = {};\n return (bindings: Bindings) => {\n const hash: string = hashFunction(bindings);\n // eslint-disable-next-line no-return-assign\n return !(hash in hashes) && (hashes[hash] = true);\n };\n }\n}\n\nexport interface IActorQueryOperationDistinctHashArgs extends IActorQueryOperationTypedMediatedArgs {\n mediatorHashBindings: MediatorHashBindings;\n}\n"]}
|
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oEAAkD","sourcesContent":["export * from './ActorQueryOperationDistinctHash';\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@comunica/actor-query-operation-distinct-hash",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.1-alpha.32.0",
|
|
4
4
|
"description": "A distinct-hash query-operation actor",
|
|
5
5
|
"lsd:module": true,
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -28,13 +28,14 @@
|
|
|
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/bus-hash-bindings": "
|
|
35
|
-
"@comunica/bus-query-operation": "
|
|
36
|
-
"@comunica/core": "
|
|
37
|
-
"@comunica/types": "
|
|
35
|
+
"@comunica/bus-hash-bindings": "2.5.1-alpha.32.0",
|
|
36
|
+
"@comunica/bus-query-operation": "2.5.1-alpha.32.0",
|
|
37
|
+
"@comunica/core": "2.5.1-alpha.32.0",
|
|
38
|
+
"@comunica/types": "2.5.1-alpha.32.0",
|
|
38
39
|
"sparqlalgebrajs": "^4.0.0"
|
|
39
40
|
},
|
|
40
41
|
"scripts": {
|
|
@@ -42,5 +43,5 @@
|
|
|
42
43
|
"build:ts": "node \"../../node_modules/typescript/bin/tsc\"",
|
|
43
44
|
"build:components": "componentsjs-generator"
|
|
44
45
|
},
|
|
45
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "3f04fbcb28737ec68227d694c127236ecf46235d"
|
|
46
47
|
}
|