@comunica/actor-query-operation-distinct-identity 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/ActorQueryOperationDistinctIdentity.jsonld +26 -16
- package/components/components.jsonld +1 -1
- package/components/context.jsonld +1 -1
- package/lib/ActorQueryOperationDistinctIdentity.d.ts +1 -1
- package/lib/ActorQueryOperationDistinctIdentity.js.map +1 -1
- package/package.json +9 -9
package/README.md
CHANGED
|
@@ -23,7 +23,7 @@ After installing, this package can be added to your engine's configuration as fo
|
|
|
23
23
|
{
|
|
24
24
|
"@context": [
|
|
25
25
|
...
|
|
26
|
-
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-operation-distinct-identity/^
|
|
26
|
+
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-operation-distinct-identity/^5.0.0/components/context.jsonld"
|
|
27
27
|
],
|
|
28
28
|
"actors": [
|
|
29
29
|
...
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"@context": [
|
|
3
|
-
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-operation-distinct-identity/^
|
|
4
|
-
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/core/^
|
|
5
|
-
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-query-operation/^
|
|
3
|
+
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-operation-distinct-identity/^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
6
|
],
|
|
7
7
|
"@id": "npmd:@comunica/actor-query-operation-distinct-identity",
|
|
8
8
|
"components": [
|
|
@@ -15,7 +15,17 @@
|
|
|
15
15
|
"@type": "GenericComponentExtension",
|
|
16
16
|
"component": "cbqo:components/ActorQueryOperationTypedMediated.jsonld#ActorQueryOperationTypedMediated",
|
|
17
17
|
"genericTypeInstances": [
|
|
18
|
-
|
|
18
|
+
{
|
|
19
|
+
"@type": "ParameterRangeIntersection",
|
|
20
|
+
"parameterRangeElements": [
|
|
21
|
+
{
|
|
22
|
+
"@type": "ParameterRangeWildcard"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"@type": "ParameterRangeWildcard"
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
}
|
|
19
29
|
]
|
|
20
30
|
}
|
|
21
31
|
],
|
|
@@ -45,37 +55,37 @@
|
|
|
45
55
|
"genericTypeInstances": [
|
|
46
56
|
{
|
|
47
57
|
"@type": "ParameterRangeGenericTypeReference",
|
|
48
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
58
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
|
|
49
59
|
},
|
|
50
60
|
{
|
|
51
61
|
"@type": "ParameterRangeGenericTypeReference",
|
|
52
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
62
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
|
|
53
63
|
},
|
|
54
64
|
{
|
|
55
65
|
"@type": "ParameterRangeGenericTypeReference",
|
|
56
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
66
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
|
|
57
67
|
},
|
|
58
68
|
{
|
|
59
69
|
"@type": "ParameterRangeGenericTypeReference",
|
|
60
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
70
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
|
|
61
71
|
}
|
|
62
72
|
]
|
|
63
73
|
},
|
|
64
74
|
{
|
|
65
75
|
"@type": "ParameterRangeGenericTypeReference",
|
|
66
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
76
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
|
|
67
77
|
},
|
|
68
78
|
{
|
|
69
79
|
"@type": "ParameterRangeGenericTypeReference",
|
|
70
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
80
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
|
|
71
81
|
},
|
|
72
82
|
{
|
|
73
83
|
"@type": "ParameterRangeGenericTypeReference",
|
|
74
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
84
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
|
|
75
85
|
},
|
|
76
86
|
{
|
|
77
87
|
"@type": "ParameterRangeGenericTypeReference",
|
|
78
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
88
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
|
|
79
89
|
}
|
|
80
90
|
]
|
|
81
91
|
},
|
|
@@ -112,19 +122,19 @@
|
|
|
112
122
|
"genericTypeInstances": [
|
|
113
123
|
{
|
|
114
124
|
"@type": "ParameterRangeGenericTypeReference",
|
|
115
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
125
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
|
|
116
126
|
},
|
|
117
127
|
{
|
|
118
128
|
"@type": "ParameterRangeGenericTypeReference",
|
|
119
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
129
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
|
|
120
130
|
},
|
|
121
131
|
{
|
|
122
132
|
"@type": "ParameterRangeGenericTypeReference",
|
|
123
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
133
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
|
|
124
134
|
},
|
|
125
135
|
{
|
|
126
136
|
"@type": "ParameterRangeGenericTypeReference",
|
|
127
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
137
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
|
|
128
138
|
}
|
|
129
139
|
]
|
|
130
140
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"@context": [
|
|
3
|
-
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-operation-distinct-identity/^
|
|
3
|
+
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-operation-distinct-identity/^5.0.0/components/context.jsonld"
|
|
4
4
|
],
|
|
5
5
|
"@id": "npmd:@comunica/actor-query-operation-distinct-identity",
|
|
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
|
-
"caqodi": "npmd:@comunica/actor-query-operation-distinct-identity/^
|
|
6
|
+
"caqodi": "npmd:@comunica/actor-query-operation-distinct-identity/^5.0.0/",
|
|
7
7
|
"ActorQueryOperationDistinctIdentity": {
|
|
8
8
|
"@id": "caqodi:components/ActorQueryOperationDistinctIdentity.jsonld#ActorQueryOperationDistinctIdentity",
|
|
9
9
|
"@prefix": true,
|
|
@@ -2,8 +2,8 @@ import type { IActorQueryOperationTypedMediatedArgs } from '@comunica/bus-query-
|
|
|
2
2
|
import { ActorQueryOperationTypedMediated } from '@comunica/bus-query-operation';
|
|
3
3
|
import type { IActorTest, TestResult } from '@comunica/core';
|
|
4
4
|
import type { Bindings, IActionContext, IQueryOperationResult } from '@comunica/types';
|
|
5
|
+
import type { Algebra } from '@comunica/utils-algebra';
|
|
5
6
|
import type * as RDF from '@rdfjs/types';
|
|
6
|
-
import type { Algebra } from 'sparqlalgebrajs';
|
|
7
7
|
/**
|
|
8
8
|
* A comunica Distinct Identity Query Operation Actor.
|
|
9
9
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActorQueryOperationDistinctIdentity.js","sourceRoot":"","sources":["ActorQueryOperationDistinctIdentity.ts"],"names":[],"mappings":";;;AACA,uEAEuC;AAEvC,yCAA8C;
|
|
1
|
+
{"version":3,"file":"ActorQueryOperationDistinctIdentity.js","sourceRoot":"","sources":["ActorQueryOperationDistinctIdentity.ts"],"names":[],"mappings":";;;AACA,uEAEuC;AAEvC,yCAA8C;AAU9C,2EAAgF;AAGhF,wCAAwC;AAExC;;GAEG;AACH,MAAa,mCAAoC,SAAQ,sDAAkD;IACzG,YAAmB,IAA8C;QAC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CAAC,QAAkB,EAAE,EAAE;YAC5B,MAAM,QAAQ,GAAW,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,YAAY,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YAC/F,OAAO,CAAC,CAAC,QAAQ,IAAI,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,CAAC;QACpE,CAAC,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,sBAAsB;QACjC,MAAM,UAAU,GAA4B,EAAE,CAAC;QAC/C,OAAO,CAAC,IAAc,EAAE,EAAE;YACxB,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YAC3E,OAAO,CAAC,CAAC,QAAQ,IAAI,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,CAAC;QACpE,CAAC,CAAC;IACJ,CAAC;CACF;AApED,kFAoEC","sourcesContent":["import type { IActorQueryOperationTypedMediatedArgs } from '@comunica/bus-query-operation';\nimport {\n ActorQueryOperationTypedMediated,\n} from '@comunica/bus-query-operation';\nimport type { IActorTest, TestResult } from '@comunica/core';\nimport { passTestVoid } from '@comunica/core';\nimport type {\n Bindings,\n BindingsStream,\n IActionContext,\n IQueryOperationResult,\n IQueryOperationResultBindings,\n IQueryOperationResultQuads,\n} from '@comunica/types';\nimport type { Algebra } from '@comunica/utils-algebra';\nimport { getSafeBindings, getSafeQuads } from '@comunica/utils-query-operation';\nimport type * as RDF from '@rdfjs/types';\nimport type { AsyncIterator } from 'asynciterator';\nimport * as RdfString from 'rdf-string';\n\n/**\n * A comunica Distinct Identity Query Operation Actor.\n */\nexport class ActorQueryOperationDistinctIdentity extends ActorQueryOperationTypedMediated<Algebra.Distinct> {\n public constructor(args: IActorQueryOperationDistinctIdentityArgs) {\n super(args, 'distinct');\n }\n\n public async testOperation(_operation: Algebra.Distinct, _context: IActionContext): Promise<TestResult<IActorTest>> {\n return passTestVoid();\n }\n\n public async runOperation(operation: Algebra.Distinct, context: IActionContext): Promise<IQueryOperationResult> {\n const output = await this.mediatorQueryOperation.mediate({ operation: operation.input, context });\n\n if (output.type === 'quads') {\n const outputQuads: IQueryOperationResultQuads = getSafeQuads(\n output,\n );\n\n const quadStream: AsyncIterator<RDF.Quad> = outputQuads.quadStream\n .filter(await this.newIdentityFilterQuads());\n return {\n type: 'quads',\n quadStream,\n metadata: outputQuads.metadata,\n };\n }\n\n const outputBindings: IQueryOperationResultBindings = getSafeBindings(\n output,\n );\n\n const variables = (await outputBindings.metadata()).variables.map(v => v.variable);\n const bindingsStream: BindingsStream = outputBindings.bindingsStream\n .filter(await this.newIdentityFilter(variables));\n return {\n type: 'bindings',\n bindingsStream,\n metadata: outputBindings.metadata,\n };\n }\n\n /**\n * Create a new distinct filter function.\n * This will maintain an internal Identity datastructure so that every bindings object only returns true once.\n * @param variables The variables to take into account while hashing.\n * @return {(bindings: Bindings) => boolean} A distinct filter for bindings.\n */\n public async newIdentityFilter(\n variables: RDF.Variable[],\n ): Promise<(bindings: Bindings) => boolean> {\n const identities: Record<string, boolean> = {};\n return (bindings: Bindings) => {\n const identity: string = variables.map(v => RdfString.termToString(bindings.get(v))).join('-');\n return !(identity in identities) && (identities[identity] = true);\n };\n }\n\n /**\n * Create a new distinct filter function to Identity quads.\n * This will maintain an internal Identity datastructure so that every quad object only returns true once.\n * @return {(quad: RDF.Quad) => boolean} A distinct filter for quads.\n */\n public async newIdentityFilterQuads(): Promise<(quad: RDF.Quad) => boolean> {\n const identities: Record<string, boolean> = {};\n return (quad: RDF.Quad) => {\n const identity = Object.values(RdfString.quadToStringQuad(quad)).join(' ');\n return !(identity in identities) && (identities[identity] = true);\n };\n }\n}\n\nexport interface IActorQueryOperationDistinctIdentityArgs extends IActorQueryOperationTypedMediatedArgs {\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@comunica/actor-query-operation-distinct-identity",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"description": "A distinct-identity query-operation actor",
|
|
5
5
|
"lsd:module": true,
|
|
6
6
|
"license": "MIT",
|
|
@@ -41,14 +41,14 @@
|
|
|
41
41
|
"build:components": "componentsjs-generator"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@comunica/bus-query-operation": "^
|
|
45
|
-
"@comunica/core": "^
|
|
46
|
-
"@comunica/types": "^
|
|
47
|
-
"@comunica/utils-
|
|
44
|
+
"@comunica/bus-query-operation": "^5.0.0",
|
|
45
|
+
"@comunica/core": "^5.0.0",
|
|
46
|
+
"@comunica/types": "^5.0.0",
|
|
47
|
+
"@comunica/utils-algebra": "^5.0.0",
|
|
48
|
+
"@comunica/utils-query-operation": "^5.0.0",
|
|
48
49
|
"@rdfjs/types": "*",
|
|
49
|
-
"asynciterator": "^3.
|
|
50
|
-
"rdf-string": "^2.0.1"
|
|
51
|
-
"sparqlalgebrajs": "^5.0.2"
|
|
50
|
+
"asynciterator": "^3.10.0",
|
|
51
|
+
"rdf-string": "^2.0.1"
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "0b1756fdb9bef014133432489627c1bd71779bd0"
|
|
54
54
|
}
|