@comunica/bus-function-factory 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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "@context": [
3
- "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-function-factory/^4.0.0/components/context.jsonld",
4
- "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/core/^4.0.0/components/context.jsonld"
3
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-function-factory/^5.0.0/components/context.jsonld",
4
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/core/^5.0.0/components/context.jsonld"
5
5
  ],
6
6
  "@id": "npmd:@comunica/bus-function-factory",
7
7
  "components": [
@@ -54,37 +54,37 @@
54
54
  "genericTypeInstances": [
55
55
  {
56
56
  "@type": "ParameterRangeGenericTypeReference",
57
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
57
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
58
58
  },
59
59
  {
60
60
  "@type": "ParameterRangeGenericTypeReference",
61
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
61
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
62
62
  },
63
63
  {
64
64
  "@type": "ParameterRangeGenericTypeReference",
65
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
65
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
66
66
  },
67
67
  {
68
68
  "@type": "ParameterRangeGenericTypeReference",
69
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
69
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
70
70
  }
71
71
  ]
72
72
  },
73
73
  {
74
74
  "@type": "ParameterRangeGenericTypeReference",
75
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
75
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
76
76
  },
77
77
  {
78
78
  "@type": "ParameterRangeGenericTypeReference",
79
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
79
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
80
80
  },
81
81
  {
82
82
  "@type": "ParameterRangeGenericTypeReference",
83
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
83
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
84
84
  },
85
85
  {
86
86
  "@type": "ParameterRangeGenericTypeReference",
87
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
87
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
88
88
  }
89
89
  ]
90
90
  },
@@ -121,19 +121,19 @@
121
121
  "genericTypeInstances": [
122
122
  {
123
123
  "@type": "ParameterRangeGenericTypeReference",
124
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
124
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
125
125
  },
126
126
  {
127
127
  "@type": "ParameterRangeGenericTypeReference",
128
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
128
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
129
129
  },
130
130
  {
131
131
  "@type": "ParameterRangeGenericTypeReference",
132
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
132
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
133
133
  },
134
134
  {
135
135
  "@type": "ParameterRangeGenericTypeReference",
136
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
136
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
137
137
  }
138
138
  ]
139
139
  }
@@ -229,23 +229,23 @@
229
229
  "genericTypeInstances": [
230
230
  {
231
231
  "@type": "ParameterRangeGenericTypeReference",
232
- "parameterRangeGenericType": "npmd:@comunica/core/^4.0.0/components/Mediator.jsonld#Mediator__generic_A"
232
+ "parameterRangeGenericType": "npmd:@comunica/core/^5.0.0/components/Mediator.jsonld#Mediator__generic_A"
233
233
  },
234
234
  {
235
235
  "@type": "ParameterRangeGenericTypeReference",
236
- "parameterRangeGenericType": "npmd:@comunica/core/^4.0.0/components/Mediator.jsonld#Mediator__generic_I"
236
+ "parameterRangeGenericType": "npmd:@comunica/core/^5.0.0/components/Mediator.jsonld#Mediator__generic_I"
237
237
  },
238
238
  {
239
239
  "@type": "ParameterRangeGenericTypeReference",
240
- "parameterRangeGenericType": "npmd:@comunica/core/^4.0.0/components/Mediator.jsonld#Mediator__generic_T"
240
+ "parameterRangeGenericType": "npmd:@comunica/core/^5.0.0/components/Mediator.jsonld#Mediator__generic_T"
241
241
  },
242
242
  {
243
243
  "@type": "ParameterRangeGenericTypeReference",
244
- "parameterRangeGenericType": "npmd:@comunica/core/^4.0.0/components/Mediator.jsonld#Mediator__generic_O"
244
+ "parameterRangeGenericType": "npmd:@comunica/core/^5.0.0/components/Mediator.jsonld#Mediator__generic_O"
245
245
  },
246
246
  {
247
247
  "@type": "ParameterRangeGenericTypeReference",
248
- "parameterRangeGenericType": "npmd:@comunica/core/^4.0.0/components/Mediator.jsonld#Mediator__generic_TS"
248
+ "parameterRangeGenericType": "npmd:@comunica/core/^5.0.0/components/Mediator.jsonld#Mediator__generic_TS"
249
249
  }
250
250
  ]
251
251
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "@context": [
3
- "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-function-factory/^4.0.0/components/context.jsonld",
4
- "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/core/^4.0.0/components/context.jsonld"
3
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-function-factory/^5.0.0/components/context.jsonld",
4
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/core/^5.0.0/components/context.jsonld"
5
5
  ],
6
6
  "@id": "npmd:@comunica/bus-function-factory",
7
7
  "components": [
@@ -54,37 +54,37 @@
54
54
  "genericTypeInstances": [
55
55
  {
56
56
  "@type": "ParameterRangeGenericTypeReference",
57
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
57
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
58
58
  },
59
59
  {
60
60
  "@type": "ParameterRangeGenericTypeReference",
61
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
61
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
62
62
  },
63
63
  {
64
64
  "@type": "ParameterRangeGenericTypeReference",
65
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
65
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
66
66
  },
67
67
  {
68
68
  "@type": "ParameterRangeGenericTypeReference",
69
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
69
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
70
70
  }
71
71
  ]
72
72
  },
73
73
  {
74
74
  "@type": "ParameterRangeGenericTypeReference",
75
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
75
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
76
76
  },
77
77
  {
78
78
  "@type": "ParameterRangeGenericTypeReference",
79
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
79
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
80
80
  },
81
81
  {
82
82
  "@type": "ParameterRangeGenericTypeReference",
83
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
83
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
84
84
  },
85
85
  {
86
86
  "@type": "ParameterRangeGenericTypeReference",
87
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
87
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
88
88
  }
89
89
  ]
90
90
  },
@@ -121,19 +121,19 @@
121
121
  "genericTypeInstances": [
122
122
  {
123
123
  "@type": "ParameterRangeGenericTypeReference",
124
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
124
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
125
125
  },
126
126
  {
127
127
  "@type": "ParameterRangeGenericTypeReference",
128
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
128
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
129
129
  },
130
130
  {
131
131
  "@type": "ParameterRangeGenericTypeReference",
132
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
132
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
133
133
  },
134
134
  {
135
135
  "@type": "ParameterRangeGenericTypeReference",
136
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
136
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
137
137
  }
138
138
  ]
139
139
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "@context": [
3
- "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-function-factory/^4.0.0/components/context.jsonld",
4
- "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/core/^4.0.0/components/context.jsonld"
3
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-function-factory/^5.0.0/components/context.jsonld",
4
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/core/^5.0.0/components/context.jsonld"
5
5
  ],
6
6
  "@id": "npmd:@comunica/bus-function-factory",
7
7
  "components": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "@context": [
3
- "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-function-factory/^4.0.0/components/context.jsonld"
3
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-function-factory/^5.0.0/components/context.jsonld"
4
4
  ],
5
5
  "@id": "npmd:@comunica/bus-function-factory",
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
- "cbff": "npmd:@comunica/bus-function-factory/^4.0.0/",
6
+ "cbff": "npmd:@comunica/bus-function-factory/^5.0.0/",
7
7
  "ActorFunctionFactory": {
8
8
  "@id": "cbff:components/ActorFunctionFactory.jsonld#ActorFunctionFactory",
9
9
  "@prefix": true,
@@ -7,8 +7,12 @@ const ActorFunctionFactory_1 = require("./ActorFunctionFactory");
7
7
  * A base implementation for function factory actors for a dedicated operator.
8
8
  */
9
9
  class ActorFunctionFactoryDedicated extends ActorFunctionFactory_1.ActorFunctionFactory {
10
+ functionNames;
11
+ termFunction;
10
12
  constructor(args) {
11
13
  super(args);
14
+ this.functionNames = args.functionNames;
15
+ this.termFunction = args.termFunction;
12
16
  }
13
17
  async test(action) {
14
18
  // Name must match, if this is a term function, all is fine, if not, look whether term-function is not requested.
@@ -1 +1 @@
1
- {"version":3,"file":"ActorFunctionFactoryDedicated.js","sourceRoot":"","sources":["ActorFunctionFactoryDedicated.ts"],"names":[],"mappings":";;;AACA,yCAAwD;AAExD,iEAA8D;AAI9D;;GAEG;AACH,MAAsB,6BAA8B,SAAQ,2CAAoB;IAI9E,YAAsB,IAAwC;QAC5D,KAAK,CAAC,IAAI,CAAC,CAAC;IACd,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,MAA8B;QAC9C,iHAAiH;QACjH,IAAI,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,IAAI,CAAC,MAAM,CAAC,qBAAqB,CAAC,EAAE,CAAC;YAC7G,OAAO,IAAA,mBAAY,GAAE,CAAC;QACxB,CAAC;QACD,OAAO,IAAA,eAAQ,EAAC,SAAS,IAAI,CAAC,IAAI,wCAAwC,MAAM,CAAC,YAAY,eAAe,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,qBAAqB,GAAG,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACpM,CAAC;CACF;AAfD,sEAeC","sourcesContent":["import type { IActorTest, TestResult } from '@comunica/core';\nimport { failTest, passTestVoid } from '@comunica/core';\nimport type { IActionFunctionFactory, IActorFunctionFactoryArgs } from './ActorFunctionFactory';\nimport { ActorFunctionFactory } from './ActorFunctionFactory';\n\ntype StringArray = [ string, ...string[]];\n\n/**\n * A base implementation for function factory actors for a dedicated operator.\n */\nexport abstract class ActorFunctionFactoryDedicated extends ActorFunctionFactory {\n public readonly functionNames: StringArray;\n public readonly termFunction: boolean;\n\n protected constructor(args: IActorFunctionFactoryDedicatedArgs) {\n super(args);\n }\n\n public async test(action: IActionFunctionFactory): Promise<TestResult<IActorTest>> {\n // Name must match, if this is a term function, all is fine, if not, look whether term-function is not requested.\n if (this.functionNames.includes(action.functionName) && (this.termFunction || !action.requireTermExpression)) {\n return passTestVoid();\n }\n return failTest(`Actor ${this.name} can not provide implementation for \"${action.functionName}\", only for ${this.termFunction ? '' : 'non-termExpression '}${this.functionNames.join(' and ')}.`);\n }\n}\n\nexport interface IActorFunctionFactoryDedicatedArgs extends IActorFunctionFactoryArgs {\n functionNames: StringArray;\n termFunction: boolean;\n}\n"]}
1
+ {"version":3,"file":"ActorFunctionFactoryDedicated.js","sourceRoot":"","sources":["ActorFunctionFactoryDedicated.ts"],"names":[],"mappings":";;;AACA,yCAAwD;AAExD,iEAA8D;AAI9D;;GAEG;AACH,MAAsB,6BAA8B,SAAQ,2CAAoB;IAC9D,aAAa,CAAc;IAC3B,YAAY,CAAU;IAEtC,YAAsB,IAAwC;QAC5D,KAAK,CAAC,IAAI,CAAC,CAAC;QACZ,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC;QACxC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;IACxC,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,MAA8B;QAC9C,iHAAiH;QACjH,IAAI,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,IAAI,CAAC,MAAM,CAAC,qBAAqB,CAAC,EAAE,CAAC;YAC7G,OAAO,IAAA,mBAAY,GAAE,CAAC;QACxB,CAAC;QACD,OAAO,IAAA,eAAQ,EAAC,SAAS,IAAI,CAAC,IAAI,wCAAwC,MAAM,CAAC,YAAY,eAAe,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,qBAAqB,GAAG,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACpM,CAAC;CACF;AAjBD,sEAiBC","sourcesContent":["import type { IActorTest, TestResult } from '@comunica/core';\nimport { failTest, passTestVoid } from '@comunica/core';\nimport type { IActionFunctionFactory, IActorFunctionFactoryArgs } from './ActorFunctionFactory';\nimport { ActorFunctionFactory } from './ActorFunctionFactory';\n\ntype StringArray = [ string, ...string[]];\n\n/**\n * A base implementation for function factory actors for a dedicated operator.\n */\nexport abstract class ActorFunctionFactoryDedicated extends ActorFunctionFactory {\n public readonly functionNames: StringArray;\n public readonly termFunction: boolean;\n\n protected constructor(args: IActorFunctionFactoryDedicatedArgs) {\n super(args);\n this.functionNames = args.functionNames;\n this.termFunction = args.termFunction;\n }\n\n public async test(action: IActionFunctionFactory): Promise<TestResult<IActorTest>> {\n // Name must match, if this is a term function, all is fine, if not, look whether term-function is not requested.\n if (this.functionNames.includes(action.functionName) && (this.termFunction || !action.requireTermExpression)) {\n return passTestVoid();\n }\n return failTest(`Actor ${this.name} can not provide implementation for \"${action.functionName}\", only for ${this.termFunction ? '' : 'non-termExpression '}${this.functionNames.join(' and ')}.`);\n }\n}\n\nexport interface IActorFunctionFactoryDedicatedArgs extends IActorFunctionFactoryArgs {\n functionNames: StringArray;\n termFunction: boolean;\n}\n"]}
@@ -4,6 +4,9 @@ exports.TermFunctionBase = exports.ExpressionFunctionBase = void 0;
4
4
  const context_entries_1 = require("@comunica/context-entries");
5
5
  const utils_expression_evaluator_1 = require("@comunica/utils-expression-evaluator");
6
6
  class ExpressionFunctionBase {
7
+ arity;
8
+ operator;
9
+ apply;
7
10
  constructor({ arity, operator, apply }) {
8
11
  this.arity = arity;
9
12
  this.operator = operator;
@@ -40,13 +43,14 @@ exports.ExpressionFunctionBase = ExpressionFunctionBase;
40
43
  * and https://www.w3.org/TR/sparql11-query/#OperatorMapping
41
44
  */
42
45
  class TermFunctionBase extends ExpressionFunctionBase {
46
+ supportsTermExpressions = true;
47
+ overloads;
43
48
  constructor({ arity, operator, overloads }) {
44
49
  super({
45
50
  arity,
46
51
  operator,
47
52
  apply: async ({ args, exprEval, mapping }) => this.applyOnTerms(await Promise.all(args.map(arg => exprEval.evaluatorExpressionEvaluation(arg, mapping))), exprEval),
48
53
  });
49
- this.supportsTermExpressions = true;
50
54
  this.overloads = overloads;
51
55
  }
52
56
  applyOnTerms(args, exprEval) {
@@ -1 +1 @@
1
- {"version":3,"file":"Core.js","sourceRoot":"","sources":["Core.ts"],"names":[],"mappings":";;;AAAA,+DAAmF;AAMnF,qFAC8C;AAa9C,MAAa,sBAAsB;IAKjC,YAAmB,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAA8B;QACvE,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;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nE,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,+BAAa,CAAC,sBAAsB,CAAC,CAC/D,IAAI,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;QACrC,OAAO,gBAAgB,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC;IAC1C,CAAC;IAES,kBAAkB,CAAC,IAAsB;QACjD,MAAM,IAAI,iDAAoB,CAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IACtD,CAAC;CACF;AA9BD,4CA8BC","sourcesContent":["import { KeysExpressionEvaluator, KeysInitQuery } from '@comunica/context-entries';\nimport type { Expression, IEvalContext, IInternalEvaluator, TermExpression } from '@comunica/types';\nimport type {\n GeneralOperator,\n OverloadTree,\n} from '@comunica/utils-expression-evaluator';\nimport { InvalidArgumentTypes,\n} from '@comunica/utils-expression-evaluator';\nimport type { IExpressionFunction, ITermFunction } from '../ActorFunctionFactory';\n\n// ----------------------------------------------------------------------------\n// Overloaded Functions\n// ----------------------------------------------------------------------------\n\ninterface BaseFunctionDefinitionArgs {\n arity: number | number[];\n operator: GeneralOperator;\n apply: (evalContext: IEvalContext) => Promise<TermExpression>;\n}\n\nexport class ExpressionFunctionBase implements IExpressionFunction {\n protected readonly arity: number | number[];\n public readonly operator: GeneralOperator;\n public readonly apply: (evalContext: IEvalContext) => Promise<TermExpression>;\n\n public constructor({ arity, operator, apply }: BaseFunctionDefinitionArgs) {\n this.arity = arity;\n this.operator = operator;\n this.apply = apply;\n }\n\n public checkArity(args: Expression[]): boolean {\n if (Array.isArray(this.arity)) {\n return this.arity.includes(args.length);\n }\n if (this.arity === Number.POSITIVE_INFINITY) {\n // Infinity is used to represent var-args, so it's always correct.\n return true;\n }\n\n return args.length === this.arity;\n }\n}\n\ninterface TermSparqlFunctionArgs {\n arity: number | number[];\n operator: GeneralOperator;\n overloads: OverloadTree;\n}\n\n/**\n * Varying kinds of functions take arguments of different types on which the\n * specific behaviour is dependant. Although their behaviour is often varying,\n * it is always relatively simple, and better suited for synced behaviour.\n * The types of their arguments are always terms, but might differ in\n * their term-type (eg: iri, literal),\n * their specific literal type (eg: string, integer),\n * their arity (see BNODE),\n * or even their specific numeric type (eg: integer, float).\n *\n * Examples include:\n * - Arithmetic operations such as: *, -, /, +\n * - Bool operators such as: =, !=, <=, <, ...\n * - Functions such as: str, IRI\n *\n * See also: https://www.w3.org/TR/definitionTypesparql11-query/#func-rdfTerms\n * and https://www.w3.org/TR/sparql11-query/#OperatorMapping\n */\nexport class TermFunctionBase extends ExpressionFunctionBase implements ITermFunction {\n public readonly supportsTermExpressions = true;\n protected readonly overloads: OverloadTree;\n\n public constructor({ arity, operator, overloads }: TermSparqlFunctionArgs) {\n super({\n arity,\n operator,\n apply: async({ args, exprEval, mapping }: IEvalContext): Promise<TermExpression> => this.applyOnTerms(\n await Promise.all(args.map(arg => exprEval.evaluatorExpressionEvaluation(arg, mapping))),\n exprEval,\n ),\n });\n\n this.overloads = overloads;\n }\n\n public applyOnTerms(args: TermExpression[], exprEval: IInternalEvaluator): TermExpression {\n const concreteFunction =\n this.overloads.search(\n args,\n exprEval.context.getSafe(KeysExpressionEvaluator.superTypeProvider),\n exprEval.context.getSafe(KeysInitQuery.functionArgumentsCache),\n ) ?? this.handleInvalidTypes(args);\n return concreteFunction(exprEval)(args);\n }\n\n protected handleInvalidTypes(args: TermExpression[]): never {\n throw new InvalidArgumentTypes(args, this.operator);\n }\n}\n"]}
1
+ {"version":3,"file":"Core.js","sourceRoot":"","sources":["Core.ts"],"names":[],"mappings":";;;AAAA,+DAAmF;AAMnF,qFAC8C;AAa9C,MAAa,sBAAsB;IACd,KAAK,CAAoB;IAC5B,QAAQ,CAAkB;IAC1B,KAAK,CAAyD;IAE9E,YAAmB,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAA8B;QACvE,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI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AAC,+BAAa,CAAC,sBAAsB,CAAC,CAC/D,IAAI,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;QACrC,OAAO,gBAAgB,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC;IAC1C,CAAC;IAES,kBAAkB,CAAC,IAAsB;QACjD,MAAM,IAAI,iDAAoB,CAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IACtD,CAAC;CACF;AA9BD,4CA8BC","sourcesContent":["import { KeysExpressionEvaluator, KeysInitQuery } from '@comunica/context-entries';\nimport type { Expression, IEvalContext, IInternalEvaluator, TermExpression } from '@comunica/types';\nimport type {\n GeneralOperator,\n OverloadTree,\n} from '@comunica/utils-expression-evaluator';\nimport { InvalidArgumentTypes,\n} from '@comunica/utils-expression-evaluator';\nimport type { IExpressionFunction, ITermFunction } from '../ActorFunctionFactory';\n\n// ----------------------------------------------------------------------------\n// Overloaded Functions\n// ----------------------------------------------------------------------------\n\ninterface BaseFunctionDefinitionArgs {\n arity: number | number[];\n operator: GeneralOperator;\n apply: (evalContext: IEvalContext) => Promise<TermExpression>;\n}\n\nexport class ExpressionFunctionBase implements IExpressionFunction {\n protected readonly arity: number | number[];\n public readonly operator: GeneralOperator;\n public readonly apply: (evalContext: IEvalContext) => Promise<TermExpression>;\n\n public constructor({ arity, operator, apply }: BaseFunctionDefinitionArgs) {\n this.arity = arity;\n this.operator = operator;\n this.apply = apply;\n }\n\n public checkArity(args: Expression[]): boolean {\n if (Array.isArray(this.arity)) {\n return this.arity.includes(args.length);\n }\n if (this.arity === Number.POSITIVE_INFINITY) {\n // Infinity is used to represent var-args, so it's always correct.\n return true;\n }\n\n return args.length === this.arity;\n }\n}\n\ninterface TermSparqlFunctionArgs {\n arity: number | number[];\n operator: GeneralOperator;\n overloads: OverloadTree;\n}\n\n/**\n * Varying kinds of functions take arguments of different types on which the\n * specific behaviour is dependant. Although their behaviour is often varying,\n * it is always relatively simple, and better suited for synced behaviour.\n * The types of their arguments are always terms, but might differ in\n * their term-type (eg: iri, literal),\n * their specific literal type (eg: string, integer),\n * their arity (see BNODE),\n * or even their specific numeric type (eg: integer, float).\n *\n * Examples include:\n * - Arithmetic operations such as: *, -, /, +\n * - Bool operators such as: =, !=, <=, <, ...\n * - Functions such as: str, IRI\n *\n * See also: https://www.w3.org/TR/definitionTypesparql11-query/#func-rdfTerms\n * and https://www.w3.org/TR/sparql11-query/#OperatorMapping\n */\nexport class TermFunctionBase extends ExpressionFunctionBase implements ITermFunction {\n public readonly supportsTermExpressions = true;\n protected readonly overloads: OverloadTree;\n\n public constructor({ arity, operator, overloads }: TermSparqlFunctionArgs) {\n super({\n arity,\n operator,\n apply: async({ args, exprEval, mapping }: IEvalContext): Promise<TermExpression> => this.applyOnTerms(\n await Promise.all(args.map(arg => exprEval.evaluatorExpressionEvaluation(arg, mapping))),\n exprEval,\n ),\n });\n\n this.overloads = overloads;\n }\n\n public applyOnTerms(args: TermExpression[], exprEval: IInternalEvaluator): TermExpression {\n const concreteFunction =\n this.overloads.search(\n args,\n exprEval.context.getSafe(KeysExpressionEvaluator.superTypeProvider),\n exprEval.context.getSafe(KeysInitQuery.functionArgumentsCache),\n ) ?? this.handleInvalidTypes(args);\n return concreteFunction(exprEval)(args);\n }\n\n protected handleInvalidTypes(args: TermExpression[]): never {\n throw new InvalidArgumentTypes(args, this.operator);\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@comunica/bus-function-factory",
3
- "version": "4.4.2-alpha.49.0",
3
+ "version": "5.0.0",
4
4
  "description": "A comunica bus for function factory events.",
5
5
  "lsd:module": true,
6
6
  "license": "MIT",
@@ -36,11 +36,11 @@
36
36
  "build:components": "componentsjs-generator"
37
37
  },
38
38
  "dependencies": {
39
- "@comunica/context-entries": "4.4.2-alpha.49.0",
40
- "@comunica/core": "4.4.2-alpha.49.0",
41
- "@comunica/types": "4.4.2-alpha.49.0",
42
- "@comunica/utils-algebra": "4.4.2-alpha.49.0",
43
- "@comunica/utils-expression-evaluator": "4.4.2-alpha.49.0"
39
+ "@comunica/context-entries": "^5.0.0",
40
+ "@comunica/core": "^5.0.0",
41
+ "@comunica/types": "^5.0.0",
42
+ "@comunica/utils-algebra": "^5.0.0",
43
+ "@comunica/utils-expression-evaluator": "^5.0.0"
44
44
  },
45
- "gitHead": "ef6f96cfd8faf7c37955bb7e0fe9f6fc6a994bdf"
45
+ "gitHead": "0b1756fdb9bef014133432489627c1bd71779bd0"
46
46
  }