@comunica/actor-query-source-identify-hypermedia-sparql 4.1.0 → 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/README.md +3 -0
- package/components/ActorQuerySourceIdentifyHypermediaSparql.jsonld +71 -0
- package/components/QuerySourceSparql.jsonld +90 -0
- package/components/components.jsonld +0 -0
- package/components/context.jsonld +70 -0
- package/lib/ActorQuerySourceIdentifyHypermediaSparql.d.ts +20 -0
- package/lib/ActorQuerySourceIdentifyHypermediaSparql.js +6 -3
- package/lib/ActorQuerySourceIdentifyHypermediaSparql.js.map +1 -1
- package/lib/QuerySourceSparql.d.ts +22 -3
- package/lib/QuerySourceSparql.js +80 -12
- package/lib/QuerySourceSparql.js.map +1 -1
- package/lib/index.d.ts +0 -0
- package/lib/index.js +0 -0
- package/lib/index.js.map +0 -0
- package/package.json +11 -10
package/README.md
CHANGED
|
@@ -42,6 +42,9 @@ After installing, this package can be added to your engine's configuration as fo
|
|
|
42
42
|
* `mediatorMergeBindingsContext`: A mediator over the [Merge Bindings Context bus](https://github.com/comunica/comunica/tree/master/packages/bus-merge-bindings-context).
|
|
43
43
|
* `checkUrlSuffix`: If URLs ending with '/sparql' should also be considered SPARQL endpoints, defaults to `true`.
|
|
44
44
|
* `forceHttpGet`: If queries should be sent via HTTP GET instead of POST, defaults to `false`.
|
|
45
|
+
* `forceSourceType`: Forces all sources provided to be interpreted as SPARQL endpoints, defaults to `false`.
|
|
45
46
|
* `cacheSize`: The cache size for COUNT queries, defaults to `1024`.
|
|
46
47
|
* `bindMethod`: The query operation for communicating bindings, defaults to `'values'`, alt: `'union'` or `'filter'`.
|
|
47
48
|
* `countTimeout`: Timeout in ms of how long count queries are allowed to take. If the timeout is reached, an infinity cardinality is returned. Defaults to `3000`.
|
|
49
|
+
* `cardinalityCountQueries`: If count queries should be sent to obtain the cardinality of (sub)queries. If set to false, resulting cardinalities will always be considered infinity. Defaults to `true`
|
|
50
|
+
* `cardinalityEstimateConstruction`: If cardinality estimates for larger queries should be constructed locally from (sub)query cardinalities when possible. Defaults to `false`. If set to false, count queries will be sent for every operation at all levels.
|
|
@@ -51,6 +51,20 @@
|
|
|
51
51
|
"default": "1024",
|
|
52
52
|
"comment": "The cache size for COUNT queries."
|
|
53
53
|
},
|
|
54
|
+
{
|
|
55
|
+
"@id": "caqsihs:components/ActorQuerySourceIdentifyHypermediaSparql.jsonld#ActorQuerySourceIdentifyHypermediaSparql_args_forceSourceType",
|
|
56
|
+
"range": {
|
|
57
|
+
"@type": "ParameterRangeUnion",
|
|
58
|
+
"parameterRangeElements": [
|
|
59
|
+
"xsd:boolean",
|
|
60
|
+
{
|
|
61
|
+
"@type": "ParameterRangeUndefined"
|
|
62
|
+
}
|
|
63
|
+
]
|
|
64
|
+
},
|
|
65
|
+
"default": "false",
|
|
66
|
+
"comment": "If provided, forces the source type of a source."
|
|
67
|
+
},
|
|
54
68
|
{
|
|
55
69
|
"@id": "caqsihs:components/ActorQuerySourceIdentifyHypermediaSparql.jsonld#ActorQuerySourceIdentifyHypermediaSparql_args_bindMethod",
|
|
56
70
|
"range": {
|
|
@@ -79,6 +93,18 @@
|
|
|
79
93
|
"default": "3000",
|
|
80
94
|
"comment": "Timeout in ms of how long count queries are allowed to take. If the timeout is reached, an infinity cardinality is returned."
|
|
81
95
|
},
|
|
96
|
+
{
|
|
97
|
+
"@id": "caqsihs:components/ActorQuerySourceIdentifyHypermediaSparql.jsonld#ActorQuerySourceIdentifyHypermediaSparql_args_cardinalityCountQueries",
|
|
98
|
+
"range": "xsd:boolean",
|
|
99
|
+
"default": "true",
|
|
100
|
+
"comment": "If count queries should be sent to obtain the cardinality of (sub)queries. If set to false, resulting cardinalities will always be considered infinity."
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"@id": "caqsihs:components/ActorQuerySourceIdentifyHypermediaSparql.jsonld#ActorQuerySourceIdentifyHypermediaSparql_args_cardinalityEstimateConstruction",
|
|
104
|
+
"range": "xsd:boolean",
|
|
105
|
+
"default": "false",
|
|
106
|
+
"comment": "If estimates for queries should be constructed locally from sub-query cardinalities. If set to false, count queries will used for cardinality estimation at all levels."
|
|
107
|
+
},
|
|
82
108
|
{
|
|
83
109
|
"@id": "caqsihs:components/ActorQuerySourceIdentifyHypermediaSparql.jsonld#ActorQuerySourceIdentifyHypermediaSparql_args_name",
|
|
84
110
|
"range": "xsd:string",
|
|
@@ -217,6 +243,11 @@
|
|
|
217
243
|
"memberFieldName": "cacheSize",
|
|
218
244
|
"range": "xsd:number"
|
|
219
245
|
},
|
|
246
|
+
{
|
|
247
|
+
"@id": "caqsihs:components/ActorQuerySourceIdentifyHypermediaSparql.jsonld#ActorQuerySourceIdentifyHypermediaSparql__member_forceSourceType",
|
|
248
|
+
"memberFieldName": "forceSourceType",
|
|
249
|
+
"range": "xsd:boolean"
|
|
250
|
+
},
|
|
220
251
|
{
|
|
221
252
|
"@id": "caqsihs:components/ActorQuerySourceIdentifyHypermediaSparql.jsonld#ActorQuerySourceIdentifyHypermediaSparql__member_bindMethod",
|
|
222
253
|
"memberFieldName": "bindMethod",
|
|
@@ -243,6 +274,16 @@
|
|
|
243
274
|
"memberFieldName": "countTimeout",
|
|
244
275
|
"range": "xsd:number"
|
|
245
276
|
},
|
|
277
|
+
{
|
|
278
|
+
"@id": "caqsihs:components/ActorQuerySourceIdentifyHypermediaSparql.jsonld#ActorQuerySourceIdentifyHypermediaSparql__member_cardinalityCountQueries",
|
|
279
|
+
"memberFieldName": "cardinalityCountQueries",
|
|
280
|
+
"range": "xsd:boolean"
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
"@id": "caqsihs:components/ActorQuerySourceIdentifyHypermediaSparql.jsonld#ActorQuerySourceIdentifyHypermediaSparql__member_cardinalityEstimateConstruction",
|
|
284
|
+
"memberFieldName": "cardinalityEstimateConstruction",
|
|
285
|
+
"range": "xsd:boolean"
|
|
286
|
+
},
|
|
246
287
|
{
|
|
247
288
|
"@id": "caqsihs:components/ActorQuerySourceIdentifyHypermediaSparql.jsonld#ActorQuerySourceIdentifyHypermediaSparql__member_constructor",
|
|
248
289
|
"memberFieldName": "constructor"
|
|
@@ -290,6 +331,12 @@
|
|
|
290
331
|
"@id": "caqsihs:components/ActorQuerySourceIdentifyHypermediaSparql.jsonld#ActorQuerySourceIdentifyHypermediaSparql_args_cacheSize"
|
|
291
332
|
}
|
|
292
333
|
},
|
|
334
|
+
{
|
|
335
|
+
"keyRaw": "forceSourceType",
|
|
336
|
+
"value": {
|
|
337
|
+
"@id": "caqsihs:components/ActorQuerySourceIdentifyHypermediaSparql.jsonld#ActorQuerySourceIdentifyHypermediaSparql_args_forceSourceType"
|
|
338
|
+
}
|
|
339
|
+
},
|
|
293
340
|
{
|
|
294
341
|
"keyRaw": "bindMethod",
|
|
295
342
|
"value": {
|
|
@@ -302,6 +349,18 @@
|
|
|
302
349
|
"@id": "caqsihs:components/ActorQuerySourceIdentifyHypermediaSparql.jsonld#ActorQuerySourceIdentifyHypermediaSparql_args_countTimeout"
|
|
303
350
|
}
|
|
304
351
|
},
|
|
352
|
+
{
|
|
353
|
+
"keyRaw": "cardinalityCountQueries",
|
|
354
|
+
"value": {
|
|
355
|
+
"@id": "caqsihs:components/ActorQuerySourceIdentifyHypermediaSparql.jsonld#ActorQuerySourceIdentifyHypermediaSparql_args_cardinalityCountQueries"
|
|
356
|
+
}
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
"keyRaw": "cardinalityEstimateConstruction",
|
|
360
|
+
"value": {
|
|
361
|
+
"@id": "caqsihs:components/ActorQuerySourceIdentifyHypermediaSparql.jsonld#ActorQuerySourceIdentifyHypermediaSparql_args_cardinalityEstimateConstruction"
|
|
362
|
+
}
|
|
363
|
+
},
|
|
305
364
|
{
|
|
306
365
|
"keyRaw": "name",
|
|
307
366
|
"value": {
|
|
@@ -356,6 +415,10 @@
|
|
|
356
415
|
"@id": "caqsihs:components/ActorQuerySourceIdentifyHypermediaSparql.jsonld#IActorQuerySourceIdentifyHypermediaSparqlArgs__member_cacheSize",
|
|
357
416
|
"memberFieldName": "cacheSize"
|
|
358
417
|
},
|
|
418
|
+
{
|
|
419
|
+
"@id": "caqsihs:components/ActorQuerySourceIdentifyHypermediaSparql.jsonld#IActorQuerySourceIdentifyHypermediaSparqlArgs__member_forceSourceType",
|
|
420
|
+
"memberFieldName": "forceSourceType"
|
|
421
|
+
},
|
|
359
422
|
{
|
|
360
423
|
"@id": "caqsihs:components/ActorQuerySourceIdentifyHypermediaSparql.jsonld#IActorQuerySourceIdentifyHypermediaSparqlArgs__member_bindMethod",
|
|
361
424
|
"memberFieldName": "bindMethod"
|
|
@@ -363,6 +426,14 @@
|
|
|
363
426
|
{
|
|
364
427
|
"@id": "caqsihs:components/ActorQuerySourceIdentifyHypermediaSparql.jsonld#IActorQuerySourceIdentifyHypermediaSparqlArgs__member_countTimeout",
|
|
365
428
|
"memberFieldName": "countTimeout"
|
|
429
|
+
},
|
|
430
|
+
{
|
|
431
|
+
"@id": "caqsihs:components/ActorQuerySourceIdentifyHypermediaSparql.jsonld#IActorQuerySourceIdentifyHypermediaSparqlArgs__member_cardinalityCountQueries",
|
|
432
|
+
"memberFieldName": "cardinalityCountQueries"
|
|
433
|
+
},
|
|
434
|
+
{
|
|
435
|
+
"@id": "caqsihs:components/ActorQuerySourceIdentifyHypermediaSparql.jsonld#IActorQuerySourceIdentifyHypermediaSparqlArgs__member_cardinalityEstimateConstruction",
|
|
436
|
+
"memberFieldName": "cardinalityEstimateConstruction"
|
|
366
437
|
}
|
|
367
438
|
],
|
|
368
439
|
"constructorArguments": []
|
|
@@ -33,6 +33,14 @@
|
|
|
33
33
|
"@id": "caqsihs:components/QuerySourceSparql.jsonld#QuerySourceSparql_countTimeout",
|
|
34
34
|
"range": "xsd:number"
|
|
35
35
|
},
|
|
36
|
+
{
|
|
37
|
+
"@id": "caqsihs:components/QuerySourceSparql.jsonld#QuerySourceSparql_cardinalityCountQueries",
|
|
38
|
+
"range": "xsd:boolean"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"@id": "caqsihs:components/QuerySourceSparql.jsonld#QuerySourceSparql_cardinalityEstimateConstruction",
|
|
42
|
+
"range": "xsd:boolean"
|
|
43
|
+
},
|
|
36
44
|
{
|
|
37
45
|
"@id": "caqsihs:components/QuerySourceSparql.jsonld#QuerySourceSparql_bindingsFactory",
|
|
38
46
|
"range": "urn:npm:@comunica/utils-bindings-factory:BindingsFactory"
|
|
@@ -65,6 +73,30 @@
|
|
|
65
73
|
]
|
|
66
74
|
}
|
|
67
75
|
},
|
|
76
|
+
{
|
|
77
|
+
"@id": "caqsihs:components/QuerySourceSparql.jsonld#QuerySourceSparql_defaultGraph",
|
|
78
|
+
"range": {
|
|
79
|
+
"@type": "ParameterRangeUnion",
|
|
80
|
+
"parameterRangeElements": [
|
|
81
|
+
"xsd:string",
|
|
82
|
+
{
|
|
83
|
+
"@type": "ParameterRangeUndefined"
|
|
84
|
+
}
|
|
85
|
+
]
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"@id": "caqsihs:components/QuerySourceSparql.jsonld#QuerySourceSparql_unionDefaultGraph",
|
|
90
|
+
"range": {
|
|
91
|
+
"@type": "ParameterRangeUnion",
|
|
92
|
+
"parameterRangeElements": [
|
|
93
|
+
"xsd:boolean",
|
|
94
|
+
{
|
|
95
|
+
"@type": "ParameterRangeUndefined"
|
|
96
|
+
}
|
|
97
|
+
]
|
|
98
|
+
}
|
|
99
|
+
},
|
|
68
100
|
{
|
|
69
101
|
"@id": "caqsihs:components/QuerySourceSparql.jsonld#QuerySourceSparql_dataFactory",
|
|
70
102
|
"range": {
|
|
@@ -76,6 +108,21 @@
|
|
|
76
108
|
}
|
|
77
109
|
]
|
|
78
110
|
}
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"@id": "caqsihs:components/QuerySourceSparql.jsonld#QuerySourceSparql_datasets",
|
|
114
|
+
"range": {
|
|
115
|
+
"@type": "ParameterRangeUnion",
|
|
116
|
+
"parameterRangeElements": [
|
|
117
|
+
{
|
|
118
|
+
"@type": "ParameterRangeArray",
|
|
119
|
+
"parameterRangeValue": "ct:components/IDataset.jsonld#IDataset"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"@type": "ParameterRangeUndefined"
|
|
123
|
+
}
|
|
124
|
+
]
|
|
125
|
+
}
|
|
79
126
|
}
|
|
80
127
|
],
|
|
81
128
|
"memberFields": [
|
|
@@ -111,6 +158,26 @@
|
|
|
111
158
|
"@id": "caqsihs:components/QuerySourceSparql.jsonld#QuerySourceSparql__member_countTimeout",
|
|
112
159
|
"memberFieldName": "countTimeout"
|
|
113
160
|
},
|
|
161
|
+
{
|
|
162
|
+
"@id": "caqsihs:components/QuerySourceSparql.jsonld#QuerySourceSparql__member_cardinalityCountQueries",
|
|
163
|
+
"memberFieldName": "cardinalityCountQueries"
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
"@id": "caqsihs:components/QuerySourceSparql.jsonld#QuerySourceSparql__member_cardinalityEstimateConstruction",
|
|
167
|
+
"memberFieldName": "cardinalityEstimateConstruction"
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
"@id": "caqsihs:components/QuerySourceSparql.jsonld#QuerySourceSparql__member_defaultGraph",
|
|
171
|
+
"memberFieldName": "defaultGraph"
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
"@id": "caqsihs:components/QuerySourceSparql.jsonld#QuerySourceSparql__member_unionDefaultGraph",
|
|
175
|
+
"memberFieldName": "unionDefaultGraph"
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
"@id": "caqsihs:components/QuerySourceSparql.jsonld#QuerySourceSparql__member_datasets",
|
|
179
|
+
"memberFieldName": "datasets"
|
|
180
|
+
},
|
|
114
181
|
{
|
|
115
182
|
"@id": "caqsihs:components/QuerySourceSparql.jsonld#QuerySourceSparql__member_dataFactory",
|
|
116
183
|
"memberFieldName": "dataFactory"
|
|
@@ -163,6 +230,14 @@
|
|
|
163
230
|
"@id": "caqsihs:components/QuerySourceSparql.jsonld#QuerySourceSparql__member_attachMetadata",
|
|
164
231
|
"memberFieldName": "attachMetadata"
|
|
165
232
|
},
|
|
233
|
+
{
|
|
234
|
+
"@id": "caqsihs:components/QuerySourceSparql.jsonld#QuerySourceSparql__member_operationToNormalizedCountQuery",
|
|
235
|
+
"memberFieldName": "operationToNormalizedCountQuery"
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
"@id": "caqsihs:components/QuerySourceSparql.jsonld#QuerySourceSparql__member_estimateOperationCardinality",
|
|
239
|
+
"memberFieldName": "estimateOperationCardinality"
|
|
240
|
+
},
|
|
166
241
|
{
|
|
167
242
|
"@id": "caqsihs:components/QuerySourceSparql.jsonld#QuerySourceSparql__member_addBindingsToOperation",
|
|
168
243
|
"memberFieldName": "addBindingsToOperation"
|
|
@@ -222,6 +297,21 @@
|
|
|
222
297
|
},
|
|
223
298
|
{
|
|
224
299
|
"@id": "caqsihs:components/QuerySourceSparql.jsonld#QuerySourceSparql_countTimeout"
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
"@id": "caqsihs:components/QuerySourceSparql.jsonld#QuerySourceSparql_cardinalityCountQueries"
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
"@id": "caqsihs:components/QuerySourceSparql.jsonld#QuerySourceSparql_cardinalityEstimateConstruction"
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
"@id": "caqsihs:components/QuerySourceSparql.jsonld#QuerySourceSparql_defaultGraph"
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
"@id": "caqsihs:components/QuerySourceSparql.jsonld#QuerySourceSparql_unionDefaultGraph"
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
"@id": "caqsihs:components/QuerySourceSparql.jsonld#QuerySourceSparql_datasets"
|
|
225
315
|
}
|
|
226
316
|
]
|
|
227
317
|
}
|
|
File without changes
|
|
@@ -23,12 +23,21 @@
|
|
|
23
23
|
"args_cacheSize": {
|
|
24
24
|
"@id": "caqsihs:components/ActorQuerySourceIdentifyHypermediaSparql.jsonld#ActorQuerySourceIdentifyHypermediaSparql_args_cacheSize"
|
|
25
25
|
},
|
|
26
|
+
"args_forceSourceType": {
|
|
27
|
+
"@id": "caqsihs:components/ActorQuerySourceIdentifyHypermediaSparql.jsonld#ActorQuerySourceIdentifyHypermediaSparql_args_forceSourceType"
|
|
28
|
+
},
|
|
26
29
|
"args_bindMethod": {
|
|
27
30
|
"@id": "caqsihs:components/ActorQuerySourceIdentifyHypermediaSparql.jsonld#ActorQuerySourceIdentifyHypermediaSparql_args_bindMethod"
|
|
28
31
|
},
|
|
29
32
|
"args_countTimeout": {
|
|
30
33
|
"@id": "caqsihs:components/ActorQuerySourceIdentifyHypermediaSparql.jsonld#ActorQuerySourceIdentifyHypermediaSparql_args_countTimeout"
|
|
31
34
|
},
|
|
35
|
+
"args_cardinalityCountQueries": {
|
|
36
|
+
"@id": "caqsihs:components/ActorQuerySourceIdentifyHypermediaSparql.jsonld#ActorQuerySourceIdentifyHypermediaSparql_args_cardinalityCountQueries"
|
|
37
|
+
},
|
|
38
|
+
"args_cardinalityEstimateConstruction": {
|
|
39
|
+
"@id": "caqsihs:components/ActorQuerySourceIdentifyHypermediaSparql.jsonld#ActorQuerySourceIdentifyHypermediaSparql_args_cardinalityEstimateConstruction"
|
|
40
|
+
},
|
|
32
41
|
"args_name": {
|
|
33
42
|
"@id": "caqsihs:components/ActorQuerySourceIdentifyHypermediaSparql.jsonld#ActorQuerySourceIdentifyHypermediaSparql_args_name"
|
|
34
43
|
},
|
|
@@ -57,12 +66,21 @@
|
|
|
57
66
|
"cacheSize": {
|
|
58
67
|
"@id": "caqsihs:components/ActorQuerySourceIdentifyHypermediaSparql.jsonld#ActorQuerySourceIdentifyHypermediaSparql_args_cacheSize"
|
|
59
68
|
},
|
|
69
|
+
"forceSourceType": {
|
|
70
|
+
"@id": "caqsihs:components/ActorQuerySourceIdentifyHypermediaSparql.jsonld#ActorQuerySourceIdentifyHypermediaSparql_args_forceSourceType"
|
|
71
|
+
},
|
|
60
72
|
"bindMethod": {
|
|
61
73
|
"@id": "caqsihs:components/ActorQuerySourceIdentifyHypermediaSparql.jsonld#ActorQuerySourceIdentifyHypermediaSparql_args_bindMethod"
|
|
62
74
|
},
|
|
63
75
|
"countTimeout": {
|
|
64
76
|
"@id": "caqsihs:components/ActorQuerySourceIdentifyHypermediaSparql.jsonld#ActorQuerySourceIdentifyHypermediaSparql_args_countTimeout"
|
|
65
77
|
},
|
|
78
|
+
"cardinalityCountQueries": {
|
|
79
|
+
"@id": "caqsihs:components/ActorQuerySourceIdentifyHypermediaSparql.jsonld#ActorQuerySourceIdentifyHypermediaSparql_args_cardinalityCountQueries"
|
|
80
|
+
},
|
|
81
|
+
"cardinalityEstimateConstruction": {
|
|
82
|
+
"@id": "caqsihs:components/ActorQuerySourceIdentifyHypermediaSparql.jsonld#ActorQuerySourceIdentifyHypermediaSparql_args_cardinalityEstimateConstruction"
|
|
83
|
+
},
|
|
66
84
|
"name": {
|
|
67
85
|
"@id": "caqsihs:components/ActorQuerySourceIdentifyHypermediaSparql.jsonld#ActorQuerySourceIdentifyHypermediaSparql_args_name"
|
|
68
86
|
},
|
|
@@ -102,6 +120,12 @@
|
|
|
102
120
|
"countTimeout": {
|
|
103
121
|
"@id": "caqsihs:components/QuerySourceSparql.jsonld#QuerySourceSparql_countTimeout"
|
|
104
122
|
},
|
|
123
|
+
"cardinalityCountQueries": {
|
|
124
|
+
"@id": "caqsihs:components/QuerySourceSparql.jsonld#QuerySourceSparql_cardinalityCountQueries"
|
|
125
|
+
},
|
|
126
|
+
"cardinalityEstimateConstruction": {
|
|
127
|
+
"@id": "caqsihs:components/QuerySourceSparql.jsonld#QuerySourceSparql_cardinalityEstimateConstruction"
|
|
128
|
+
},
|
|
105
129
|
"bindingsFactory": {
|
|
106
130
|
"@id": "caqsihs:components/QuerySourceSparql.jsonld#QuerySourceSparql_bindingsFactory"
|
|
107
131
|
},
|
|
@@ -114,8 +138,54 @@
|
|
|
114
138
|
"bindMethod": {
|
|
115
139
|
"@id": "caqsihs:components/QuerySourceSparql.jsonld#QuerySourceSparql_bindMethod"
|
|
116
140
|
},
|
|
141
|
+
"defaultGraph": {
|
|
142
|
+
"@id": "caqsihs:components/QuerySourceSparql.jsonld#QuerySourceSparql_defaultGraph"
|
|
143
|
+
},
|
|
144
|
+
"unionDefaultGraph": {
|
|
145
|
+
"@id": "caqsihs:components/QuerySourceSparql.jsonld#QuerySourceSparql_unionDefaultGraph"
|
|
146
|
+
},
|
|
117
147
|
"dataFactory": {
|
|
118
148
|
"@id": "caqsihs:components/QuerySourceSparql.jsonld#QuerySourceSparql_dataFactory"
|
|
149
|
+
},
|
|
150
|
+
"datasets": {
|
|
151
|
+
"@id": "caqsihs:components/QuerySourceSparql.jsonld#QuerySourceSparql_datasets",
|
|
152
|
+
"@container": "@list"
|
|
153
|
+
},
|
|
154
|
+
"ctory": {
|
|
155
|
+
"@id": "caqsihs:components/QuerySourceSparql.jsonld#QuerySourceSparql_algebraFactory"
|
|
156
|
+
},
|
|
157
|
+
"Get": {
|
|
158
|
+
"@id": "caqsihs:components/QuerySourceSparql.jsonld#QuerySourceSparql_forceHttpGet"
|
|
159
|
+
},
|
|
160
|
+
"": {
|
|
161
|
+
"@id": "caqsihs:components/QuerySourceSparql.jsonld#QuerySourceSparql_cacheSize"
|
|
162
|
+
},
|
|
163
|
+
"out": {
|
|
164
|
+
"@id": "caqsihs:components/QuerySourceSparql.jsonld#QuerySourceSparql_countTimeout"
|
|
165
|
+
},
|
|
166
|
+
"tyCountQueries": {
|
|
167
|
+
"@id": "caqsihs:components/QuerySourceSparql.jsonld#QuerySourceSparql_cardinalityCountQueries"
|
|
168
|
+
},
|
|
169
|
+
"tyEstimateConstruction": {
|
|
170
|
+
"@id": "caqsihs:components/QuerySourceSparql.jsonld#QuerySourceSparql_cardinalityEstimateConstruction"
|
|
171
|
+
},
|
|
172
|
+
"actory": {
|
|
173
|
+
"@id": "caqsihs:components/QuerySourceSparql.jsonld#QuerySourceSparql_bindingsFactory"
|
|
174
|
+
},
|
|
175
|
+
"ttp": {
|
|
176
|
+
"@id": "caqsihs:components/QuerySourceSparql.jsonld#QuerySourceSparql_mediatorHttp"
|
|
177
|
+
},
|
|
178
|
+
"d": {
|
|
179
|
+
"@id": "caqsihs:components/QuerySourceSparql.jsonld#QuerySourceSparql_bindMethod"
|
|
180
|
+
},
|
|
181
|
+
"aph": {
|
|
182
|
+
"@id": "caqsihs:components/QuerySourceSparql.jsonld#QuerySourceSparql_defaultGraph"
|
|
183
|
+
},
|
|
184
|
+
"ultGraph": {
|
|
185
|
+
"@id": "caqsihs:components/QuerySourceSparql.jsonld#QuerySourceSparql_unionDefaultGraph"
|
|
186
|
+
},
|
|
187
|
+
"ry": {
|
|
188
|
+
"@id": "caqsihs:components/QuerySourceSparql.jsonld#QuerySourceSparql_dataFactory"
|
|
119
189
|
}
|
|
120
190
|
}
|
|
121
191
|
}
|
|
@@ -12,8 +12,11 @@ export declare class ActorQuerySourceIdentifyHypermediaSparql extends ActorQuery
|
|
|
12
12
|
readonly checkUrlSuffix: boolean;
|
|
13
13
|
readonly forceHttpGet: boolean;
|
|
14
14
|
readonly cacheSize: number;
|
|
15
|
+
readonly forceSourceType: boolean;
|
|
15
16
|
readonly bindMethod: BindMethod;
|
|
16
17
|
readonly countTimeout: number;
|
|
18
|
+
readonly cardinalityCountQueries: boolean;
|
|
19
|
+
readonly cardinalityEstimateConstruction: boolean;
|
|
17
20
|
constructor(args: IActorQuerySourceIdentifyHypermediaSparqlArgs);
|
|
18
21
|
testMetadata(action: IActionQuerySourceIdentifyHypermedia): Promise<TestResult<IActorQuerySourceIdentifyHypermediaTest>>;
|
|
19
22
|
run(action: IActionQuerySourceIdentifyHypermedia): Promise<IActorQuerySourceIdentifyHypermediaOutput>;
|
|
@@ -43,6 +46,11 @@ export interface IActorQuerySourceIdentifyHypermediaSparqlArgs extends IActorQue
|
|
|
43
46
|
* @default {1024}
|
|
44
47
|
*/
|
|
45
48
|
cacheSize?: number;
|
|
49
|
+
/**
|
|
50
|
+
* If provided, forces the source type of a source.
|
|
51
|
+
* @default {false}
|
|
52
|
+
*/
|
|
53
|
+
forceSourceType?: boolean;
|
|
46
54
|
/**
|
|
47
55
|
* The query operation for communicating bindings.
|
|
48
56
|
* @default {values}
|
|
@@ -54,5 +62,17 @@ export interface IActorQuerySourceIdentifyHypermediaSparqlArgs extends IActorQue
|
|
|
54
62
|
* @default {3000}
|
|
55
63
|
*/
|
|
56
64
|
countTimeout: number;
|
|
65
|
+
/**
|
|
66
|
+
* If count queries should be sent to obtain the cardinality of (sub)queries.
|
|
67
|
+
* If set to false, resulting cardinalities will always be considered infinity.
|
|
68
|
+
* @default {true}
|
|
69
|
+
*/
|
|
70
|
+
cardinalityCountQueries: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* If estimates for queries should be constructed locally from sub-query cardinalities.
|
|
73
|
+
* If set to false, count queries will used for cardinality estimation at all levels.
|
|
74
|
+
* @default {false}
|
|
75
|
+
*/
|
|
76
|
+
cardinalityEstimateConstruction: boolean;
|
|
57
77
|
}
|
|
58
78
|
export type BindMethod = 'values' | 'union' | 'filter';
|
|
@@ -15,8 +15,8 @@ class ActorQuerySourceIdentifyHypermediaSparql extends bus_query_source_identify
|
|
|
15
15
|
super(args, 'sparql');
|
|
16
16
|
}
|
|
17
17
|
async testMetadata(action) {
|
|
18
|
-
if (!action.forceSourceType && !action.metadata.sparqlService &&
|
|
19
|
-
!(this.checkUrlSuffix && action.url.endsWith('/sparql'))) {
|
|
18
|
+
if (!action.forceSourceType && !this.forceSourceType && !action.metadata.sparqlService &&
|
|
19
|
+
!(this.checkUrlSuffix && (action.url.endsWith('/sparql') || action.url.endsWith('/sparql/')))) {
|
|
20
20
|
return (0, core_1.failTest)(`Actor ${this.name} could not detect a SPARQL service description or URL ending on /sparql.`);
|
|
21
21
|
}
|
|
22
22
|
return (0, core_1.passTest)({ filterFactor: 1 });
|
|
@@ -25,7 +25,10 @@ class ActorQuerySourceIdentifyHypermediaSparql extends bus_query_source_identify
|
|
|
25
25
|
this.logInfo(action.context, `Identified ${action.url} as sparql source with service URL: ${action.metadata.sparqlService || action.url}`);
|
|
26
26
|
const dataFactory = action.context.getSafe(context_entries_1.KeysInitQuery.dataFactory);
|
|
27
27
|
const algebraFactory = new sparqlalgebrajs_1.Factory(dataFactory);
|
|
28
|
-
const
|
|
28
|
+
const isSingularSource = action.context.get(context_entries_1.KeysQueryOperation.querySources)?.length === 1;
|
|
29
|
+
const source = new QuerySourceSparql_1.QuerySourceSparql((action.forceSourceType ?? this.forceSourceType) ? action.url : action.metadata.sparqlService || action.url, action.context, this.mediatorHttp, this.bindMethod, dataFactory, algebraFactory, await utils_bindings_factory_1.BindingsFactory.create(this.mediatorMergeBindingsContext, action.context, dataFactory), this.forceHttpGet, this.cacheSize, this.countTimeout,
|
|
30
|
+
// Cardinalities can be infinity when we're querying just a single source.
|
|
31
|
+
this.cardinalityCountQueries && !isSingularSource, this.cardinalityEstimateConstruction, action.metadata.defaultGraph, action.metadata.unionDefaultGraph, action.metadata.datasets);
|
|
29
32
|
return { source };
|
|
30
33
|
}
|
|
31
34
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActorQuerySourceIdentifyHypermediaSparql.js","sourceRoot":"","sources":["ActorQuerySourceIdentifyHypermediaSparql.ts"],"names":[],"mappings":";;;AAQA,yGAEwD;AACxD,+
|
|
1
|
+
{"version":3,"file":"ActorQuerySourceIdentifyHypermediaSparql.js","sourceRoot":"","sources":["ActorQuerySourceIdentifyHypermediaSparql.ts"],"names":[],"mappings":";;;AAQA,yGAEwD;AACxD,+DAA8E;AAE9E,yCAAoD;AAEpD,6EAAmE;AACnE,qDAA0C;AAC1C,2DAAwD;AAExD;;GAEG;AACH,MAAa,wCAAyC,SAAQ,yEAAkC;I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aAAa,IAAI,MAAM,CAAC,GAAG,EAC3G,MAAM,CAAC,OAAO,EACd,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,UAAU,EACf,WAAW,EACX,cAAc,EACd,MAAM,wCAAe,CAAC,MAAM,CAAC,IAAI,CAAC,4BAA4B,EAAE,MAAM,CAAC,OAAO,EAAE,WAAW,CAAC,EAC5F,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,SAAS,EACd,IAAI,CAAC,YAAY;QACjB,0EAA0E;QAC1E,IAAI,CAAC,uBAAuB,IAAI,CAAC,gBAAgB,EACjD,IAAI,CAAC,+BAA+B,EACpC,MAAM,CAAC,QAAQ,CAAC,YAAY,EAC5B,MAAM,CAAC,QAAQ,CAAC,iBAAiB,EACjC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CACzB,CAAC;QACF,OAAO,EAAE,MAAM,EAAE,CAAC;IACpB,CAAC;CACF;AApDD,4FAoDC","sourcesContent":["import type { MediatorHttp } from '@comunica/bus-http';\nimport type { MediatorMergeBindingsContext } from '@comunica/bus-merge-bindings-context';\nimport type {\n IActionQuerySourceIdentifyHypermedia,\n IActorQuerySourceIdentifyHypermediaOutput,\n IActorQuerySourceIdentifyHypermediaArgs,\n IActorQuerySourceIdentifyHypermediaTest,\n} from '@comunica/bus-query-source-identify-hypermedia';\nimport {\n ActorQuerySourceIdentifyHypermedia,\n} from '@comunica/bus-query-source-identify-hypermedia';\nimport { KeysInitQuery, KeysQueryOperation } from '@comunica/context-entries';\nimport type { TestResult } from '@comunica/core';\nimport { failTest, passTest } from '@comunica/core';\nimport type { ComunicaDataFactory } from '@comunica/types';\nimport { BindingsFactory } from '@comunica/utils-bindings-factory';\nimport { Factory } from 'sparqlalgebrajs';\nimport { QuerySourceSparql } from './QuerySourceSparql';\n\n/**\n * A comunica SPARQL Query Source Identify Hypermedia Actor.\n */\nexport class ActorQuerySourceIdentifyHypermediaSparql extends ActorQuerySourceIdentifyHypermedia {\n public readonly mediatorHttp: MediatorHttp;\n public readonly mediatorMergeBindingsContext: MediatorMergeBindingsContext;\n public readonly checkUrlSuffix: boolean;\n public readonly forceHttpGet: boolean;\n public readonly cacheSize: number;\n public readonly forceSourceType: boolean;\n public readonly bindMethod: BindMethod;\n public readonly countTimeout: number;\n public readonly cardinalityCountQueries: boolean;\n public readonly cardinalityEstimateConstruction: boolean;\n\n public constructor(args: IActorQuerySourceIdentifyHypermediaSparqlArgs) {\n super(args, 'sparql');\n }\n\n public async testMetadata(\n action: IActionQuerySourceIdentifyHypermedia,\n ): Promise<TestResult<IActorQuerySourceIdentifyHypermediaTest>> {\n if (!action.forceSourceType && !this.forceSourceType && !action.metadata.sparqlService &&\n !(this.checkUrlSuffix && (action.url.endsWith('/sparql') || action.url.endsWith('/sparql/')))) {\n return failTest(`Actor ${this.name} could not detect a SPARQL service description or URL ending on /sparql.`);\n }\n return passTest({ filterFactor: 1 });\n }\n\n public async run(action: IActionQuerySourceIdentifyHypermedia): Promise<IActorQuerySourceIdentifyHypermediaOutput> {\n this.logInfo(action.context, `Identified ${action.url} as sparql source with service URL: ${action.metadata.sparqlService || action.url}`);\n\n const dataFactory: ComunicaDataFactory = action.context.getSafe(KeysInitQuery.dataFactory);\n const algebraFactory = new Factory(dataFactory);\n const isSingularSource = action.context.get(KeysQueryOperation.querySources)?.length === 1;\n const source = new QuerySourceSparql(\n (action.forceSourceType ?? this.forceSourceType) ? action.url : action.metadata.sparqlService || action.url,\n action.context,\n this.mediatorHttp,\n this.bindMethod,\n dataFactory,\n algebraFactory,\n await BindingsFactory.create(this.mediatorMergeBindingsContext, action.context, dataFactory),\n this.forceHttpGet,\n this.cacheSize,\n this.countTimeout,\n // Cardinalities can be infinity when we're querying just a single source.\n this.cardinalityCountQueries && !isSingularSource,\n this.cardinalityEstimateConstruction,\n action.metadata.defaultGraph,\n action.metadata.unionDefaultGraph,\n action.metadata.datasets,\n );\n return { source };\n }\n}\n\nexport interface IActorQuerySourceIdentifyHypermediaSparqlArgs extends IActorQuerySourceIdentifyHypermediaArgs {\n /**\n * The HTTP mediator\n */\n mediatorHttp: MediatorHttp;\n /**\n * A mediator for creating binding context merge handlers\n */\n mediatorMergeBindingsContext: MediatorMergeBindingsContext;\n /**\n * If URLs ending with '/sparql' should also be considered SPARQL endpoints.\n * @default {true}\n */\n checkUrlSuffix: boolean;\n /**\n * If non-update queries should be sent via HTTP GET instead of POST\n * @default {false}\n */\n forceHttpGet: boolean;\n /**\n * The cache size for COUNT queries.\n * @range {integer}\n * @default {1024}\n */\n cacheSize?: number;\n /**\n * If provided, forces the source type of a source.\n * @default {false}\n */\n forceSourceType?: boolean;\n /**\n * The query operation for communicating bindings.\n * @default {values}\n */\n bindMethod: BindMethod;\n /**\n * Timeout in ms of how long count queries are allowed to take.\n * If the timeout is reached, an infinity cardinality is returned.\n * @default {3000}\n */\n countTimeout: number;\n /**\n * If count queries should be sent to obtain the cardinality of (sub)queries.\n * If set to false, resulting cardinalities will always be considered infinity.\n * @default {true}\n */\n cardinalityCountQueries: boolean;\n /**\n * If estimates for queries should be constructed locally from sub-query cardinalities.\n * If set to false, count queries will used for cardinality estimation at all levels.\n * @default {false}\n */\n cardinalityEstimateConstruction: boolean;\n}\n\nexport type BindMethod = 'values' | 'union' | 'filter';\n"]}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { MediatorHttp } from '@comunica/bus-http';
|
|
2
|
-
import type { BindingsStream, ComunicaDataFactory, FragmentSelectorShape, IActionContext, IQueryBindingsOptions, IQuerySource, MetadataBindings } from '@comunica/types';
|
|
2
|
+
import type { BindingsStream, ComunicaDataFactory, FragmentSelectorShape, IActionContext, IDataset, IQueryBindingsOptions, IQuerySource, MetadataBindings, QueryResultCardinality } from '@comunica/types';
|
|
3
3
|
import type { BindingsFactory } from '@comunica/utils-bindings-factory';
|
|
4
4
|
import type * as RDF from '@rdfjs/types';
|
|
5
5
|
import type { AsyncIterator } from 'asynciterator';
|
|
6
|
-
import type { Factory
|
|
6
|
+
import type { Factory } from 'sparqlalgebrajs';
|
|
7
|
+
import { Algebra } from 'sparqlalgebrajs';
|
|
7
8
|
import type { BindMethod } from './ActorQuerySourceIdentifyHypermediaSparql';
|
|
8
9
|
export declare class QuerySourceSparql implements IQuerySource {
|
|
9
10
|
protected static readonly SELECTOR_SHAPE: FragmentSelectorShape;
|
|
@@ -13,19 +14,37 @@ export declare class QuerySourceSparql implements IQuerySource {
|
|
|
13
14
|
private readonly mediatorHttp;
|
|
14
15
|
private readonly bindMethod;
|
|
15
16
|
private readonly countTimeout;
|
|
17
|
+
private readonly cardinalityCountQueries;
|
|
18
|
+
private readonly cardinalityEstimateConstruction;
|
|
19
|
+
private readonly defaultGraph?;
|
|
20
|
+
private readonly unionDefaultGraph;
|
|
21
|
+
private readonly datasets?;
|
|
16
22
|
private readonly dataFactory;
|
|
17
23
|
private readonly algebraFactory;
|
|
18
24
|
private readonly bindingsFactory;
|
|
19
25
|
private readonly endpointFetcher;
|
|
20
26
|
private readonly cache;
|
|
21
27
|
private lastSourceContext;
|
|
22
|
-
constructor(url: string, context: IActionContext, mediatorHttp: MediatorHttp, bindMethod: BindMethod, dataFactory: ComunicaDataFactory, algebraFactory: Factory, bindingsFactory: BindingsFactory, forceHttpGet: boolean, cacheSize: number, countTimeout: number);
|
|
28
|
+
constructor(url: string, context: IActionContext, mediatorHttp: MediatorHttp, bindMethod: BindMethod, dataFactory: ComunicaDataFactory, algebraFactory: Factory, bindingsFactory: BindingsFactory, forceHttpGet: boolean, cacheSize: number, countTimeout: number, cardinalityCountQueries: boolean, cardinalityEstimateConstruction: boolean, defaultGraph?: string, unionDefaultGraph?: boolean, datasets?: IDataset[]);
|
|
23
29
|
getSelectorShape(): Promise<FragmentSelectorShape>;
|
|
24
30
|
queryBindings(operationIn: Algebra.Operation, context: IActionContext, options?: IQueryBindingsOptions): BindingsStream;
|
|
25
31
|
queryQuads(operation: Algebra.Operation, context: IActionContext): AsyncIterator<RDF.Quad>;
|
|
26
32
|
queryBoolean(operation: Algebra.Ask, context: IActionContext): Promise<boolean>;
|
|
27
33
|
queryVoid(operation: Algebra.Update, context: IActionContext): Promise<void>;
|
|
28
34
|
protected attachMetadata(target: AsyncIterator<any>, context: IActionContext, operationPromise: Promise<Algebra.Operation>): void;
|
|
35
|
+
/**
|
|
36
|
+
* Convert an algebra operation into a query string, and if the operation is a simple triple pattern,
|
|
37
|
+
* then also replace any variables with s, p, and o to increase the chance of cache hits.
|
|
38
|
+
* @param {Algebra.Operation} operation The operation to convert into a query string.
|
|
39
|
+
* @returns {string} Query string for a COUNT query over the operation.
|
|
40
|
+
*/
|
|
41
|
+
operationToNormalizedCountQuery(operation: Algebra.Operation): string;
|
|
42
|
+
/**
|
|
43
|
+
* Performs local cardinality estimation for the specified SPARQL algebra operation, which should
|
|
44
|
+
* result in better estimation performance at the expense of accuracy.
|
|
45
|
+
* @param {Algebra.Operation} operation A query operation.
|
|
46
|
+
*/
|
|
47
|
+
estimateOperationCardinality(operation: Algebra.Operation): Promise<QueryResultCardinality>;
|
|
29
48
|
/**
|
|
30
49
|
* Create an operation that includes the bindings from the given bindings stream.
|
|
31
50
|
* @param algebraFactory The algebra factory.
|
package/lib/QuerySourceSparql.js
CHANGED
|
@@ -4,14 +4,14 @@ exports.QuerySourceSparql = void 0;
|
|
|
4
4
|
const context_entries_1 = require("@comunica/context-entries");
|
|
5
5
|
const core_1 = require("@comunica/core");
|
|
6
6
|
const utils_metadata_1 = require("@comunica/utils-metadata");
|
|
7
|
+
const utils_query_operation_1 = require("@comunica/utils-query-operation");
|
|
7
8
|
const asynciterator_1 = require("asynciterator");
|
|
8
9
|
const fetch_sparql_endpoint_1 = require("fetch-sparql-endpoint");
|
|
9
10
|
const lru_cache_1 = require("lru-cache");
|
|
10
11
|
const rdf_terms_1 = require("rdf-terms");
|
|
11
12
|
const sparqlalgebrajs_1 = require("sparqlalgebrajs");
|
|
12
|
-
const COUNT_INFINITY = { type: 'estimate', value: Number.POSITIVE_INFINITY };
|
|
13
13
|
class QuerySourceSparql {
|
|
14
|
-
constructor(url, context, mediatorHttp, bindMethod, dataFactory, algebraFactory, bindingsFactory, forceHttpGet, cacheSize, countTimeout) {
|
|
14
|
+
constructor(url, context, mediatorHttp, bindMethod, dataFactory, algebraFactory, bindingsFactory, forceHttpGet, cacheSize, countTimeout, cardinalityCountQueries, cardinalityEstimateConstruction, defaultGraph, unionDefaultGraph, datasets) {
|
|
15
15
|
this.referenceValue = url;
|
|
16
16
|
this.url = url;
|
|
17
17
|
this.context = context;
|
|
@@ -30,6 +30,11 @@ class QuerySourceSparql {
|
|
|
30
30
|
new lru_cache_1.LRUCache({ max: cacheSize }) :
|
|
31
31
|
undefined;
|
|
32
32
|
this.countTimeout = countTimeout;
|
|
33
|
+
this.cardinalityCountQueries = cardinalityCountQueries;
|
|
34
|
+
this.cardinalityEstimateConstruction = cardinalityEstimateConstruction;
|
|
35
|
+
this.defaultGraph = defaultGraph;
|
|
36
|
+
this.unionDefaultGraph = unionDefaultGraph ?? false;
|
|
37
|
+
this.datasets = datasets;
|
|
33
38
|
}
|
|
34
39
|
async getSelectorShape() {
|
|
35
40
|
return QuerySourceSparql.SELECTOR_SHAPE;
|
|
@@ -48,7 +53,8 @@ class QuerySourceSparql {
|
|
|
48
53
|
const operation = await operationPromise;
|
|
49
54
|
const variables = sparqlalgebrajs_1.Util.inScopeVariables(operation);
|
|
50
55
|
const queryString = context.get(context_entries_1.KeysInitQuery.queryString);
|
|
51
|
-
const
|
|
56
|
+
const queryFormat = context.getSafe(context_entries_1.KeysInitQuery.queryFormat);
|
|
57
|
+
const selectQuery = !options?.joinBindings && queryString && queryFormat.language === 'sparql' ?
|
|
52
58
|
queryString :
|
|
53
59
|
QuerySourceSparql.operationToSelectQuery(this.algebraFactory, operation, variables);
|
|
54
60
|
const undefVariables = QuerySourceSparql.getOperationUndefs(operation);
|
|
@@ -82,29 +88,48 @@ class QuerySourceSparql {
|
|
|
82
88
|
let variablesCount = [];
|
|
83
89
|
// eslint-disable-next-line no-async-promise-executor,ts/no-misused-promises
|
|
84
90
|
new Promise(async (resolve, reject) => {
|
|
85
|
-
// Prepare queries
|
|
86
|
-
let countQuery;
|
|
87
91
|
try {
|
|
88
92
|
const operation = await operationPromise;
|
|
89
93
|
const variablesScoped = sparqlalgebrajs_1.Util.inScopeVariables(operation);
|
|
90
|
-
countQuery =
|
|
94
|
+
const countQuery = this.operationToNormalizedCountQuery(operation);
|
|
91
95
|
const undefVariables = QuerySourceSparql.getOperationUndefs(operation);
|
|
92
96
|
variablesCount = variablesScoped.map(variable => ({
|
|
93
97
|
variable,
|
|
94
98
|
canBeUndef: undefVariables.some(undefVariable => undefVariable.equals(variable)),
|
|
95
99
|
}));
|
|
96
100
|
const cachedCardinality = this.cache?.get(countQuery);
|
|
97
|
-
if (cachedCardinality
|
|
101
|
+
if (cachedCardinality) {
|
|
98
102
|
return resolve(cachedCardinality);
|
|
99
103
|
}
|
|
100
|
-
|
|
104
|
+
// Attempt to estimate locally prior to sending a COUNT request, as this should be much faster.
|
|
105
|
+
// The estimates may be off by varying amounts, so this is set behind a configuration flag.
|
|
106
|
+
if (this.cardinalityEstimateConstruction) {
|
|
107
|
+
const localEstimate = await this.estimateOperationCardinality(operation);
|
|
108
|
+
if (Number.isFinite(localEstimate.value)) {
|
|
109
|
+
this.cache?.set(countQuery, localEstimate);
|
|
110
|
+
return resolve(localEstimate);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
// Don't send count queries if disabled.
|
|
114
|
+
if (!this.cardinalityCountQueries) {
|
|
115
|
+
return resolve({ type: 'estimate', value: Number.POSITIVE_INFINITY, dataset: this.url });
|
|
116
|
+
}
|
|
117
|
+
const timeoutHandler = setTimeout(() => resolve({
|
|
118
|
+
type: 'estimate',
|
|
119
|
+
value: Number.POSITIVE_INFINITY,
|
|
120
|
+
dataset: this.url,
|
|
121
|
+
}), this.countTimeout);
|
|
101
122
|
const varCount = this.dataFactory.variable('count');
|
|
102
123
|
const bindingsStream = await this
|
|
103
124
|
.queryBindingsRemote(this.url, countQuery, [varCount], context, []);
|
|
104
125
|
bindingsStream.on('data', (bindings) => {
|
|
105
126
|
clearTimeout(timeoutHandler);
|
|
106
127
|
const count = bindings.get(varCount);
|
|
107
|
-
const cardinality = {
|
|
128
|
+
const cardinality = {
|
|
129
|
+
type: 'estimate',
|
|
130
|
+
value: Number.POSITIVE_INFINITY,
|
|
131
|
+
dataset: this.url,
|
|
132
|
+
};
|
|
108
133
|
if (count) {
|
|
109
134
|
const cardinalityValue = Number.parseInt(count.value, 10);
|
|
110
135
|
if (!Number.isNaN(cardinalityValue)) {
|
|
@@ -117,11 +142,11 @@ class QuerySourceSparql {
|
|
|
117
142
|
});
|
|
118
143
|
bindingsStream.on('error', () => {
|
|
119
144
|
clearTimeout(timeoutHandler);
|
|
120
|
-
resolve(
|
|
145
|
+
resolve({ type: 'estimate', value: Number.POSITIVE_INFINITY, dataset: this.url });
|
|
121
146
|
});
|
|
122
147
|
bindingsStream.on('end', () => {
|
|
123
148
|
clearTimeout(timeoutHandler);
|
|
124
|
-
resolve(
|
|
149
|
+
resolve({ type: 'estimate', value: Number.POSITIVE_INFINITY, dataset: this.url });
|
|
125
150
|
});
|
|
126
151
|
}
|
|
127
152
|
catch (error) {
|
|
@@ -137,10 +162,53 @@ class QuerySourceSparql {
|
|
|
137
162
|
})
|
|
138
163
|
.catch(() => target.setProperty('metadata', {
|
|
139
164
|
state: new utils_metadata_1.MetadataValidationState(),
|
|
140
|
-
cardinality:
|
|
165
|
+
cardinality: { type: 'estimate', value: Number.POSITIVE_INFINITY, dataset: this.url },
|
|
141
166
|
variables: variablesCount,
|
|
142
167
|
}));
|
|
143
168
|
}
|
|
169
|
+
/**
|
|
170
|
+
* Convert an algebra operation into a query string, and if the operation is a simple triple pattern,
|
|
171
|
+
* then also replace any variables with s, p, and o to increase the chance of cache hits.
|
|
172
|
+
* @param {Algebra.Operation} operation The operation to convert into a query string.
|
|
173
|
+
* @returns {string} Query string for a COUNT query over the operation.
|
|
174
|
+
*/
|
|
175
|
+
operationToNormalizedCountQuery(operation) {
|
|
176
|
+
const normalizedOperation = operation.type === sparqlalgebrajs_1.Algebra.types.PATTERN ?
|
|
177
|
+
this.algebraFactory.createPattern(operation.subject.termType === 'Variable' ? this.dataFactory.variable('s') : operation.subject, operation.predicate.termType === 'Variable' ? this.dataFactory.variable('p') : operation.predicate, operation.object.termType === 'Variable' ? this.dataFactory.variable('o') : operation.object) :
|
|
178
|
+
operation;
|
|
179
|
+
const operationString = QuerySourceSparql.operationToCountQuery(this.dataFactory, this.algebraFactory, normalizedOperation);
|
|
180
|
+
return operationString;
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Performs local cardinality estimation for the specified SPARQL algebra operation, which should
|
|
184
|
+
* result in better estimation performance at the expense of accuracy.
|
|
185
|
+
* @param {Algebra.Operation} operation A query operation.
|
|
186
|
+
*/
|
|
187
|
+
async estimateOperationCardinality(operation) {
|
|
188
|
+
const dataset = {
|
|
189
|
+
getCardinality: (operation) => {
|
|
190
|
+
const queryString = this.operationToNormalizedCountQuery(operation);
|
|
191
|
+
const cachedCardinality = this.cache?.get(queryString);
|
|
192
|
+
if (cachedCardinality) {
|
|
193
|
+
return cachedCardinality;
|
|
194
|
+
}
|
|
195
|
+
if (this.datasets) {
|
|
196
|
+
const cardinalities = this.datasets
|
|
197
|
+
.filter(ds => this.unionDefaultGraph || (this.defaultGraph && ds.uri.endsWith(this.defaultGraph)))
|
|
198
|
+
.map(ds => (0, utils_query_operation_1.estimateCardinality)(operation, ds));
|
|
199
|
+
const cardinality = {
|
|
200
|
+
type: cardinalities.some(card => card.type === 'estimate') ? 'estimate' : 'exact',
|
|
201
|
+
value: cardinalities.length > 0 ? cardinalities.reduce((acc, card) => acc + card.value, 0) : 0,
|
|
202
|
+
dataset: this.url,
|
|
203
|
+
};
|
|
204
|
+
return cardinality;
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
source: this.url,
|
|
208
|
+
uri: this.url,
|
|
209
|
+
};
|
|
210
|
+
return (0, utils_query_operation_1.estimateCardinality)(operation, dataset);
|
|
211
|
+
}
|
|
144
212
|
/**
|
|
145
213
|
* Create an operation that includes the bindings from the given bindings stream.
|
|
146
214
|
* @param algebraFactory The algebra factory.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QuerySourceSparql.js","sourceRoot":"","sources":["QuerySourceSparql.ts"],"names":[],"mappings":";;;AACA,+DAA0D;AAC1D,yCAAuC;AAavC,6DAAmE;AAGnE,iDAAwD;AACxD,iEAA8D;AAC9D,yCAAqC;AACrC,yCAAsC;AAEtC,qDAAiD;AAGjD,MAAM,cAAc,GAA+B,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,CAAC,iBAAiB,EAAE,CAAC;AAEzG,MAAa,iBAAiB;IA2B5B,YACE,GAAW,EACX,OAAuB,EACvB,YAA0B,EAC1B,UAAsB,EACtB,WAAgC,EAChC,cAAuB,EACvB,eAAgC,EAChC,YAAqB,EACrB,SAAiB,EACjB,YAAoB;QAEpB,IAAI,CAAC,cAAc,GAAG,GAAG,CAAC;QAC1B,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;QACrC,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;QACvC,IAAI,CAAC,eAAe,GAAG,IAAI,6CAAqB,CAAC;YAC/C,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM;YACrC,KAAK,EAAE,CAAC,KAAuB,EAAE,IAAkB,EAAE,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,OAAO,CAC/E,EAAE,KAAK,EAAE,IAAI,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AC,iBAAiB,GAAG,SAAS,CAAC;QAEnC,OAAO,IAAA,oBAAI,EAAM,SAAS,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,CAAC,iBAAiB,EAAE,CAAC;aACvF,GAAG,CAAe,CAAC,OAAiC,EAAE,EAAE,CAAC,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,SAAS;aAC9F,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE;YAChB,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC;YAC5C,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;gBACvD,YAAK,CAAC,gBAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,gBAAgB,QAAQ,oCAAoC,QAAQ,CAAC,KAAK,GAAG,CAAC,CAAC;YAC5H,CAAC;YACD,OAAiC,CAAE,QAAQ,EAAE,KAAK,CAAE,CAAC;QACvD,CAAC,CAAC;aACD,MAAM,CAAC,CAAC,CAAE,CAAC,EAAE,CAAC,CAAE,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1C,CAAC;IAEM,QAAQ;QACb,OAAO,qBAAqB,IAAI,CAAC,GAAG,GAAG,CAAC;IAC1C,CAAC;;AAjXH,8CAkXC;AAjX2B,gCAAc,GAA0B;IAChE,IAAI,EAAE,aAAa;IACnB,QAAQ,EAAE;QACR;YACE,IAAI,EAAE,WAAW;YACjB,SAAS,EAAE,EAAE,aAAa,EAAE,UAAU,EAAE;YACxC,YAAY,EAAE,IAAI;SACnB;KACF;CACF,CAAC","sourcesContent":["import type { MediatorHttp } from '@comunica/bus-http';\nimport { KeysInitQuery } from '@comunica/context-entries';\nimport { Actor } from '@comunica/core';\nimport type {\n Bindings,\n BindingsStream,\n ComunicaDataFactory,\n FragmentSelectorShape,\n IActionContext,\n IQueryBindingsOptions,\n IQuerySource,\n MetadataBindings,\n MetadataVariable,\n} from '@comunica/types';\nimport type { BindingsFactory } from '@comunica/utils-bindings-factory';\nimport { MetadataValidationState } from '@comunica/utils-metadata';\nimport type * as RDF from '@rdfjs/types';\nimport type { AsyncIterator } from 'asynciterator';\nimport { TransformIterator, wrap } from 'asynciterator';\nimport { SparqlEndpointFetcher } from 'fetch-sparql-endpoint';\nimport { LRUCache } from 'lru-cache';\nimport { uniqTerms } from 'rdf-terms';\nimport type { Factory, Algebra } from 'sparqlalgebrajs';\nimport { toSparql, Util } from 'sparqlalgebrajs';\nimport type { BindMethod } from './ActorQuerySourceIdentifyHypermediaSparql';\n\nconst COUNT_INFINITY: RDF.QueryResultCardinality = { type: 'estimate', value: Number.POSITIVE_INFINITY };\n\nexport class QuerySourceSparql implements IQuerySource {\n protected static readonly SELECTOR_SHAPE: FragmentSelectorShape = {\n type: 'disjunction',\n children: [\n {\n type: 'operation',\n operation: { operationType: 'wildcard' },\n joinBindings: true,\n },\n ],\n };\n\n public readonly referenceValue: string;\n private readonly url: string;\n private readonly context: IActionContext;\n private readonly mediatorHttp: MediatorHttp;\n private readonly bindMethod: BindMethod;\n private readonly countTimeout: number;\n private readonly dataFactory: ComunicaDataFactory;\n private readonly algebraFactory: Factory;\n private readonly bindingsFactory: BindingsFactory;\n\n private readonly endpointFetcher: SparqlEndpointFetcher;\n private readonly cache: LRUCache<string, RDF.QueryResultCardinality> | undefined;\n\n private lastSourceContext: IActionContext | undefined;\n\n public constructor(\n url: string,\n context: IActionContext,\n mediatorHttp: MediatorHttp,\n bindMethod: BindMethod,\n dataFactory: ComunicaDataFactory,\n algebraFactory: Factory,\n bindingsFactory: BindingsFactory,\n forceHttpGet: boolean,\n cacheSize: number,\n countTimeout: number,\n ) {\n this.referenceValue = url;\n this.url = url;\n this.context = context;\n this.mediatorHttp = mediatorHttp;\n this.bindMethod = bindMethod;\n this.dataFactory = dataFactory;\n this.algebraFactory = algebraFactory;\n this.bindingsFactory = bindingsFactory;\n this.endpointFetcher = new SparqlEndpointFetcher({\n method: forceHttpGet ? 'GET' : 'POST',\n fetch: (input: Request | string, init?: RequestInit) => this.mediatorHttp.mediate(\n { input, init, context: this.lastSourceContext! },\n ),\n prefixVariableQuestionMark: true,\n dataFactory,\n });\n this.cache = cacheSize > 0 ?\n new LRUCache<string, RDF.QueryResultCardinality>({ max: cacheSize }) :\n undefined;\n this.countTimeout = countTimeout;\n }\n\n public async getSelectorShape(): Promise<FragmentSelectorShape> {\n return QuerySourceSparql.SELECTOR_SHAPE;\n }\n\n public queryBindings(\n operationIn: Algebra.Operation,\n context: IActionContext,\n options?: IQueryBindingsOptions,\n ): BindingsStream {\n // If bindings are passed, modify the operations\n let operationPromise: Promise<Algebra.Operation>;\n if (options?.joinBindings) {\n operationPromise = QuerySourceSparql.addBindingsToOperation(\n this.algebraFactory,\n this.bindMethod,\n operationIn,\n options.joinBindings,\n );\n } else {\n operationPromise = Promise.resolve(operationIn);\n }\n\n const bindings: BindingsStream = new TransformIterator(async() => {\n // Prepare queries\n const operation = await operationPromise;\n const variables: RDF.Variable[] = Util.inScopeVariables(operation);\n const queryString = context.get<string>(KeysInitQuery.queryString);\n const selectQuery: string = !options?.joinBindings && queryString ?\n queryString :\n QuerySourceSparql.operationToSelectQuery(this.algebraFactory, operation, variables);\n const undefVariables = QuerySourceSparql.getOperationUndefs(operation);\n\n return this.queryBindingsRemote(this.url, selectQuery, variables, context, undefVariables);\n }, { autoStart: false });\n this.attachMetadata(bindings, context, operationPromise);\n\n return bindings;\n }\n\n public queryQuads(operation: Algebra.Operation, context: IActionContext): AsyncIterator<RDF.Quad> {\n this.lastSourceContext = this.context.merge(context);\n const rawStream = this.endpointFetcher.fetchTriples(\n this.url,\n context.get(KeysInitQuery.queryString) ?? QuerySourceSparql.operationToQuery(operation),\n );\n this.lastSourceContext = undefined;\n const quads = wrap<any>(rawStream, { autoStart: false, maxBufferSize: Number.POSITIVE_INFINITY });\n this.attachMetadata(quads, context, Promise.resolve(operation.input));\n return quads;\n }\n\n public queryBoolean(operation: Algebra.Ask, context: IActionContext): Promise<boolean> {\n this.lastSourceContext = this.context.merge(context);\n const promise = this.endpointFetcher.fetchAsk(\n this.url,\n context.get(KeysInitQuery.queryString) ?? QuerySourceSparql.operationToQuery(operation),\n );\n this.lastSourceContext = undefined;\n return promise;\n }\n\n public queryVoid(operation: Algebra.Update, context: IActionContext): Promise<void> {\n this.lastSourceContext = this.context.merge(context);\n const promise = this.endpointFetcher.fetchUpdate(\n this.url,\n context.get(KeysInitQuery.queryString) ?? QuerySourceSparql.operationToQuery(operation),\n );\n this.lastSourceContext = undefined;\n return promise;\n }\n\n protected attachMetadata(\n target: AsyncIterator<any>,\n context: IActionContext,\n operationPromise: Promise<Algebra.Operation>,\n ): void {\n // Emit metadata containing the estimated count\n let variablesCount: MetadataVariable[] = [];\n // eslint-disable-next-line no-async-promise-executor,ts/no-misused-promises\n new Promise<RDF.QueryResultCardinality>(async(resolve, reject) => {\n // Prepare queries\n let countQuery: string;\n try {\n const operation = await operationPromise;\n const variablesScoped = Util.inScopeVariables(operation);\n countQuery = QuerySourceSparql.operationToCountQuery(this.dataFactory, this.algebraFactory, operation);\n const undefVariables = QuerySourceSparql.getOperationUndefs(operation);\n variablesCount = variablesScoped.map(variable => ({\n variable,\n canBeUndef: undefVariables.some(undefVariable => undefVariable.equals(variable)),\n }));\n\n const cachedCardinality = this.cache?.get(countQuery);\n if (cachedCardinality !== undefined) {\n return resolve(cachedCardinality);\n }\n\n const timeoutHandler = setTimeout(() => resolve(COUNT_INFINITY), this.countTimeout);\n const varCount = this.dataFactory.variable('count');\n const bindingsStream: BindingsStream = await this\n .queryBindingsRemote(this.url, countQuery, [ varCount ], context, []);\n bindingsStream.on('data', (bindings: Bindings) => {\n clearTimeout(timeoutHandler);\n const count = bindings.get(varCount);\n const cardinality: RDF.QueryResultCardinality = { type: 'estimate', value: Number.POSITIVE_INFINITY };\n if (count) {\n const cardinalityValue: number = Number.parseInt(count.value, 10);\n if (!Number.isNaN(cardinalityValue)) {\n cardinality.type = 'exact';\n cardinality.value = cardinalityValue;\n this.cache?.set(countQuery, cardinality);\n }\n }\n return resolve(cardinality);\n });\n bindingsStream.on('error', () => {\n clearTimeout(timeoutHandler);\n resolve(COUNT_INFINITY);\n });\n bindingsStream.on('end', () => {\n clearTimeout(timeoutHandler);\n resolve(COUNT_INFINITY);\n });\n } catch (error: unknown) {\n return reject(error);\n }\n })\n .then((cardinality) => {\n target.setProperty('metadata', {\n state: new MetadataValidationState(),\n cardinality,\n variables: variablesCount,\n });\n })\n .catch(() => target.setProperty('metadata', {\n state: new MetadataValidationState(),\n cardinality: COUNT_INFINITY,\n variables: variablesCount,\n }));\n }\n\n /**\n * Create an operation that includes the bindings from the given bindings stream.\n * @param algebraFactory The algebra factory.\n * @param bindMethod A method for adding bindings to an operation.\n * @param operation The operation to bind to.\n * @param addBindings The bindings to add.\n * @param addBindings.bindings The bindings stream.\n * @param addBindings.metadata The bindings metadata.\n */\n public static async addBindingsToOperation(\n algebraFactory: Factory,\n bindMethod: BindMethod,\n operation: Algebra.Operation,\n addBindings: { bindings: BindingsStream; metadata: MetadataBindings },\n ): Promise<Algebra.Operation> {\n const bindings = await addBindings.bindings.toArray();\n\n switch (bindMethod) {\n case 'values':\n return algebraFactory.createJoin([\n algebraFactory.createValues(\n addBindings.metadata.variables.map(v => v.variable),\n bindings.map(binding => Object.fromEntries([ ...binding ]\n .map(([ key, value ]) => [ `?${key.value}`, <RDF.Literal | RDF.NamedNode> value ]))),\n ),\n operation,\n ], false);\n case 'union': { throw new Error('Not implemented yet: \"union\" case'); }\n case 'filter': { throw new Error('Not implemented yet: \"filter\" case'); }\n }\n }\n\n /**\n * Convert an operation to a select query for this pattern.\n * @param algebraFactory The algebra factory.\n * @param {Algebra.Operation} operation A query operation.\n * @param {RDF.Variable[]} variables The variables in scope for the operation.\n * @return {string} A select query string.\n */\n public static operationToSelectQuery(\n algebraFactory: Factory,\n operation: Algebra.Operation,\n variables: RDF.Variable[],\n ): string {\n return QuerySourceSparql.operationToQuery(algebraFactory.createProject(operation, variables));\n }\n\n /**\n * Convert an operation to a count query for the number of matching triples for this pattern.\n * @param dataFactory The data factory.\n * @param algebraFactory The algebra factory.\n * @param {Algebra.Operation} operation A query operation.\n * @return {string} A count query string.\n */\n public static operationToCountQuery(\n dataFactory: ComunicaDataFactory,\n algebraFactory: Factory,\n operation: Algebra.Operation,\n ): string {\n return QuerySourceSparql.operationToQuery(algebraFactory.createProject(\n algebraFactory.createExtend(\n algebraFactory.createGroup(\n operation,\n [],\n [ algebraFactory.createBoundAggregate(\n dataFactory.variable('var0'),\n 'count',\n algebraFactory.createWildcardExpression(),\n false,\n ) ],\n ),\n dataFactory.variable('count'),\n algebraFactory.createTermExpression(dataFactory.variable('var0')),\n ),\n [ dataFactory.variable('count') ],\n ));\n }\n\n /**\n * Convert an operation to a query for this pattern.\n * @param {Algebra.Operation} operation A query operation.\n * @return {string} A query string.\n */\n public static operationToQuery(operation: Algebra.Operation): string {\n return toSparql(operation, { sparqlStar: true });\n }\n\n /**\n * Check if the given operation may produce undefined values.\n * @param operation\n */\n public static getOperationUndefs(operation: Algebra.Operation): RDF.Variable[] {\n const variables: RDF.Variable[] = [];\n Util.recurseOperation(operation, {\n leftjoin(subOperation): boolean {\n const left = Util.inScopeVariables(subOperation.input[0]);\n const right = Util.inScopeVariables(subOperation.input[1]);\n for (const varRight of right) {\n if (!left.some(varLeft => varLeft.equals(varRight))) {\n variables.push(varRight);\n }\n }\n return false;\n },\n values(values: Algebra.Values): boolean {\n for (const variable of values.variables) {\n if (values.bindings.some(bindings => !(`?${variable.value}` in bindings))) {\n variables.push(variable);\n }\n }\n return false;\n },\n union(union: Algebra.Union): boolean {\n // Determine variables in scope of the union branches that are not occurring in every branch\n const scopedVariables = union.input.map(Util.inScopeVariables);\n for (const variable of uniqTerms(scopedVariables.flat())) {\n if (!scopedVariables.every(input => input.some(inputVar => inputVar.equals(variable)))) {\n variables.push(variable);\n }\n }\n\n return true;\n },\n });\n return uniqTerms(variables);\n }\n\n /**\n * Send a SPARQL query to a SPARQL endpoint and retrieve its bindings as a stream.\n * @param {string} endpoint A SPARQL endpoint URL.\n * @param {string} query A SPARQL query string.\n * @param {RDF.Variable[]} variables The expected variables.\n * @param {IActionContext} context The source context.\n * @param undefVariables Variables that may have undefs.\n * @return {BindingsStream} A stream of bindings.\n */\n public async queryBindingsRemote(\n endpoint: string,\n query: string,\n variables: RDF.Variable[],\n context: IActionContext,\n undefVariables: RDF.Variable[],\n ): Promise<BindingsStream> {\n // Index undef variables\n const undefVariablesIndex: Set<string> = new Set();\n for (const undefVariable of undefVariables) {\n undefVariablesIndex.add(undefVariable.value);\n }\n\n this.lastSourceContext = this.context.merge(context);\n const rawStream = await this.endpointFetcher.fetchBindings(endpoint, query);\n this.lastSourceContext = undefined;\n\n return wrap<any>(rawStream, { autoStart: false, maxBufferSize: Number.POSITIVE_INFINITY })\n .map<RDF.Bindings>((rawData: Record<string, RDF.Term>) => this.bindingsFactory.bindings(variables\n .map((variable) => {\n const value = rawData[`?${variable.value}`];\n if (!undefVariablesIndex.has(variable.value) && !value) {\n Actor.getContextLogger(this.context)?.warn(`The endpoint ${endpoint} failed to provide a binding for ${variable.value}.`);\n }\n return <[RDF.Variable, RDF.Term]>[ variable, value ];\n })\n .filter(([ _, v ]) => Boolean(v))));\n }\n\n public toString(): string {\n return `QuerySourceSparql(${this.url})`;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"QuerySourceSparql.js","sourceRoot":"","sources":["QuerySourceSparql.ts"],"names":[],"mappings":";;;AACA,+DAA0D;AAC1D,yCAAuC;AAevC,6DAAmE;AACnE,2EAAsE;AAGtE,iDAAwD;AACxD,iEAA8D;AAC9D,yCAAqC;AACrC,yCAAsC;AAEtC,qDAA0D;AAG1D,MAAa,iBAAiB;IAgC5B,YACE,GAAW,EACX,OAAuB,EACvB,YAA0B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CAAC,CAAC,CAAE,CAAC,EAAE,CAAC,CAAE,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1C,CAAC;IAEM,QAAQ;QACb,OAAO,qBAAqB,IAAI,CAAC,GAAG,GAAG,CAAC;IAC1C,CAAC;;AAhdH,8CAidC;AAhd2B,gCAAc,GAA0B;IAChE,IAAI,EAAE,aAAa;IACnB,QAAQ,EAAE;QACR;YACE,IAAI,EAAE,WAAW;YACjB,SAAS,EAAE,EAAE,aAAa,EAAE,UAAU,EAAE;YACxC,YAAY,EAAE,IAAI;SACnB;KACF;CACF,CAAC","sourcesContent":["import type { MediatorHttp } from '@comunica/bus-http';\nimport { KeysInitQuery } from '@comunica/context-entries';\nimport { Actor } from '@comunica/core';\nimport type {\n Bindings,\n BindingsStream,\n ComunicaDataFactory,\n FragmentSelectorShape,\n IActionContext,\n IDataset,\n IQueryBindingsOptions,\n IQuerySource,\n MetadataBindings,\n MetadataVariable,\n QueryResultCardinality,\n} from '@comunica/types';\nimport type { BindingsFactory } from '@comunica/utils-bindings-factory';\nimport { MetadataValidationState } from '@comunica/utils-metadata';\nimport { estimateCardinality } from '@comunica/utils-query-operation';\nimport type * as RDF from '@rdfjs/types';\nimport type { AsyncIterator } from 'asynciterator';\nimport { TransformIterator, wrap } from 'asynciterator';\nimport { SparqlEndpointFetcher } from 'fetch-sparql-endpoint';\nimport { LRUCache } from 'lru-cache';\nimport { uniqTerms } from 'rdf-terms';\nimport type { Factory } from 'sparqlalgebrajs';\nimport { toSparql, Algebra, Util } from 'sparqlalgebrajs';\nimport type { BindMethod } from './ActorQuerySourceIdentifyHypermediaSparql';\n\nexport class QuerySourceSparql implements IQuerySource {\n protected static readonly SELECTOR_SHAPE: FragmentSelectorShape = {\n type: 'disjunction',\n children: [\n {\n type: 'operation',\n operation: { operationType: 'wildcard' },\n joinBindings: true,\n },\n ],\n };\n\n public readonly referenceValue: string;\n private readonly url: string;\n private readonly context: IActionContext;\n private readonly mediatorHttp: MediatorHttp;\n private readonly bindMethod: BindMethod;\n private readonly countTimeout: number;\n private readonly cardinalityCountQueries: boolean;\n private readonly cardinalityEstimateConstruction: boolean;\n private readonly defaultGraph?: string;\n private readonly unionDefaultGraph: boolean;\n private readonly datasets?: IDataset[];\n private readonly dataFactory: ComunicaDataFactory;\n private readonly algebraFactory: Factory;\n private readonly bindingsFactory: BindingsFactory;\n\n private readonly endpointFetcher: SparqlEndpointFetcher;\n private readonly cache: LRUCache<string, QueryResultCardinality> | undefined;\n\n private lastSourceContext: IActionContext | undefined;\n\n public constructor(\n url: string,\n context: IActionContext,\n mediatorHttp: MediatorHttp,\n bindMethod: BindMethod,\n dataFactory: ComunicaDataFactory,\n algebraFactory: Factory,\n bindingsFactory: BindingsFactory,\n forceHttpGet: boolean,\n cacheSize: number,\n countTimeout: number,\n cardinalityCountQueries: boolean,\n cardinalityEstimateConstruction: boolean,\n defaultGraph?: string,\n unionDefaultGraph?: boolean,\n datasets?: IDataset[],\n ) {\n this.referenceValue = url;\n this.url = url;\n this.context = context;\n this.mediatorHttp = mediatorHttp;\n this.bindMethod = bindMethod;\n this.dataFactory = dataFactory;\n this.algebraFactory = algebraFactory;\n this.bindingsFactory = bindingsFactory;\n this.endpointFetcher = new SparqlEndpointFetcher({\n method: forceHttpGet ? 'GET' : 'POST',\n fetch: (input: Request | string, init?: RequestInit) => this.mediatorHttp.mediate(\n { input, init, context: this.lastSourceContext! },\n ),\n prefixVariableQuestionMark: true,\n dataFactory,\n });\n this.cache = cacheSize > 0 ?\n new LRUCache<string, QueryResultCardinality>({ max: cacheSize }) :\n undefined;\n this.countTimeout = countTimeout;\n this.cardinalityCountQueries = cardinalityCountQueries;\n this.cardinalityEstimateConstruction = cardinalityEstimateConstruction;\n this.defaultGraph = defaultGraph;\n this.unionDefaultGraph = unionDefaultGraph ?? false;\n this.datasets = datasets;\n }\n\n public async getSelectorShape(): Promise<FragmentSelectorShape> {\n return QuerySourceSparql.SELECTOR_SHAPE;\n }\n\n public queryBindings(\n operationIn: Algebra.Operation,\n context: IActionContext,\n options?: IQueryBindingsOptions,\n ): BindingsStream {\n // If bindings are passed, modify the operations\n let operationPromise: Promise<Algebra.Operation>;\n if (options?.joinBindings) {\n operationPromise = QuerySourceSparql.addBindingsToOperation(\n this.algebraFactory,\n this.bindMethod,\n operationIn,\n options.joinBindings,\n );\n } else {\n operationPromise = Promise.resolve(operationIn);\n }\n\n const bindings: BindingsStream = new TransformIterator(async() => {\n // Prepare queries\n const operation = await operationPromise;\n const variables: RDF.Variable[] = Util.inScopeVariables(operation);\n const queryString = context.get<string>(KeysInitQuery.queryString);\n const queryFormat: RDF.QueryFormat = context.getSafe(KeysInitQuery.queryFormat);\n const selectQuery: string = !options?.joinBindings && queryString && queryFormat.language === 'sparql' ?\n queryString :\n QuerySourceSparql.operationToSelectQuery(this.algebraFactory, operation, variables);\n const undefVariables = QuerySourceSparql.getOperationUndefs(operation);\n\n return this.queryBindingsRemote(this.url, selectQuery, variables, context, undefVariables);\n }, { autoStart: false });\n this.attachMetadata(bindings, context, operationPromise);\n\n return bindings;\n }\n\n public queryQuads(operation: Algebra.Operation, context: IActionContext): AsyncIterator<RDF.Quad> {\n this.lastSourceContext = this.context.merge(context);\n const rawStream = this.endpointFetcher.fetchTriples(\n this.url,\n context.get(KeysInitQuery.queryString) ?? QuerySourceSparql.operationToQuery(operation),\n );\n this.lastSourceContext = undefined;\n const quads = wrap<any>(rawStream, { autoStart: false, maxBufferSize: Number.POSITIVE_INFINITY });\n this.attachMetadata(quads, context, Promise.resolve(operation.input));\n return quads;\n }\n\n public queryBoolean(operation: Algebra.Ask, context: IActionContext): Promise<boolean> {\n this.lastSourceContext = this.context.merge(context);\n const promise = this.endpointFetcher.fetchAsk(\n this.url,\n context.get(KeysInitQuery.queryString) ?? QuerySourceSparql.operationToQuery(operation),\n );\n this.lastSourceContext = undefined;\n return promise;\n }\n\n public queryVoid(operation: Algebra.Update, context: IActionContext): Promise<void> {\n this.lastSourceContext = this.context.merge(context);\n const promise = this.endpointFetcher.fetchUpdate(\n this.url,\n context.get(KeysInitQuery.queryString) ?? QuerySourceSparql.operationToQuery(operation),\n );\n this.lastSourceContext = undefined;\n return promise;\n }\n\n protected attachMetadata(\n target: AsyncIterator<any>,\n context: IActionContext,\n operationPromise: Promise<Algebra.Operation>,\n ): void {\n // Emit metadata containing the estimated count\n let variablesCount: MetadataVariable[] = [];\n // eslint-disable-next-line no-async-promise-executor,ts/no-misused-promises\n new Promise<QueryResultCardinality>(async(resolve, reject) => {\n try {\n const operation = await operationPromise;\n const variablesScoped = Util.inScopeVariables(operation);\n const countQuery = this.operationToNormalizedCountQuery(operation);\n const undefVariables = QuerySourceSparql.getOperationUndefs(operation);\n variablesCount = variablesScoped.map(variable => ({\n variable,\n canBeUndef: undefVariables.some(undefVariable => undefVariable.equals(variable)),\n }));\n\n const cachedCardinality = this.cache?.get(countQuery);\n if (cachedCardinality) {\n return resolve(cachedCardinality);\n }\n\n // Attempt to estimate locally prior to sending a COUNT request, as this should be much faster.\n // The estimates may be off by varying amounts, so this is set behind a configuration flag.\n if (this.cardinalityEstimateConstruction) {\n const localEstimate = await this.estimateOperationCardinality(operation);\n if (Number.isFinite(localEstimate.value)) {\n this.cache?.set(countQuery, localEstimate);\n return resolve(localEstimate);\n }\n }\n\n // Don't send count queries if disabled.\n if (!this.cardinalityCountQueries) {\n return resolve({ type: 'estimate', value: Number.POSITIVE_INFINITY, dataset: this.url });\n }\n\n const timeoutHandler = setTimeout(() => resolve({\n type: 'estimate',\n value: Number.POSITIVE_INFINITY,\n dataset: this.url,\n }), this.countTimeout);\n const varCount = this.dataFactory.variable('count');\n const bindingsStream: BindingsStream = await this\n .queryBindingsRemote(this.url, countQuery, [ varCount ], context, []);\n bindingsStream.on('data', (bindings: Bindings) => {\n clearTimeout(timeoutHandler);\n const count = bindings.get(varCount);\n const cardinality: QueryResultCardinality = {\n type: 'estimate',\n value: Number.POSITIVE_INFINITY,\n dataset: this.url,\n };\n if (count) {\n const cardinalityValue: number = Number.parseInt(count.value, 10);\n if (!Number.isNaN(cardinalityValue)) {\n cardinality.type = 'exact';\n cardinality.value = cardinalityValue;\n this.cache?.set(countQuery, cardinality);\n }\n }\n return resolve(cardinality);\n });\n bindingsStream.on('error', () => {\n clearTimeout(timeoutHandler);\n resolve({ type: 'estimate', value: Number.POSITIVE_INFINITY, dataset: this.url });\n });\n bindingsStream.on('end', () => {\n clearTimeout(timeoutHandler);\n resolve({ type: 'estimate', value: Number.POSITIVE_INFINITY, dataset: this.url });\n });\n } catch (error: unknown) {\n return reject(error);\n }\n })\n .then((cardinality) => {\n target.setProperty('metadata', {\n state: new MetadataValidationState(),\n cardinality,\n variables: variablesCount,\n });\n })\n .catch(() => target.setProperty('metadata', {\n state: new MetadataValidationState(),\n cardinality: { type: 'estimate', value: Number.POSITIVE_INFINITY, dataset: this.url },\n variables: variablesCount,\n }));\n }\n\n /**\n * Convert an algebra operation into a query string, and if the operation is a simple triple pattern,\n * then also replace any variables with s, p, and o to increase the chance of cache hits.\n * @param {Algebra.Operation} operation The operation to convert into a query string.\n * @returns {string} Query string for a COUNT query over the operation.\n */\n public operationToNormalizedCountQuery(operation: Algebra.Operation): string {\n const normalizedOperation = operation.type === Algebra.types.PATTERN ?\n this.algebraFactory.createPattern(\n operation.subject.termType === 'Variable' ? this.dataFactory.variable('s') : operation.subject,\n operation.predicate.termType === 'Variable' ? this.dataFactory.variable('p') : operation.predicate,\n operation.object.termType === 'Variable' ? this.dataFactory.variable('o') : operation.object,\n ) :\n operation;\n const operationString = QuerySourceSparql.operationToCountQuery(\n this.dataFactory,\n this.algebraFactory,\n normalizedOperation,\n );\n return operationString;\n }\n\n /**\n * Performs local cardinality estimation for the specified SPARQL algebra operation, which should\n * result in better estimation performance at the expense of accuracy.\n * @param {Algebra.Operation} operation A query operation.\n */\n public async estimateOperationCardinality(operation: Algebra.Operation): Promise<QueryResultCardinality> {\n const dataset: IDataset = {\n getCardinality: (operation: Algebra.Operation): QueryResultCardinality | undefined => {\n const queryString = this.operationToNormalizedCountQuery(operation);\n\n const cachedCardinality = this.cache?.get(queryString);\n if (cachedCardinality) {\n return cachedCardinality;\n }\n\n if (this.datasets) {\n const cardinalities = this.datasets\n .filter(ds => this.unionDefaultGraph || (this.defaultGraph && ds.uri.endsWith(this.defaultGraph)))\n .map(ds => estimateCardinality(operation, ds));\n\n const cardinality: QueryResultCardinality = {\n type: cardinalities.some(card => card.type === 'estimate') ? 'estimate' : 'exact',\n value: cardinalities.length > 0 ? cardinalities.reduce((acc, card) => acc + card.value, 0) : 0,\n dataset: this.url,\n };\n\n return cardinality;\n }\n },\n source: this.url,\n uri: this.url,\n };\n\n return estimateCardinality(operation, dataset);\n }\n\n /**\n * Create an operation that includes the bindings from the given bindings stream.\n * @param algebraFactory The algebra factory.\n * @param bindMethod A method for adding bindings to an operation.\n * @param operation The operation to bind to.\n * @param addBindings The bindings to add.\n * @param addBindings.bindings The bindings stream.\n * @param addBindings.metadata The bindings metadata.\n */\n public static async addBindingsToOperation(\n algebraFactory: Factory,\n bindMethod: BindMethod,\n operation: Algebra.Operation,\n addBindings: { bindings: BindingsStream; metadata: MetadataBindings },\n ): Promise<Algebra.Operation> {\n const bindings = await addBindings.bindings.toArray();\n\n switch (bindMethod) {\n case 'values':\n return algebraFactory.createJoin([\n algebraFactory.createValues(\n addBindings.metadata.variables.map(v => v.variable),\n bindings.map(binding => Object.fromEntries([ ...binding ]\n .map(([ key, value ]) => [ `?${key.value}`, <RDF.Literal | RDF.NamedNode> value ]))),\n ),\n operation,\n ], false);\n case 'union': { throw new Error('Not implemented yet: \"union\" case'); }\n case 'filter': { throw new Error('Not implemented yet: \"filter\" case'); }\n }\n }\n\n /**\n * Convert an operation to a select query for this pattern.\n * @param algebraFactory The algebra factory.\n * @param {Algebra.Operation} operation A query operation.\n * @param {RDF.Variable[]} variables The variables in scope for the operation.\n * @return {string} A select query string.\n */\n public static operationToSelectQuery(\n algebraFactory: Factory,\n operation: Algebra.Operation,\n variables: RDF.Variable[],\n ): string {\n return QuerySourceSparql.operationToQuery(algebraFactory.createProject(operation, variables));\n }\n\n /**\n * Convert an operation to a count query for the number of matching triples for this pattern.\n * @param dataFactory The data factory.\n * @param algebraFactory The algebra factory.\n * @param {Algebra.Operation} operation A query operation.\n * @return {string} A count query string.\n */\n public static operationToCountQuery(\n dataFactory: ComunicaDataFactory,\n algebraFactory: Factory,\n operation: Algebra.Operation,\n ): string {\n return QuerySourceSparql.operationToQuery(algebraFactory.createProject(\n algebraFactory.createExtend(\n algebraFactory.createGroup(\n operation,\n [],\n [ algebraFactory.createBoundAggregate(\n dataFactory.variable('var0'),\n 'count',\n algebraFactory.createWildcardExpression(),\n false,\n ) ],\n ),\n dataFactory.variable('count'),\n algebraFactory.createTermExpression(dataFactory.variable('var0')),\n ),\n [ dataFactory.variable('count') ],\n ));\n }\n\n /**\n * Convert an operation to a query for this pattern.\n * @param {Algebra.Operation} operation A query operation.\n * @return {string} A query string.\n */\n public static operationToQuery(operation: Algebra.Operation): string {\n return toSparql(operation, { sparqlStar: true });\n }\n\n /**\n * Check if the given operation may produce undefined values.\n * @param operation\n */\n public static getOperationUndefs(operation: Algebra.Operation): RDF.Variable[] {\n const variables: RDF.Variable[] = [];\n Util.recurseOperation(operation, {\n leftjoin(subOperation): boolean {\n const left = Util.inScopeVariables(subOperation.input[0]);\n const right = Util.inScopeVariables(subOperation.input[1]);\n for (const varRight of right) {\n if (!left.some(varLeft => varLeft.equals(varRight))) {\n variables.push(varRight);\n }\n }\n return false;\n },\n values(values: Algebra.Values): boolean {\n for (const variable of values.variables) {\n if (values.bindings.some(bindings => !(`?${variable.value}` in bindings))) {\n variables.push(variable);\n }\n }\n return false;\n },\n union(union: Algebra.Union): boolean {\n // Determine variables in scope of the union branches that are not occurring in every branch\n const scopedVariables = union.input.map(Util.inScopeVariables);\n for (const variable of uniqTerms(scopedVariables.flat())) {\n if (!scopedVariables.every(input => input.some(inputVar => inputVar.equals(variable)))) {\n variables.push(variable);\n }\n }\n\n return true;\n },\n });\n return uniqTerms(variables);\n }\n\n /**\n * Send a SPARQL query to a SPARQL endpoint and retrieve its bindings as a stream.\n * @param {string} endpoint A SPARQL endpoint URL.\n * @param {string} query A SPARQL query string.\n * @param {RDF.Variable[]} variables The expected variables.\n * @param {IActionContext} context The source context.\n * @param undefVariables Variables that may have undefs.\n * @return {BindingsStream} A stream of bindings.\n */\n public async queryBindingsRemote(\n endpoint: string,\n query: string,\n variables: RDF.Variable[],\n context: IActionContext,\n undefVariables: RDF.Variable[],\n ): Promise<BindingsStream> {\n // Index undef variables\n const undefVariablesIndex: Set<string> = new Set();\n for (const undefVariable of undefVariables) {\n undefVariablesIndex.add(undefVariable.value);\n }\n\n this.lastSourceContext = this.context.merge(context);\n const rawStream = await this.endpointFetcher.fetchBindings(endpoint, query);\n this.lastSourceContext = undefined;\n\n return wrap<any>(rawStream, { autoStart: false, maxBufferSize: Number.POSITIVE_INFINITY })\n .map<RDF.Bindings>((rawData: Record<string, RDF.Term>) => this.bindingsFactory.bindings(variables\n .map((variable) => {\n const value = rawData[`?${variable.value}`];\n if (!undefVariablesIndex.has(variable.value) && !value) {\n Actor.getContextLogger(this.context)?.warn(`The endpoint ${endpoint} failed to provide a binding for ${variable.value}.`);\n }\n return <[RDF.Variable, RDF.Term]>[ variable, value ];\n })\n .filter(([ _, v ]) => Boolean(v))));\n }\n\n public toString(): string {\n return `QuerySourceSparql(${this.url})`;\n }\n}\n"]}
|
package/lib/index.d.ts
CHANGED
|
File without changes
|
package/lib/index.js
CHANGED
|
File without changes
|
package/lib/index.js.map
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@comunica/actor-query-source-identify-hypermedia-sparql",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.0",
|
|
4
4
|
"description": "A sparql query-source-identify-hypermedia actor",
|
|
5
5
|
"lsd:module": true,
|
|
6
6
|
"license": "MIT",
|
|
@@ -41,14 +41,15 @@
|
|
|
41
41
|
"build:components": "componentsjs-generator"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@comunica/bus-http": "^4.
|
|
45
|
-
"@comunica/bus-merge-bindings-context": "^4.
|
|
46
|
-
"@comunica/bus-query-source-identify-hypermedia": "^4.
|
|
47
|
-
"@comunica/context-entries": "^4.
|
|
48
|
-
"@comunica/core": "^4.
|
|
49
|
-
"@comunica/types": "^4.
|
|
50
|
-
"@comunica/utils-bindings-factory": "^4.
|
|
51
|
-
"@comunica/utils-metadata": "^4.
|
|
44
|
+
"@comunica/bus-http": "^4.2.0",
|
|
45
|
+
"@comunica/bus-merge-bindings-context": "^4.2.0",
|
|
46
|
+
"@comunica/bus-query-source-identify-hypermedia": "^4.2.0",
|
|
47
|
+
"@comunica/context-entries": "^4.2.0",
|
|
48
|
+
"@comunica/core": "^4.2.0",
|
|
49
|
+
"@comunica/types": "^4.2.0",
|
|
50
|
+
"@comunica/utils-bindings-factory": "^4.2.0",
|
|
51
|
+
"@comunica/utils-metadata": "^4.2.0",
|
|
52
|
+
"@comunica/utils-query-operation": "^4.2.0",
|
|
52
53
|
"@rdfjs/types": "*",
|
|
53
54
|
"asynciterator": "^3.9.0",
|
|
54
55
|
"fetch-sparql-endpoint": "^5.1.0",
|
|
@@ -56,5 +57,5 @@
|
|
|
56
57
|
"rdf-terms": "^1.11.0",
|
|
57
58
|
"sparqlalgebrajs": "^4.3.8"
|
|
58
59
|
},
|
|
59
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "94e1eacab069551590cc250074b36bce08720c4c"
|
|
60
61
|
}
|