@comunica/actor-function-factory-term-lesser-than-equal 4.5.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/ActorFunctionFactoryTermLesserThanEqual.jsonld +15 -15
- package/components/components.jsonld +1 -1
- package/components/context.jsonld +1 -1
- package/lib/ActorFunctionFactoryTermLesserThanEqual.d.ts +0 -0
- package/lib/ActorFunctionFactoryTermLesserThanEqual.js +1 -0
- package/lib/ActorFunctionFactoryTermLesserThanEqual.js.map +1 -1
- package/lib/TermFunctionLesserThanEqual.d.ts +0 -0
- package/lib/TermFunctionLesserThanEqual.js +28 -9
- package/lib/TermFunctionLesserThanEqual.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 +4 -4
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-term-lesser-than-equal/^
|
|
27
|
+
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-function-factory-term-lesser-than-equal/^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-term-lesser-than-equal/^
|
|
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-term-lesser-than-equal/^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-term-lesser-than-equal",
|
|
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-term-lesser-than-equal/^
|
|
3
|
+
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-function-factory-term-lesser-than-equal/^5.0.0/components/context.jsonld"
|
|
4
4
|
],
|
|
5
5
|
"@id": "npmd:@comunica/actor-function-factory-term-lesser-than-equal",
|
|
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
|
-
"cafftlte": "npmd:@comunica/actor-function-factory-term-lesser-than-equal/^
|
|
6
|
+
"cafftlte": "npmd:@comunica/actor-function-factory-term-lesser-than-equal/^5.0.0/",
|
|
7
7
|
"ActorFunctionFactoryTermLesserThanEqual": {
|
|
8
8
|
"@id": "cafftlte:components/ActorFunctionFactoryTermLesserThanEqual.jsonld#ActorFunctionFactoryTermLesserThanEqual",
|
|
9
9
|
"@prefix": true,
|
|
File without changes
|
|
@@ -8,6 +8,7 @@ const TermFunctionLesserThanEqual_1 = require("./TermFunctionLesserThanEqual");
|
|
|
8
8
|
* A comunica TermFunctionLesserThanEqual Function Factory Actor.
|
|
9
9
|
*/
|
|
10
10
|
class ActorFunctionFactoryTermLesserThanEqual extends bus_function_factory_1.ActorFunctionFactoryDedicated {
|
|
11
|
+
mediatorFunctionFactory;
|
|
11
12
|
constructor(args) {
|
|
12
13
|
super({
|
|
13
14
|
...args,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActorFunctionFactoryTermLesserThanEqual.js","sourceRoot":"","sources":["ActorFunctionFactoryTermLesserThanEqual.ts"],"names":[],"mappings":";;;AAQA,yEAEwC;AAExC,qFAAsE;AACtE,+EAA4E;AAM5E;;GAEG;AACH,MAAa,uCAAwC,SAAQ,oDAA6B;
|
|
1
|
+
{"version":3,"file":"ActorFunctionFactoryTermLesserThanEqual.js","sourceRoot":"","sources":["ActorFunctionFactoryTermLesserThanEqual.ts"],"names":[],"mappings":";;;AAQA,yEAEwC;AAExC,qFAAsE;AACtE,+EAA4E;AAM5E;;GAEG;AACH,MAAa,uCAAwC,SAAQ,oDAA6B;IACvE,uBAAuB,CAA0B;IAElE,YAAmB,IAA0D;QAC3E,KAAK,CAAC;YACJ,GAAG,IAAI;YACP,aAAa,EAAE,CAAE,2CAAc,CAAC,GAAG,CAAE;YACrC,YAAY,EAAE,IAAI;SACnB,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;QACH,MAAM,gBAAgB,GAAG,MAAM,IAAI,CAAC,uBAAuB,CAAC,OAAO,CAAC;YAClE,YAAY,EAAE,2CAAc,CAAC,EAAE;YAC/B,qBAAqB,EAAE,IAAI;YAC3B,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,SAAS,EAAE,IAAI,CAAC,SAAS;SAC1B,CAAC,CAAC;QACH,OAAO,IAAI,yDAA2B,CAAC,gBAAgB,EAAE,gBAAgB,CAAC,CAAC;IAC7E,CAAC;CACF;AA5BD,0FA4BC","sourcesContent":["import type {\n IActionFunctionFactory,\n IActorFunctionFactoryArgs,\n IActorFunctionFactoryOutput,\n IActorFunctionFactoryOutputTerm,\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 { TermFunctionLesserThanEqual } from './TermFunctionLesserThanEqual';\n\ninterface IActorFunctionFactoryTermFunctionLesserThanEqualArgs extends IActorFunctionFactoryArgs {\n mediatorFunctionFactory: MediatorFunctionFactoryUnsafe;\n}\n\n/**\n * A comunica TermFunctionLesserThanEqual Function Factory Actor.\n */\nexport class ActorFunctionFactoryTermLesserThanEqual extends ActorFunctionFactoryDedicated {\n private readonly mediatorFunctionFactory: MediatorFunctionFactory;\n\n public constructor(args: IActorFunctionFactoryTermFunctionLesserThanEqualArgs) {\n super({\n ...args,\n functionNames: [ SparqlOperator.LTE ],\n termFunction: true,\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 const lessThanFunction = await this.mediatorFunctionFactory.mediate({\n functionName: SparqlOperator.LT,\n requireTermExpression: true,\n context: args.context,\n arguments: args.arguments,\n });\n return new TermFunctionLesserThanEqual(equalityFunction, lessThanFunction);\n }\n}\n"]}
|
|
File without changes
|
|
@@ -4,20 +4,39 @@ exports.TermFunctionLesserThanEqual = void 0;
|
|
|
4
4
|
const bus_function_factory_1 = require("@comunica/bus-function-factory");
|
|
5
5
|
const utils_expression_evaluator_1 = require("@comunica/utils-expression-evaluator");
|
|
6
6
|
class TermFunctionLesserThanEqual extends bus_function_factory_1.TermFunctionBase {
|
|
7
|
+
equalityFunction;
|
|
8
|
+
lessThanFunction;
|
|
7
9
|
constructor(equalityFunction, lessThanFunction) {
|
|
8
10
|
super({
|
|
9
11
|
arity: 2,
|
|
10
12
|
operator: utils_expression_evaluator_1.SparqlOperator.LTE,
|
|
11
13
|
overloads: (0, utils_expression_evaluator_1.declare)(utils_expression_evaluator_1.SparqlOperator.LTE)
|
|
12
|
-
.set(['term', 'term'], exprEval => ([first, second]) =>
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
.set(['term', 'term'], exprEval => ([first, second]) => {
|
|
15
|
+
// X <= Y -> X = Y || X < Y
|
|
16
|
+
// We must ensure correct handling of errors following logical-or semantics.
|
|
17
|
+
// First check if the first is lesser than the second.
|
|
18
|
+
let lessThanError;
|
|
19
|
+
try {
|
|
20
|
+
if (this.lessThanFunction.applyOnTerms([first, second], exprEval).typedValue) {
|
|
21
|
+
return (0, utils_expression_evaluator_1.bool)(true);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
catch (error) {
|
|
25
|
+
// If an error occurs, store it for later.
|
|
26
|
+
lessThanError = error;
|
|
27
|
+
}
|
|
28
|
+
// Then check if they are equal, and return if so.
|
|
29
|
+
if (this.equalityFunction.applyOnTerms([first, second], exprEval)
|
|
30
|
+
.typedValue) {
|
|
31
|
+
return (0, utils_expression_evaluator_1.bool)(true);
|
|
32
|
+
}
|
|
33
|
+
// If less than produced an error and equals was false, throw the error.
|
|
34
|
+
if (lessThanError) {
|
|
35
|
+
throw lessThanError;
|
|
36
|
+
}
|
|
37
|
+
// In all other cases, return false
|
|
38
|
+
return (0, utils_expression_evaluator_1.bool)(false);
|
|
39
|
+
})
|
|
21
40
|
.collect(),
|
|
22
41
|
});
|
|
23
42
|
this.equalityFunction = equalityFunction;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TermFunctionLesserThanEqual.js","sourceRoot":"","sources":["TermFunctionLesserThanEqual.ts"],"names":[],"mappings":";;;AACA,yEAAkE;AAIlE,qFAI8C;AAE9C,MAAa,2BAA4B,SAAQ,uCAAgB;
|
|
1
|
+
{"version":3,"file":"TermFunctionLesserThanEqual.js","sourceRoot":"","sources":["TermFunctionLesserThanEqual.ts"],"names":[],"mappings":";;;AACA,yEAAkE;AAIlE,qFAI8C;AAE9C,MAAa,2BAA4B,SAAQ,uCAAgB;IAE5C;IACA;IAFnB,YACmB,gBAA+B,EAC/B,gBAA+B;QAEhD,KAAK,CAAC;YACJ,KAAK,EAAE,CAAC;YACR,QAAQ,EAAE,2CAAc,CAAC,GAAG;YAC5B,SAAS,EAAE,IAAA,oCAAO,EAAC,2CAAc,CAAC,GAAG,CAAC;iBACnC,GAAG,CAAC,CAAE,MAAM,EAAE,MAAM,CAAE,EAAE,QAAQ,CAAC,EAAE,CAClC,CAAC,CAAE,KAAK,EAAE,MAAM,CAAE,EAAE,EAAE;gBACpB,2BAA2B;gBAC3B,4EAA4E;gBAE5E,sDAAsD;gBACtD,IAAI,aAAgC,CAAC;gBACrC,IAAI,CAAC;oBACH,IAAsB,IAAI,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAE,KAAK,EAAE,MAAM,CAAE,EAAE,QAAQ,CAAE,CAAC,UAAU,EAAE,CAAC;wBAClG,OAAO,IAAA,iCAAI,EAAC,IAAI,CAAC,CAAC;oBACpB,CAAC;gBACH,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBACf,0CAA0C;oBAC1C,aAAa,GAAW,KAAK,CAAC;gBAChC,CAAC;gBAED,kDAAkD;gBAClD,IAAsB,IAAI,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAE,KAAK,EAAE,MAAM,CAAE,EAAE,QAAQ,CAAE;qBACnF,UAAU,EAAE,CAAC;oBACd,OAAO,IAAA,iCAAI,EAAC,IAAI,CAAC,CAAC;gBACpB,CAAC;gBAED,wEAAwE;gBACxE,IAAI,aAAa,EAAE,CAAC;oBAClB,MAAM,aAAa,CAAC;gBACtB,CAAC;gBAED,mCAAmC;gBACnC,OAAO,IAAA,iCAAI,EAAC,KAAK,CAAC,CAAC;YACrB,CAAC,CAAC;iBACH,OAAO,EAAE;SACb,CAAC,CAAC;QAtCc,qBAAgB,GAAhB,gBAAgB,CAAe;QAC/B,qBAAgB,GAAhB,gBAAgB,CAAe;IAsClD,CAAC;CACF;AA1CD,kEA0CC","sourcesContent":["import type { ITermFunction } from '@comunica/bus-function-factory';\nimport { TermFunctionBase } from '@comunica/bus-function-factory';\nimport type {\n BooleanLiteral,\n} from '@comunica/utils-expression-evaluator';\nimport {\n bool,\n declare,\n SparqlOperator,\n} from '@comunica/utils-expression-evaluator';\n\nexport class TermFunctionLesserThanEqual extends TermFunctionBase {\n public constructor(\n private readonly equalityFunction: ITermFunction,\n private readonly lessThanFunction: ITermFunction,\n ) {\n super({\n arity: 2,\n operator: SparqlOperator.LTE,\n overloads: declare(SparqlOperator.LTE)\n .set([ 'term', 'term' ], exprEval =>\n ([ first, second ]) => {\n // X <= Y -> X = Y || X < Y\n // We must ensure correct handling of errors following logical-or semantics.\n\n // First check if the first is lesser than the second.\n let lessThanError: Error | undefined;\n try {\n if ((<BooleanLiteral> this.lessThanFunction.applyOnTerms([ first, second ], exprEval)).typedValue) {\n return bool(true);\n }\n } catch (error) {\n // If an error occurs, store it for later.\n lessThanError = <Error> error;\n }\n\n // Then check if they are equal, and return if so.\n if ((<BooleanLiteral> this.equalityFunction.applyOnTerms([ first, second ], exprEval))\n .typedValue) {\n return bool(true);\n }\n\n // If less than produced an error and equals was false, throw the error.\n if (lessThanError) {\n throw lessThanError;\n }\n\n // In all other cases, return false\n return bool(false);\n })\n .collect(),\n });\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-function-factory-term-lesser-than-equal",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"description": "A term-lesser-than-equal function-factory actor",
|
|
5
5
|
"lsd:module": true,
|
|
6
6
|
"license": "MIT",
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"build:components": "componentsjs-generator"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@comunica/bus-function-factory": "^
|
|
41
|
-
"@comunica/utils-expression-evaluator": "^
|
|
40
|
+
"@comunica/bus-function-factory": "^5.0.0",
|
|
41
|
+
"@comunica/utils-expression-evaluator": "^5.0.0"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "0b1756fdb9bef014133432489627c1bd71779bd0"
|
|
44
44
|
}
|