@comunica/actor-rdf-join-optional-optplus 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright © 2017–now Ruben Taelman, Joachim Van Herwegen
4
+ Comunica Association and Ghent University – imec, Belgium
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in
14
+ all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
+ THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,43 @@
1
+ # Comunica Optional OptPlus Loop RDF Join Actor
2
+
3
+ [![npm version](https://badge.fury.io/js/%40comunica%2Factor-rdf-join-optional-optplus.svg)](https://www.npmjs.com/package/@comunica/actor-rdf-join-optional-optplus)
4
+
5
+ An [RDF Join](https://github.com/comunica/comunica/tree/master/packages/bus-rdf-join) actor that handles ["OPT+: A Monotonic Alternative to OPTIONAL in SPARQL" (by Sijin Cheng and Olaf Hartig)](https://www.researchgate.net/publication/333627321_OPT_A_Monotonic_Alternativeto_OPTIONAL_in_SPARQL) operations
6
+ by delegating back to the [RDF Join bus](https://github.com/comunica/comunica/tree/master/packages/bus-rdf-join) bus.
7
+
8
+ This module is part of the [Comunica framework](https://github.com/comunica/comunica),
9
+ and should only be used by [developers that want to build their own query engine](https://comunica.dev/docs/modify/).
10
+
11
+ [Click here if you just want to query with Comunica](https://comunica.dev/docs/query/).
12
+
13
+ ## Install
14
+
15
+ ```bash
16
+ $ yarn add @comunica/actor-rdf-join-optional-optplus
17
+ ```
18
+
19
+ ## Configure
20
+
21
+ After installing, this package can be added to your engine's configuration as follows:
22
+ ```text
23
+ {
24
+ "@context": [
25
+ ...
26
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-rdf-join-optional-optplus/^3.0.0/components/context.jsonld"
27
+ ],
28
+ "actors": [
29
+ ...
30
+ {
31
+ "@id": "urn:comunica:default:rdf-join/actors#optional-optplus",
32
+ "@type": "ActorRdfJoinOptionalOptPlus",
33
+ "mediatorJoin": { "@id": "urn:comunica:default:rdf-join/mediators#main" },
34
+ "mediatorJoinSelectivity": { "@id": "urn:comunica:default:rdf-join-selectivity/mediators#main" }
35
+ }
36
+ ]
37
+ }
38
+ ```
39
+
40
+ ### Config Parameters
41
+
42
+ * `mediatorJoinSelectivity`: A mediator over the [RDF Join Selectivity bus](https://github.com/comunica/comunica/tree/master/packages/bus-rdf-join-selectivity).
43
+ * `mediatorJoin`: A mediator over the [RDF Join bus](https://github.com/comunica/comunica/tree/master/packages/bus-rdf-join).
@@ -0,0 +1,187 @@
1
+ {
2
+ "@context": [
3
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-rdf-join-optional-optplus/^3.0.0/components/context.jsonld",
4
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/core/^3.0.0/components/context.jsonld",
5
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-rdf-join/^3.0.0/components/context.jsonld"
6
+ ],
7
+ "@id": "npmd:@comunica/actor-rdf-join-optional-optplus",
8
+ "components": [
9
+ {
10
+ "@id": "carjoo:components/ActorRdfJoinOptionalOptPlus.jsonld#ActorRdfJoinOptionalOptPlus",
11
+ "@type": "Class",
12
+ "requireElement": "ActorRdfJoinOptionalOptPlus",
13
+ "extends": [
14
+ "cbrj:components/ActorRdfJoin.jsonld#ActorRdfJoin"
15
+ ],
16
+ "comment": "A comunica Optional Opt+ RDF Join Actor.",
17
+ "parameters": [
18
+ {
19
+ "@id": "carjoo:components/ActorRdfJoinOptionalOptPlus.jsonld#ActorRdfJoinOptionalOptPlus_args_mediatorJoin",
20
+ "range": "cc:components/Mediator.jsonld#Mediator",
21
+ "comment": "A mediator for joining Bindings streams"
22
+ },
23
+ {
24
+ "@id": "carjoo:components/ActorRdfJoinOptionalOptPlus.jsonld#ActorRdfJoinOptionalOptPlus_args_mediatorJoinSelectivity",
25
+ "range": "cc:components/Mediator.jsonld#Mediator"
26
+ },
27
+ {
28
+ "@id": "carjoo:components/ActorRdfJoinOptionalOptPlus.jsonld#ActorRdfJoinOptionalOptPlus_args_name",
29
+ "range": "xsd:string",
30
+ "default": {
31
+ "@id": "rdf:subject"
32
+ },
33
+ "comment": "The name for this actor."
34
+ },
35
+ {
36
+ "@id": "carjoo:components/ActorRdfJoinOptionalOptPlus.jsonld#ActorRdfJoinOptionalOptPlus_args_bus",
37
+ "range": {
38
+ "@type": "ParameterRangeGenericComponent",
39
+ "component": "cc:components/Bus.jsonld#Bus",
40
+ "genericTypeInstances": [
41
+ {
42
+ "@type": "ParameterRangeGenericComponent",
43
+ "component": "cc:components/Actor.jsonld#Actor",
44
+ "genericTypeInstances": [
45
+ {
46
+ "@type": "ParameterRangeGenericTypeReference",
47
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^3.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
48
+ },
49
+ {
50
+ "@type": "ParameterRangeGenericTypeReference",
51
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^3.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
52
+ },
53
+ {
54
+ "@type": "ParameterRangeGenericTypeReference",
55
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^3.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
56
+ }
57
+ ]
58
+ },
59
+ {
60
+ "@type": "ParameterRangeGenericTypeReference",
61
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^3.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
62
+ },
63
+ {
64
+ "@type": "ParameterRangeGenericTypeReference",
65
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^3.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
66
+ },
67
+ {
68
+ "@type": "ParameterRangeGenericTypeReference",
69
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^3.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
70
+ }
71
+ ]
72
+ },
73
+ "default": {
74
+ "@id": "cbrj:components/ActorRdfJoin.jsonld#ActorRdfJoin_default_bus",
75
+ "@type": "cc:components/Bus.jsonld#Bus"
76
+ },
77
+ "comment": "The bus this actor subscribes to."
78
+ },
79
+ {
80
+ "@id": "carjoo:components/ActorRdfJoinOptionalOptPlus.jsonld#ActorRdfJoinOptionalOptPlus_args_beforeActors",
81
+ "range": {
82
+ "@type": "ParameterRangeUnion",
83
+ "parameterRangeElements": [
84
+ {
85
+ "@type": "ParameterRangeArray",
86
+ "parameterRangeValue": {
87
+ "@type": "ParameterRangeGenericComponent",
88
+ "component": "cc:components/Actor.jsonld#Actor",
89
+ "genericTypeInstances": [
90
+ {
91
+ "@type": "ParameterRangeGenericTypeReference",
92
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^3.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
93
+ },
94
+ {
95
+ "@type": "ParameterRangeGenericTypeReference",
96
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^3.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
97
+ },
98
+ {
99
+ "@type": "ParameterRangeGenericTypeReference",
100
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^3.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
101
+ }
102
+ ]
103
+ }
104
+ },
105
+ {
106
+ "@type": "ParameterRangeUndefined"
107
+ }
108
+ ]
109
+ },
110
+ "comment": "Actor that must be registered in the bus before this actor."
111
+ }
112
+ ],
113
+ "memberFields": [
114
+ {
115
+ "@id": "carjoo:components/ActorRdfJoinOptionalOptPlus.jsonld#ActorRdfJoinOptionalOptPlus__member_mediatorJoin",
116
+ "memberFieldName": "mediatorJoin",
117
+ "range": "cc:components/Mediator.jsonld#Mediator"
118
+ },
119
+ {
120
+ "@id": "carjoo:components/ActorRdfJoinOptionalOptPlus.jsonld#ActorRdfJoinOptionalOptPlus__member_constructor",
121
+ "memberFieldName": "constructor"
122
+ },
123
+ {
124
+ "@id": "carjoo:components/ActorRdfJoinOptionalOptPlus.jsonld#ActorRdfJoinOptionalOptPlus__member_getOutput",
125
+ "memberFieldName": "getOutput"
126
+ },
127
+ {
128
+ "@id": "carjoo:components/ActorRdfJoinOptionalOptPlus.jsonld#ActorRdfJoinOptionalOptPlus__member_getJoinCoefficients",
129
+ "memberFieldName": "getJoinCoefficients"
130
+ }
131
+ ],
132
+ "constructorArguments": [
133
+ {
134
+ "@id": "carjoo:components/ActorRdfJoinOptionalOptPlus.jsonld#ActorRdfJoinOptionalOptPlus_args__constructorArgument",
135
+ "fields": [
136
+ {
137
+ "keyRaw": "mediatorJoin",
138
+ "value": {
139
+ "@id": "carjoo:components/ActorRdfJoinOptionalOptPlus.jsonld#ActorRdfJoinOptionalOptPlus_args_mediatorJoin"
140
+ }
141
+ },
142
+ {
143
+ "keyRaw": "mediatorJoinSelectivity",
144
+ "value": {
145
+ "@id": "carjoo:components/ActorRdfJoinOptionalOptPlus.jsonld#ActorRdfJoinOptionalOptPlus_args_mediatorJoinSelectivity"
146
+ }
147
+ },
148
+ {
149
+ "keyRaw": "name",
150
+ "value": {
151
+ "@id": "carjoo:components/ActorRdfJoinOptionalOptPlus.jsonld#ActorRdfJoinOptionalOptPlus_args_name"
152
+ }
153
+ },
154
+ {
155
+ "keyRaw": "bus",
156
+ "value": {
157
+ "@id": "carjoo:components/ActorRdfJoinOptionalOptPlus.jsonld#ActorRdfJoinOptionalOptPlus_args_bus"
158
+ }
159
+ },
160
+ {
161
+ "keyRaw": "beforeActors",
162
+ "value": {
163
+ "@id": "carjoo:components/ActorRdfJoinOptionalOptPlus.jsonld#ActorRdfJoinOptionalOptPlus_args_beforeActors"
164
+ }
165
+ }
166
+ ]
167
+ }
168
+ ]
169
+ },
170
+ {
171
+ "@id": "carjoo:components/ActorRdfJoinOptionalOptPlus.jsonld#IActorRdfJoinOptionalOptPlusJoinArgs",
172
+ "@type": "AbstractClass",
173
+ "requireElement": "IActorRdfJoinOptionalOptPlusJoinArgs",
174
+ "extends": [
175
+ "cbrj:components/ActorRdfJoin.jsonld#IActorRdfJoinArgs"
176
+ ],
177
+ "parameters": [],
178
+ "memberFields": [
179
+ {
180
+ "@id": "carjoo:components/ActorRdfJoinOptionalOptPlus.jsonld#IActorRdfJoinOptionalOptPlusJoinArgs__member_mediatorJoin",
181
+ "memberFieldName": "mediatorJoin"
182
+ }
183
+ ],
184
+ "constructorArguments": []
185
+ }
186
+ ]
187
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "@context": [
3
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-rdf-join-optional-optplus/^3.0.0/components/context.jsonld"
4
+ ],
5
+ "@id": "npmd:@comunica/actor-rdf-join-optional-optplus",
6
+ "@type": "Module",
7
+ "requireName": "@comunica/actor-rdf-join-optional-optplus",
8
+ "import": [
9
+ "carjoo:components/ActorRdfJoinOptionalOptPlus.jsonld"
10
+ ]
11
+ }
@@ -0,0 +1,52 @@
1
+ {
2
+ "@context": [
3
+ "https://linkedsoftwaredependencies.org/bundles/npm/componentsjs/^6.0.0/components/context.jsonld",
4
+ {
5
+ "npmd": "https://linkedsoftwaredependencies.org/bundles/npm/",
6
+ "carjoo": "npmd:@comunica/actor-rdf-join-optional-optplus/^3.0.0/",
7
+ "ActorRdfJoinOptionalOptPlus": {
8
+ "@id": "carjoo:components/ActorRdfJoinOptionalOptPlus.jsonld#ActorRdfJoinOptionalOptPlus",
9
+ "@prefix": true,
10
+ "@context": {
11
+ "args_mediatorJoin": {
12
+ "@id": "carjoo:components/ActorRdfJoinOptionalOptPlus.jsonld#ActorRdfJoinOptionalOptPlus_args_mediatorJoin"
13
+ },
14
+ "args_mediatorJoinSelectivity": {
15
+ "@id": "carjoo:components/ActorRdfJoinOptionalOptPlus.jsonld#ActorRdfJoinOptionalOptPlus_args_mediatorJoinSelectivity"
16
+ },
17
+ "args_name": {
18
+ "@id": "carjoo:components/ActorRdfJoinOptionalOptPlus.jsonld#ActorRdfJoinOptionalOptPlus_args_name"
19
+ },
20
+ "args_bus": {
21
+ "@id": "carjoo:components/ActorRdfJoinOptionalOptPlus.jsonld#ActorRdfJoinOptionalOptPlus_args_bus"
22
+ },
23
+ "args_beforeActors": {
24
+ "@id": "carjoo:components/ActorRdfJoinOptionalOptPlus.jsonld#ActorRdfJoinOptionalOptPlus_args_beforeActors",
25
+ "@container": "@list"
26
+ },
27
+ "mediatorJoin": {
28
+ "@id": "carjoo:components/ActorRdfJoinOptionalOptPlus.jsonld#ActorRdfJoinOptionalOptPlus_args_mediatorJoin"
29
+ },
30
+ "mediatorJoinSelectivity": {
31
+ "@id": "carjoo:components/ActorRdfJoinOptionalOptPlus.jsonld#ActorRdfJoinOptionalOptPlus_args_mediatorJoinSelectivity"
32
+ },
33
+ "name": {
34
+ "@id": "carjoo:components/ActorRdfJoinOptionalOptPlus.jsonld#ActorRdfJoinOptionalOptPlus_args_name"
35
+ },
36
+ "bus": {
37
+ "@id": "carjoo:components/ActorRdfJoinOptionalOptPlus.jsonld#ActorRdfJoinOptionalOptPlus_args_bus"
38
+ },
39
+ "beforeActors": {
40
+ "@id": "carjoo:components/ActorRdfJoinOptionalOptPlus.jsonld#ActorRdfJoinOptionalOptPlus_args_beforeActors",
41
+ "@container": "@list"
42
+ }
43
+ }
44
+ },
45
+ "IActorRdfJoinOptionalOptPlusJoinArgs": {
46
+ "@id": "carjoo:components/ActorRdfJoinOptionalOptPlus.jsonld#IActorRdfJoinOptionalOptPlusJoinArgs",
47
+ "@prefix": true,
48
+ "@context": {}
49
+ }
50
+ }
51
+ ]
52
+ }
@@ -0,0 +1,19 @@
1
+ import type { IActionRdfJoin, IActorRdfJoinOutputInner, IActorRdfJoinArgs, MediatorRdfJoin } from '@comunica/bus-rdf-join';
2
+ import { ActorRdfJoin } from '@comunica/bus-rdf-join';
3
+ import type { IMediatorTypeJoinCoefficients } from '@comunica/mediatortype-join-coefficients';
4
+ import type { MetadataBindings } from '@comunica/types';
5
+ /**
6
+ * A comunica Optional Opt+ RDF Join Actor.
7
+ */
8
+ export declare class ActorRdfJoinOptionalOptPlus extends ActorRdfJoin {
9
+ readonly mediatorJoin: MediatorRdfJoin;
10
+ constructor(args: IActorRdfJoinOptionalOptPlusJoinArgs);
11
+ getOutput({ entries, context }: IActionRdfJoin): Promise<IActorRdfJoinOutputInner>;
12
+ protected getJoinCoefficients(action: IActionRdfJoin, metadatas: MetadataBindings[]): Promise<IMediatorTypeJoinCoefficients>;
13
+ }
14
+ export interface IActorRdfJoinOptionalOptPlusJoinArgs extends IActorRdfJoinArgs {
15
+ /**
16
+ * A mediator for joining Bindings streams
17
+ */
18
+ mediatorJoin: MediatorRdfJoin;
19
+ }
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ActorRdfJoinOptionalOptPlus = void 0;
4
+ const bus_rdf_join_1 = require("@comunica/bus-rdf-join");
5
+ const asynciterator_1 = require("asynciterator");
6
+ /**
7
+ * A comunica Optional Opt+ RDF Join Actor.
8
+ */
9
+ class ActorRdfJoinOptionalOptPlus extends bus_rdf_join_1.ActorRdfJoin {
10
+ constructor(args) {
11
+ super(args, {
12
+ logicalType: 'optional',
13
+ physicalName: 'nested-loop',
14
+ limitEntries: 2,
15
+ canHandleUndefs: true,
16
+ });
17
+ }
18
+ async getOutput({ entries, context }) {
19
+ const clonedStream = entries[0].output.bindingsStream.clone();
20
+ entries[0].output.bindingsStream = entries[0].output.bindingsStream.clone();
21
+ const joined = await this.mediatorJoin.mediate({ type: 'inner', entries, context });
22
+ return { result: {
23
+ type: 'bindings',
24
+ bindingsStream: new asynciterator_1.UnionIterator([clonedStream, joined.bindingsStream], { autoStart: false }),
25
+ metadata: async () => {
26
+ const [leftMeta, joinedMeta] = await Promise.all([entries[0].output.metadata(), joined.metadata()]);
27
+ return {
28
+ variables: joinedMeta.variables,
29
+ canContainUndefs: true,
30
+ cardinality: {
31
+ type: joinedMeta.cardinality.type,
32
+ value: leftMeta.cardinality.value + joinedMeta.cardinality.value,
33
+ },
34
+ state: this.constructState([leftMeta, joinedMeta]),
35
+ };
36
+ },
37
+ } };
38
+ }
39
+ async getJoinCoefficients(action, metadatas) {
40
+ return {
41
+ iterations: metadatas[0].cardinality.value + metadatas[1].cardinality.value,
42
+ persistedItems: 0,
43
+ blockingItems: 0,
44
+ requestTime: 0,
45
+ };
46
+ }
47
+ }
48
+ exports.ActorRdfJoinOptionalOptPlus = ActorRdfJoinOptionalOptPlus;
49
+ //# sourceMappingURL=ActorRdfJoinOptionalOptPlus.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ActorRdfJoinOptionalOptPlus.js","sourceRoot":"","sources":["ActorRdfJoinOptionalOptPlus.ts"],"names":[],"mappings":";;;AAMA,yDAEgC;AAGhC,iDAA8C;AAE9C;;GAEG;AACH,MAAa,2BAA4B,SAAQ,2BAAY;IAG3D,YAAmB,IAA0C;QAC3D,KAAK,CAAC,IAAI,EAAE;YACV,WAAW,EAAE,UAAU;YACvB,YAAY,EAAE,aAAa;YAC3B,YAAY,EAAE,CAAC;YACf,eAAe,EAAE,IAAI;SACtB,CAAC,CAAC;IACL,CAAC;IAEM,KAAK,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,OAAO,EAAkB;QACzD,MAAM,YAAY,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE,CAAC;QAC9D,OAAO,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,cAAc,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE,CAAC;QAC5E,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;QACpF,OAAO,EAAE,MAAM,EAAE;gBACf,IAAI,EAAE,UAAU;gBAChB,cAAc,EAAE,IAAI,6BAAa,CAAC,CAAE,YAAY,EAAE,MAAM,CAAC,cAAc,CAAE,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;gBAChG,QAAQ,EAAE,KAAK,IAA8B,EAAE;oBAC7C,MAAM,CAAE,QAAQ,EAAE,UAAU,CAAE,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,CAAE,OAAO,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAE,MAAM,CAAC,QAAQ,EAAE,CAAE,CAAC,CAAC;oBACxG,OAAO;wBACL,SAAS,EAAE,UAAU,CAAC,SAAS;wBAC/B,gBAAgB,EAAE,IAAI;wBACtB,WAAW,EAAE;4BACX,IAAI,EAAE,UAAU,CAAC,WAAW,CAAC,IAAI;4BACjC,KAAK,EAAE,QAAQ,CAAC,WAAW,CAAC,KAAK,GAAG,UAAU,CAAC,WAAW,CAAC,KAAK;yBACjE;wBACD,KAAK,EAAE,IAAI,CAAC,cAAc,CAAC,CAAE,QAAQ,EAAE,UAAU,CAAE,CAAC;qBACrD,CAAC;gBACJ,CAAC;aACF,EAAC,CAAC;IACL,CAAC;IAES,KAAK,CAAC,mBAAmB,CACjC,MAAsB,EACtB,SAA6B;QAE7B,OAAO;YACL,UAAU,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK;YAC3E,cAAc,EAAE,CAAC;YACjB,aAAa,EAAE,CAAC;YAChB,WAAW,EAAE,CAAC;SACf,CAAC;IACJ,CAAC;CACF;AA7CD,kEA6CC","sourcesContent":["import type {\n IActionRdfJoin,\n IActorRdfJoinOutputInner,\n IActorRdfJoinArgs,\n MediatorRdfJoin,\n} from '@comunica/bus-rdf-join';\nimport {\n ActorRdfJoin,\n} from '@comunica/bus-rdf-join';\nimport type { IMediatorTypeJoinCoefficients } from '@comunica/mediatortype-join-coefficients';\nimport type { MetadataBindings } from '@comunica/types';\nimport { UnionIterator } from 'asynciterator';\n\n/**\n * A comunica Optional Opt+ RDF Join Actor.\n */\nexport class ActorRdfJoinOptionalOptPlus extends ActorRdfJoin {\n public readonly mediatorJoin: MediatorRdfJoin;\n\n public constructor(args: IActorRdfJoinOptionalOptPlusJoinArgs) {\n super(args, {\n logicalType: 'optional',\n physicalName: 'nested-loop',\n limitEntries: 2,\n canHandleUndefs: true,\n });\n }\n\n public async getOutput({ entries, context }: IActionRdfJoin): Promise<IActorRdfJoinOutputInner> {\n const clonedStream = entries[0].output.bindingsStream.clone();\n entries[0].output.bindingsStream = entries[0].output.bindingsStream.clone();\n const joined = await this.mediatorJoin.mediate({ type: 'inner', entries, context });\n return { result: {\n type: 'bindings',\n bindingsStream: new UnionIterator([ clonedStream, joined.bindingsStream ], { autoStart: false }),\n metadata: async(): Promise<MetadataBindings> => {\n const [ leftMeta, joinedMeta ] = await Promise.all([ entries[0].output.metadata(), joined.metadata() ]);\n return {\n variables: joinedMeta.variables,\n canContainUndefs: true,\n cardinality: {\n type: joinedMeta.cardinality.type,\n value: leftMeta.cardinality.value + joinedMeta.cardinality.value,\n },\n state: this.constructState([ leftMeta, joinedMeta ]),\n };\n },\n }};\n }\n\n protected async getJoinCoefficients(\n action: IActionRdfJoin,\n metadatas: MetadataBindings[],\n ): Promise<IMediatorTypeJoinCoefficients> {\n return {\n iterations: metadatas[0].cardinality.value + metadatas[1].cardinality.value,\n persistedItems: 0,\n blockingItems: 0,\n requestTime: 0,\n };\n }\n}\n\nexport interface IActorRdfJoinOptionalOptPlusJoinArgs extends IActorRdfJoinArgs {\n /**\n * A mediator for joining Bindings streams\n */\n mediatorJoin: MediatorRdfJoin;\n}\n"]}
package/lib/index.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './ActorRdfJoinOptionalOptPlus';
package/lib/index.js ADDED
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./ActorRdfJoinOptionalOptPlus"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gEAA8C","sourcesContent":["export * from './ActorRdfJoinOptionalOptPlus';\n"]}
package/package.json ADDED
@@ -0,0 +1,46 @@
1
+ {
2
+ "name": "@comunica/actor-rdf-join-optional-optplus",
3
+ "version": "3.2.0",
4
+ "description": "A optional-optplus rdf-join actor",
5
+ "lsd:module": true,
6
+ "license": "MIT",
7
+ "homepage": "https://comunica.dev/",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "https://github.com/comunica/comunica.git",
11
+ "directory": "packages/actor-rdf-join-optional-optplus"
12
+ },
13
+ "bugs": {
14
+ "url": "https://github.com/comunica/comunica/issues"
15
+ },
16
+ "keywords": [
17
+ "comunica",
18
+ "actor",
19
+ "rdf-join",
20
+ "optional-optplus"
21
+ ],
22
+ "sideEffects": false,
23
+ "main": "lib/index.js",
24
+ "typings": "lib/index",
25
+ "publishConfig": {
26
+ "access": "public"
27
+ },
28
+ "files": [
29
+ "components",
30
+ "lib/**/*.d.ts",
31
+ "lib/**/*.js",
32
+ "lib/**/*.js.map"
33
+ ],
34
+ "scripts": {
35
+ "build": "yarn run build:ts && yarn run build:components",
36
+ "build:ts": "node \"../../node_modules/typescript/bin/tsc\"",
37
+ "build:components": "componentsjs-generator"
38
+ },
39
+ "dependencies": {
40
+ "@comunica/bus-rdf-join": "^3.2.0",
41
+ "@comunica/mediatortype-join-coefficients": "^3.2.0",
42
+ "@comunica/types": "^3.2.0",
43
+ "asynciterator": "^3.9.0"
44
+ },
45
+ "gitHead": "87baf2afed021a254859e64b92f34d9b51c6a7db"
46
+ }