@comunica/bus-query-source-identify 3.0.1-alpha.43.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 +27 -0
- package/components/ActorQuerySourceIdentify.jsonld +176 -0
- package/components/components.jsonld +11 -0
- package/components/context.jsonld +45 -0
- package/lib/ActorQuerySourceIdentify.d.ts +34 -0
- package/lib/ActorQuerySourceIdentify.js +25 -0
- package/lib/ActorQuerySourceIdentify.js.map +1 -0
- package/lib/Utils.d.ts +83 -0
- package/lib/Utils.js +242 -0
- package/lib/Utils.js.map +1 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +19 -0
- package/lib/index.js.map +1 -0
- package/package.json +52 -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,27 @@
|
|
|
1
|
+
# Comunica Bus Query Source Identify
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@comunica/bus-query-source-identify)
|
|
4
|
+
|
|
5
|
+
A comunica bus for identifying the types of query sources.
|
|
6
|
+
|
|
7
|
+
This module is part of the [Comunica framework](https://github.com/comunica/comunica),
|
|
8
|
+
and should only be used by [developers that want to build their own query engine](https://comunica.dev/docs/modify/).
|
|
9
|
+
|
|
10
|
+
[Click here if you just want to query with Comunica](https://comunica.dev/docs/query/).
|
|
11
|
+
|
|
12
|
+
## Install
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
$ yarn add @comunica/bus-query-source-identify
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Usage
|
|
19
|
+
|
|
20
|
+
## Bus usage
|
|
21
|
+
|
|
22
|
+
* **Context**: `"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-query-source-identify/^1.0.0/components/context.jsonld"`
|
|
23
|
+
* **Bus name**: `ActorQuerySourceIdentify:_default_bus`
|
|
24
|
+
|
|
25
|
+
## Creating actors on this bus
|
|
26
|
+
|
|
27
|
+
Actors extending [`ActorQuerySourceIdentify`](https://comunica.github.io/comunica/classes/bus_query_source_identify.actorquerysourceidentify.html) are automatically subscribed to this bus.
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
{
|
|
2
|
+
"@context": [
|
|
3
|
+
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-query-source-identify/^3.0.0/components/context.jsonld",
|
|
4
|
+
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/core/^3.0.0/components/context.jsonld"
|
|
5
|
+
],
|
|
6
|
+
"@id": "npmd:@comunica/bus-query-source-identify",
|
|
7
|
+
"components": [
|
|
8
|
+
{
|
|
9
|
+
"@id": "cbqsi:components/ActorQuerySourceIdentify.jsonld#ActorQuerySourceIdentify",
|
|
10
|
+
"@type": "AbstractClass",
|
|
11
|
+
"requireElement": "ActorQuerySourceIdentify",
|
|
12
|
+
"extends": [
|
|
13
|
+
{
|
|
14
|
+
"@type": "GenericComponentExtension",
|
|
15
|
+
"component": "cc:components/Actor.jsonld#Actor",
|
|
16
|
+
"genericTypeInstances": [
|
|
17
|
+
"cbqsi:components/ActorQuerySourceIdentify.jsonld#IActionQuerySourceIdentify",
|
|
18
|
+
"cc:components/Actor.jsonld#IActorTest",
|
|
19
|
+
"cbqsi:components/ActorQuerySourceIdentify.jsonld#IActorQuerySourceIdentifyOutput"
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
"comment": "A comunica actor for query-source-identify events. Actor types: * Input: IActionQuerySourceIdentify: An unidentified query source. * Test: <none> * Output: IActorQuerySourceIdentifyOutput: An identified query source.",
|
|
24
|
+
"parameters": [
|
|
25
|
+
{
|
|
26
|
+
"@id": "cbqsi:components/ActorQuerySourceIdentify.jsonld#ActorQuerySourceIdentify_args_name",
|
|
27
|
+
"range": "xsd:string",
|
|
28
|
+
"default": {
|
|
29
|
+
"@id": "rdf:subject"
|
|
30
|
+
},
|
|
31
|
+
"comment": "The name for this actor."
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"@id": "cbqsi:components/ActorQuerySourceIdentify.jsonld#ActorQuerySourceIdentify_args_bus",
|
|
35
|
+
"range": {
|
|
36
|
+
"@type": "ParameterRangeGenericComponent",
|
|
37
|
+
"component": "cc:components/Bus.jsonld#Bus",
|
|
38
|
+
"genericTypeInstances": [
|
|
39
|
+
{
|
|
40
|
+
"@type": "ParameterRangeGenericComponent",
|
|
41
|
+
"component": "cc:components/Actor.jsonld#Actor",
|
|
42
|
+
"genericTypeInstances": [
|
|
43
|
+
{
|
|
44
|
+
"@type": "ParameterRangeGenericTypeReference",
|
|
45
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^3.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"@type": "ParameterRangeGenericTypeReference",
|
|
49
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^3.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"@type": "ParameterRangeGenericTypeReference",
|
|
53
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^3.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
|
|
54
|
+
}
|
|
55
|
+
]
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"@type": "ParameterRangeGenericTypeReference",
|
|
59
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^3.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"@type": "ParameterRangeGenericTypeReference",
|
|
63
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^3.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"@type": "ParameterRangeGenericTypeReference",
|
|
67
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^3.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
|
|
68
|
+
}
|
|
69
|
+
]
|
|
70
|
+
},
|
|
71
|
+
"default": {
|
|
72
|
+
"@id": "cbqsi:components/ActorQuerySourceIdentify.jsonld#ActorQuerySourceIdentify_default_bus",
|
|
73
|
+
"@type": "cc:components/Bus.jsonld#Bus"
|
|
74
|
+
},
|
|
75
|
+
"comment": "The bus this actor subscribes to."
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"@id": "cbqsi:components/ActorQuerySourceIdentify.jsonld#ActorQuerySourceIdentify_args_beforeActors",
|
|
79
|
+
"range": {
|
|
80
|
+
"@type": "ParameterRangeUnion",
|
|
81
|
+
"parameterRangeElements": [
|
|
82
|
+
{
|
|
83
|
+
"@type": "ParameterRangeArray",
|
|
84
|
+
"parameterRangeValue": {
|
|
85
|
+
"@type": "ParameterRangeGenericComponent",
|
|
86
|
+
"component": "cc:components/Actor.jsonld#Actor",
|
|
87
|
+
"genericTypeInstances": [
|
|
88
|
+
{
|
|
89
|
+
"@type": "ParameterRangeGenericTypeReference",
|
|
90
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^3.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"@type": "ParameterRangeGenericTypeReference",
|
|
94
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^3.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"@type": "ParameterRangeGenericTypeReference",
|
|
98
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^3.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
|
|
99
|
+
}
|
|
100
|
+
]
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"@type": "ParameterRangeUndefined"
|
|
105
|
+
}
|
|
106
|
+
]
|
|
107
|
+
},
|
|
108
|
+
"comment": "Actor that must be registered in the bus before this actor."
|
|
109
|
+
}
|
|
110
|
+
],
|
|
111
|
+
"memberFields": [
|
|
112
|
+
{
|
|
113
|
+
"@id": "cbqsi:components/ActorQuerySourceIdentify.jsonld#ActorQuerySourceIdentify__member_constructor",
|
|
114
|
+
"memberFieldName": "constructor"
|
|
115
|
+
}
|
|
116
|
+
],
|
|
117
|
+
"constructorArguments": [
|
|
118
|
+
{
|
|
119
|
+
"@id": "cbqsi:components/ActorQuerySourceIdentify.jsonld#ActorQuerySourceIdentify_args__constructorArgument",
|
|
120
|
+
"fields": [
|
|
121
|
+
{
|
|
122
|
+
"keyRaw": "name",
|
|
123
|
+
"value": {
|
|
124
|
+
"@id": "cbqsi:components/ActorQuerySourceIdentify.jsonld#ActorQuerySourceIdentify_args_name"
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"keyRaw": "bus",
|
|
129
|
+
"value": {
|
|
130
|
+
"@id": "cbqsi:components/ActorQuerySourceIdentify.jsonld#ActorQuerySourceIdentify_args_bus"
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
"keyRaw": "beforeActors",
|
|
135
|
+
"value": {
|
|
136
|
+
"@id": "cbqsi:components/ActorQuerySourceIdentify.jsonld#ActorQuerySourceIdentify_args_beforeActors"
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
]
|
|
140
|
+
}
|
|
141
|
+
]
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
"@id": "cbqsi:components/ActorQuerySourceIdentify.jsonld#IActionQuerySourceIdentify",
|
|
145
|
+
"@type": "AbstractClass",
|
|
146
|
+
"requireElement": "IActionQuerySourceIdentify",
|
|
147
|
+
"extends": [
|
|
148
|
+
"cc:components/Actor.jsonld#IAction"
|
|
149
|
+
],
|
|
150
|
+
"parameters": [],
|
|
151
|
+
"memberFields": [
|
|
152
|
+
{
|
|
153
|
+
"@id": "cbqsi:components/ActorQuerySourceIdentify.jsonld#IActionQuerySourceIdentify__member_querySourceUnidentified",
|
|
154
|
+
"memberFieldName": "querySourceUnidentified"
|
|
155
|
+
}
|
|
156
|
+
],
|
|
157
|
+
"constructorArguments": []
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
"@id": "cbqsi:components/ActorQuerySourceIdentify.jsonld#IActorQuerySourceIdentifyOutput",
|
|
161
|
+
"@type": "AbstractClass",
|
|
162
|
+
"requireElement": "IActorQuerySourceIdentifyOutput",
|
|
163
|
+
"extends": [
|
|
164
|
+
"cc:components/Actor.jsonld#IActorOutput"
|
|
165
|
+
],
|
|
166
|
+
"parameters": [],
|
|
167
|
+
"memberFields": [
|
|
168
|
+
{
|
|
169
|
+
"@id": "cbqsi:components/ActorQuerySourceIdentify.jsonld#IActorQuerySourceIdentifyOutput__member_querySource",
|
|
170
|
+
"memberFieldName": "querySource"
|
|
171
|
+
}
|
|
172
|
+
],
|
|
173
|
+
"constructorArguments": []
|
|
174
|
+
}
|
|
175
|
+
]
|
|
176
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"@context": [
|
|
3
|
+
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-query-source-identify/^3.0.0/components/context.jsonld"
|
|
4
|
+
],
|
|
5
|
+
"@id": "npmd:@comunica/bus-query-source-identify",
|
|
6
|
+
"@type": "Module",
|
|
7
|
+
"requireName": "@comunica/bus-query-source-identify",
|
|
8
|
+
"import": [
|
|
9
|
+
"cbqsi:components/ActorQuerySourceIdentify.jsonld"
|
|
10
|
+
]
|
|
11
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"@context": [
|
|
3
|
+
"https://linkedsoftwaredependencies.org/bundles/npm/componentsjs/^5.0.0/components/context.jsonld",
|
|
4
|
+
{
|
|
5
|
+
"npmd": "https://linkedsoftwaredependencies.org/bundles/npm/",
|
|
6
|
+
"cbqsi": "npmd:@comunica/bus-query-source-identify/^3.0.0/",
|
|
7
|
+
"ActorQuerySourceIdentify": {
|
|
8
|
+
"@id": "cbqsi:components/ActorQuerySourceIdentify.jsonld#ActorQuerySourceIdentify",
|
|
9
|
+
"@prefix": true,
|
|
10
|
+
"@context": {
|
|
11
|
+
"args_name": {
|
|
12
|
+
"@id": "cbqsi:components/ActorQuerySourceIdentify.jsonld#ActorQuerySourceIdentify_args_name"
|
|
13
|
+
},
|
|
14
|
+
"args_bus": {
|
|
15
|
+
"@id": "cbqsi:components/ActorQuerySourceIdentify.jsonld#ActorQuerySourceIdentify_args_bus"
|
|
16
|
+
},
|
|
17
|
+
"args_beforeActors": {
|
|
18
|
+
"@id": "cbqsi:components/ActorQuerySourceIdentify.jsonld#ActorQuerySourceIdentify_args_beforeActors",
|
|
19
|
+
"@container": "@list"
|
|
20
|
+
},
|
|
21
|
+
"name": {
|
|
22
|
+
"@id": "cbqsi:components/ActorQuerySourceIdentify.jsonld#ActorQuerySourceIdentify_args_name"
|
|
23
|
+
},
|
|
24
|
+
"bus": {
|
|
25
|
+
"@id": "cbqsi:components/ActorQuerySourceIdentify.jsonld#ActorQuerySourceIdentify_args_bus"
|
|
26
|
+
},
|
|
27
|
+
"beforeActors": {
|
|
28
|
+
"@id": "cbqsi:components/ActorQuerySourceIdentify.jsonld#ActorQuerySourceIdentify_args_beforeActors",
|
|
29
|
+
"@container": "@list"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"IActionQuerySourceIdentify": {
|
|
34
|
+
"@id": "cbqsi:components/ActorQuerySourceIdentify.jsonld#IActionQuerySourceIdentify",
|
|
35
|
+
"@prefix": true,
|
|
36
|
+
"@context": {}
|
|
37
|
+
},
|
|
38
|
+
"IActorQuerySourceIdentifyOutput": {
|
|
39
|
+
"@id": "cbqsi:components/ActorQuerySourceIdentify.jsonld#IActorQuerySourceIdentifyOutput",
|
|
40
|
+
"@prefix": true,
|
|
41
|
+
"@context": {}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { IAction, IActorArgs, IActorOutput, IActorTest, Mediate } from '@comunica/core';
|
|
2
|
+
import { Actor } from '@comunica/core';
|
|
3
|
+
import type { IQuerySourceWrapper, QuerySourceUnidentifiedExpanded } from '@comunica/types';
|
|
4
|
+
/**
|
|
5
|
+
* A comunica actor for query-source-identify events.
|
|
6
|
+
*
|
|
7
|
+
* Actor types:
|
|
8
|
+
* * Input: IActionQuerySourceIdentify: An unidentified query source.
|
|
9
|
+
* * Test: <none>
|
|
10
|
+
* * Output: IActorQuerySourceIdentifyOutput: An identified query source.
|
|
11
|
+
*
|
|
12
|
+
* @see IActionQuerySourceIdentify
|
|
13
|
+
* @see IActorQuerySourceIdentifyOutput
|
|
14
|
+
*/
|
|
15
|
+
export declare abstract class ActorQuerySourceIdentify extends Actor<IActionQuerySourceIdentify, IActorTest, IActorQuerySourceIdentifyOutput> {
|
|
16
|
+
/**
|
|
17
|
+
* @param args - @defaultNested {<default_bus> a <cc:components/Bus.jsonld#Bus>} bus
|
|
18
|
+
*/
|
|
19
|
+
constructor(args: IActorQuerySourceIdentifyArgs);
|
|
20
|
+
}
|
|
21
|
+
export interface IActionQuerySourceIdentify extends IAction {
|
|
22
|
+
/**
|
|
23
|
+
* An unidentified query source.
|
|
24
|
+
*/
|
|
25
|
+
querySourceUnidentified: QuerySourceUnidentifiedExpanded;
|
|
26
|
+
}
|
|
27
|
+
export interface IActorQuerySourceIdentifyOutput extends IActorOutput {
|
|
28
|
+
/**
|
|
29
|
+
* An identified query source.
|
|
30
|
+
*/
|
|
31
|
+
querySource: IQuerySourceWrapper;
|
|
32
|
+
}
|
|
33
|
+
export type IActorQuerySourceIdentifyArgs = IActorArgs<IActionQuerySourceIdentify, IActorTest, IActorQuerySourceIdentifyOutput>;
|
|
34
|
+
export type MediatorQuerySourceIdentify = Mediate<IActionQuerySourceIdentify, IActorQuerySourceIdentifyOutput>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ActorQuerySourceIdentify = void 0;
|
|
4
|
+
const core_1 = require("@comunica/core");
|
|
5
|
+
/**
|
|
6
|
+
* A comunica actor for query-source-identify events.
|
|
7
|
+
*
|
|
8
|
+
* Actor types:
|
|
9
|
+
* * Input: IActionQuerySourceIdentify: An unidentified query source.
|
|
10
|
+
* * Test: <none>
|
|
11
|
+
* * Output: IActorQuerySourceIdentifyOutput: An identified query source.
|
|
12
|
+
*
|
|
13
|
+
* @see IActionQuerySourceIdentify
|
|
14
|
+
* @see IActorQuerySourceIdentifyOutput
|
|
15
|
+
*/
|
|
16
|
+
class ActorQuerySourceIdentify extends core_1.Actor {
|
|
17
|
+
/**
|
|
18
|
+
* @param args - @defaultNested {<default_bus> a <cc:components/Bus.jsonld#Bus>} bus
|
|
19
|
+
*/
|
|
20
|
+
constructor(args) {
|
|
21
|
+
super(args);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.ActorQuerySourceIdentify = ActorQuerySourceIdentify;
|
|
25
|
+
//# sourceMappingURL=ActorQuerySourceIdentify.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActorQuerySourceIdentify.js","sourceRoot":"","sources":["ActorQuerySourceIdentify.ts"],"names":[],"mappings":";;;AACA,yCAAuC;AAGvC;;;;;;;;;;GAUG;AACH,MAAsB,wBACpB,SAAQ,YAA8E;IACtF;;MAEE;IACF,YAAmB,IAAmC;QACpD,KAAK,CAAC,IAAI,CAAC,CAAC;IACd,CAAC;CACF;AARD,4DAQC","sourcesContent":["import type { IAction, IActorArgs, IActorOutput, IActorTest, Mediate } from '@comunica/core';\nimport { Actor } from '@comunica/core';\nimport type { IQuerySourceWrapper, QuerySourceUnidentifiedExpanded } from '@comunica/types';\n\n/**\n * A comunica actor for query-source-identify events.\n *\n * Actor types:\n * * Input: IActionQuerySourceIdentify: An unidentified query source.\n * * Test: <none>\n * * Output: IActorQuerySourceIdentifyOutput: An identified query source.\n *\n * @see IActionQuerySourceIdentify\n * @see IActorQuerySourceIdentifyOutput\n */\nexport abstract class ActorQuerySourceIdentify\n extends Actor<IActionQuerySourceIdentify, IActorTest, IActorQuerySourceIdentifyOutput> {\n /**\n * @param args - @defaultNested {<default_bus> a <cc:components/Bus.jsonld#Bus>} bus\n */\n public constructor(args: IActorQuerySourceIdentifyArgs) {\n super(args);\n }\n}\n\nexport interface IActionQuerySourceIdentify extends IAction {\n /**\n * An unidentified query source.\n */\n querySourceUnidentified: QuerySourceUnidentifiedExpanded;\n}\n\nexport interface IActorQuerySourceIdentifyOutput extends IActorOutput {\n /**\n * An identified query source.\n */\n querySource: IQuerySourceWrapper;\n}\n\nexport type IActorQuerySourceIdentifyArgs = IActorArgs<\nIActionQuerySourceIdentify, IActorTest, IActorQuerySourceIdentifyOutput>;\n\nexport type MediatorQuerySourceIdentify = Mediate<\nIActionQuerySourceIdentify, IActorQuerySourceIdentifyOutput>;\n"]}
|
package/lib/Utils.d.ts
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import type { BindingsFactory } from '@comunica/bindings-factory';
|
|
2
|
+
import type { BindingsStream, MetadataBindings, MetadataQuads, TermsOrder } from '@comunica/types';
|
|
3
|
+
import type * as RDF from '@rdfjs/types';
|
|
4
|
+
import type { AsyncIterator } from 'asynciterator';
|
|
5
|
+
import type { QuadTermName } from 'rdf-terms';
|
|
6
|
+
import type { Algebra } from 'sparqlalgebrajs';
|
|
7
|
+
/**
|
|
8
|
+
* Convert an iterator of quads to an iterator of bindings.
|
|
9
|
+
* @param quads The quads to convert.
|
|
10
|
+
* @param pattern The pattern to get variables from to determine bindings.
|
|
11
|
+
* All quads are also assumed to match the pattern.
|
|
12
|
+
* @param bindingsFactory The factory for creating bindings.
|
|
13
|
+
* @param unionDefaultGraph If union default graph mode is enabled.
|
|
14
|
+
* If true, variable graphs will match all graphs, including the default graph.
|
|
15
|
+
* If false, variable graphs will only match named graphs, and not the default graph.
|
|
16
|
+
*/
|
|
17
|
+
export declare function quadsToBindings(quads: AsyncIterator<RDF.Quad>, pattern: Algebra.Pattern, bindingsFactory: BindingsFactory, unionDefaultGraph: boolean): BindingsStream;
|
|
18
|
+
/**
|
|
19
|
+
* Check if a term is a variable.
|
|
20
|
+
* @param {RDF.Term} term An RDF term.
|
|
21
|
+
* @return {any} If the term is a variable or blank node.
|
|
22
|
+
*/
|
|
23
|
+
export declare function isTermVariable(term: RDF.Term): term is RDF.Variable;
|
|
24
|
+
/**
|
|
25
|
+
* Get all variables in the given pattern.
|
|
26
|
+
* No duplicates are returned.
|
|
27
|
+
* @param {RDF.BaseQuad} pattern A quad pattern.
|
|
28
|
+
*/
|
|
29
|
+
export declare function getVariables(pattern: RDF.BaseQuad): RDF.Variable[];
|
|
30
|
+
/**
|
|
31
|
+
* A helper function to find a hash with quad elements that have duplicate variables.
|
|
32
|
+
*
|
|
33
|
+
* @param {RDF.Quad} pattern A quad pattern.
|
|
34
|
+
*
|
|
35
|
+
* @return {{[p: string]: string[]}} If no equal variable names are present in the four terms, this returns undefined.
|
|
36
|
+
* Otherwise, this maps quad elements paths (['subject'], ['predicate'], ['object'],
|
|
37
|
+
* ['graph'])
|
|
38
|
+
* to the list of quad elements it shares a variable name with.
|
|
39
|
+
* For quoted triples, paths such as ['subject', 'object'] may occur.
|
|
40
|
+
* If no links for a certain element exist, this element will
|
|
41
|
+
* not be included in the hash.
|
|
42
|
+
* Note 1: Quad elements will never have a link to themselves.
|
|
43
|
+
* So this can never occur: { subject: [[ 'subject']] },
|
|
44
|
+
* instead 'null' would be returned.
|
|
45
|
+
* Note 2: Links only exist in one direction,
|
|
46
|
+
* this means that { subject: [[ 'predicate']], predicate: [[ 'subject' ]] }
|
|
47
|
+
* will not occur, instead only { subject: [[ 'predicate']] }
|
|
48
|
+
* will be returned.
|
|
49
|
+
* Note 3: Keys can also be paths, but they are delimited by '_', such as:
|
|
50
|
+
* { subject_object_subject: [[ 'predicate']] }
|
|
51
|
+
*/
|
|
52
|
+
export declare function getDuplicateElementLinks(pattern: RDF.BaseQuad): Record<string, QuadTermName[][]> | undefined;
|
|
53
|
+
/**
|
|
54
|
+
* Set the metadata of the bindings stream derived from the metadata of the quads stream.
|
|
55
|
+
*
|
|
56
|
+
* @param {BindingsStream} bindings The bindings stream that will receive the metadata property.
|
|
57
|
+
* @param {AsyncIterator<Quad>} quads The quads stream that is guaranteed to emit the metadata property.
|
|
58
|
+
* @param elementVariables Mapping of quad term name to variable name.
|
|
59
|
+
* @param variables Variables to include in the metadata
|
|
60
|
+
* @param forceEstimateCardinality Set the cardinality to estimate
|
|
61
|
+
* @return {() => Promise<{[p: string]: any}>} A lazy promise behind a callback resolving to a metadata object.
|
|
62
|
+
*/
|
|
63
|
+
export declare function setMetadata(bindings: BindingsStream, quads: AsyncIterator<RDF.Quad>, elementVariables: Record<string, string>, variables: RDF.Variable[], forceEstimateCardinality: boolean): void;
|
|
64
|
+
/**
|
|
65
|
+
* Convert the metadata of quads to the metadata of bindings.
|
|
66
|
+
* @param metadataQuads Quads metadata.
|
|
67
|
+
* @param elementVariables A mapping from quad elements to variables.
|
|
68
|
+
* @param variables The variables in the bindings.
|
|
69
|
+
*/
|
|
70
|
+
export declare function quadsMetadataToBindingsMetadata(metadataQuads: MetadataQuads, elementVariables: Record<string, string>, variables: RDF.Variable[]): MetadataBindings;
|
|
71
|
+
/**
|
|
72
|
+
* Convert the quads order metadata element to a bindings order metadata element.
|
|
73
|
+
* @param quadsOrder Quads order.
|
|
74
|
+
* @param elementVariables A mapping from quad elements to variables.
|
|
75
|
+
*/
|
|
76
|
+
export declare function quadsOrderToBindingsOrder(quadsOrder: TermsOrder<RDF.QuadTermName>, elementVariables: Record<string, string>): TermsOrder<RDF.Variable>;
|
|
77
|
+
/**
|
|
78
|
+
* Perform post-match-filtering if the source does not support quoted triple filtering,
|
|
79
|
+
* but we have a variable inside a quoted triple.
|
|
80
|
+
* @param pattern The current quad pattern operation.
|
|
81
|
+
* @param it The iterator to filter.
|
|
82
|
+
*/
|
|
83
|
+
export declare function filterMatchingQuotedQuads(pattern: RDF.BaseQuad, it: AsyncIterator<RDF.Quad>): AsyncIterator<RDF.Quad>;
|
package/lib/Utils.js
ADDED
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.filterMatchingQuotedQuads = exports.quadsOrderToBindingsOrder = exports.quadsMetadataToBindingsMetadata = exports.setMetadata = exports.getDuplicateElementLinks = exports.getVariables = exports.isTermVariable = exports.quadsToBindings = void 0;
|
|
4
|
+
const bus_query_operation_1 = require("@comunica/bus-query-operation");
|
|
5
|
+
const metadata_1 = require("@comunica/metadata");
|
|
6
|
+
const rdf_data_factory_1 = require("rdf-data-factory");
|
|
7
|
+
const rdf_string_1 = require("rdf-string");
|
|
8
|
+
const rdf_terms_1 = require("rdf-terms");
|
|
9
|
+
const QuadTermUtil_1 = require("rdf-terms/lib/QuadTermUtil");
|
|
10
|
+
const DF = new rdf_data_factory_1.DataFactory();
|
|
11
|
+
/**
|
|
12
|
+
* Convert an iterator of quads to an iterator of bindings.
|
|
13
|
+
* @param quads The quads to convert.
|
|
14
|
+
* @param pattern The pattern to get variables from to determine bindings.
|
|
15
|
+
* All quads are also assumed to match the pattern.
|
|
16
|
+
* @param bindingsFactory The factory for creating bindings.
|
|
17
|
+
* @param unionDefaultGraph If union default graph mode is enabled.
|
|
18
|
+
* If true, variable graphs will match all graphs, including the default graph.
|
|
19
|
+
* If false, variable graphs will only match named graphs, and not the default graph.
|
|
20
|
+
*/
|
|
21
|
+
function quadsToBindings(quads, pattern, bindingsFactory, unionDefaultGraph) {
|
|
22
|
+
const variables = getVariables(pattern);
|
|
23
|
+
// If non-default-graph triples need to be filtered out
|
|
24
|
+
const filterNonDefaultQuads = pattern.graph.termType === 'Variable' && !unionDefaultGraph;
|
|
25
|
+
// Detect duplicate variables in the pattern
|
|
26
|
+
const duplicateElementLinks = getDuplicateElementLinks(pattern);
|
|
27
|
+
// Convenience datastructure for mapping quad elements to variables
|
|
28
|
+
const elementVariables = (0, rdf_terms_1.reduceTermsNested)(pattern, (acc, term, keys) => {
|
|
29
|
+
if (term.termType === 'Variable') {
|
|
30
|
+
acc[keys.join('_')] = term.value;
|
|
31
|
+
}
|
|
32
|
+
return acc;
|
|
33
|
+
}, {});
|
|
34
|
+
// Optionally filter, and construct bindings
|
|
35
|
+
const it = new bus_query_operation_1.ClosableTransformIterator(async () => {
|
|
36
|
+
let filteredOutput = quads;
|
|
37
|
+
// SPARQL query semantics allow graph variables to only match with named graphs, excluding the default graph
|
|
38
|
+
// But this is not the case when using union default graph semantics
|
|
39
|
+
if (filterNonDefaultQuads) {
|
|
40
|
+
filteredOutput = filteredOutput.filter(quad => quad.graph.termType !== 'DefaultGraph');
|
|
41
|
+
}
|
|
42
|
+
// If there are duplicate variables in the search pattern,
|
|
43
|
+
// make sure that we filter out the triples that don't have equal values for those triple elements,
|
|
44
|
+
// as the rdf-resolve-quad-pattern bus ignores variable names.
|
|
45
|
+
if (duplicateElementLinks) {
|
|
46
|
+
filteredOutput = filteredOutput.filter(quad => {
|
|
47
|
+
for (const keyLeft in duplicateElementLinks) {
|
|
48
|
+
const keysLeft = keyLeft.split('_');
|
|
49
|
+
const valueLeft = (0, rdf_terms_1.getValueNestedPath)(quad, keysLeft);
|
|
50
|
+
for (const keysRight of duplicateElementLinks[keyLeft]) {
|
|
51
|
+
if (!valueLeft.equals((0, rdf_terms_1.getValueNestedPath)(quad, keysRight))) {
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return true;
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
return filteredOutput.map(quad => bindingsFactory.bindings(Object.keys(elementVariables).map(key => {
|
|
60
|
+
const keys = key.split('_');
|
|
61
|
+
const variable = elementVariables[key];
|
|
62
|
+
const term = (0, rdf_terms_1.getValueNestedPath)(quad, keys);
|
|
63
|
+
return [DF.variable(variable), term];
|
|
64
|
+
})));
|
|
65
|
+
}, {
|
|
66
|
+
autoStart: false,
|
|
67
|
+
onClose: () => quads.destroy(),
|
|
68
|
+
});
|
|
69
|
+
// Set the metadata property
|
|
70
|
+
setMetadata(it, quads, elementVariables, variables, filterNonDefaultQuads || Boolean(duplicateElementLinks));
|
|
71
|
+
return it;
|
|
72
|
+
}
|
|
73
|
+
exports.quadsToBindings = quadsToBindings;
|
|
74
|
+
/**
|
|
75
|
+
* Check if a term is a variable.
|
|
76
|
+
* @param {RDF.Term} term An RDF term.
|
|
77
|
+
* @return {any} If the term is a variable or blank node.
|
|
78
|
+
*/
|
|
79
|
+
function isTermVariable(term) {
|
|
80
|
+
return term.termType === 'Variable';
|
|
81
|
+
}
|
|
82
|
+
exports.isTermVariable = isTermVariable;
|
|
83
|
+
/**
|
|
84
|
+
* Get all variables in the given pattern.
|
|
85
|
+
* No duplicates are returned.
|
|
86
|
+
* @param {RDF.BaseQuad} pattern A quad pattern.
|
|
87
|
+
*/
|
|
88
|
+
function getVariables(pattern) {
|
|
89
|
+
return (0, rdf_terms_1.uniqTerms)((0, rdf_terms_1.getTermsNested)(pattern).filter(isTermVariable));
|
|
90
|
+
}
|
|
91
|
+
exports.getVariables = getVariables;
|
|
92
|
+
/**
|
|
93
|
+
* A helper function to find a hash with quad elements that have duplicate variables.
|
|
94
|
+
*
|
|
95
|
+
* @param {RDF.Quad} pattern A quad pattern.
|
|
96
|
+
*
|
|
97
|
+
* @return {{[p: string]: string[]}} If no equal variable names are present in the four terms, this returns undefined.
|
|
98
|
+
* Otherwise, this maps quad elements paths (['subject'], ['predicate'], ['object'],
|
|
99
|
+
* ['graph'])
|
|
100
|
+
* to the list of quad elements it shares a variable name with.
|
|
101
|
+
* For quoted triples, paths such as ['subject', 'object'] may occur.
|
|
102
|
+
* If no links for a certain element exist, this element will
|
|
103
|
+
* not be included in the hash.
|
|
104
|
+
* Note 1: Quad elements will never have a link to themselves.
|
|
105
|
+
* So this can never occur: { subject: [[ 'subject']] },
|
|
106
|
+
* instead 'null' would be returned.
|
|
107
|
+
* Note 2: Links only exist in one direction,
|
|
108
|
+
* this means that { subject: [[ 'predicate']], predicate: [[ 'subject' ]] }
|
|
109
|
+
* will not occur, instead only { subject: [[ 'predicate']] }
|
|
110
|
+
* will be returned.
|
|
111
|
+
* Note 3: Keys can also be paths, but they are delimited by '_', such as:
|
|
112
|
+
* { subject_object_subject: [[ 'predicate']] }
|
|
113
|
+
*/
|
|
114
|
+
function getDuplicateElementLinks(pattern) {
|
|
115
|
+
// Collect a variable to quad elements mapping.
|
|
116
|
+
const variableElements = {};
|
|
117
|
+
let duplicateVariables = false;
|
|
118
|
+
(0, rdf_terms_1.forEachTermsNested)(pattern, (value, keys) => {
|
|
119
|
+
if (value.termType === 'Variable') {
|
|
120
|
+
const val = (0, rdf_string_1.termToString)(value);
|
|
121
|
+
const length = (variableElements[val] || (variableElements[val] = [])).push(keys);
|
|
122
|
+
duplicateVariables = duplicateVariables || length > 1;
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
if (!duplicateVariables) {
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
// Collect quad element to elements with equal variables mapping.
|
|
129
|
+
const duplicateElementLinks = {};
|
|
130
|
+
for (const variable in variableElements) {
|
|
131
|
+
const elements = variableElements[variable];
|
|
132
|
+
const remainingElements = elements.slice(1);
|
|
133
|
+
// Only store the elements that have at least one equal element.
|
|
134
|
+
if (remainingElements.length > 0) {
|
|
135
|
+
duplicateElementLinks[elements[0].join('_')] = remainingElements;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
return duplicateElementLinks;
|
|
139
|
+
}
|
|
140
|
+
exports.getDuplicateElementLinks = getDuplicateElementLinks;
|
|
141
|
+
/**
|
|
142
|
+
* Set the metadata of the bindings stream derived from the metadata of the quads stream.
|
|
143
|
+
*
|
|
144
|
+
* @param {BindingsStream} bindings The bindings stream that will receive the metadata property.
|
|
145
|
+
* @param {AsyncIterator<Quad>} quads The quads stream that is guaranteed to emit the metadata property.
|
|
146
|
+
* @param elementVariables Mapping of quad term name to variable name.
|
|
147
|
+
* @param variables Variables to include in the metadata
|
|
148
|
+
* @param forceEstimateCardinality Set the cardinality to estimate
|
|
149
|
+
* @return {() => Promise<{[p: string]: any}>} A lazy promise behind a callback resolving to a metadata object.
|
|
150
|
+
*/
|
|
151
|
+
function setMetadata(bindings, quads, elementVariables, variables, forceEstimateCardinality) {
|
|
152
|
+
const getMetadataCb = (metadataRaw) => {
|
|
153
|
+
if (!('canContainUndefs' in metadataRaw)) {
|
|
154
|
+
metadataRaw.canContainUndefs = false;
|
|
155
|
+
}
|
|
156
|
+
if (forceEstimateCardinality) {
|
|
157
|
+
metadataRaw.cardinality.type = 'estimate';
|
|
158
|
+
}
|
|
159
|
+
bindings.setProperty('metadata', quadsMetadataToBindingsMetadata((0, metadata_1.validateMetadataQuads)(metadataRaw), elementVariables, variables));
|
|
160
|
+
// Propagate metadata invalidations
|
|
161
|
+
if (metadataRaw.state) {
|
|
162
|
+
metadataRaw.state.addInvalidateListener(() => {
|
|
163
|
+
setMetadata(bindings, quads, elementVariables, variables, forceEstimateCardinality);
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
const metadata = quads.getProperty('metadata');
|
|
168
|
+
if (metadata) {
|
|
169
|
+
// This is to enforce sync metadata setting, because AsyncIterator will always call it async,
|
|
170
|
+
// even if the property was already defined.
|
|
171
|
+
getMetadataCb(metadata);
|
|
172
|
+
}
|
|
173
|
+
else {
|
|
174
|
+
quads.getProperty('metadata', getMetadataCb);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
exports.setMetadata = setMetadata;
|
|
178
|
+
/**
|
|
179
|
+
* Convert the metadata of quads to the metadata of bindings.
|
|
180
|
+
* @param metadataQuads Quads metadata.
|
|
181
|
+
* @param elementVariables A mapping from quad elements to variables.
|
|
182
|
+
* @param variables The variables in the bindings.
|
|
183
|
+
*/
|
|
184
|
+
function quadsMetadataToBindingsMetadata(metadataQuads, elementVariables, variables) {
|
|
185
|
+
return {
|
|
186
|
+
...metadataQuads,
|
|
187
|
+
canContainUndefs: false,
|
|
188
|
+
order: metadataQuads.order ?
|
|
189
|
+
quadsOrderToBindingsOrder(metadataQuads.order, elementVariables) :
|
|
190
|
+
undefined,
|
|
191
|
+
availableOrders: metadataQuads.availableOrders ?
|
|
192
|
+
metadataQuads.availableOrders.map(orderDef => ({
|
|
193
|
+
cost: orderDef.cost,
|
|
194
|
+
terms: quadsOrderToBindingsOrder(orderDef.terms, elementVariables),
|
|
195
|
+
})) :
|
|
196
|
+
undefined,
|
|
197
|
+
variables,
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
exports.quadsMetadataToBindingsMetadata = quadsMetadataToBindingsMetadata;
|
|
201
|
+
/**
|
|
202
|
+
* Convert the quads order metadata element to a bindings order metadata element.
|
|
203
|
+
* @param quadsOrder Quads order.
|
|
204
|
+
* @param elementVariables A mapping from quad elements to variables.
|
|
205
|
+
*/
|
|
206
|
+
function quadsOrderToBindingsOrder(quadsOrder, elementVariables) {
|
|
207
|
+
const mappedVariables = {};
|
|
208
|
+
return quadsOrder.map(entry => {
|
|
209
|
+
// Omit entries that do not map to a variable
|
|
210
|
+
const variableName = elementVariables[entry.term];
|
|
211
|
+
if (!variableName) {
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
214
|
+
// Omit entries that have been mapped already
|
|
215
|
+
if (mappedVariables[variableName]) {
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
218
|
+
mappedVariables[variableName] = true;
|
|
219
|
+
return {
|
|
220
|
+
term: DF.variable(variableName),
|
|
221
|
+
direction: entry.direction,
|
|
222
|
+
};
|
|
223
|
+
}).filter(entry => Boolean(entry));
|
|
224
|
+
}
|
|
225
|
+
exports.quadsOrderToBindingsOrder = quadsOrderToBindingsOrder;
|
|
226
|
+
/**
|
|
227
|
+
* Perform post-match-filtering if the source does not support quoted triple filtering,
|
|
228
|
+
* but we have a variable inside a quoted triple.
|
|
229
|
+
* @param pattern The current quad pattern operation.
|
|
230
|
+
* @param it The iterator to filter.
|
|
231
|
+
*/
|
|
232
|
+
function filterMatchingQuotedQuads(pattern, it) {
|
|
233
|
+
if ((0, rdf_terms_1.someTerms)(pattern, term => term.termType === 'Quad')) {
|
|
234
|
+
it = it.transform({
|
|
235
|
+
filter: quad => (0, QuadTermUtil_1.matchPatternMappings)(quad, pattern),
|
|
236
|
+
autoStart: false,
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
return it;
|
|
240
|
+
}
|
|
241
|
+
exports.filterMatchingQuotedQuads = filterMatchingQuotedQuads;
|
|
242
|
+
//# sourceMappingURL=Utils.js.map
|
package/lib/Utils.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Utils.js","sourceRoot":"","sources":["Utils.ts"],"names":[],"mappings":";;;AACA,uEAA0E;AAC1E,iDAA2D;AAI3D,uDAA+C;AAC/C,2CAA0C;AAE1C,yCAOmB;AACnB,6DAAkE;AAGlE,MAAM,EAAE,GAAG,IAAI,8BAAW,EAAE,CAAC;AAE7B;;;;;;;;;GASG;AACH,SAAgB,eAAe,CAC7B,KAA8B,EAC9B,OAAwB,EACxB,eAAgC,EAChC,iBAA0B;IAE1B,MAAM,SAAS,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC;IAExC,uDAAuD;IACvD,MAAM,qBAAqB,GAAG,OAAO,CAAC,KAAK,CAAC,QAAQ,KAAK,UAAU,IAAI,CAAC,iBAAiB,CAAC;IAE1F,4CAA4C;IAC5C,MAAM,qBAAqB,GAAiD,wBAAwB,CAAC,OAAO,CAAC,CAAC;IAE9G,mEAAmE;IACnE,MAAM,gBAAgB,GAA2B,IAAA,6BAAiB,EAAC,OAAO,EACxE,CAAC,GAA2B,EAAE,IAAc,EAAE,IAAoB,EAAE,EAAE;QACpE,IAAI,IAAI,CAAC,QAAQ,KAAK,UAA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CAAC;IACpD,OAAkC,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;QACvD,6CAA6C;QAC7C,MAAM,YAAY,GAAG,gBAAgB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAClD,IAAI,CAAC,YAAY,EAAE;YACjB,OAAO;SACR;QAED,6CAA6C;QAC7C,IAAI,eAAe,CAAC,YAAY,CAAC,EAAE;YACjC,OAAO;SACR;QAED,eAAe,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC;QACrC,OAAO;YACL,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,YAAY,CAAC;YAC/B,SAAS,EAAE,KAAK,CAAC,SAAS;SAC3B,CAAC;IACJ,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;AACrC,CAAC;AAvBD,8DAuBC;AAED;;;;;GAKG;AACH,SAAgB,yBAAyB,CAAC,OAAqB,EAAE,EAA2B;IAC1F,IAAI,IAAA,qBAAS,EAAC,OAAO,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,KAAK,MAAM,CAAC,EAAE;QACxD,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC;YAChB,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC,IAAA,mCAAoB,EAAC,IAAI,EAAE,OAAO,CAAC;YACnD,SAAS,EAAE,KAAK;SACjB,CAAC,CAAC;KACJ;IACD,OAAO,EAAE,CAAC;AACZ,CAAC;AARD,8DAQC","sourcesContent":["import type { BindingsFactory } from '@comunica/bindings-factory';\nimport { ClosableTransformIterator } from '@comunica/bus-query-operation';\nimport { validateMetadataQuads } from '@comunica/metadata';\nimport type { BindingsStream, MetadataBindings, MetadataQuads, TermsOrder } from '@comunica/types';\nimport type * as RDF from '@rdfjs/types';\nimport type { AsyncIterator } from 'asynciterator';\nimport { DataFactory } from 'rdf-data-factory';\nimport { termToString } from 'rdf-string';\nimport type { QuadTermName } from 'rdf-terms';\nimport {\n forEachTermsNested,\n getTermsNested,\n getValueNestedPath,\n reduceTermsNested,\n someTerms,\n uniqTerms,\n} from 'rdf-terms';\nimport { matchPatternMappings } from 'rdf-terms/lib/QuadTermUtil';\nimport type { Algebra } from 'sparqlalgebrajs';\n\nconst DF = new DataFactory();\n\n/**\n * Convert an iterator of quads to an iterator of bindings.\n * @param quads The quads to convert.\n * @param pattern The pattern to get variables from to determine bindings.\n * All quads are also assumed to match the pattern.\n * @param bindingsFactory The factory for creating bindings.\n * @param unionDefaultGraph If union default graph mode is enabled.\n * If true, variable graphs will match all graphs, including the default graph.\n * If false, variable graphs will only match named graphs, and not the default graph.\n */\nexport function quadsToBindings(\n quads: AsyncIterator<RDF.Quad>,\n pattern: Algebra.Pattern,\n bindingsFactory: BindingsFactory,\n unionDefaultGraph: boolean,\n): BindingsStream {\n const variables = getVariables(pattern);\n\n // If non-default-graph triples need to be filtered out\n const filterNonDefaultQuads = pattern.graph.termType === 'Variable' && !unionDefaultGraph;\n\n // Detect duplicate variables in the pattern\n const duplicateElementLinks: Record<string, QuadTermName[][]> | undefined = getDuplicateElementLinks(pattern);\n\n // Convenience datastructure for mapping quad elements to variables\n const elementVariables: Record<string, string> = reduceTermsNested(pattern,\n (acc: Record<string, string>, term: RDF.Term, keys: QuadTermName[]) => {\n if (term.termType === 'Variable') {\n acc[keys.join('_')] = term.value;\n }\n return acc;\n },\n {});\n\n // Optionally filter, and construct bindings\n const it = new ClosableTransformIterator(async() => {\n let filteredOutput = quads;\n\n // SPARQL query semantics allow graph variables to only match with named graphs, excluding the default graph\n // But this is not the case when using union default graph semantics\n if (filterNonDefaultQuads) {\n filteredOutput = filteredOutput.filter(quad => quad.graph.termType !== 'DefaultGraph');\n }\n\n // If there are duplicate variables in the search pattern,\n // make sure that we filter out the triples that don't have equal values for those triple elements,\n // as the rdf-resolve-quad-pattern bus ignores variable names.\n if (duplicateElementLinks) {\n filteredOutput = filteredOutput.filter(quad => {\n for (const keyLeft in duplicateElementLinks) {\n const keysLeft: QuadTermName[] = <QuadTermName[]> keyLeft.split('_');\n const valueLeft = getValueNestedPath(quad, keysLeft);\n for (const keysRight of duplicateElementLinks[keyLeft]) {\n if (!valueLeft.equals(getValueNestedPath(quad, keysRight))) {\n return false;\n }\n }\n }\n return true;\n });\n }\n\n return filteredOutput.map(quad => bindingsFactory.bindings(Object.keys(elementVariables).map(key => {\n const keys: QuadTermName[] = <any>key.split('_');\n const variable = elementVariables[key];\n const term = getValueNestedPath(quad, keys);\n return [ DF.variable(variable), term ];\n })));\n }, {\n autoStart: false,\n onClose: () => quads.destroy(),\n });\n\n // Set the metadata property\n setMetadata(it, quads, elementVariables, variables, filterNonDefaultQuads || Boolean(duplicateElementLinks));\n\n return it;\n}\n\n/**\n * Check if a term is a variable.\n * @param {RDF.Term} term An RDF term.\n * @return {any} If the term is a variable or blank node.\n */\nexport function isTermVariable(term: RDF.Term): term is RDF.Variable {\n return term.termType === 'Variable';\n}\n\n/**\n * Get all variables in the given pattern.\n * No duplicates are returned.\n * @param {RDF.BaseQuad} pattern A quad pattern.\n */\nexport function getVariables(pattern: RDF.BaseQuad): RDF.Variable[] {\n return uniqTerms(getTermsNested(pattern).filter(isTermVariable));\n}\n\n/**\n * A helper function to find a hash with quad elements that have duplicate variables.\n *\n * @param {RDF.Quad} pattern A quad pattern.\n *\n * @return {{[p: string]: string[]}} If no equal variable names are present in the four terms, this returns undefined.\n * Otherwise, this maps quad elements paths (['subject'], ['predicate'], ['object'],\n * ['graph'])\n * to the list of quad elements it shares a variable name with.\n * For quoted triples, paths such as ['subject', 'object'] may occur.\n * If no links for a certain element exist, this element will\n * not be included in the hash.\n * Note 1: Quad elements will never have a link to themselves.\n * So this can never occur: { subject: [[ 'subject']] },\n * instead 'null' would be returned.\n * Note 2: Links only exist in one direction,\n * this means that { subject: [[ 'predicate']], predicate: [[ 'subject' ]] }\n * will not occur, instead only { subject: [[ 'predicate']] }\n * will be returned.\n * Note 3: Keys can also be paths, but they are delimited by '_', such as:\n * { subject_object_subject: [[ 'predicate']] }\n */\nexport function getDuplicateElementLinks(pattern: RDF.BaseQuad): Record<string, QuadTermName[][]> | undefined {\n // Collect a variable to quad elements mapping.\n const variableElements: Record<string, QuadTermName[][]> = {};\n let duplicateVariables = false;\n forEachTermsNested(pattern, (value, keys) => {\n if (value.termType === 'Variable') {\n const val = termToString(value);\n const length = (variableElements[val] || (variableElements[val] = [])).push(keys);\n duplicateVariables = duplicateVariables || length > 1;\n }\n });\n\n if (!duplicateVariables) {\n return;\n }\n\n // Collect quad element to elements with equal variables mapping.\n const duplicateElementLinks: Record<string, QuadTermName[][]> = {};\n for (const variable in variableElements) {\n const elements = variableElements[variable];\n const remainingElements = elements.slice(1);\n // Only store the elements that have at least one equal element.\n if (remainingElements.length > 0) {\n duplicateElementLinks[elements[0].join('_')] = remainingElements;\n }\n }\n\n return duplicateElementLinks;\n}\n\n/**\n * Set the metadata of the bindings stream derived from the metadata of the quads stream.\n *\n * @param {BindingsStream} bindings The bindings stream that will receive the metadata property.\n * @param {AsyncIterator<Quad>} quads The quads stream that is guaranteed to emit the metadata property.\n * @param elementVariables Mapping of quad term name to variable name.\n * @param variables Variables to include in the metadata\n * @param forceEstimateCardinality Set the cardinality to estimate\n * @return {() => Promise<{[p: string]: any}>} A lazy promise behind a callback resolving to a metadata object.\n */\nexport function setMetadata(\n bindings: BindingsStream,\n quads: AsyncIterator<RDF.Quad>,\n elementVariables: Record<string, string>,\n variables: RDF.Variable[],\n forceEstimateCardinality: boolean,\n): void {\n const getMetadataCb = (metadataRaw: Record<string, any>): void => {\n if (!('canContainUndefs' in metadataRaw)) {\n metadataRaw.canContainUndefs = false;\n }\n if (forceEstimateCardinality) {\n metadataRaw.cardinality.type = 'estimate';\n }\n bindings.setProperty('metadata',\n quadsMetadataToBindingsMetadata(validateMetadataQuads(metadataRaw), elementVariables, variables));\n\n // Propagate metadata invalidations\n if (metadataRaw.state) {\n metadataRaw.state.addInvalidateListener(() => {\n setMetadata(bindings, quads, elementVariables, variables, forceEstimateCardinality);\n });\n }\n };\n\n const metadata = quads.getProperty('metadata');\n if (metadata) {\n // This is to enforce sync metadata setting, because AsyncIterator will always call it async,\n // even if the property was already defined.\n getMetadataCb(metadata);\n } else {\n quads.getProperty('metadata', getMetadataCb);\n }\n}\n\n/**\n * Convert the metadata of quads to the metadata of bindings.\n * @param metadataQuads Quads metadata.\n * @param elementVariables A mapping from quad elements to variables.\n * @param variables The variables in the bindings.\n */\nexport function quadsMetadataToBindingsMetadata(\n metadataQuads: MetadataQuads,\n elementVariables: Record<string, string>,\n variables: RDF.Variable[],\n): MetadataBindings {\n return {\n ...metadataQuads,\n canContainUndefs: false,\n order: metadataQuads.order ?\n quadsOrderToBindingsOrder(metadataQuads.order, elementVariables) :\n undefined,\n availableOrders: metadataQuads.availableOrders ?\n metadataQuads.availableOrders.map(orderDef => ({\n cost: orderDef.cost,\n terms: quadsOrderToBindingsOrder(orderDef.terms, elementVariables),\n })) :\n undefined,\n variables,\n };\n}\n\n/**\n * Convert the quads order metadata element to a bindings order metadata element.\n * @param quadsOrder Quads order.\n * @param elementVariables A mapping from quad elements to variables.\n */\nexport function quadsOrderToBindingsOrder(\n quadsOrder: TermsOrder<RDF.QuadTermName>,\n elementVariables: Record<string, string>,\n): TermsOrder<RDF.Variable> {\n const mappedVariables: Record<string, boolean> = {};\n return <TermsOrder<RDF.Variable>> quadsOrder.map(entry => {\n // Omit entries that do not map to a variable\n const variableName = elementVariables[entry.term];\n if (!variableName) {\n return;\n }\n\n // Omit entries that have been mapped already\n if (mappedVariables[variableName]) {\n return;\n }\n\n mappedVariables[variableName] = true;\n return {\n term: DF.variable(variableName),\n direction: entry.direction,\n };\n }).filter(entry => Boolean(entry));\n}\n\n/**\n * Perform post-match-filtering if the source does not support quoted triple filtering,\n * but we have a variable inside a quoted triple.\n * @param pattern The current quad pattern operation.\n * @param it The iterator to filter.\n */\nexport function filterMatchingQuotedQuads(pattern: RDF.BaseQuad, it: AsyncIterator<RDF.Quad>): AsyncIterator<RDF.Quad> {\n if (someTerms(pattern, term => term.termType === 'Quad')) {\n it = it.transform({\n filter: quad => matchPatternMappings(quad, pattern),\n autoStart: false,\n });\n }\n return it;\n}\n"]}
|
package/lib/index.d.ts
ADDED
package/lib/index.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
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("./ActorQuerySourceIdentify"), exports);
|
|
18
|
+
__exportStar(require("./Utils"), exports);
|
|
19
|
+
//# 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,6DAA2C;AAC3C,0CAAwB","sourcesContent":["export * from './ActorQuerySourceIdentify';\nexport * from './Utils';\n"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@comunica/bus-query-source-identify",
|
|
3
|
+
"version": "3.0.1-alpha.43.0",
|
|
4
|
+
"description": "A comunica bus for query-source-identify events.",
|
|
5
|
+
"lsd:module": true,
|
|
6
|
+
"main": "lib/index.js",
|
|
7
|
+
"typings": "lib/index",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/comunica/comunica.git",
|
|
11
|
+
"directory": "packages/bus-query-source-identify"
|
|
12
|
+
},
|
|
13
|
+
"publishConfig": {
|
|
14
|
+
"access": "public"
|
|
15
|
+
},
|
|
16
|
+
"sideEffects": false,
|
|
17
|
+
"keywords": [
|
|
18
|
+
"comunica",
|
|
19
|
+
"bus",
|
|
20
|
+
"query-source-identify"
|
|
21
|
+
],
|
|
22
|
+
"license": "MIT",
|
|
23
|
+
"bugs": {
|
|
24
|
+
"url": "https://github.com/comunica/comunica/issues"
|
|
25
|
+
},
|
|
26
|
+
"homepage": "https://comunica.dev/",
|
|
27
|
+
"files": [
|
|
28
|
+
"components",
|
|
29
|
+
"lib/**/*.d.ts",
|
|
30
|
+
"lib/**/*.js",
|
|
31
|
+
"lib/**/*.js.map"
|
|
32
|
+
],
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"@comunica/bindings-factory": "3.0.1-alpha.43.0",
|
|
35
|
+
"@comunica/bus-query-operation": "3.0.1-alpha.43.0",
|
|
36
|
+
"@comunica/core": "3.0.1-alpha.43.0",
|
|
37
|
+
"@comunica/metadata": "3.0.1-alpha.43.0",
|
|
38
|
+
"@comunica/types": "3.0.1-alpha.43.0",
|
|
39
|
+
"@rdfjs/types": "*",
|
|
40
|
+
"asynciterator": "^3.8.1",
|
|
41
|
+
"rdf-data-factory": "^1.1.2",
|
|
42
|
+
"rdf-string": "^1.6.3",
|
|
43
|
+
"rdf-terms": "^1.11.0",
|
|
44
|
+
"sparqlalgebrajs": "^4.3.0"
|
|
45
|
+
},
|
|
46
|
+
"scripts": {
|
|
47
|
+
"build": "npm run build:ts && npm run build:components",
|
|
48
|
+
"build:ts": "node \"../../node_modules/typescript/bin/tsc\"",
|
|
49
|
+
"build:components": "componentsjs-generator"
|
|
50
|
+
},
|
|
51
|
+
"gitHead": "d11e44cf07d4699f9d2c51d5851b5ed443de1997"
|
|
52
|
+
}
|