Skip to content

Commit

Permalink
Move aggregators to dedicated bus
Browse files Browse the repository at this point in the history
This allows aggregator implementations to be swapped and added more easily.
  • Loading branch information
jitsedesmet authored Oct 20, 2023
1 parent 6a1a5fe commit 64a487a
Show file tree
Hide file tree
Showing 185 changed files with 4,848 additions and 2,748 deletions.
14 changes: 11 additions & 3 deletions .componentsjs-generator-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
"packages/data-factory",
"packages/jest",
"packages/packager",
"packages/runner-cli",
"packages/expression-evaluator"
"packages/runner-cli"
],
"ignoreComponents": [
"Error",
Expand Down Expand Up @@ -64,7 +63,16 @@
"Factory",

"UriTemplate",
"LRUCache"
"LRUCache",

"isExpressionError",
"AggregateEvaluator",
"ExpressionEvaluator",
"AggregateEvaluator",
"Expression",
"TypeURL",
"RegularOperator",
"typedLiteral"
],
"modulePrefix": {
"@comunica/actor-query-operation-service": "caqoser",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"@context": [
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/config-query-sparql/^2.0.0/components/context.jsonld"
],
"import": [
"ccqs:config/bindings-aggregator-factory/actors/average.json",
"ccqs:config/bindings-aggregator-factory/actors/count.json",
"ccqs:config/bindings-aggregator-factory/actors/group-concat.json",
"ccqs:config/bindings-aggregator-factory/actors/max.json",
"ccqs:config/bindings-aggregator-factory/actors/min.json",
"ccqs:config/bindings-aggregator-factory/actors/sample.json",
"ccqs:config/bindings-aggregator-factory/actors/sum.json",
"ccqs:config/bindings-aggregator-factory/actors/wildcard-count.json"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"@context": [
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/runner/^2.0.0/components/context.jsonld",

"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-bindings-aggregator-factory-average/^1.0.0/components/context.jsonld"
],
"@id": "urn:comunica:default:Runner",
"@type": "Runner",
"actors": [
{
"@id": "urn:comunica:default:bindings-aggregator-factory/actors#average",
"@type": "ActorBindingsAggregatorFactoryAverage"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"@context": [
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/runner/^2.0.0/components/context.jsonld",

"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-bindings-aggregator-factory-count/^1.0.0/components/context.jsonld"
],
"@id": "urn:comunica:default:Runner",
"@type": "Runner",
"actors": [
{
"@id": "urn:comunica:default:bindings-aggregator-factory/actors#count",
"@type": "ActorBindingsAggregatorFactoryCount"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"@context": [
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/runner/^2.0.0/components/context.jsonld",

"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-bindings-aggregator-factory-group-concat/^1.0.0/components/context.jsonld"
],
"@id": "urn:comunica:default:Runner",
"@type": "Runner",
"actors": [
{
"@id": "urn:comunica:default:bindings-aggregator-factory/actors#group-concat",
"@type": "ActorBindingsAggregatorFactoryGroupConcat"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"@context": [
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/runner/^2.0.0/components/context.jsonld",

"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-bindings-aggregator-factory-max/^1.0.0/components/context.jsonld"
],
"@id": "urn:comunica:default:Runner",
"@type": "Runner",
"actors": [
{
"@id": "urn:comunica:default:bindings-aggregator-factory/actors#max",
"@type": "ActorBindingsAggregatorFactoryMax"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"@context": [
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/runner/^2.0.0/components/context.jsonld",

"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-bindings-aggregator-factory-min/^1.0.0/components/context.jsonld"
],
"@id": "urn:comunica:default:Runner",
"@type": "Runner",
"actors": [
{
"@id": "urn:comunica:default:bindings-aggregator-factory/actors#min",
"@type": "ActorBindingsAggregatorFactoryMin"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"@context": [
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/runner/^2.0.0/components/context.jsonld",

"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-bindings-aggregator-factory-sample/^1.0.0/components/context.jsonld"
],
"@id": "urn:comunica:default:Runner",
"@type": "Runner",
"actors": [
{
"@id": "urn:comunica:default:bindings-aggregator-factory/actors#sample",
"@type": "ActorBindingsAggregatorFactorySample"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"@context": [
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/runner/^2.0.0/components/context.jsonld",

"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-bindings-aggregator-factory-sum/^1.0.0/components/context.jsonld"
],
"@id": "urn:comunica:default:Runner",
"@type": "Runner",
"actors": [
{
"@id": "urn:comunica:default:bindings-aggregator-factory/actors#sum",
"@type": "ActorBindingsAggregatorFactorySum"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"@context": [
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/runner/^2.0.0/components/context.jsonld",

"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-bindings-aggregator-factory-wildcard-count/^1.0.0/components/context.jsonld"
],
"@id": "urn:comunica:default:Runner",
"@type": "Runner",
"actors": [
{
"@id": "urn:comunica:default:bindings-aggregator-factory/actors#wildcard-count",
"@type": "ActorBindingsAggregatorFactoryWildcardCount"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"@context": [
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-bindings-aggeregator-factory/^1.0.0/components/context.jsonld",
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/mediator-race/^2.0.0/components/context.jsonld"
],
"@id": "urn:comunica:default:bindings-aggregator-factory/mediators#main",
"@type": "MediatorRace",
"bus": { "@id": "ActorBindingsAggregatorFactory:_default_bus" }
}
3 changes: 3 additions & 0 deletions engines/config-query-sparql/config/config-default.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/config-query-sparql/^2.0.0/components/context.jsonld"
],
"import": [
"ccqs:config/bindings-aggregator-factory/actors.json",
"ccqs:config/bindings-aggregator-factory/mediators.json",
"ccqs:config/context-preprocess/actors.json",
"ccqs:config/context-preprocess/mediators.json",
"ccqs:config/expression-evaluator/evaluators.json",
"ccqs:config/hash-bindings/actors.json",
"ccqs:config/hash-bindings/mediators.json",
"ccqs:config/http/actors.json",
Expand Down
3 changes: 3 additions & 0 deletions engines/config-query-sparql/config/config-rdfjs.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/config-query-sparql/^2.0.0/components/context.jsonld"
],
"import": [
"ccqs:config/bindings-aggregator-factory/actors.json",
"ccqs:config/bindings-aggregator-factory/mediators.json",
"ccqs:config/context-preprocess/actors.json",
"ccqs:config/context-preprocess/mediators.json",
"ccqs:config/expression-evaluator/evaluators.json",
"ccqs:config/hash-bindings/actors.json",
"ccqs:config/hash-bindings/mediators.json",

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"@context": [
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/expression-evaluator/^2.0.0/components/context.jsonld"
],
"@id": "urn:comunica:default:expression-evaluator/evaluators#main",
"@type": "ExpressionEvaluatorFactory",
"mediatorQueryOperation": { "@id": "urn:comunica:default:query-operation/mediators#main" },
"mediatorBindingsAggregatorFactory": { "@id": "urn:comunica:default:bindings-aggregator-factory/mediators#main" }
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
{
"@id": "urn:comunica:default:query-operation/actors#extend",
"@type": "ActorQueryOperationExtend",
"mediatorQueryOperation": { "@id": "urn:comunica:default:query-operation/mediators#main" }
"mediatorQueryOperation": { "@id": "urn:comunica:default:query-operation/mediators#main" },
"expressionEvaluatorFactory": { "@id": "urn:comunica:default:expression-evaluator/evaluators#main" }
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
{
"@id": "urn:comunica:default:query-operation/actors#filter",
"@type": "ActorQueryOperationFilterSparqlee",
"mediatorQueryOperation": { "@id": "urn:comunica:default:query-operation/mediators#main" }
"mediatorQueryOperation": { "@id": "urn:comunica:default:query-operation/mediators#main" },
"expressionEvaluatorFactory": { "@id": "urn:comunica:default:expression-evaluator/evaluators#main" }
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"@id": "urn:comunica:default:query-operation/actors#group",
"@type": "ActorQueryOperationGroup",
"mediatorQueryOperation": { "@id": "urn:comunica:default:query-operation/mediators#main" },
"mediatorHashBindings": { "@id": "urn:comunica:default:hash-bindings/mediators#main" }
"mediatorHashBindings": { "@id": "urn:comunica:default:hash-bindings/mediators#main" },
"expressionEvaluatorFactory": { "@id": "urn:comunica:default:expression-evaluator/evaluators#main" }
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"@id": "urn:comunica:default:query-operation/actors#leftjoin",
"@type": "ActorQueryOperationLeftJoin",
"mediatorQueryOperation": { "@id": "urn:comunica:default:query-operation/mediators#main" },
"mediatorJoin": { "@id": "urn:comunica:default:rdf-join/mediators#main" }
"mediatorJoin": { "@id": "urn:comunica:default:rdf-join/mediators#main" },
"expressionEvaluatorFactory": { "@id": "urn:comunica:default:expression-evaluator/evaluators#main" }
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
{
"@id": "urn:comunica:default:query-operation/actors#orderby",
"@type": "ActorQueryOperationOrderBySparqlee",
"mediatorQueryOperation": { "@id": "urn:comunica:default:query-operation/mediators#main" }
"mediatorQueryOperation": { "@id": "urn:comunica:default:query-operation/mediators#main" },
"expressionEvaluatorFactory": { "@id": "urn:comunica:default:expression-evaluator/evaluators#main" }
}
]
}
9 changes: 9 additions & 0 deletions engines/query-sparql-file/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@
"@comunica/actor-dereference-file": "^2.8.2",
"@comunica/actor-dereference-http": "^2.8.2",
"@comunica/actor-dereference-rdf-parse": "^2.8.2",
"@comunica/actor-bindings-aggregator-factory-average": "^1.0.0",
"@comunica/actor-bindings-aggregator-factory-count": "^1.0.0",
"@comunica/actor-bindings-aggregator-factory-group-concat": "^1.0.0",
"@comunica/actor-bindings-aggregator-factory-max": "^1.0.0",
"@comunica/actor-bindings-aggregator-factory-min": "^1.0.0",
"@comunica/actor-bindings-aggregator-factory-sample": "^1.0.0",
"@comunica/actor-bindings-aggregator-factory-sum": "^1.0.0",
"@comunica/actor-bindings-aggregator-factory-wildcard-count": "^1.0.0",
"@comunica/actor-hash-bindings-sha1": "^2.8.2",
"@comunica/actor-http-fetch": "^2.8.2",
"@comunica/actor-http-proxy": "^2.8.2",
Expand Down Expand Up @@ -169,6 +177,7 @@
"@comunica/bus-query-operation": "^2.9.0",
"@comunica/config-query-sparql": "^2.7.0",
"@comunica/core": "^2.8.2",
"@comunica/expression-evaluator": "^2.9.0",
"@comunica/logger-void": "^2.8.2",
"@comunica/mediator-all": "^2.8.2",
"@comunica/mediator-combine-pipeline": "^2.8.2",
Expand Down
9 changes: 9 additions & 0 deletions engines/query-sparql-rdfjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@
],
"dependencies": {
"@comunica/actor-context-preprocess-source-to-destination": "^2.8.2",
"@comunica/actor-bindings-aggregator-factory-average": "^1.0.0",
"@comunica/actor-bindings-aggregator-factory-count": "^1.0.0",
"@comunica/actor-bindings-aggregator-factory-group-concat": "^1.0.0",
"@comunica/actor-bindings-aggregator-factory-max": "^1.0.0",
"@comunica/actor-bindings-aggregator-factory-min": "^1.0.0",
"@comunica/actor-bindings-aggregator-factory-sample": "^1.0.0",
"@comunica/actor-bindings-aggregator-factory-sum": "^1.0.0",
"@comunica/actor-bindings-aggregator-factory-wildcard-count": "^1.0.0",
"@comunica/actor-hash-bindings-sha1": "^2.8.2",
"@comunica/actor-init-query": "^2.9.0",
"@comunica/actor-optimize-query-operation-bgp-to-join": "^2.8.2",
Expand Down Expand Up @@ -124,6 +132,7 @@
"@comunica/bus-query-operation": "^2.9.0",
"@comunica/config-query-sparql": "^2.7.0",
"@comunica/core": "^2.8.2",
"@comunica/expression-evaluator": "^2.9.0",
"@comunica/logger-void": "^2.8.2",
"@comunica/mediator-all": "^2.8.2",
"@comunica/mediator-combine-pipeline": "^2.8.2",
Expand Down
9 changes: 9 additions & 0 deletions engines/query-sparql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@
"@comunica/actor-dereference-fallback": "^2.8.2",
"@comunica/actor-dereference-http": "^2.8.2",
"@comunica/actor-dereference-rdf-parse": "^2.8.2",
"@comunica/actor-bindings-aggregator-factory-average": "^1.0.0",
"@comunica/actor-bindings-aggregator-factory-count": "^1.0.0",
"@comunica/actor-bindings-aggregator-factory-group-concat": "^1.0.0",
"@comunica/actor-bindings-aggregator-factory-max": "^1.0.0",
"@comunica/actor-bindings-aggregator-factory-min": "^1.0.0",
"@comunica/actor-bindings-aggregator-factory-sample": "^1.0.0",
"@comunica/actor-bindings-aggregator-factory-sum": "^1.0.0",
"@comunica/actor-bindings-aggregator-factory-wildcard-count": "^1.0.0",
"@comunica/actor-hash-bindings-sha1": "^2.8.2",
"@comunica/actor-http-fetch": "^2.8.2",
"@comunica/actor-http-proxy": "^2.8.2",
Expand Down Expand Up @@ -167,6 +175,7 @@
"@comunica/bus-query-operation": "^2.9.0",
"@comunica/config-query-sparql": "^2.7.0",
"@comunica/core": "^2.8.2",
"@comunica/expression-evaluator": "^2.9.0",
"@comunica/logger-void": "^2.8.2",
"@comunica/mediator-all": "^2.8.2",
"@comunica/mediator-combine-pipeline": "^2.8.2",
Expand Down
3 changes: 2 additions & 1 deletion engines/query-sparql/test/QuerySparql-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,8 @@ describe('System test: QuerySparql', () => {
});
});

describe('extension function', () => {
// eslint-disable-next-line mocha/no-skipped-tests
describe.skip('extension function', () => {
let funcAllow: string;
let store: Store;
let baseFunctions: Record<string, (args: RDF.Term[]) => Promise<RDF.Term>>;
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@
"depcheck": "lerna-script depcheckTask",
"depcheck:fix": "lerna-script depfixTask",
"ncu:all": "lerna-script updateTask",
"ncu:major:all": "lerna-script updateTaskMajor"
"ncu:major:all": "lerna-script updateTaskMajor",
"clean": "git status --untracked-files=all --ignored=traditional | grep \"^[^a-z]*packages/[^/]*/lib/\" | grep \"\\.\\(\\(js\\)\\|\\(d\\.ts\\)\\|\\(js\\.map\\)\\)$\" | xargs rm && git status --untracked-files=all --ignored=traditional | grep \"^[^a-z]*packages/[^/]*/components/\" | xargs rm"
},
"resolutions": {
"@rdfjs/types": "1.1.0"
Expand Down
Empty file.
35 changes: 35 additions & 0 deletions packages/actor-bindings-aggregator-factory-average/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Comunica Bindings Aggregator Factory Average Actor

[![npm version](https://badge.fury.io/js/%40comunica%2Factor-bindings-aggregator-factory-average.svg)](https://www.npmjs.com/package/@comunica/actor-bindings-aggregator-factory-average)

A comunica bindings aggregator factory for the average aggregator.

This module is part of the [Comunica framework](https://github.com/comunica/comunica),
and should only be used by [developers that want to build their own query engine](https://comunica.dev/docs/modify/).

[Click here if you just want to query with Comunica](https://comunica.dev/docs/query/).

## Install

```bash
$ yarn add @comunica/actor-bindings-aggregator-factory-average
```

## Configure

After installing, this package can be added to your engine's configuration as follows:
```text
{
"@context": [
...
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-bindings-aggregator-factory-average/^1.0.0/components/context.jsonld"
],
"actors": [
...
{
"@id": "urn:comunica:default:bindings-aggregator-factory/actors#average",
"@type": "ActorBindingsAggregatorFactoryAverage"
}
]
}
```
Loading

0 comments on commit 64a487a

Please sign in to comment.