@comunica/actor-function-factory-expression-in 4.4.2-alpha.49.0 → 5.0.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 +1 -1
- package/components/ActorFunctionFactoryExpressionIn.jsonld +15 -15
- package/components/components.jsonld +1 -1
- package/components/context.jsonld +1 -1
- package/lib/ActorFunctionFactoryExpressionIn.js +1 -0
- package/lib/ActorFunctionFactoryExpressionIn.js.map +1 -1
- package/lib/ExpressionFunctionIn.js +1 -0
- package/lib/ExpressionFunctionIn.js.map +1 -1
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@ After installing, this package can be added to your engine's configuration as fo
|
|
|
24
24
|
{
|
|
25
25
|
"@context": [
|
|
26
26
|
...
|
|
27
|
-
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-function-factory-expression-in/^
|
|
27
|
+
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-function-factory-expression-in/^5.0.0/components/context.jsonld"
|
|
28
28
|
],
|
|
29
29
|
"actors": [
|
|
30
30
|
...
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"@context": [
|
|
3
|
-
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-function-factory-expression-in/^
|
|
4
|
-
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/core/^
|
|
5
|
-
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-function-factory/^
|
|
3
|
+
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-function-factory-expression-in/^5.0.0/components/context.jsonld",
|
|
4
|
+
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/core/^5.0.0/components/context.jsonld",
|
|
5
|
+
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-function-factory/^5.0.0/components/context.jsonld"
|
|
6
6
|
],
|
|
7
7
|
"@id": "npmd:@comunica/actor-function-factory-expression-in",
|
|
8
8
|
"components": [
|
|
@@ -39,37 +39,37 @@
|
|
|
39
39
|
"genericTypeInstances": [
|
|
40
40
|
{
|
|
41
41
|
"@type": "ParameterRangeGenericTypeReference",
|
|
42
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
42
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
|
|
43
43
|
},
|
|
44
44
|
{
|
|
45
45
|
"@type": "ParameterRangeGenericTypeReference",
|
|
46
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
46
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
|
|
47
47
|
},
|
|
48
48
|
{
|
|
49
49
|
"@type": "ParameterRangeGenericTypeReference",
|
|
50
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
50
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
|
|
51
51
|
},
|
|
52
52
|
{
|
|
53
53
|
"@type": "ParameterRangeGenericTypeReference",
|
|
54
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
54
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
|
|
55
55
|
}
|
|
56
56
|
]
|
|
57
57
|
},
|
|
58
58
|
{
|
|
59
59
|
"@type": "ParameterRangeGenericTypeReference",
|
|
60
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
60
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
|
|
61
61
|
},
|
|
62
62
|
{
|
|
63
63
|
"@type": "ParameterRangeGenericTypeReference",
|
|
64
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
64
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
|
|
65
65
|
},
|
|
66
66
|
{
|
|
67
67
|
"@type": "ParameterRangeGenericTypeReference",
|
|
68
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
68
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
|
|
69
69
|
},
|
|
70
70
|
{
|
|
71
71
|
"@type": "ParameterRangeGenericTypeReference",
|
|
72
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
72
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
|
|
73
73
|
}
|
|
74
74
|
]
|
|
75
75
|
},
|
|
@@ -106,19 +106,19 @@
|
|
|
106
106
|
"genericTypeInstances": [
|
|
107
107
|
{
|
|
108
108
|
"@type": "ParameterRangeGenericTypeReference",
|
|
109
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
109
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
|
|
110
110
|
},
|
|
111
111
|
{
|
|
112
112
|
"@type": "ParameterRangeGenericTypeReference",
|
|
113
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
113
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
|
|
114
114
|
},
|
|
115
115
|
{
|
|
116
116
|
"@type": "ParameterRangeGenericTypeReference",
|
|
117
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
117
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
|
|
118
118
|
},
|
|
119
119
|
{
|
|
120
120
|
"@type": "ParameterRangeGenericTypeReference",
|
|
121
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
121
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
|
|
122
122
|
}
|
|
123
123
|
]
|
|
124
124
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"@context": [
|
|
3
|
-
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-function-factory-expression-in/^
|
|
3
|
+
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-function-factory-expression-in/^5.0.0/components/context.jsonld"
|
|
4
4
|
],
|
|
5
5
|
"@id": "npmd:@comunica/actor-function-factory-expression-in",
|
|
6
6
|
"@type": "Module",
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"https://linkedsoftwaredependencies.org/bundles/npm/componentsjs/^6.0.0/components/context.jsonld",
|
|
4
4
|
{
|
|
5
5
|
"npmd": "https://linkedsoftwaredependencies.org/bundles/npm/",
|
|
6
|
-
"caffei": "npmd:@comunica/actor-function-factory-expression-in/^
|
|
6
|
+
"caffei": "npmd:@comunica/actor-function-factory-expression-in/^5.0.0/",
|
|
7
7
|
"ActorFunctionFactoryExpressionIn": {
|
|
8
8
|
"@id": "caffei:components/ActorFunctionFactoryExpressionIn.jsonld#ActorFunctionFactoryExpressionIn",
|
|
9
9
|
"@prefix": true,
|
|
@@ -8,6 +8,7 @@ const ExpressionFunctionIn_1 = require("./ExpressionFunctionIn");
|
|
|
8
8
|
* A comunica ExpressionFunctionIn Function Factory Actor.
|
|
9
9
|
*/
|
|
10
10
|
class ActorFunctionFactoryExpressionIn extends bus_function_factory_1.ActorFunctionFactoryDedicated {
|
|
11
|
+
mediatorFunctionFactory;
|
|
11
12
|
constructor(args) {
|
|
12
13
|
super({
|
|
13
14
|
...args,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActorFunctionFactoryExpressionIn.js","sourceRoot":"","sources":["ActorFunctionFactoryExpressionIn.ts"],"names":[],"mappings":";;;AASA,yEAEwC;AAExC,qFAAsE;AACtE,iEAA8D;AAM9D;;GAEG;AACH,MAAa,gCAAiC,SAAQ,oDAA6B;
|
|
1
|
+
{"version":3,"file":"ActorFunctionFactoryExpressionIn.js","sourceRoot":"","sources":["ActorFunctionFactoryExpressionIn.ts"],"names":[],"mappings":";;;AASA,yEAEwC;AAExC,qFAAsE;AACtE,iEAA8D;AAM9D;;GAEG;AACH,MAAa,gCAAiC,SAAQ,oDAA6B;IAChE,uBAAuB,CAA0B;IAElE,YAAmB,IAAmD;QACpE,KAAK,CAAC;YACJ,GAAG,IAAI;YACP,aAAa,EAAE,CAAE,2CAAc,CAAC,EAAE,CAAE;YACpC,YAAY,EAAE,KAAK;SACpB,CAAC,CAAC;QACH,IAAI,CAAC,uBAAuB,GAA6B,IAAI,CAAC,uBAAuB,CAAC;IACxF,CAAC;IAEM,KAAK,CAAC,GAAG,CAAmC,IAAO;QAExD,MAAM,gBAAgB,GAAG,MAAM,IAAI,CAAC,uBAAuB,CAAC,OAAO,CAAC;YAClE,YAAY,EAAE,2CAAc,CAAC,KAAK;YAClC,qBAAqB,EAAE,IAAI;YAC3B,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,SAAS,EAAE,IAAI,CAAC,SAAS;SAC1B,CAAC,CAAC;QAEH,OAGwB,IAAI,2CAAoB,CAAC,gBAAgB,CAAC,CAAC;IACrE,CAAC;CACF;AA1BD,4EA0BC","sourcesContent":["import type {\n IActionFunctionFactory,\n IActorFunctionFactoryArgs,\n IActorFunctionFactoryOutput,\n IActorFunctionFactoryOutputTerm,\n IExpressionFunction,\n MediatorFunctionFactory,\n MediatorFunctionFactoryUnsafe,\n} from '@comunica/bus-function-factory';\nimport {\n ActorFunctionFactoryDedicated,\n} from '@comunica/bus-function-factory';\n\nimport { SparqlOperator } from '@comunica/utils-expression-evaluator';\nimport { ExpressionFunctionIn } from './ExpressionFunctionIn';\n\ninterface IActorFunctionFactoryExpressionFunctionInArgs extends IActorFunctionFactoryArgs {\n mediatorFunctionFactory: MediatorFunctionFactoryUnsafe;\n}\n\n/**\n * A comunica ExpressionFunctionIn Function Factory Actor.\n */\nexport class ActorFunctionFactoryExpressionIn extends ActorFunctionFactoryDedicated {\n private readonly mediatorFunctionFactory: MediatorFunctionFactory;\n\n public constructor(args: IActorFunctionFactoryExpressionFunctionInArgs) {\n super({\n ...args,\n functionNames: [ SparqlOperator.IN ],\n termFunction: false,\n });\n this.mediatorFunctionFactory = <MediatorFunctionFactory> args.mediatorFunctionFactory;\n }\n\n public async run<T extends IActionFunctionFactory>(args: T):\n Promise<T extends { requireTermExpression: true } ? IActorFunctionFactoryOutputTerm : IActorFunctionFactoryOutput> {\n const equalityFunction = await this.mediatorFunctionFactory.mediate({\n functionName: SparqlOperator.EQUAL,\n requireTermExpression: true,\n context: args.context,\n arguments: args.arguments,\n });\n\n return <T extends { requireTermExpression: true } ?\n IActorFunctionFactoryOutputTerm :\n IActorFunctionFactoryOutput>\n <IExpressionFunction> new ExpressionFunctionIn(equalityFunction);\n }\n}\n"]}
|
|
@@ -8,6 +8,7 @@ const utils_expression_evaluator_1 = require("@comunica/utils-expression-evaluat
|
|
|
8
8
|
* This function doesn't require type promotion or subtype-substitution, everything works on TermExpression
|
|
9
9
|
*/
|
|
10
10
|
class ExpressionFunctionIn extends bus_function_factory_1.ExpressionFunctionBase {
|
|
11
|
+
equalityFunction;
|
|
11
12
|
constructor(equalityFunction) {
|
|
12
13
|
super({
|
|
13
14
|
arity: Number.POSITIVE_INFINITY,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpressionFunctionIn.js","sourceRoot":"","sources":["ExpressionFunctionIn.ts"],"names":[],"mappings":";;;AACA,yEAAwE;AAKxE,qFAI8C;AAE9C;;;GAGG;AACH,MAAa,oBAAqB,SAAQ,6CAAsB;
|
|
1
|
+
{"version":3,"file":"ExpressionFunctionIn.js","sourceRoot":"","sources":["ExpressionFunctionIn.ts"],"names":[],"mappings":";;;AACA,yEAAwE;AAKxE,qFAI8C;AAE9C;;;GAGG;AACH,MAAa,oBAAqB,SAAQ,6CAAsB;IAC1B;IAApC,YAAoC,gBAA+B;QACjE,KAAK,CAAC;YACJ,KAAK,EAAE,MAAM,CAAC,iBAAiB;YAC/B,QAAQ,EAAE,2CAAc,CAAC,EAAE;YAC3B,KAAK,EAAE,KAAK,EAAC,OAAqB,EAA2B,EAAE;gBAC7D,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC;gBAC5C,MAAM,CAAE,QAAQ,EAAE,GAAG,SAAS,CAAE,GAAG,IAAI,CAAC;gBACxC,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,6BAA6B,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;gBAC7E,OAAO,MAAM,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,EAAE,GAAG,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,CAAC;YAC3E,CAAC;SACF,CAAC,CAAC;QAV+B,qBAAgB,GAAhB,gBAAgB,CAAe;IAWnE,CAAC;IAEe,UAAU,CAAC,IAAkB;QAC3C,OAAO,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;IACzB,CAAC;IAEO,KAAK,CAAC,WAAW,CACvB,MAAsB,EACtB,OAAqB,EACrB,OAA0B;QAE1B,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC;QAC5C,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACtB,MAAM,QAAQ,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC;YAC5C,OAAO,QAAQ,CAAC,CAAC,CAAC,IAAA,iCAAI,EAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,oCAAO,CAAC,OAAO,CAAC,CAAC,CAAC;QACvE,CAAC;QAED,IAAI,CAAC;YACH,wEAAwE;YACxE,MAAM,cAAc,GAAG,IAAI,CAAC,KAAK,EAAG,CAAC;YACrC,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,6BAA6B,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;YACnF,IAAsB,IAAI,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAE,MAAM,EAAE,IAAI,CAAE,EAAE,QAAQ,CAAE,CAAC,UAAU,EAAE,CAAC;gBACjG,OAAO,IAAA,iCAAI,EAAC,IAAI,CAAC,CAAC;YACpB,CAAC;YACD,OAAO,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,OAAO,EAAE,CAAE,GAAG,OAAO,EAAE,KAAK,CAAE,CAAC,CAAC;QAClE,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACxB,OAAO,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,OAAO,EAAE,CAAE,GAAG,OAAO,EAAU,KAAK,CAAE,CAAC,CAAC;QAC1E,CAAC;IACH,CAAC;CACF;AAzCD,oDAyCC","sourcesContent":["import type { ITermFunction } from '@comunica/bus-function-factory';\nimport { ExpressionFunctionBase } from '@comunica/bus-function-factory';\nimport type { Expression, IEvalContext, TermExpression } from '@comunica/types';\nimport type {\n BooleanLiteral,\n} from '@comunica/utils-expression-evaluator';\nimport {\n bool,\n InError,\n SparqlOperator,\n} from '@comunica/utils-expression-evaluator';\n\n/**\n * https://www.w3.org/TR/sparql11-query/#func-in\n * This function doesn't require type promotion or subtype-substitution, everything works on TermExpression\n */\nexport class ExpressionFunctionIn extends ExpressionFunctionBase {\n public constructor(private readonly equalityFunction: ITermFunction) {\n super({\n arity: Number.POSITIVE_INFINITY,\n operator: SparqlOperator.IN,\n apply: async(context: IEvalContext): Promise<TermExpression> => {\n const { args, mapping, exprEval } = context;\n const [ leftExpr, ...remaining ] = args;\n const left = await exprEval.evaluatorExpressionEvaluation(leftExpr, mapping);\n return await this.inRecursive(left, { ...context, args: remaining }, []);\n },\n });\n }\n\n public override checkArity(args: Expression[]): boolean {\n return args.length > 0;\n }\n\n private async inRecursive(\n needle: TermExpression,\n context: IEvalContext,\n results: (Error | false)[],\n ): Promise<TermExpression> {\n const { args, mapping, exprEval } = context;\n if (args.length === 0) {\n const noErrors = results.every(val => !val);\n return noErrors ? bool(false) : Promise.reject(new InError(results));\n }\n\n try {\n // We know this will not be undefined because we check args.length === 0\n const nextExpression = args.shift()!;\n const next = await exprEval.evaluatorExpressionEvaluation(nextExpression, mapping);\n if ((<BooleanLiteral> this.equalityFunction.applyOnTerms([ needle, next ], exprEval)).typedValue) {\n return bool(true);\n }\n return this.inRecursive(needle, context, [ ...results, false ]);\n } catch (error: unknown) {\n return this.inRecursive(needle, context, [ ...results, <Error> error ]);\n }\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@comunica/actor-function-factory-expression-in",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"description": "A expression-in function-factory actor",
|
|
5
5
|
"lsd:module": true,
|
|
6
6
|
"license": "MIT",
|
|
@@ -37,9 +37,9 @@
|
|
|
37
37
|
"build:components": "componentsjs-generator"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@comunica/bus-function-factory": "
|
|
41
|
-
"@comunica/types": "
|
|
42
|
-
"@comunica/utils-expression-evaluator": "
|
|
40
|
+
"@comunica/bus-function-factory": "^5.0.0",
|
|
41
|
+
"@comunica/types": "^5.0.0",
|
|
42
|
+
"@comunica/utils-expression-evaluator": "^5.0.0"
|
|
43
43
|
},
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "0b1756fdb9bef014133432489627c1bd71779bd0"
|
|
45
45
|
}
|