@comunica/actor-rdf-join-inner-multi-smallest 2.0.1-alpha.5.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/LICENSE.txt +22 -0
- package/README.md +43 -0
- package/components/ActorRdfJoinMultiSmallest.jsonld +194 -0
- package/components/components.jsonld +11 -0
- package/components/context.jsonld +52 -0
- package/lib/ActorRdfJoinMultiSmallest.d.ts +22 -0
- package/lib/ActorRdfJoinMultiSmallest.js +76 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +14 -0
- package/package.json +46 -0
package/LICENSE.txt
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright © 2017–now Ruben Taelman, Joachim Van Herwegen
|
|
4
|
+
Comunica Association and Ghent University – imec, Belgium
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in
|
|
14
|
+
all copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
22
|
+
THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Comunica Inner Multi-way Smallest RDF Join Actor
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@comunica/actor-rdf-join-inner-multi-smallest)
|
|
4
|
+
|
|
5
|
+
An [RDF Join](https://github.com/comunica/comunica/tree/master/packages/bus-rdf-join) actor that inner-joins 3 or more streams
|
|
6
|
+
by joining the smallest two, and joining the result with the remaining streams by delegating back to the [RDF Join bus](https://github.com/comunica/comunica/tree/master/packages/bus-rdf-join).
|
|
7
|
+
|
|
8
|
+
This module is part of the [Comunica framework](https://github.com/comunica/comunica),
|
|
9
|
+
and should only be used by [developers that want to build their own query engine](https://comunica.dev/docs/modify/).
|
|
10
|
+
|
|
11
|
+
[Click here if you just want to query with Comunica](https://comunica.dev/docs/query/).
|
|
12
|
+
|
|
13
|
+
## Install
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
$ yarn add @comunica/actor-rdf-join-inner-multi-smallest
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Configure
|
|
20
|
+
|
|
21
|
+
After installing, this package can be added to your engine's configuration as follows:
|
|
22
|
+
```text
|
|
23
|
+
{
|
|
24
|
+
"@context": [
|
|
25
|
+
...
|
|
26
|
+
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-rdf-join-inner-multi-smallest/^2.0.0/components/context.jsonld"
|
|
27
|
+
],
|
|
28
|
+
"actors": [
|
|
29
|
+
...
|
|
30
|
+
{
|
|
31
|
+
"@id": "urn:comunica:default:rdf-join/actors#inner-multi-smallest",
|
|
32
|
+
"@type": "ActorRdfJoinMultiSmallest",
|
|
33
|
+
"mediatorJoinSelectivity": { "@id": "urn:comunica:default:rdf-join-selectivity/mediators#main" },
|
|
34
|
+
"mediatorJoin": { "@id": "urn:comunica:default:rdf-join/mediators#main" }
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Config Parameters
|
|
41
|
+
|
|
42
|
+
* `mediatorJoinSelectivity`: A mediator over the [RDF Join Selectivity bus](https://github.com/comunica/comunica/tree/master/packages/bus-rdf-join-selectivity).
|
|
43
|
+
* `mediatorJoin`: A mediator over the [RDF Join bus](https://github.com/comunica/comunica/tree/master/packages/bus-rdf-join).
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
{
|
|
2
|
+
"@context": [
|
|
3
|
+
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-rdf-join-inner-multi-smallest/^2.0.0/components/context.jsonld",
|
|
4
|
+
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/core/^2.0.0/components/context.jsonld",
|
|
5
|
+
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-rdf-join/^2.0.0/components/context.jsonld"
|
|
6
|
+
],
|
|
7
|
+
"@id": "npmd:@comunica/actor-rdf-join-inner-multi-smallest",
|
|
8
|
+
"components": [
|
|
9
|
+
{
|
|
10
|
+
"@id": "carjimsm:components/ActorRdfJoinMultiSmallest.jsonld#ActorRdfJoinMultiSmallest",
|
|
11
|
+
"@type": "Class",
|
|
12
|
+
"requireElement": "ActorRdfJoinMultiSmallest",
|
|
13
|
+
"extends": [
|
|
14
|
+
"cbrj:components/ActorRdfJoin.jsonld#ActorRdfJoin"
|
|
15
|
+
],
|
|
16
|
+
"comment": "A Multi Smallest RDF Join Actor. It accepts 3 or more streams, joins the smallest two, and joins the result with the remaining streams.",
|
|
17
|
+
"parameters": [
|
|
18
|
+
{
|
|
19
|
+
"@id": "carjimsm:components/ActorRdfJoinMultiSmallest.jsonld#ActorRdfJoinMultiSmallest_args_mediatorJoin",
|
|
20
|
+
"range": "cc:components/Mediator.jsonld#Mediator",
|
|
21
|
+
"comment": "A mediator for joining Bindings streams"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"@id": "carjimsm:components/ActorRdfJoinMultiSmallest.jsonld#ActorRdfJoinMultiSmallest_args_mediatorJoinSelectivity",
|
|
25
|
+
"range": "cc:components/Mediator.jsonld#Mediator"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"@id": "carjimsm:components/ActorRdfJoinMultiSmallest.jsonld#ActorRdfJoinMultiSmallest_args_name",
|
|
29
|
+
"range": "xsd:string",
|
|
30
|
+
"default": {
|
|
31
|
+
"@id": "rdf:subject"
|
|
32
|
+
},
|
|
33
|
+
"comment": "The name for this actor."
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"@id": "carjimsm:components/ActorRdfJoinMultiSmallest.jsonld#ActorRdfJoinMultiSmallest_args_bus",
|
|
37
|
+
"range": {
|
|
38
|
+
"@type": "ParameterRangeGenericComponent",
|
|
39
|
+
"component": "cc:components/Bus.jsonld#Bus",
|
|
40
|
+
"genericTypeInstances": [
|
|
41
|
+
{
|
|
42
|
+
"@type": "ParameterRangeGenericComponent",
|
|
43
|
+
"component": "cc:components/Actor.jsonld#Actor",
|
|
44
|
+
"genericTypeInstances": [
|
|
45
|
+
{
|
|
46
|
+
"@type": "ParameterRangeGenericTypeReference",
|
|
47
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^2.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"@type": "ParameterRangeGenericTypeReference",
|
|
51
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^2.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"@type": "ParameterRangeGenericTypeReference",
|
|
55
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^2.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
|
|
56
|
+
}
|
|
57
|
+
]
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"@type": "ParameterRangeGenericTypeReference",
|
|
61
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^2.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"@type": "ParameterRangeGenericTypeReference",
|
|
65
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^2.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"@type": "ParameterRangeGenericTypeReference",
|
|
69
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^2.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
|
|
70
|
+
}
|
|
71
|
+
]
|
|
72
|
+
},
|
|
73
|
+
"default": {
|
|
74
|
+
"@id": "cbrj:components/ActorRdfJoin.jsonld#ActorRdfJoin_default_bus",
|
|
75
|
+
"@type": "cc:components/Bus.jsonld#Bus"
|
|
76
|
+
},
|
|
77
|
+
"comment": "The bus this actor subscribes to."
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"@id": "carjimsm:components/ActorRdfJoinMultiSmallest.jsonld#ActorRdfJoinMultiSmallest_args_beforeActors",
|
|
81
|
+
"range": {
|
|
82
|
+
"@type": "ParameterRangeUnion",
|
|
83
|
+
"parameterRangeElements": [
|
|
84
|
+
{
|
|
85
|
+
"@type": "ParameterRangeArray",
|
|
86
|
+
"parameterRangeValue": {
|
|
87
|
+
"@type": "ParameterRangeGenericComponent",
|
|
88
|
+
"component": "cc:components/Actor.jsonld#Actor",
|
|
89
|
+
"genericTypeInstances": [
|
|
90
|
+
{
|
|
91
|
+
"@type": "ParameterRangeGenericTypeReference",
|
|
92
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^2.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"@type": "ParameterRangeGenericTypeReference",
|
|
96
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^2.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"@type": "ParameterRangeGenericTypeReference",
|
|
100
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^2.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
|
|
101
|
+
}
|
|
102
|
+
]
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"@type": "ParameterRangeUndefined"
|
|
107
|
+
}
|
|
108
|
+
]
|
|
109
|
+
},
|
|
110
|
+
"comment": "Actor that must be registered in the bus before this actor."
|
|
111
|
+
}
|
|
112
|
+
],
|
|
113
|
+
"memberFields": [
|
|
114
|
+
{
|
|
115
|
+
"@id": "carjimsm:components/ActorRdfJoinMultiSmallest.jsonld#ActorRdfJoinMultiSmallest__member_mediatorJoin",
|
|
116
|
+
"memberFieldName": "mediatorJoin",
|
|
117
|
+
"range": "cc:components/Mediator.jsonld#Mediator"
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"@id": "carjimsm:components/ActorRdfJoinMultiSmallest.jsonld#ActorRdfJoinMultiSmallest__member_FACTORY",
|
|
121
|
+
"memberFieldName": "FACTORY",
|
|
122
|
+
"range": {
|
|
123
|
+
"@type": "ParameterRangeWildcard"
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"@id": "carjimsm:components/ActorRdfJoinMultiSmallest.jsonld#ActorRdfJoinMultiSmallest__member_constructor",
|
|
128
|
+
"memberFieldName": "constructor"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"@id": "carjimsm:components/ActorRdfJoinMultiSmallest.jsonld#ActorRdfJoinMultiSmallest__member_getOutput",
|
|
132
|
+
"memberFieldName": "getOutput"
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
"@id": "carjimsm:components/ActorRdfJoinMultiSmallest.jsonld#ActorRdfJoinMultiSmallest__member_getJoinCoefficients",
|
|
136
|
+
"memberFieldName": "getJoinCoefficients"
|
|
137
|
+
}
|
|
138
|
+
],
|
|
139
|
+
"constructorArguments": [
|
|
140
|
+
{
|
|
141
|
+
"@id": "carjimsm:components/ActorRdfJoinMultiSmallest.jsonld#ActorRdfJoinMultiSmallest_args__constructorArgument",
|
|
142
|
+
"fields": [
|
|
143
|
+
{
|
|
144
|
+
"keyRaw": "mediatorJoin",
|
|
145
|
+
"value": {
|
|
146
|
+
"@id": "carjimsm:components/ActorRdfJoinMultiSmallest.jsonld#ActorRdfJoinMultiSmallest_args_mediatorJoin"
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
"keyRaw": "mediatorJoinSelectivity",
|
|
151
|
+
"value": {
|
|
152
|
+
"@id": "carjimsm:components/ActorRdfJoinMultiSmallest.jsonld#ActorRdfJoinMultiSmallest_args_mediatorJoinSelectivity"
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"keyRaw": "name",
|
|
157
|
+
"value": {
|
|
158
|
+
"@id": "carjimsm:components/ActorRdfJoinMultiSmallest.jsonld#ActorRdfJoinMultiSmallest_args_name"
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
"keyRaw": "bus",
|
|
163
|
+
"value": {
|
|
164
|
+
"@id": "carjimsm:components/ActorRdfJoinMultiSmallest.jsonld#ActorRdfJoinMultiSmallest_args_bus"
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
"keyRaw": "beforeActors",
|
|
169
|
+
"value": {
|
|
170
|
+
"@id": "carjimsm:components/ActorRdfJoinMultiSmallest.jsonld#ActorRdfJoinMultiSmallest_args_beforeActors"
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
]
|
|
174
|
+
}
|
|
175
|
+
]
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
"@id": "carjimsm:components/ActorRdfJoinMultiSmallest.jsonld#IActorRdfJoinMultiSmallestArgs",
|
|
179
|
+
"@type": "AbstractClass",
|
|
180
|
+
"requireElement": "IActorRdfJoinMultiSmallestArgs",
|
|
181
|
+
"extends": [
|
|
182
|
+
"cbrj:components/ActorRdfJoin.jsonld#IActorRdfJoinArgs"
|
|
183
|
+
],
|
|
184
|
+
"parameters": [],
|
|
185
|
+
"memberFields": [
|
|
186
|
+
{
|
|
187
|
+
"@id": "carjimsm:components/ActorRdfJoinMultiSmallest.jsonld#IActorRdfJoinMultiSmallestArgs__member_mediatorJoin",
|
|
188
|
+
"memberFieldName": "mediatorJoin"
|
|
189
|
+
}
|
|
190
|
+
],
|
|
191
|
+
"constructorArguments": []
|
|
192
|
+
}
|
|
193
|
+
]
|
|
194
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"@context": [
|
|
3
|
+
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-rdf-join-inner-multi-smallest/^2.0.0/components/context.jsonld"
|
|
4
|
+
],
|
|
5
|
+
"@id": "npmd:@comunica/actor-rdf-join-inner-multi-smallest",
|
|
6
|
+
"@type": "Module",
|
|
7
|
+
"requireName": "@comunica/actor-rdf-join-inner-multi-smallest",
|
|
8
|
+
"import": [
|
|
9
|
+
"carjimsm:components/ActorRdfJoinMultiSmallest.jsonld"
|
|
10
|
+
]
|
|
11
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"@context": [
|
|
3
|
+
"https://linkedsoftwaredependencies.org/bundles/npm/componentsjs/^4.0.0/components/context.jsonld",
|
|
4
|
+
{
|
|
5
|
+
"npmd": "https://linkedsoftwaredependencies.org/bundles/npm/",
|
|
6
|
+
"carjimsm": "npmd:@comunica/actor-rdf-join-inner-multi-smallest/^2.0.0/",
|
|
7
|
+
"ActorRdfJoinMultiSmallest": {
|
|
8
|
+
"@id": "carjimsm:components/ActorRdfJoinMultiSmallest.jsonld#ActorRdfJoinMultiSmallest",
|
|
9
|
+
"@prefix": true,
|
|
10
|
+
"@context": {
|
|
11
|
+
"args_mediatorJoin": {
|
|
12
|
+
"@id": "carjimsm:components/ActorRdfJoinMultiSmallest.jsonld#ActorRdfJoinMultiSmallest_args_mediatorJoin"
|
|
13
|
+
},
|
|
14
|
+
"args_mediatorJoinSelectivity": {
|
|
15
|
+
"@id": "carjimsm:components/ActorRdfJoinMultiSmallest.jsonld#ActorRdfJoinMultiSmallest_args_mediatorJoinSelectivity"
|
|
16
|
+
},
|
|
17
|
+
"args_name": {
|
|
18
|
+
"@id": "carjimsm:components/ActorRdfJoinMultiSmallest.jsonld#ActorRdfJoinMultiSmallest_args_name"
|
|
19
|
+
},
|
|
20
|
+
"args_bus": {
|
|
21
|
+
"@id": "carjimsm:components/ActorRdfJoinMultiSmallest.jsonld#ActorRdfJoinMultiSmallest_args_bus"
|
|
22
|
+
},
|
|
23
|
+
"args_beforeActors": {
|
|
24
|
+
"@id": "carjimsm:components/ActorRdfJoinMultiSmallest.jsonld#ActorRdfJoinMultiSmallest_args_beforeActors",
|
|
25
|
+
"@container": "@list"
|
|
26
|
+
},
|
|
27
|
+
"mediatorJoin": {
|
|
28
|
+
"@id": "carjimsm:components/ActorRdfJoinMultiSmallest.jsonld#ActorRdfJoinMultiSmallest_args_mediatorJoin"
|
|
29
|
+
},
|
|
30
|
+
"mediatorJoinSelectivity": {
|
|
31
|
+
"@id": "carjimsm:components/ActorRdfJoinMultiSmallest.jsonld#ActorRdfJoinMultiSmallest_args_mediatorJoinSelectivity"
|
|
32
|
+
},
|
|
33
|
+
"name": {
|
|
34
|
+
"@id": "carjimsm:components/ActorRdfJoinMultiSmallest.jsonld#ActorRdfJoinMultiSmallest_args_name"
|
|
35
|
+
},
|
|
36
|
+
"bus": {
|
|
37
|
+
"@id": "carjimsm:components/ActorRdfJoinMultiSmallest.jsonld#ActorRdfJoinMultiSmallest_args_bus"
|
|
38
|
+
},
|
|
39
|
+
"beforeActors": {
|
|
40
|
+
"@id": "carjimsm:components/ActorRdfJoinMultiSmallest.jsonld#ActorRdfJoinMultiSmallest_args_beforeActors",
|
|
41
|
+
"@container": "@list"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"IActorRdfJoinMultiSmallestArgs": {
|
|
46
|
+
"@id": "carjimsm:components/ActorRdfJoinMultiSmallest.jsonld#IActorRdfJoinMultiSmallestArgs",
|
|
47
|
+
"@prefix": true,
|
|
48
|
+
"@context": {}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { IActionRdfJoin, IActorRdfJoinOutputInner, IActorRdfJoinArgs, MediatorRdfJoin } from '@comunica/bus-rdf-join';
|
|
2
|
+
import { ActorRdfJoin } from '@comunica/bus-rdf-join';
|
|
3
|
+
import type { IMediatorTypeJoinCoefficients } from '@comunica/mediatortype-join-coefficients';
|
|
4
|
+
import type { MetadataBindings } from '@comunica/types';
|
|
5
|
+
import { Factory } from 'sparqlalgebrajs';
|
|
6
|
+
/**
|
|
7
|
+
* A Multi Smallest RDF Join Actor.
|
|
8
|
+
* It accepts 3 or more streams, joins the smallest two, and joins the result with the remaining streams.
|
|
9
|
+
*/
|
|
10
|
+
export declare class ActorRdfJoinMultiSmallest extends ActorRdfJoin {
|
|
11
|
+
readonly mediatorJoin: MediatorRdfJoin;
|
|
12
|
+
static readonly FACTORY: Factory;
|
|
13
|
+
constructor(args: IActorRdfJoinMultiSmallestArgs);
|
|
14
|
+
protected getOutput(action: IActionRdfJoin): Promise<IActorRdfJoinOutputInner>;
|
|
15
|
+
protected getJoinCoefficients(action: IActionRdfJoin, metadatas: MetadataBindings[]): Promise<IMediatorTypeJoinCoefficients>;
|
|
16
|
+
}
|
|
17
|
+
export interface IActorRdfJoinMultiSmallestArgs extends IActorRdfJoinArgs {
|
|
18
|
+
/**
|
|
19
|
+
* A mediator for joining Bindings streams
|
|
20
|
+
*/
|
|
21
|
+
mediatorJoin: MediatorRdfJoin;
|
|
22
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ActorRdfJoinMultiSmallest = void 0;
|
|
4
|
+
const bus_query_operation_1 = require("@comunica/bus-query-operation");
|
|
5
|
+
const bus_rdf_join_1 = require("@comunica/bus-rdf-join");
|
|
6
|
+
const sparqlalgebrajs_1 = require("sparqlalgebrajs");
|
|
7
|
+
/**
|
|
8
|
+
* A Multi Smallest RDF Join Actor.
|
|
9
|
+
* It accepts 3 or more streams, joins the smallest two, and joins the result with the remaining streams.
|
|
10
|
+
*/
|
|
11
|
+
class ActorRdfJoinMultiSmallest extends bus_rdf_join_1.ActorRdfJoin {
|
|
12
|
+
constructor(args) {
|
|
13
|
+
super(args, {
|
|
14
|
+
logicalType: 'inner',
|
|
15
|
+
physicalName: 'multi-smallest',
|
|
16
|
+
limitEntries: 3,
|
|
17
|
+
limitEntriesMin: true,
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
async getOutput(action) {
|
|
21
|
+
const entries = [...action.entries];
|
|
22
|
+
// Determine the two smallest streams by estimated count
|
|
23
|
+
const metadatas = await bus_rdf_join_1.ActorRdfJoin.getMetadatas(action.entries);
|
|
24
|
+
const smallestIndex1 = bus_rdf_join_1.ActorRdfJoin.getLowestCardinalityIndex(metadatas);
|
|
25
|
+
const smallestItem1 = entries.splice(smallestIndex1, 1)[0];
|
|
26
|
+
metadatas.splice(smallestIndex1, 1);
|
|
27
|
+
const smallestIndex2 = bus_rdf_join_1.ActorRdfJoin.getLowestCardinalityIndex(metadatas);
|
|
28
|
+
const smallestItem2 = entries.splice(smallestIndex2, 1)[0];
|
|
29
|
+
metadatas.splice(smallestIndex2, 1);
|
|
30
|
+
// Join the two selected streams, and then join the result with the remaining streams
|
|
31
|
+
const firstEntry = {
|
|
32
|
+
output: bus_query_operation_1.ActorQueryOperation.getSafeBindings(await this.mediatorJoin
|
|
33
|
+
.mediate({ type: action.type, entries: [smallestItem1, smallestItem2], context: action.context })),
|
|
34
|
+
operation: ActorRdfJoinMultiSmallest.FACTORY
|
|
35
|
+
.createJoin([smallestItem1.operation, smallestItem2.operation], false),
|
|
36
|
+
};
|
|
37
|
+
entries.push(firstEntry);
|
|
38
|
+
return {
|
|
39
|
+
result: await this.mediatorJoin.mediate({
|
|
40
|
+
type: action.type,
|
|
41
|
+
entries,
|
|
42
|
+
context: action.context,
|
|
43
|
+
}),
|
|
44
|
+
physicalPlanMetadata: {
|
|
45
|
+
smallest: [smallestIndex1, smallestIndex2],
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
async getJoinCoefficients(action, metadatas) {
|
|
50
|
+
metadatas = [...metadatas];
|
|
51
|
+
const requestInitialTimes = bus_rdf_join_1.ActorRdfJoin.getRequestInitialTimes(metadatas);
|
|
52
|
+
const requestItemTimes = bus_rdf_join_1.ActorRdfJoin.getRequestItemTimes(metadatas);
|
|
53
|
+
// Determine the two smallest streams by estimated count
|
|
54
|
+
const smallestIndex1 = bus_rdf_join_1.ActorRdfJoin.getLowestCardinalityIndex(metadatas);
|
|
55
|
+
const metadataSmallest1 = metadatas.splice(smallestIndex1, 1)[0];
|
|
56
|
+
const requestInitialTimeSmallest1 = requestInitialTimes.splice(smallestIndex1, 1)[0];
|
|
57
|
+
const requestItemTimesSmallest1 = requestItemTimes.splice(smallestIndex1, 1)[0];
|
|
58
|
+
const smallestIndex2 = bus_rdf_join_1.ActorRdfJoin.getLowestCardinalityIndex(metadatas);
|
|
59
|
+
const metadataSmallest2 = metadatas.splice(smallestIndex2, 1)[0];
|
|
60
|
+
const requestInitialTimeSmallest2 = requestInitialTimes.splice(smallestIndex2, 1)[0];
|
|
61
|
+
const requestItemTimesSmallest2 = requestItemTimes.splice(smallestIndex2, 1)[0];
|
|
62
|
+
return {
|
|
63
|
+
iterations: metadataSmallest1.cardinality.value * metadataSmallest2.cardinality.value *
|
|
64
|
+
metadatas.reduce((acc, metadata) => acc * metadata.cardinality.value, 1),
|
|
65
|
+
persistedItems: 0,
|
|
66
|
+
blockingItems: 0,
|
|
67
|
+
requestTime: requestInitialTimeSmallest1 + metadataSmallest1.cardinality.value * requestItemTimesSmallest1 +
|
|
68
|
+
requestInitialTimeSmallest2 + metadataSmallest2.cardinality.value * requestItemTimesSmallest2 +
|
|
69
|
+
metadatas.reduce((sum, metadata, i) => sum + requestInitialTimes[i] +
|
|
70
|
+
metadata.cardinality.value * requestItemTimes[i], 0),
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
exports.ActorRdfJoinMultiSmallest = ActorRdfJoinMultiSmallest;
|
|
75
|
+
ActorRdfJoinMultiSmallest.FACTORY = new sparqlalgebrajs_1.Factory();
|
|
76
|
+
//# sourceMappingURL=ActorRdfJoinMultiSmallest.js.map
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ActorRdfJoinMultiSmallest';
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./ActorRdfJoinMultiSmallest"), exports);
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
package/package.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@comunica/actor-rdf-join-inner-multi-smallest",
|
|
3
|
+
"version": "2.0.1-alpha.5.0",
|
|
4
|
+
"description": "A multi-smallest rdf-join actor",
|
|
5
|
+
"lsd:module": true,
|
|
6
|
+
"main": "lib/index.js",
|
|
7
|
+
"typings": "lib/index",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/comunica/comunica.git",
|
|
11
|
+
"directory": "packages/actor-rdf-join-inner-multi-smallest"
|
|
12
|
+
},
|
|
13
|
+
"publishConfig": {
|
|
14
|
+
"access": "public"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"comunica",
|
|
18
|
+
"actor",
|
|
19
|
+
"rdf-join",
|
|
20
|
+
"multi-smallest"
|
|
21
|
+
],
|
|
22
|
+
"license": "MIT",
|
|
23
|
+
"bugs": {
|
|
24
|
+
"url": "https://github.com/comunica/comunica/issues"
|
|
25
|
+
},
|
|
26
|
+
"homepage": "https://comunica.dev/",
|
|
27
|
+
"files": [
|
|
28
|
+
"components",
|
|
29
|
+
"lib/**/*.d.ts",
|
|
30
|
+
"lib/**/*.js"
|
|
31
|
+
],
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"@comunica/bus-query-operation": "2.0.1-alpha.5.0",
|
|
34
|
+
"@comunica/bus-rdf-join": "2.0.1-alpha.5.0",
|
|
35
|
+
"@comunica/core": "2.0.1-alpha.5.0",
|
|
36
|
+
"@comunica/mediatortype-join-coefficients": "2.0.1-alpha.5.0",
|
|
37
|
+
"@comunica/types": "2.0.1-alpha.5.0",
|
|
38
|
+
"sparqlalgebrajs": "^4.0.0"
|
|
39
|
+
},
|
|
40
|
+
"scripts": {
|
|
41
|
+
"build": "npm run build:ts && npm run build:components",
|
|
42
|
+
"build:ts": "node \"../../node_modules/typescript/bin/tsc\"",
|
|
43
|
+
"build:components": "componentsjs-generator"
|
|
44
|
+
},
|
|
45
|
+
"gitHead": "e2ae2e9e924bf0656df60cc99774f7e560d47695"
|
|
46
|
+
}
|