@comunica/actor-rdf-join-entries-sort-selectivity 4.2.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 +42 -0
- package/components/ActorRdfJoinEntriesSortSelectivity.jsonld +205 -0
- package/components/components.jsonld +11 -0
- package/components/context.jsonld +52 -0
- package/lib/ActorRdfJoinEntriesSortSelectivity.d.ts +16 -0
- package/lib/ActorRdfJoinEntriesSortSelectivity.js +39 -0
- package/lib/ActorRdfJoinEntriesSortSelectivity.js.map +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +18 -0
- package/lib/index.js.map +1 -0
- package/package.json +50 -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,42 @@
|
|
|
1
|
+
# Comunica Selectivity RDF Join Entries Sort Actor
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@comunica/actor-rdf-join-entries-sort-selectivity)
|
|
4
|
+
|
|
5
|
+
An [RDF Join Entries Sort](https://github.com/comunica/comunica/tree/master/packages/bus-rdf-join-entries-sort) actor
|
|
6
|
+
that orders join entries by increasing selectivity values,
|
|
7
|
+
so that the join entries that would become most selective come first.
|
|
8
|
+
|
|
9
|
+
This module is part of the [Comunica framework](https://github.com/comunica/comunica),
|
|
10
|
+
and should only be used by [developers that want to build their own query engine](https://comunica.dev/docs/modify/).
|
|
11
|
+
|
|
12
|
+
[Click here if you just want to query with Comunica](https://comunica.dev/docs/query/).
|
|
13
|
+
|
|
14
|
+
## Install
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
$ yarn add @comunica/actor-rdf-join-entries-sort-selectivity
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Configure
|
|
21
|
+
|
|
22
|
+
After installing, this package can be added to your engine's configuration as follows:
|
|
23
|
+
```text
|
|
24
|
+
{
|
|
25
|
+
"@context": [
|
|
26
|
+
...
|
|
27
|
+
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-rdf-join-entries-sort-selectivity/^1.0.0/components/context.jsonld"
|
|
28
|
+
],
|
|
29
|
+
"actors": [
|
|
30
|
+
...
|
|
31
|
+
{
|
|
32
|
+
"@id": "urn:comunica:default:rdf-join-entries-sort/actors#selectivity",
|
|
33
|
+
"@type": "ActorRdfJoinEntriesSortSelectivity",
|
|
34
|
+
"mediatorJoinSelectivity": { "@id": "urn:comunica:default:rdf-join-selectivity/mediators#main" }
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Config Parameters
|
|
41
|
+
|
|
42
|
+
* `mediatorJoinSelectivity`: A mediator over the [Join Selectivity bus](https://github.com/comunica/comunica/tree/master/packages/bus-rdf-join-selectivity).
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
{
|
|
2
|
+
"@context": [
|
|
3
|
+
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-rdf-join-entries-sort-selectivity/^4.0.0/components/context.jsonld",
|
|
4
|
+
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/core/^4.0.0/components/context.jsonld",
|
|
5
|
+
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-rdf-join-entries-sort/^4.0.0/components/context.jsonld"
|
|
6
|
+
],
|
|
7
|
+
"@id": "npmd:@comunica/actor-rdf-join-entries-sort-selectivity",
|
|
8
|
+
"components": [
|
|
9
|
+
{
|
|
10
|
+
"@id": "carjess:components/ActorRdfJoinEntriesSortSelectivity.jsonld#ActorRdfJoinEntriesSortSelectivity",
|
|
11
|
+
"@type": "Class",
|
|
12
|
+
"requireElement": "ActorRdfJoinEntriesSortSelectivity",
|
|
13
|
+
"extends": [
|
|
14
|
+
"cbrjes:components/ActorRdfJoinEntriesSort.jsonld#ActorRdfJoinEntriesSort"
|
|
15
|
+
],
|
|
16
|
+
"comment": "A comunica Selectivity RDF Join Entries Sort Actor.",
|
|
17
|
+
"parameters": [
|
|
18
|
+
{
|
|
19
|
+
"@id": "carjess:components/ActorRdfJoinEntriesSortSelectivity.jsonld#ActorRdfJoinEntriesSortSelectivity_args_mediatorJoinSelectivity",
|
|
20
|
+
"range": "cc:components/Mediator.jsonld#Mediator"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"@id": "carjess:components/ActorRdfJoinEntriesSortSelectivity.jsonld#ActorRdfJoinEntriesSortSelectivity_args_name",
|
|
24
|
+
"range": "xsd:string",
|
|
25
|
+
"default": {
|
|
26
|
+
"@id": "rdf:subject"
|
|
27
|
+
},
|
|
28
|
+
"comment": "The name for this actor."
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"@id": "carjess:components/ActorRdfJoinEntriesSortSelectivity.jsonld#ActorRdfJoinEntriesSortSelectivity_args_bus",
|
|
32
|
+
"range": {
|
|
33
|
+
"@type": "ParameterRangeGenericComponent",
|
|
34
|
+
"component": "cc:components/Bus.jsonld#Bus",
|
|
35
|
+
"genericTypeInstances": [
|
|
36
|
+
{
|
|
37
|
+
"@type": "ParameterRangeGenericComponent",
|
|
38
|
+
"component": "cc:components/Actor.jsonld#Actor",
|
|
39
|
+
"genericTypeInstances": [
|
|
40
|
+
{
|
|
41
|
+
"@type": "ParameterRangeGenericTypeReference",
|
|
42
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"@type": "ParameterRangeGenericTypeReference",
|
|
46
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"@type": "ParameterRangeGenericTypeReference",
|
|
50
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"@type": "ParameterRangeGenericTypeReference",
|
|
54
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
|
|
55
|
+
}
|
|
56
|
+
]
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"@type": "ParameterRangeGenericTypeReference",
|
|
60
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"@type": "ParameterRangeGenericTypeReference",
|
|
64
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"@type": "ParameterRangeGenericTypeReference",
|
|
68
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"@type": "ParameterRangeGenericTypeReference",
|
|
72
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
|
|
73
|
+
}
|
|
74
|
+
]
|
|
75
|
+
},
|
|
76
|
+
"default": {
|
|
77
|
+
"@id": "cbrjes:components/ActorRdfJoinEntriesSort.jsonld#ActorRdfJoinEntriesSort_default_bus",
|
|
78
|
+
"@type": "cc:components/Bus.jsonld#Bus"
|
|
79
|
+
},
|
|
80
|
+
"comment": "The bus this actor subscribes to."
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"@id": "carjess:components/ActorRdfJoinEntriesSortSelectivity.jsonld#ActorRdfJoinEntriesSortSelectivity_args_busFailMessage",
|
|
84
|
+
"range": {
|
|
85
|
+
"@type": "ParameterRangeUnion",
|
|
86
|
+
"parameterRangeElements": [
|
|
87
|
+
"xsd:string",
|
|
88
|
+
{
|
|
89
|
+
"@type": "ParameterRangeUndefined"
|
|
90
|
+
}
|
|
91
|
+
]
|
|
92
|
+
},
|
|
93
|
+
"default": "Sorting join entries failed: none of the configured actors were able to sort",
|
|
94
|
+
"comment": "The message that will be configured in the bus for reporting failures. This message may be a template string that contains references to the executed `action`. For example, the following templated string is allowed: \"RDF dereferencing failed: no actors could handle ${action.handle.mediaType}\""
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"@id": "carjess:components/ActorRdfJoinEntriesSortSelectivity.jsonld#ActorRdfJoinEntriesSortSelectivity_args_beforeActors",
|
|
98
|
+
"range": {
|
|
99
|
+
"@type": "ParameterRangeUnion",
|
|
100
|
+
"parameterRangeElements": [
|
|
101
|
+
{
|
|
102
|
+
"@type": "ParameterRangeArray",
|
|
103
|
+
"parameterRangeValue": {
|
|
104
|
+
"@type": "ParameterRangeGenericComponent",
|
|
105
|
+
"component": "cc:components/Actor.jsonld#Actor",
|
|
106
|
+
"genericTypeInstances": [
|
|
107
|
+
{
|
|
108
|
+
"@type": "ParameterRangeGenericTypeReference",
|
|
109
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"@type": "ParameterRangeGenericTypeReference",
|
|
113
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"@type": "ParameterRangeGenericTypeReference",
|
|
117
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"@type": "ParameterRangeGenericTypeReference",
|
|
121
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
|
|
122
|
+
}
|
|
123
|
+
]
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"@type": "ParameterRangeUndefined"
|
|
128
|
+
}
|
|
129
|
+
]
|
|
130
|
+
},
|
|
131
|
+
"comment": "Actor that must be registered in the bus before this actor."
|
|
132
|
+
}
|
|
133
|
+
],
|
|
134
|
+
"memberFields": [
|
|
135
|
+
{
|
|
136
|
+
"@id": "carjess:components/ActorRdfJoinEntriesSortSelectivity.jsonld#ActorRdfJoinEntriesSortSelectivity__member_mediatorJoinSelectivity",
|
|
137
|
+
"memberFieldName": "mediatorJoinSelectivity",
|
|
138
|
+
"range": "cc:components/Mediator.jsonld#Mediator"
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"@id": "carjess:components/ActorRdfJoinEntriesSortSelectivity.jsonld#ActorRdfJoinEntriesSortSelectivity__member_constructor",
|
|
142
|
+
"memberFieldName": "constructor"
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"@id": "carjess:components/ActorRdfJoinEntriesSortSelectivity.jsonld#ActorRdfJoinEntriesSortSelectivity__member_test",
|
|
146
|
+
"memberFieldName": "test"
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"@id": "carjess:components/ActorRdfJoinEntriesSortSelectivity.jsonld#ActorRdfJoinEntriesSortSelectivity__member_run",
|
|
150
|
+
"memberFieldName": "run"
|
|
151
|
+
}
|
|
152
|
+
],
|
|
153
|
+
"constructorArguments": [
|
|
154
|
+
{
|
|
155
|
+
"@id": "carjess:components/ActorRdfJoinEntriesSortSelectivity.jsonld#ActorRdfJoinEntriesSortSelectivity_args__constructorArgument",
|
|
156
|
+
"fields": [
|
|
157
|
+
{
|
|
158
|
+
"keyRaw": "mediatorJoinSelectivity",
|
|
159
|
+
"value": {
|
|
160
|
+
"@id": "carjess:components/ActorRdfJoinEntriesSortSelectivity.jsonld#ActorRdfJoinEntriesSortSelectivity_args_mediatorJoinSelectivity"
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
"keyRaw": "name",
|
|
165
|
+
"value": {
|
|
166
|
+
"@id": "carjess:components/ActorRdfJoinEntriesSortSelectivity.jsonld#ActorRdfJoinEntriesSortSelectivity_args_name"
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
"keyRaw": "bus",
|
|
171
|
+
"value": {
|
|
172
|
+
"@id": "carjess:components/ActorRdfJoinEntriesSortSelectivity.jsonld#ActorRdfJoinEntriesSortSelectivity_args_bus"
|
|
173
|
+
}
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
"keyRaw": "busFailMessage",
|
|
177
|
+
"value": {
|
|
178
|
+
"@id": "carjess:components/ActorRdfJoinEntriesSortSelectivity.jsonld#ActorRdfJoinEntriesSortSelectivity_args_busFailMessage"
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
"keyRaw": "beforeActors",
|
|
183
|
+
"value": {
|
|
184
|
+
"@id": "carjess:components/ActorRdfJoinEntriesSortSelectivity.jsonld#ActorRdfJoinEntriesSortSelectivity_args_beforeActors"
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
]
|
|
188
|
+
}
|
|
189
|
+
]
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
"@id": "carjess:components/ActorRdfJoinEntriesSortSelectivity.jsonld#IActorRdfJoinEntriesSortSelectivityArgs",
|
|
193
|
+
"@type": "AbstractClass",
|
|
194
|
+
"requireElement": "IActorRdfJoinEntriesSortSelectivityArgs",
|
|
195
|
+
"parameters": [],
|
|
196
|
+
"memberFields": [
|
|
197
|
+
{
|
|
198
|
+
"@id": "carjess:components/ActorRdfJoinEntriesSortSelectivity.jsonld#IActorRdfJoinEntriesSortSelectivityArgs__member_mediatorJoinSelectivity",
|
|
199
|
+
"memberFieldName": "mediatorJoinSelectivity"
|
|
200
|
+
}
|
|
201
|
+
],
|
|
202
|
+
"constructorArguments": []
|
|
203
|
+
}
|
|
204
|
+
]
|
|
205
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"@context": [
|
|
3
|
+
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-rdf-join-entries-sort-selectivity/^4.0.0/components/context.jsonld"
|
|
4
|
+
],
|
|
5
|
+
"@id": "npmd:@comunica/actor-rdf-join-entries-sort-selectivity",
|
|
6
|
+
"@type": "Module",
|
|
7
|
+
"requireName": "@comunica/actor-rdf-join-entries-sort-selectivity",
|
|
8
|
+
"import": [
|
|
9
|
+
"carjess:components/ActorRdfJoinEntriesSortSelectivity.jsonld"
|
|
10
|
+
]
|
|
11
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"@context": [
|
|
3
|
+
"https://linkedsoftwaredependencies.org/bundles/npm/componentsjs/^6.0.0/components/context.jsonld",
|
|
4
|
+
{
|
|
5
|
+
"npmd": "https://linkedsoftwaredependencies.org/bundles/npm/",
|
|
6
|
+
"carjess": "npmd:@comunica/actor-rdf-join-entries-sort-selectivity/^4.0.0/",
|
|
7
|
+
"ActorRdfJoinEntriesSortSelectivity": {
|
|
8
|
+
"@id": "carjess:components/ActorRdfJoinEntriesSortSelectivity.jsonld#ActorRdfJoinEntriesSortSelectivity",
|
|
9
|
+
"@prefix": true,
|
|
10
|
+
"@context": {
|
|
11
|
+
"args_mediatorJoinSelectivity": {
|
|
12
|
+
"@id": "carjess:components/ActorRdfJoinEntriesSortSelectivity.jsonld#ActorRdfJoinEntriesSortSelectivity_args_mediatorJoinSelectivity"
|
|
13
|
+
},
|
|
14
|
+
"args_name": {
|
|
15
|
+
"@id": "carjess:components/ActorRdfJoinEntriesSortSelectivity.jsonld#ActorRdfJoinEntriesSortSelectivity_args_name"
|
|
16
|
+
},
|
|
17
|
+
"args_bus": {
|
|
18
|
+
"@id": "carjess:components/ActorRdfJoinEntriesSortSelectivity.jsonld#ActorRdfJoinEntriesSortSelectivity_args_bus"
|
|
19
|
+
},
|
|
20
|
+
"args_busFailMessage": {
|
|
21
|
+
"@id": "carjess:components/ActorRdfJoinEntriesSortSelectivity.jsonld#ActorRdfJoinEntriesSortSelectivity_args_busFailMessage"
|
|
22
|
+
},
|
|
23
|
+
"args_beforeActors": {
|
|
24
|
+
"@id": "carjess:components/ActorRdfJoinEntriesSortSelectivity.jsonld#ActorRdfJoinEntriesSortSelectivity_args_beforeActors",
|
|
25
|
+
"@container": "@list"
|
|
26
|
+
},
|
|
27
|
+
"mediatorJoinSelectivity": {
|
|
28
|
+
"@id": "carjess:components/ActorRdfJoinEntriesSortSelectivity.jsonld#ActorRdfJoinEntriesSortSelectivity_args_mediatorJoinSelectivity"
|
|
29
|
+
},
|
|
30
|
+
"name": {
|
|
31
|
+
"@id": "carjess:components/ActorRdfJoinEntriesSortSelectivity.jsonld#ActorRdfJoinEntriesSortSelectivity_args_name"
|
|
32
|
+
},
|
|
33
|
+
"bus": {
|
|
34
|
+
"@id": "carjess:components/ActorRdfJoinEntriesSortSelectivity.jsonld#ActorRdfJoinEntriesSortSelectivity_args_bus"
|
|
35
|
+
},
|
|
36
|
+
"busFailMessage": {
|
|
37
|
+
"@id": "carjess:components/ActorRdfJoinEntriesSortSelectivity.jsonld#ActorRdfJoinEntriesSortSelectivity_args_busFailMessage"
|
|
38
|
+
},
|
|
39
|
+
"beforeActors": {
|
|
40
|
+
"@id": "carjess:components/ActorRdfJoinEntriesSortSelectivity.jsonld#ActorRdfJoinEntriesSortSelectivity_args_beforeActors",
|
|
41
|
+
"@container": "@list"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"IActorRdfJoinEntriesSortSelectivityArgs": {
|
|
46
|
+
"@id": "carjess:components/ActorRdfJoinEntriesSortSelectivity.jsonld#IActorRdfJoinEntriesSortSelectivityArgs",
|
|
47
|
+
"@prefix": true,
|
|
48
|
+
"@context": {}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { IActionRdfJoinEntriesSort, IActorRdfJoinEntriesSortOutput, IActorRdfJoinEntriesSortArgs, IActorRdfJoinEntriesSortTest } from '@comunica/bus-rdf-join-entries-sort';
|
|
2
|
+
import { ActorRdfJoinEntriesSort } from '@comunica/bus-rdf-join-entries-sort';
|
|
3
|
+
import type { MediatorRdfJoinSelectivity } from '@comunica/bus-rdf-join-selectivity';
|
|
4
|
+
import type { TestResult } from '@comunica/core';
|
|
5
|
+
/**
|
|
6
|
+
* A comunica Selectivity RDF Join Entries Sort Actor.
|
|
7
|
+
*/
|
|
8
|
+
export declare class ActorRdfJoinEntriesSortSelectivity extends ActorRdfJoinEntriesSort {
|
|
9
|
+
readonly mediatorJoinSelectivity: MediatorRdfJoinSelectivity;
|
|
10
|
+
constructor(args: IActorRdfJoinEntriesSortSelectivityArgs);
|
|
11
|
+
test(_action: IActionRdfJoinEntriesSort): Promise<TestResult<IActorRdfJoinEntriesSortTest>>;
|
|
12
|
+
run(action: IActionRdfJoinEntriesSort): Promise<IActorRdfJoinEntriesSortOutput>;
|
|
13
|
+
}
|
|
14
|
+
export interface IActorRdfJoinEntriesSortSelectivityArgs extends IActorRdfJoinEntriesSortArgs {
|
|
15
|
+
mediatorJoinSelectivity: MediatorRdfJoinSelectivity;
|
|
16
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ActorRdfJoinEntriesSortSelectivity = void 0;
|
|
4
|
+
const bus_rdf_join_entries_sort_1 = require("@comunica/bus-rdf-join-entries-sort");
|
|
5
|
+
const core_1 = require("@comunica/core");
|
|
6
|
+
/**
|
|
7
|
+
* A comunica Selectivity RDF Join Entries Sort Actor.
|
|
8
|
+
*/
|
|
9
|
+
class ActorRdfJoinEntriesSortSelectivity extends bus_rdf_join_entries_sort_1.ActorRdfJoinEntriesSort {
|
|
10
|
+
constructor(args) {
|
|
11
|
+
super(args);
|
|
12
|
+
}
|
|
13
|
+
async test(_action) {
|
|
14
|
+
return (0, core_1.passTest)({ accuracy: 0.501 });
|
|
15
|
+
}
|
|
16
|
+
async run(action) {
|
|
17
|
+
const remainingEntries = [...action.entries];
|
|
18
|
+
const finalEntries = [];
|
|
19
|
+
while (remainingEntries.length > 0) {
|
|
20
|
+
let minSelectivity = Number.MAX_VALUE;
|
|
21
|
+
let minEntryIndex = -1;
|
|
22
|
+
for (const [remainingEntryIndex, remainingEntry] of remainingEntries.entries()) {
|
|
23
|
+
const { selectivity } = await this.mediatorJoinSelectivity.mediate({
|
|
24
|
+
entries: [remainingEntry, ...finalEntries],
|
|
25
|
+
context: action.context,
|
|
26
|
+
});
|
|
27
|
+
if (selectivity < minSelectivity) {
|
|
28
|
+
minSelectivity = selectivity;
|
|
29
|
+
minEntryIndex = remainingEntryIndex;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
finalEntries.push(remainingEntries[minEntryIndex]);
|
|
33
|
+
remainingEntries.splice(minEntryIndex, 1);
|
|
34
|
+
}
|
|
35
|
+
return { entries: finalEntries };
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.ActorRdfJoinEntriesSortSelectivity = ActorRdfJoinEntriesSortSelectivity;
|
|
39
|
+
//# sourceMappingURL=ActorRdfJoinEntriesSortSelectivity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActorRdfJoinEntriesSortSelectivity.js","sourceRoot":"","sources":["ActorRdfJoinEntriesSortSelectivity.ts"],"names":[],"mappings":";;;AAMA,mFAA8E;AAG9E,yCAA0C;AAG1C;;GAEG;AACH,MAAa,kCAAmC,SAAQ,mDAAuB;IAG7E,YAAmB,IAA6C;QAC9D,KAAK,CAAC,IAAI,CAAC,CAAC;IACd,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,OAAkC;QAClD,OAAO,IAAA,eAAQ,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC;IACvC,CAAC;IAEM,KAAK,CAAC,GAAG,CAAC,MAAiC;QAChD,MAAM,gBAAgB,GAAG,CAAE,GAAG,MAAM,CAAC,OAAO,CAAE,CAAC;QAC/C,MAAM,YAAY,GAA6B,EAAE,CAAC;QAElD,OAAO,gBAAgB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACnC,IAAI,cAAc,GAAG,MAAM,CAAC,SAAS,CAAC;YACtC,IAAI,aAAa,GAAG,CAAC,CAAC,CAAC;YACvB,KAAK,MAAM,CAAE,mBAAmB,EAAE,cAAc,CAAE,IAAI,gBAAgB,CAAC,OAAO,EAAE,EAAE,CAAC;gBACjF,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,IAAI,CAAC,uBAAuB,CAAC,OAAO,CAAC;oBACjE,OAAO,EAAE,CAAE,cAAc,EAAE,GAAG,YAAY,CAAE;oBAC5C,OAAO,EAAE,MAAM,CAAC,OAAO;iBACxB,CAAC,CAAC;gBACH,IAAI,WAAW,GAAG,cAAc,EAAE,CAAC;oBACjC,cAAc,GAAG,WAAW,CAAC;oBAC7B,aAAa,GAAG,mBAAmB,CAAC;gBACtC,CAAC;YACH,CAAC;YACD,YAAY,CAAC,IAAI,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC,CAAC;YACnD,gBAAgB,CAAC,MAAM,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC;QAC5C,CAAC;QAED,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC;IACnC,CAAC;CACF;AAlCD,gFAkCC","sourcesContent":["import type {\n IActionRdfJoinEntriesSort,\n IActorRdfJoinEntriesSortOutput,\n IActorRdfJoinEntriesSortArgs,\n IActorRdfJoinEntriesSortTest,\n} from '@comunica/bus-rdf-join-entries-sort';\nimport { ActorRdfJoinEntriesSort } from '@comunica/bus-rdf-join-entries-sort';\nimport type { MediatorRdfJoinSelectivity } from '@comunica/bus-rdf-join-selectivity';\nimport type { TestResult } from '@comunica/core';\nimport { passTest } from '@comunica/core';\nimport type { IJoinEntryWithMetadata } from '@comunica/types';\n\n/**\n * A comunica Selectivity RDF Join Entries Sort Actor.\n */\nexport class ActorRdfJoinEntriesSortSelectivity extends ActorRdfJoinEntriesSort {\n public readonly mediatorJoinSelectivity: MediatorRdfJoinSelectivity;\n\n public constructor(args: IActorRdfJoinEntriesSortSelectivityArgs) {\n super(args);\n }\n\n public async test(_action: IActionRdfJoinEntriesSort): Promise<TestResult<IActorRdfJoinEntriesSortTest>> {\n return passTest({ accuracy: 0.501 });\n }\n\n public async run(action: IActionRdfJoinEntriesSort): Promise<IActorRdfJoinEntriesSortOutput> {\n const remainingEntries = [ ...action.entries ];\n const finalEntries: IJoinEntryWithMetadata[] = [];\n\n while (remainingEntries.length > 0) {\n let minSelectivity = Number.MAX_VALUE;\n let minEntryIndex = -1;\n for (const [ remainingEntryIndex, remainingEntry ] of remainingEntries.entries()) {\n const { selectivity } = await this.mediatorJoinSelectivity.mediate({\n entries: [ remainingEntry, ...finalEntries ],\n context: action.context,\n });\n if (selectivity < minSelectivity) {\n minSelectivity = selectivity;\n minEntryIndex = remainingEntryIndex;\n }\n }\n finalEntries.push(remainingEntries[minEntryIndex]);\n remainingEntries.splice(minEntryIndex, 1);\n }\n\n return { entries: finalEntries };\n }\n}\n\nexport interface IActorRdfJoinEntriesSortSelectivityArgs extends IActorRdfJoinEntriesSortArgs {\n mediatorJoinSelectivity: MediatorRdfJoinSelectivity;\n}\n"]}
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ActorRdfJoinEntriesSortSelectivity';
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./ActorRdfJoinEntriesSortSelectivity"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uEAAqD","sourcesContent":["export * from './ActorRdfJoinEntriesSortSelectivity';\n"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@comunica/actor-rdf-join-entries-sort-selectivity",
|
|
3
|
+
"version": "4.2.0",
|
|
4
|
+
"description": "A selectivity rdf-join-entries-sort actor",
|
|
5
|
+
"lsd:module": true,
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"funding": {
|
|
8
|
+
"type": "opencollective",
|
|
9
|
+
"url": "https://opencollective.com/comunica-association"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://comunica.dev/",
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "https://github.com/comunica/comunica.git",
|
|
15
|
+
"directory": "packages/actor-rdf-join-entries-sort-selectivity"
|
|
16
|
+
},
|
|
17
|
+
"bugs": {
|
|
18
|
+
"url": "https://github.com/comunica/comunica/issues"
|
|
19
|
+
},
|
|
20
|
+
"keywords": [
|
|
21
|
+
"comunica",
|
|
22
|
+
"actor",
|
|
23
|
+
"rdf-join-entries-sort",
|
|
24
|
+
"selectivity"
|
|
25
|
+
],
|
|
26
|
+
"sideEffects": false,
|
|
27
|
+
"main": "lib/index.js",
|
|
28
|
+
"typings": "lib/index",
|
|
29
|
+
"publishConfig": {
|
|
30
|
+
"access": "public"
|
|
31
|
+
},
|
|
32
|
+
"files": [
|
|
33
|
+
"components",
|
|
34
|
+
"lib/**/*.d.ts",
|
|
35
|
+
"lib/**/*.js",
|
|
36
|
+
"lib/**/*.js.map"
|
|
37
|
+
],
|
|
38
|
+
"scripts": {
|
|
39
|
+
"build": "yarn run build:ts && yarn run build:components",
|
|
40
|
+
"build:ts": "node \"../../node_modules/typescript/bin/tsc\"",
|
|
41
|
+
"build:components": "componentsjs-generator"
|
|
42
|
+
},
|
|
43
|
+
"dependencies": {
|
|
44
|
+
"@comunica/bus-rdf-join-entries-sort": "^4.2.0",
|
|
45
|
+
"@comunica/bus-rdf-join-selectivity": "^4.2.0",
|
|
46
|
+
"@comunica/core": "^4.2.0",
|
|
47
|
+
"@comunica/types": "^4.2.0"
|
|
48
|
+
},
|
|
49
|
+
"gitHead": "94e1eacab069551590cc250074b36bce08720c4c"
|
|
50
|
+
}
|