@comunica/actor-bindings-aggregator-factory-sum 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,8 +1,8 @@
1
1
  {
2
2
  "@context": [
3
- "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-bindings-aggregator-factory-sum/^4.0.0/components/context.jsonld",
4
- "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/core/^4.0.0/components/context.jsonld",
5
- "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-bindings-aggregator-factory/^4.0.0/components/context.jsonld"
3
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-bindings-aggregator-factory-sum/^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-bindings-aggregator-factory/^5.0.0/components/context.jsonld"
6
6
  ],
7
7
  "@id": "npmd:@comunica/actor-bindings-aggregator-factory-sum",
8
8
  "components": [
@@ -43,37 +43,37 @@
43
43
  "genericTypeInstances": [
44
44
  {
45
45
  "@type": "ParameterRangeGenericTypeReference",
46
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
46
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
47
47
  },
48
48
  {
49
49
  "@type": "ParameterRangeGenericTypeReference",
50
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
50
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
51
51
  },
52
52
  {
53
53
  "@type": "ParameterRangeGenericTypeReference",
54
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
54
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
55
55
  },
56
56
  {
57
57
  "@type": "ParameterRangeGenericTypeReference",
58
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
58
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
59
59
  }
60
60
  ]
61
61
  },
62
62
  {
63
63
  "@type": "ParameterRangeGenericTypeReference",
64
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
64
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
65
65
  },
66
66
  {
67
67
  "@type": "ParameterRangeGenericTypeReference",
68
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
68
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
69
69
  },
70
70
  {
71
71
  "@type": "ParameterRangeGenericTypeReference",
72
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
72
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
73
73
  },
74
74
  {
75
75
  "@type": "ParameterRangeGenericTypeReference",
76
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
76
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
77
77
  }
78
78
  ]
79
79
  },
@@ -110,19 +110,19 @@
110
110
  "genericTypeInstances": [
111
111
  {
112
112
  "@type": "ParameterRangeGenericTypeReference",
113
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
113
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
114
114
  },
115
115
  {
116
116
  "@type": "ParameterRangeGenericTypeReference",
117
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
117
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
118
118
  },
119
119
  {
120
120
  "@type": "ParameterRangeGenericTypeReference",
121
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
121
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
122
122
  },
123
123
  {
124
124
  "@type": "ParameterRangeGenericTypeReference",
125
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
125
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
126
126
  }
127
127
  ]
128
128
  }
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "@context": [
3
- "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-bindings-aggregator-factory-sum/^4.0.0/components/context.jsonld",
4
- "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/types/^4.0.0/components/context.jsonld",
5
- "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-function-factory/^4.0.0/components/context.jsonld"
3
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-bindings-aggregator-factory-sum/^5.0.0/components/context.jsonld",
4
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/types/^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-bindings-aggregator-factory-sum",
8
8
  "components": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "@context": [
3
- "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-bindings-aggregator-factory-sum/^4.0.0/components/context.jsonld"
3
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-bindings-aggregator-factory-sum/^5.0.0/components/context.jsonld"
4
4
  ],
5
5
  "@id": "npmd:@comunica/actor-bindings-aggregator-factory-sum",
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
- "cabafs": "npmd:@comunica/actor-bindings-aggregator-factory-sum/^4.0.0/",
6
+ "cabafs": "npmd:@comunica/actor-bindings-aggregator-factory-sum/^5.0.0/",
7
7
  "ActorBindingsAggregatorFactorySum": {
8
8
  "@id": "cabafs:components/ActorBindingsAggregatorFactorySum.jsonld#ActorBindingsAggregatorFactorySum",
9
9
  "@prefix": true,
@@ -10,6 +10,7 @@ const SumAggregator_1 = require("./SumAggregator");
10
10
  * A comunica Sum Expression Evaluator Aggregate Actor.
11
11
  */
12
12
  class ActorBindingsAggregatorFactorySum extends bus_bindings_aggregator_factory_1.ActorBindingsAggregatorFactory {
13
+ mediatorFunctionFactory;
13
14
  constructor(args) {
14
15
  super(args);
15
16
  this.mediatorFunctionFactory = args.mediatorFunctionFactory;
@@ -1 +1 @@
1
- {"version":3,"file":"ActorBindingsAggregatorFactorySum.js","sourceRoot":"","sources":["ActorBindingsAggregatorFactorySum.ts"],"names":[],"mappings":";;;AAKA,+FAEmD;AAEnD,+DAA0D;AAE1D,yCAAwD;AACxD,qFAAsE;AACtE,mDAAgD;AAMhD;;GAEG;AACH,MAAa,iCAAkC,SAAQ,gEAA8B;IAGnF,YAAmB,IAA4C;QAC7D,KAAK,CAAC,IAAI,CAAC,CAAC;QACZ,IAAI,CAAC,uBAAuB,GAA6B,IAAI,CAAC,uBAAuB,CAAC;IACxF,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,MAAwC;QACxD,IAAI,MAAM,CAAC,IAAI,CAAC,UAAU,KAAK,KAAK,EAAE,CAAC;YACrC,OAAO,IAAA,eAAQ,EAAC,kDAAkD,CAAC,CAAC;QACtE,CAAC;QACD,OAAO,IAAA,mBAAY,GAAE,CAAC;IACxB,CAAC;IAEM,KAAK,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,OAAO,EAAoC;QAElE,OAAO,IAAI,6BAAa,CACtB,MAAM,IAAI,CAAC,kCAAkC,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,UAAU,EAAE,OAAO,EAAE,CAAC,EAC5F,IAAI,CAAC,QAAQ,EACb,OAAO,CAAC,OAAO,CAAC,+BAAa,CAAC,WAAW,CAAC,EAC1C,MAAM,IAAI,CAAC,uBAAuB,CAAC,OAAO,CAAC;YACzC,YAAY,EAAE,2CAAc,CAAC,QAAQ;YACrC,OAAO;YACP,qBAAqB,EAAE,IAAI;SAC5B,CAAC,CACH,CAAC;IACJ,CAAC;CACF;AA5BD,8EA4BC","sourcesContent":["import type {\n IActionBindingsAggregatorFactory,\n IActorBindingsAggregatorFactoryArgs,\n IActorBindingsAggregatorFactoryOutput,\n} from '@comunica/bus-bindings-aggregator-factory';\nimport {\n ActorBindingsAggregatorFactory,\n} from '@comunica/bus-bindings-aggregator-factory';\nimport type { MediatorFunctionFactory, MediatorFunctionFactoryUnsafe } from '@comunica/bus-function-factory';\nimport { KeysInitQuery } from '@comunica/context-entries';\nimport type { IActorTest, TestResult } from '@comunica/core';\nimport { failTest, passTestVoid } from '@comunica/core';\nimport { SparqlOperator } from '@comunica/utils-expression-evaluator';\nimport { SumAggregator } from './SumAggregator';\n\nexport interface IActorBindingsAggregatorFactorySumArgs extends IActorBindingsAggregatorFactoryArgs {\n mediatorFunctionFactory: MediatorFunctionFactoryUnsafe;\n}\n\n/**\n * A comunica Sum Expression Evaluator Aggregate Actor.\n */\nexport class ActorBindingsAggregatorFactorySum extends ActorBindingsAggregatorFactory {\n private readonly mediatorFunctionFactory: MediatorFunctionFactory;\n\n public constructor(args: IActorBindingsAggregatorFactorySumArgs) {\n super(args);\n this.mediatorFunctionFactory = <MediatorFunctionFactory> args.mediatorFunctionFactory;\n }\n\n public async test(action: IActionBindingsAggregatorFactory): Promise<TestResult<IActorTest>> {\n if (action.expr.aggregator !== 'sum') {\n return failTest('This actor only supports the \\'sum\\' aggregator.');\n }\n return passTestVoid();\n }\n\n public async run({ expr, context }: IActionBindingsAggregatorFactory):\n Promise<IActorBindingsAggregatorFactoryOutput> {\n return new SumAggregator(\n await this.mediatorExpressionEvaluatorFactory.mediate({ algExpr: expr.expression, context }),\n expr.distinct,\n context.getSafe(KeysInitQuery.dataFactory),\n await this.mediatorFunctionFactory.mediate({\n functionName: SparqlOperator.ADDITION,\n context,\n requireTermExpression: true,\n }),\n );\n }\n}\n"]}
1
+ {"version":3,"file":"ActorBindingsAggregatorFactorySum.js","sourceRoot":"","sources":["ActorBindingsAggregatorFactorySum.ts"],"names":[],"mappings":";;;AAKA,+FAEmD;AAEnD,+DAA0D;AAE1D,yCAAwD;AACxD,qFAAsE;AACtE,mDAAgD;AAMhD;;GAEG;AACH,MAAa,iCAAkC,SAAQ,gEAA8B;IAClE,uBAAuB,CAA0B;IAElE,YAAmB,IAA4C;QAC7D,KAAK,CAAC,IAAI,CAAC,CAAC;QACZ,IAAI,CAAC,uBAAuB,GAA6B,IAAI,CAAC,uBAAuB,CAAC;IACxF,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,MAAwC;QACxD,IAAI,MAAM,CAAC,IAAI,CAAC,UAAU,KAAK,KAAK,EAAE,CAAC;YACrC,OAAO,IAAA,eAAQ,EAAC,kDAAkD,CAAC,CAAC;QACtE,CAAC;QACD,OAAO,IAAA,mBAAY,GAAE,CAAC;IACxB,CAAC;IAEM,KAAK,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,OAAO,EAAoC;QAElE,OAAO,IAAI,6BAAa,CACtB,MAAM,IAAI,CAAC,kCAAkC,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,UAAU,EAAE,OAAO,EAAE,CAAC,EAC5F,IAAI,CAAC,QAAQ,EACb,OAAO,CAAC,OAAO,CAAC,+BAAa,CAAC,WAAW,CAAC,EAC1C,MAAM,IAAI,CAAC,uBAAuB,CAAC,OAAO,CAAC;YACzC,YAAY,EAAE,2CAAc,CAAC,QAAQ;YACrC,OAAO;YACP,qBAAqB,EAAE,IAAI;SAC5B,CAAC,CACH,CAAC;IACJ,CAAC;CACF;AA5BD,8EA4BC","sourcesContent":["import type {\n IActionBindingsAggregatorFactory,\n IActorBindingsAggregatorFactoryArgs,\n IActorBindingsAggregatorFactoryOutput,\n} from '@comunica/bus-bindings-aggregator-factory';\nimport {\n ActorBindingsAggregatorFactory,\n} from '@comunica/bus-bindings-aggregator-factory';\nimport type { MediatorFunctionFactory, MediatorFunctionFactoryUnsafe } from '@comunica/bus-function-factory';\nimport { KeysInitQuery } from '@comunica/context-entries';\nimport type { IActorTest, TestResult } from '@comunica/core';\nimport { failTest, passTestVoid } from '@comunica/core';\nimport { SparqlOperator } from '@comunica/utils-expression-evaluator';\nimport { SumAggregator } from './SumAggregator';\n\nexport interface IActorBindingsAggregatorFactorySumArgs extends IActorBindingsAggregatorFactoryArgs {\n mediatorFunctionFactory: MediatorFunctionFactoryUnsafe;\n}\n\n/**\n * A comunica Sum Expression Evaluator Aggregate Actor.\n */\nexport class ActorBindingsAggregatorFactorySum extends ActorBindingsAggregatorFactory {\n private readonly mediatorFunctionFactory: MediatorFunctionFactory;\n\n public constructor(args: IActorBindingsAggregatorFactorySumArgs) {\n super(args);\n this.mediatorFunctionFactory = <MediatorFunctionFactory> args.mediatorFunctionFactory;\n }\n\n public async test(action: IActionBindingsAggregatorFactory): Promise<TestResult<IActorTest>> {\n if (action.expr.aggregator !== 'sum') {\n return failTest('This actor only supports the \\'sum\\' aggregator.');\n }\n return passTestVoid();\n }\n\n public async run({ expr, context }: IActionBindingsAggregatorFactory):\n Promise<IActorBindingsAggregatorFactoryOutput> {\n return new SumAggregator(\n await this.mediatorExpressionEvaluatorFactory.mediate({ algExpr: expr.expression, context }),\n expr.distinct,\n context.getSafe(KeysInitQuery.dataFactory),\n await this.mediatorFunctionFactory.mediate({\n functionName: SparqlOperator.ADDITION,\n context,\n requireTermExpression: true,\n }),\n );\n }\n}\n"]}
@@ -4,11 +4,13 @@ exports.SumAggregator = void 0;
4
4
  const bus_bindings_aggregator_factory_1 = require("@comunica/bus-bindings-aggregator-factory");
5
5
  const utils_expression_evaluator_1 = require("@comunica/utils-expression-evaluator");
6
6
  class SumAggregator extends bus_bindings_aggregator_factory_1.AggregateEvaluator {
7
+ dataFactory;
8
+ additionFunction;
9
+ state = undefined;
7
10
  constructor(evaluator, distinct, dataFactory, additionFunction, throwError) {
8
11
  super(evaluator, distinct, throwError);
9
12
  this.dataFactory = dataFactory;
10
13
  this.additionFunction = additionFunction;
11
- this.state = undefined;
12
14
  }
13
15
  emptyValueTerm() {
14
16
  return (0, utils_expression_evaluator_1.typedLiteral)('0', utils_expression_evaluator_1.TypeURL.XSD_INTEGER);
@@ -1 +1 @@
1
- {"version":3,"file":"SumAggregator.js","sourceRoot":"","sources":["SumAggregator.ts"],"names":[],"mappings":";;;AAAA,+FAA+E;AAI/E,qFAA6E;AAK7E,MAAa,aAAc,SAAQ,oDAAkB;IAGnD,YACE,SAA+B,EAC/B,QAAiB,EACA,WAAgC,EAChC,gBAA+B,EAChD,UAAoB;QAEpB,KAAK,CAAC,SAAS,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC;QAJtB,gBAAW,GAAX,WAAW,CAAqB;QAChC,qBAAgB,GAAhB,gBAAgB,CAAe;QAN1C,UAAK,GAAyB,SAAS,CAAC;IAUhD,CAAC;IAEe,cAAc;QAC5B,OAAO,IAAA,yCAAY,EAAC,GAAG,EAAE,oCAAO,CAAC,WAAW,CAAC,CAAC;IAChD,CAAC;IAEM,OAAO,CAAC,IAAc;QAC3B,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;YAC7B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC;QAC/C,CAAC;aAAM,CAAC;YACN,MAAM,YAAY,GAAG,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC;YACrD,IAAI,CAAC,KAAK,GAAoB,IAAI,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAE,IAAI,CAAC,KAAK,EAAE,YAAY,CAAE,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;QACjH,CAAC;IACH,CAAC;IAEM,UAAU;QACf,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;YAC7B,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC;QAC3B,CAAC;QACD,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAC5C,CAAC;CACF;AAhCD,sCAgCC","sourcesContent":["import { AggregateEvaluator } from '@comunica/bus-bindings-aggregator-factory';\nimport type { ITermFunction } from '@comunica/bus-function-factory';\nimport type { ComunicaDataFactory, IExpressionEvaluator } from '@comunica/types';\nimport type { NumericLiteral } from '@comunica/utils-expression-evaluator';\nimport { typedLiteral, TypeURL } from '@comunica/utils-expression-evaluator';\nimport type * as RDF from '@rdfjs/types';\n\ntype SumState = NumericLiteral;\n\nexport class SumAggregator extends AggregateEvaluator {\n private state: SumState | undefined = undefined;\n\n public constructor(\n evaluator: IExpressionEvaluator,\n distinct: boolean,\n private readonly dataFactory: ComunicaDataFactory,\n private readonly additionFunction: ITermFunction,\n throwError?: boolean,\n ) {\n super(evaluator, distinct, throwError);\n }\n\n public override emptyValueTerm(): RDF.Term {\n return typedLiteral('0', TypeURL.XSD_INTEGER);\n }\n\n public putTerm(term: RDF.Term): void {\n if (this.state === undefined) {\n this.state = this.termToNumericOrError(term);\n } else {\n const internalTerm = this.termToNumericOrError(term);\n this.state = <NumericLiteral> this.additionFunction.applyOnTerms([ this.state, internalTerm ], this.evaluator);\n }\n }\n\n public termResult(): RDF.Term | undefined {\n if (this.state === undefined) {\n return this.emptyValue();\n }\n return this.state.toRDF(this.dataFactory);\n }\n}\n"]}
1
+ {"version":3,"file":"SumAggregator.js","sourceRoot":"","sources":["SumAggregator.ts"],"names":[],"mappings":";;;AAAA,+FAA+E;AAI/E,qFAA6E;AAK7E,MAAa,aAAc,SAAQ,oDAAkB;IAMhC;IACA;IANX,KAAK,GAAyB,SAAS,CAAC;IAEhD,YACE,SAA+B,EAC/B,QAAiB,EACA,WAAgC,EAChC,gBAA+B,EAChD,UAAoB;QAEpB,KAAK,CAAC,SAAS,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC;QAJtB,gBAAW,GAAX,WAAW,CAAqB;QAChC,qBAAgB,GAAhB,gBAAgB,CAAe;IAIlD,CAAC;IAEe,cAAc;QAC5B,OAAO,IAAA,yCAAY,EAAC,GAAG,EAAE,oCAAO,CAAC,WAAW,CAAC,CAAC;IAChD,CAAC;IAEM,OAAO,CAAC,IAAc;QAC3B,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;YAC7B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC;QAC/C,CAAC;aAAM,CAAC;YACN,MAAM,YAAY,GAAG,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC;YACrD,IAAI,CAAC,KAAK,GAAoB,IAAI,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAE,IAAI,CAAC,KAAK,EAAE,YAAY,CAAE,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;QACjH,CAAC;IACH,CAAC;IAEM,UAAU;QACf,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;YAC7B,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC;QAC3B,CAAC;QACD,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAC5C,CAAC;CACF;AAhCD,sCAgCC","sourcesContent":["import { AggregateEvaluator } from '@comunica/bus-bindings-aggregator-factory';\nimport type { ITermFunction } from '@comunica/bus-function-factory';\nimport type { ComunicaDataFactory, IExpressionEvaluator } from '@comunica/types';\nimport type { NumericLiteral } from '@comunica/utils-expression-evaluator';\nimport { typedLiteral, TypeURL } from '@comunica/utils-expression-evaluator';\nimport type * as RDF from '@rdfjs/types';\n\ntype SumState = NumericLiteral;\n\nexport class SumAggregator extends AggregateEvaluator {\n private state: SumState | undefined = undefined;\n\n public constructor(\n evaluator: IExpressionEvaluator,\n distinct: boolean,\n private readonly dataFactory: ComunicaDataFactory,\n private readonly additionFunction: ITermFunction,\n throwError?: boolean,\n ) {\n super(evaluator, distinct, throwError);\n }\n\n public override emptyValueTerm(): RDF.Term {\n return typedLiteral('0', TypeURL.XSD_INTEGER);\n }\n\n public putTerm(term: RDF.Term): void {\n if (this.state === undefined) {\n this.state = this.termToNumericOrError(term);\n } else {\n const internalTerm = this.termToNumericOrError(term);\n this.state = <NumericLiteral> this.additionFunction.applyOnTerms([ this.state, internalTerm ], this.evaluator);\n }\n }\n\n public termResult(): RDF.Term | undefined {\n if (this.state === undefined) {\n return this.emptyValue();\n }\n return this.state.toRDF(this.dataFactory);\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@comunica/actor-bindings-aggregator-factory-sum",
3
- "version": "4.4.2-alpha.49.0",
3
+ "version": "5.0.0",
4
4
  "description": "A sum bindings aggregator factory actor",
5
5
  "lsd:module": true,
6
6
  "license": "MIT",
@@ -37,13 +37,13 @@
37
37
  "build:components": "componentsjs-generator"
38
38
  },
39
39
  "dependencies": {
40
- "@comunica/bus-bindings-aggregator-factory": "4.4.2-alpha.49.0",
41
- "@comunica/bus-function-factory": "4.4.2-alpha.49.0",
42
- "@comunica/context-entries": "4.4.2-alpha.49.0",
43
- "@comunica/core": "4.4.2-alpha.49.0",
44
- "@comunica/types": "4.4.2-alpha.49.0",
45
- "@comunica/utils-expression-evaluator": "4.4.2-alpha.49.0",
40
+ "@comunica/bus-bindings-aggregator-factory": "^5.0.0",
41
+ "@comunica/bus-function-factory": "^5.0.0",
42
+ "@comunica/context-entries": "^5.0.0",
43
+ "@comunica/core": "^5.0.0",
44
+ "@comunica/types": "^5.0.0",
45
+ "@comunica/utils-expression-evaluator": "^5.0.0",
46
46
  "@rdfjs/types": "*"
47
47
  },
48
- "gitHead": "ef6f96cfd8faf7c37955bb7e0fe9f6fc6a994bdf"
48
+ "gitHead": "0b1756fdb9bef014133432489627c1bd71779bd0"
49
49
  }