From 150bc74c3320b23ffad8a58ab890d8e052942d94 Mon Sep 17 00:00:00 2001 From: Jitse De Smet Date: Sun, 28 Apr 2024 15:12:00 +0200 Subject: [PATCH] rename base EE factory to default --- .github/typedoc-json.sh | 2 +- .../expression-evaluator-factory/actors.json | 2 +- .../actors/{base.json => default.json} | 6 +++--- .../query-operation/actors/query/extend.json | 2 +- .../query-operation/actors/query/filter.json | 2 +- .../query-operation/actors/query/leftjoin.json | 2 +- engines/query-sparql-file/package.json | 2 +- engines/query-sparql-rdfjs/package.json | 2 +- engines/query-sparql/package.json | 2 +- .../lib/index.ts | 1 - .../.npmignore | 0 .../README.md | 14 +++++++------- .../ActorExpressionEvaluatorFactoryDefault.ts} | 4 ++-- .../lib/AlgebraTransformer.ts | 0 .../lib/ExpressionEvaluator.ts | 0 .../lib/InternalEvaluator.ts | 0 .../lib/index.ts | 1 + .../package.json | 8 ++++---- ...ActorExpressionEvaluatorFactoryBase-test.ts | 8 ++++---- .../test/Algebra-EBVCoercion-test.ts | 0 .../test/AlgebraTransformer-test.ts | 2 +- .../lib/implementation/RegularFunctions.ts | 2 +- .../lib/ActorQueryOperationExtend.ts | 18 ++++++++---------- .../lib/ActorQueryOperationFilterSparqlee.ts | 16 +++++++++------- .../lib/ActorQueryOperationLeftJoin.ts | 14 +++++++------- ...omparatorFactoryInequalityFunctionsBased.ts | 2 +- .../lib/InequalityFunctionBasedComparator.ts | 2 +- .../package.json | 2 +- packages/expression-evaluator/README.md | 2 +- packages/jest/lib/expressions.ts | 8 ++++---- packages/jest/package.json | 2 +- 31 files changed, 64 insertions(+), 64 deletions(-) rename engines/config-query-sparql/config/expression-evaluator-factory/actors/{base.json => default.json} (77%) delete mode 100644 packages/actor-expression-evaluator-factory-base/lib/index.ts rename packages/{actor-expression-evaluator-factory-base => actor-expression-evaluator-factory-default}/.npmignore (100%) rename packages/{actor-expression-evaluator-factory-base => actor-expression-evaluator-factory-default}/README.md (68%) rename packages/{actor-expression-evaluator-factory-base/lib/ActorExpressionEvaluatorFactoryBase.ts => actor-expression-evaluator-factory-default/lib/ActorExpressionEvaluatorFactoryDefault.ts} (88%) rename packages/{actor-expression-evaluator-factory-base => actor-expression-evaluator-factory-default}/lib/AlgebraTransformer.ts (100%) rename packages/{actor-expression-evaluator-factory-base => actor-expression-evaluator-factory-default}/lib/ExpressionEvaluator.ts (100%) rename packages/{actor-expression-evaluator-factory-base => actor-expression-evaluator-factory-default}/lib/InternalEvaluator.ts (100%) create mode 100644 packages/actor-expression-evaluator-factory-default/lib/index.ts rename packages/{actor-expression-evaluator-factory-base => actor-expression-evaluator-factory-default}/package.json (85%) rename packages/{actor-expression-evaluator-factory-base => actor-expression-evaluator-factory-default}/test/ActorExpressionEvaluatorFactoryBase-test.ts (74%) rename packages/{actor-expression-evaluator-factory-base => actor-expression-evaluator-factory-default}/test/Algebra-EBVCoercion-test.ts (100%) rename packages/{actor-expression-evaluator-factory-base => actor-expression-evaluator-factory-default}/test/AlgebraTransformer-test.ts (99%) diff --git a/.github/typedoc-json.sh b/.github/typedoc-json.sh index fafd92f332..f1b29681ac 100755 --- a/.github/typedoc-json.sh +++ b/.github/typedoc-json.sh @@ -2,7 +2,7 @@ typedocjson='{ "extends": [ - "../../typedoc.base.json" + "../../typedoc.default.json" ], "entryPoints": [ "lib/index.ts" diff --git a/engines/config-query-sparql/config/expression-evaluator-factory/actors.json b/engines/config-query-sparql/config/expression-evaluator-factory/actors.json index 536ce727b0..e6a6f1dff5 100644 --- a/engines/config-query-sparql/config/expression-evaluator-factory/actors.json +++ b/engines/config-query-sparql/config/expression-evaluator-factory/actors.json @@ -3,6 +3,6 @@ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/config-query-sparql/^2.0.0/components/context.jsonld" ], "import": [ - "ccqs:config/expression-evaluator-factory/actors/base.json" + "ccqs:config/expression-evaluator-factory/actors/default.json" ] } diff --git a/engines/config-query-sparql/config/expression-evaluator-factory/actors/base.json b/engines/config-query-sparql/config/expression-evaluator-factory/actors/default.json similarity index 77% rename from engines/config-query-sparql/config/expression-evaluator-factory/actors/base.json rename to engines/config-query-sparql/config/expression-evaluator-factory/actors/default.json index 664e4a52cc..2ec0258a35 100644 --- a/engines/config-query-sparql/config/expression-evaluator-factory/actors/base.json +++ b/engines/config-query-sparql/config/expression-evaluator-factory/actors/default.json @@ -2,14 +2,14 @@ "@context": [ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/runner/^2.0.0/components/context.jsonld", - "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-expression-evaluator-factory-base/^1.0.0/components/context.jsonld" + "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-expression-evaluator-factory-default/^1.0.0/components/context.jsonld" ], "@id": "urn:comunica:default:Runner", "@type": "Runner", "actors": [ { - "@id": "urn:comunica:default:expression-evaluator-factory/actors#base", - "@type": "ActorExpressionEvaluatorFactoryBase", + "@id": "urn:comunica:default:expression-evaluator-factory/actors#default", + "@type": "ActorExpressionEvaluatorFactoryDefault", "mediatorQueryOperation": { "@id": "urn:comunica:default:query-operation/mediators#main" }, "mediatorFunctions": { "@id": "urn:comunica:default:functions/mediators#main" } } diff --git a/engines/config-query-sparql/config/query-operation/actors/query/extend.json b/engines/config-query-sparql/config/query-operation/actors/query/extend.json index a58802818c..f9330f5965 100644 --- a/engines/config-query-sparql/config/query-operation/actors/query/extend.json +++ b/engines/config-query-sparql/config/query-operation/actors/query/extend.json @@ -11,7 +11,7 @@ "@id": "urn:comunica:default:query-operation/actors#extend", "@type": "ActorQueryOperationExtend", "mediatorQueryOperation": { "@id": "urn:comunica:default:query-operation/mediators#main" }, - "expressionEvaluatorFactory": { "@id": "urn:comunica:default:expression-evaluator-factory/actors#base" } + "mediatorExpressionEvaluatorFactory": { "@id": "urn:comunica:default:expression-evaluator-factory/mediators#main" } } ] } diff --git a/engines/config-query-sparql/config/query-operation/actors/query/filter.json b/engines/config-query-sparql/config/query-operation/actors/query/filter.json index b7ee78a4b9..af70feb1f7 100644 --- a/engines/config-query-sparql/config/query-operation/actors/query/filter.json +++ b/engines/config-query-sparql/config/query-operation/actors/query/filter.json @@ -11,7 +11,7 @@ "@id": "urn:comunica:default:query-operation/actors#filter", "@type": "ActorQueryOperationFilterSparqlee", "mediatorQueryOperation": { "@id": "urn:comunica:default:query-operation/mediators#main" }, - "expressionEvaluatorFactory": { "@id": "urn:comunica:default:expression-evaluator-factory/actors#base" } + "mediatorExpressionEvaluatorFactory": { "@id": "urn:comunica:default:expression-evaluator-factory/mediators#main" } } ] } diff --git a/engines/config-query-sparql/config/query-operation/actors/query/leftjoin.json b/engines/config-query-sparql/config/query-operation/actors/query/leftjoin.json index 63f199a8aa..f725a209f4 100644 --- a/engines/config-query-sparql/config/query-operation/actors/query/leftjoin.json +++ b/engines/config-query-sparql/config/query-operation/actors/query/leftjoin.json @@ -12,7 +12,7 @@ "@type": "ActorQueryOperationLeftJoin", "mediatorQueryOperation": { "@id": "urn:comunica:default:query-operation/mediators#main" }, "mediatorJoin": { "@id": "urn:comunica:default:rdf-join/mediators#main" }, - "expressionEvaluatorFactory": { "@id": "urn:comunica:default:expression-evaluator-factory/actors#base" } + "mediatorExpressionEvaluatorFactory": { "@id": "urn:comunica:default:expression-evaluator-factory/mediators#main" } } ] } diff --git a/engines/query-sparql-file/package.json b/engines/query-sparql-file/package.json index 998c39e8c0..c7eb92cfbc 100644 --- a/engines/query-sparql-file/package.json +++ b/engines/query-sparql-file/package.json @@ -57,7 +57,7 @@ "@comunica/actor-bindings-aggregator-factory-wildcard-count": "^1.0.0", "@comunica/actor-functions-wrapper-all": "^1.0.0", "@comunica/actor-term-comparator-factory-inequality-functions-based": "^1.0.0", - "@comunica/actor-expression-evaluator-factory-base": "^1.0.0", + "@comunica/actor-expression-evaluator-factory-default": "^1.0.0", "@comunica/actor-context-preprocess-source-to-destination": "^2.8.2", "@comunica/actor-dereference-fallback": "^2.8.2", "@comunica/actor-dereference-file": "^2.8.2", diff --git a/engines/query-sparql-rdfjs/package.json b/engines/query-sparql-rdfjs/package.json index 43f98c2490..486264b248 100644 --- a/engines/query-sparql-rdfjs/package.json +++ b/engines/query-sparql-rdfjs/package.json @@ -49,7 +49,7 @@ "@comunica/actor-bindings-aggregator-factory-wildcard-count": "^1.0.0", "@comunica/actor-functions-wrapper-all": "^1.0.0", "@comunica/actor-term-comparator-factory-inequality-functions-based": "^1.0.0", - "@comunica/actor-expression-evaluator-factory-base": "^1.0.0", + "@comunica/actor-expression-evaluator-factory-default": "^1.0.0", "@comunica/actor-context-preprocess-source-to-destination": "^2.8.2", "@comunica/actor-hash-bindings-sha1": "^2.8.2", "@comunica/actor-init-query": "^2.9.0", diff --git a/engines/query-sparql/package.json b/engines/query-sparql/package.json index 6995999377..651b706ac4 100644 --- a/engines/query-sparql/package.json +++ b/engines/query-sparql/package.json @@ -55,7 +55,7 @@ "@comunica/actor-bindings-aggregator-factory-sum": "^1.0.0", "@comunica/actor-functions-wrapper-all": "^1.0.0", "@comunica/actor-term-comparator-factory-inequality-functions-based": "^1.0.0", - "@comunica/actor-expression-evaluator-factory-base": "^1.0.0", + "@comunica/actor-expression-evaluator-factory-default": "^1.0.0", "@comunica/actor-bindings-aggregator-factory-wildcard-count": "^1.0.0", "@comunica/actor-context-preprocess-source-to-destination": "^2.8.2", "@comunica/actor-dereference-fallback": "^2.8.2", diff --git a/packages/actor-expression-evaluator-factory-base/lib/index.ts b/packages/actor-expression-evaluator-factory-base/lib/index.ts deleted file mode 100644 index 86931d0c9e..0000000000 --- a/packages/actor-expression-evaluator-factory-base/lib/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './ActorExpressionEvaluatorFactoryBase'; diff --git a/packages/actor-expression-evaluator-factory-base/.npmignore b/packages/actor-expression-evaluator-factory-default/.npmignore similarity index 100% rename from packages/actor-expression-evaluator-factory-base/.npmignore rename to packages/actor-expression-evaluator-factory-default/.npmignore diff --git a/packages/actor-expression-evaluator-factory-base/README.md b/packages/actor-expression-evaluator-factory-default/README.md similarity index 68% rename from packages/actor-expression-evaluator-factory-base/README.md rename to packages/actor-expression-evaluator-factory-default/README.md index 230bfa2ecf..bec638b8a7 100644 --- a/packages/actor-expression-evaluator-factory-base/README.md +++ b/packages/actor-expression-evaluator-factory-default/README.md @@ -1,8 +1,8 @@ -# Comunica Base Expression Evaluator Factory Actor +# Comunica Default Expression Evaluator Factory Actor -[![npm version](https://badge.fury.io/js/%40comunica%2Factor-expression-evaluator-factory-base.svg)](https://www.npmjs.com/package/@comunica/actor-expression-evaluator-factory-base) +[![npm version](https://badge.fury.io/js/%40comunica%2Factor-expression-evaluator-factory-default.svg)](https://www.npmjs.com/package/@comunica/actor-expression-evaluator-factory-default) -A comunica Base Expression Evaluator Factory Actor. +A comunica Default Expression Evaluator Factory Actor. 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/). @@ -12,7 +12,7 @@ and should only be used by [developers that want to build their own query engine ## Install ```bash -$ yarn add @comunica/actor-expression-evaluator-factory-base +$ yarn add @comunica/actor-expression-evaluator-factory-default ``` ## Configure @@ -22,13 +22,13 @@ After installing, this package can be added to your engine's configuration as fo { "@context": [ ... - "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-expression-evaluator-factory-base/^1.0.0/components/context.jsonld" + "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-expression-evaluator-factory-default/^1.0.0/components/context.jsonld" ], "actors": [ ... { - "@id": "urn:comunica:default:expression-evaluator-factory/actors#base", - "@type": "ActorExpressionEvaluatorFactoryBase" + "@id": "urn:comunica:default:expression-evaluator-factory/actors#default", + "@type": "ActorExpressionEvaluatorFactoryDefault" } ] } diff --git a/packages/actor-expression-evaluator-factory-base/lib/ActorExpressionEvaluatorFactoryBase.ts b/packages/actor-expression-evaluator-factory-default/lib/ActorExpressionEvaluatorFactoryDefault.ts similarity index 88% rename from packages/actor-expression-evaluator-factory-base/lib/ActorExpressionEvaluatorFactoryBase.ts rename to packages/actor-expression-evaluator-factory-default/lib/ActorExpressionEvaluatorFactoryDefault.ts index bc058ba488..38080ad0f0 100644 --- a/packages/actor-expression-evaluator-factory-base/lib/ActorExpressionEvaluatorFactoryBase.ts +++ b/packages/actor-expression-evaluator-factory-default/lib/ActorExpressionEvaluatorFactoryDefault.ts @@ -12,9 +12,9 @@ import { AlgebraTransformer } from './AlgebraTransformer'; import { ExpressionEvaluator } from './ExpressionEvaluator'; /** - * A comunica Base Expression Evaluator Factory Actor. + * A comunica Default Expression Evaluator Factory Actor. */ -export class ActorExpressionEvaluatorFactoryBase extends ActorExpressionEvaluatorFactory { +export class ActorExpressionEvaluatorFactoryDefault extends ActorExpressionEvaluatorFactory { public constructor(args: IActorExpressionEvaluatorFactoryArgs) { super(args); } diff --git a/packages/actor-expression-evaluator-factory-base/lib/AlgebraTransformer.ts b/packages/actor-expression-evaluator-factory-default/lib/AlgebraTransformer.ts similarity index 100% rename from packages/actor-expression-evaluator-factory-base/lib/AlgebraTransformer.ts rename to packages/actor-expression-evaluator-factory-default/lib/AlgebraTransformer.ts diff --git a/packages/actor-expression-evaluator-factory-base/lib/ExpressionEvaluator.ts b/packages/actor-expression-evaluator-factory-default/lib/ExpressionEvaluator.ts similarity index 100% rename from packages/actor-expression-evaluator-factory-base/lib/ExpressionEvaluator.ts rename to packages/actor-expression-evaluator-factory-default/lib/ExpressionEvaluator.ts diff --git a/packages/actor-expression-evaluator-factory-base/lib/InternalEvaluator.ts b/packages/actor-expression-evaluator-factory-default/lib/InternalEvaluator.ts similarity index 100% rename from packages/actor-expression-evaluator-factory-base/lib/InternalEvaluator.ts rename to packages/actor-expression-evaluator-factory-default/lib/InternalEvaluator.ts diff --git a/packages/actor-expression-evaluator-factory-default/lib/index.ts b/packages/actor-expression-evaluator-factory-default/lib/index.ts new file mode 100644 index 0000000000..8689bb0470 --- /dev/null +++ b/packages/actor-expression-evaluator-factory-default/lib/index.ts @@ -0,0 +1 @@ +export * from './ActorExpressionEvaluatorFactoryDefault'; diff --git a/packages/actor-expression-evaluator-factory-base/package.json b/packages/actor-expression-evaluator-factory-default/package.json similarity index 85% rename from packages/actor-expression-evaluator-factory-base/package.json rename to packages/actor-expression-evaluator-factory-default/package.json index 599fee5678..6b5d5558de 100644 --- a/packages/actor-expression-evaluator-factory-base/package.json +++ b/packages/actor-expression-evaluator-factory-default/package.json @@ -1,14 +1,14 @@ { - "name": "@comunica/actor-expression-evaluator-factory-base", + "name": "@comunica/actor-expression-evaluator-factory-default", "version": "1.0.0", - "description": "A base expression-evaluator-factory actor", + "description": "A default expression-evaluator-factory actor", "lsd:module": true, "main": "lib/index.js", "typings": "lib/index", "repository": { "type": "git", "url": "https://github.com/comunica/comunica.git", - "directory": "packages/actor-expression-evaluator-factory-base" + "directory": "packages/actor-expression-evaluator-factory-default" }, "publishConfig": { "access": "public" @@ -18,7 +18,7 @@ "comunica", "actor", "expression-evaluator-factory", - "base" + "default" ], "license": "MIT", "bugs": { diff --git a/packages/actor-expression-evaluator-factory-base/test/ActorExpressionEvaluatorFactoryBase-test.ts b/packages/actor-expression-evaluator-factory-default/test/ActorExpressionEvaluatorFactoryBase-test.ts similarity index 74% rename from packages/actor-expression-evaluator-factory-base/test/ActorExpressionEvaluatorFactoryBase-test.ts rename to packages/actor-expression-evaluator-factory-default/test/ActorExpressionEvaluatorFactoryBase-test.ts index 53f7340607..badfd0e309 100644 --- a/packages/actor-expression-evaluator-factory-base/test/ActorExpressionEvaluatorFactoryBase-test.ts +++ b/packages/actor-expression-evaluator-factory-default/test/ActorExpressionEvaluatorFactoryBase-test.ts @@ -1,17 +1,17 @@ import { Bus } from '@comunica/core'; import { getMockExpression } from '@comunica/expression-evaluator/test/util/utils'; import { getMockEEActionContext, getMockEEFactory } from '@comunica/jest'; -import type { ActorExpressionEvaluatorFactoryBase } from '../lib'; +import type { ActorExpressionEvaluatorFactoryDefault } from '../lib'; -describe('ActorExpressionEvaluatorFactoryBase', () => { +describe('ActorExpressionEvaluatorFactoryDefault', () => { let bus: any; beforeEach(() => { bus = new Bus({ name: 'bus' }); }); - describe('An ActorExpressionEvaluatorFactoryBase instance', () => { - let actor: ActorExpressionEvaluatorFactoryBase; + describe('An ActorExpressionEvaluatorFactoryDefault instance', () => { + let actor: ActorExpressionEvaluatorFactoryDefault; beforeEach(() => { actor = getMockEEFactory(); diff --git a/packages/actor-expression-evaluator-factory-base/test/Algebra-EBVCoercion-test.ts b/packages/actor-expression-evaluator-factory-default/test/Algebra-EBVCoercion-test.ts similarity index 100% rename from packages/actor-expression-evaluator-factory-base/test/Algebra-EBVCoercion-test.ts rename to packages/actor-expression-evaluator-factory-default/test/Algebra-EBVCoercion-test.ts diff --git a/packages/actor-expression-evaluator-factory-base/test/AlgebraTransformer-test.ts b/packages/actor-expression-evaluator-factory-default/test/AlgebraTransformer-test.ts similarity index 99% rename from packages/actor-expression-evaluator-factory-base/test/AlgebraTransformer-test.ts rename to packages/actor-expression-evaluator-factory-default/test/AlgebraTransformer-test.ts index 590d55f590..61968c3cbe 100644 --- a/packages/actor-expression-evaluator-factory-base/test/AlgebraTransformer-test.ts +++ b/packages/actor-expression-evaluator-factory-default/test/AlgebraTransformer-test.ts @@ -1,4 +1,4 @@ -import { AlgebraTransformer } from '@comunica/actor-expression-evaluator-factory-base/lib/AlgebraTransformer'; +import { AlgebraTransformer } from '@comunica/actor-expression-evaluator-factory-default/lib/AlgebraTransformer'; import { NamedExtension } from '@comunica/actor-functions-wrapper-all/lib/implementation/NamedExtension'; import { namedFunctions } from '@comunica/actor-functions-wrapper-all/lib/implementation/NamedFunctions'; import { regularFunctions } from '@comunica/actor-functions-wrapper-all/lib/implementation/RegularFunctions'; diff --git a/packages/actor-functions-wrapper-all/lib/implementation/RegularFunctions.ts b/packages/actor-functions-wrapper-all/lib/implementation/RegularFunctions.ts index d525b71448..66a5acc1c4 100644 --- a/packages/actor-functions-wrapper-all/lib/implementation/RegularFunctions.ts +++ b/packages/actor-functions-wrapper-all/lib/implementation/RegularFunctions.ts @@ -1,4 +1,4 @@ -import type { InternalEvaluator } from '@comunica/actor-expression-evaluator-factory-base/lib/InternalEvaluator'; +import type { InternalEvaluator } from '@comunica/actor-expression-evaluator-factory-default/lib/InternalEvaluator'; import { RegularFunction } from '@comunica/bus-functions/lib/implementation/Core'; import { KeysExpressionEvaluator } from '@comunica/context-entries'; diff --git a/packages/actor-query-operation-extend/lib/ActorQueryOperationExtend.ts b/packages/actor-query-operation-extend/lib/ActorQueryOperationExtend.ts index 6bc09d8f72..1c4741924d 100644 --- a/packages/actor-query-operation-extend/lib/ActorQueryOperationExtend.ts +++ b/packages/actor-query-operation-extend/lib/ActorQueryOperationExtend.ts @@ -1,9 +1,7 @@ import { bindingsToString } from '@comunica/bindings-factory'; -import type { ActorExpressionEvaluatorFactory } from '@comunica/bus-expression-evaluator-factory'; +import type { MediatorExpressionEvaluatorFactory } from '@comunica/bus-expression-evaluator-factory'; import type { IActorQueryOperationTypedMediatedArgs } from '@comunica/bus-query-operation'; -import { - ActorQueryOperation, ActorQueryOperationTypedMediated, -} from '@comunica/bus-query-operation'; +import { ActorQueryOperation, ActorQueryOperationTypedMediated } from '@comunica/bus-query-operation'; import type { IActorTest } from '@comunica/core'; import { isExpressionError } from '@comunica/expression-evaluator'; import type { Bindings, IActionContext, IQueryOperationResult, IQueryOperationResultBindings } from '@comunica/types'; @@ -15,17 +13,17 @@ import type { Algebra } from 'sparqlalgebrajs'; * See https://www.w3.org/TR/sparql11-query/#sparqlAlgebra; */ export class ActorQueryOperationExtend extends ActorQueryOperationTypedMediated { - private readonly expressionEvaluatorFactory: ActorExpressionEvaluatorFactory; + private readonly mediatorExpressionEvaluatorFactory: MediatorExpressionEvaluatorFactory; public constructor(args: IActorQueryOperationExtendArgs) { super(args, 'extend'); - this.expressionEvaluatorFactory = args.expressionEvaluatorFactory; + this.mediatorExpressionEvaluatorFactory = args.mediatorExpressionEvaluatorFactory; } public async testOperation(operation: Algebra.Extend, context: IActionContext): Promise { // Will throw error for unsupported operations const _ = Boolean( - await this.expressionEvaluatorFactory.run({ algExpr: operation.expression, context }), + await this.mediatorExpressionEvaluatorFactory.mediate({ algExpr: operation.expression, context }), ); return true; } @@ -43,8 +41,8 @@ export class ActorQueryOperationExtend extends ActorQueryOperationTypedMediated< throw new Error(`Illegal binding to variable '${variable.value}' that has already been bound`); } - const evaluator = await this.expressionEvaluatorFactory - .run({ algExpr: operation.expression, context }); + const evaluator = await this.mediatorExpressionEvaluatorFactory + .mediate({ algExpr: operation.expression, context }); // Transform the stream by extending each Bindings with the expression result const transform = async(bindings: Bindings, next: any, push: (pusbBindings: Bindings) => void): Promise => { @@ -80,5 +78,5 @@ export class ActorQueryOperationExtend extends ActorQueryOperationTypedMediated< } interface IActorQueryOperationExtendArgs extends IActorQueryOperationTypedMediatedArgs { - expressionEvaluatorFactory: ActorExpressionEvaluatorFactory; + mediatorExpressionEvaluatorFactory: MediatorExpressionEvaluatorFactory; } diff --git a/packages/actor-query-operation-filter-sparqlee/lib/ActorQueryOperationFilterSparqlee.ts b/packages/actor-query-operation-filter-sparqlee/lib/ActorQueryOperationFilterSparqlee.ts index f09a6e0428..522c2875ed 100644 --- a/packages/actor-query-operation-filter-sparqlee/lib/ActorQueryOperationFilterSparqlee.ts +++ b/packages/actor-query-operation-filter-sparqlee/lib/ActorQueryOperationFilterSparqlee.ts @@ -1,5 +1,7 @@ import { bindingsToString } from '@comunica/bindings-factory'; -import type { ActorExpressionEvaluatorFactory } from '@comunica/bus-expression-evaluator-factory'; +import type { + MediatorExpressionEvaluatorFactory, +} from '@comunica/bus-expression-evaluator-factory'; import type { IActorQueryOperationTypedMediatedArgs } from '@comunica/bus-query-operation'; import { ActorQueryOperation, @@ -14,16 +16,16 @@ import type { Algebra } from 'sparqlalgebrajs'; * A comunica Filter Sparqlee Query Operation Actor. */ export class ActorQueryOperationFilterSparqlee extends ActorQueryOperationTypedMediated { - private readonly expressionEvaluatorFactory: ActorExpressionEvaluatorFactory; + private readonly mediatorExpressionEvaluatorFactory: MediatorExpressionEvaluatorFactory; public constructor(args: IActorQueryOperationFilterSparqleeArgs) { super(args, 'filter'); - this.expressionEvaluatorFactory = args.expressionEvaluatorFactory; + this.mediatorExpressionEvaluatorFactory = args.mediatorExpressionEvaluatorFactory; } public async testOperation(operation: Algebra.Filter, context: IActionContext): Promise { // Will throw error for unsupported operators - const _ = await this.expressionEvaluatorFactory.run({ algExpr: operation.expression, + const _ = await this.mediatorExpressionEvaluatorFactory.mediate({ algExpr: operation.expression, context }); return true; } @@ -34,8 +36,8 @@ export class ActorQueryOperationFilterSparqlee extends ActorQueryOperationTypedM const output = ActorQueryOperation.getSafeBindings(outputRaw); ActorQueryOperation.validateQueryOutput(output, 'bindings'); - const evaluator = await this.expressionEvaluatorFactory - .run({ algExpr: operation.expression, context }); + const evaluator = await this.mediatorExpressionEvaluatorFactory + .mediate({ algExpr: operation.expression, context }); const transform = async(item: Bindings, next: any, push: (bindings: Bindings) => void): Promise => { try { @@ -70,5 +72,5 @@ export class ActorQueryOperationFilterSparqlee extends ActorQueryOperationTypedM } interface IActorQueryOperationFilterSparqleeArgs extends IActorQueryOperationTypedMediatedArgs { - expressionEvaluatorFactory: ActorExpressionEvaluatorFactory; + mediatorExpressionEvaluatorFactory: MediatorExpressionEvaluatorFactory; } diff --git a/packages/actor-query-operation-leftjoin/lib/ActorQueryOperationLeftJoin.ts b/packages/actor-query-operation-leftjoin/lib/ActorQueryOperationLeftJoin.ts index 87220cdefe..49487e71d6 100644 --- a/packages/actor-query-operation-leftjoin/lib/ActorQueryOperationLeftJoin.ts +++ b/packages/actor-query-operation-leftjoin/lib/ActorQueryOperationLeftJoin.ts @@ -1,10 +1,10 @@ -import type { ActorExpressionEvaluatorFactory } from '@comunica/bus-expression-evaluator-factory'; +import type { MediatorExpressionEvaluatorFactory } from '@comunica/bus-expression-evaluator-factory'; import type { IActorQueryOperationTypedMediatedArgs } from '@comunica/bus-query-operation'; import { ActorQueryOperation, ActorQueryOperationTypedMediated } from '@comunica/bus-query-operation'; import type { MediatorRdfJoin } from '@comunica/bus-rdf-join'; import type { IActorTest } from '@comunica/core'; import { isExpressionError } from '@comunica/expression-evaluator'; -import type { IQueryOperationResult, Bindings, IActionContext, IJoinEntry } from '@comunica/types'; +import type { Bindings, IActionContext, IJoinEntry, IQueryOperationResult } from '@comunica/types'; import type { Algebra } from 'sparqlalgebrajs'; /** @@ -12,11 +12,11 @@ import type { Algebra } from 'sparqlalgebrajs'; */ export class ActorQueryOperationLeftJoin extends ActorQueryOperationTypedMediated { public readonly mediatorJoin: MediatorRdfJoin; - private readonly expressionEvaluatorFactory: ActorExpressionEvaluatorFactory; + private readonly mediatorExpressionEvaluatorFactory: MediatorExpressionEvaluatorFactory; public constructor(args: IActorQueryOperationLeftJoinArgs) { super(args, 'leftjoin'); - this.expressionEvaluatorFactory = args.expressionEvaluatorFactory; + this.mediatorExpressionEvaluatorFactory = args.mediatorExpressionEvaluatorFactory; } public async testOperation(operation: Algebra.LeftJoin, context: IActionContext): Promise { @@ -41,8 +41,8 @@ export class ActorQueryOperationLeftJoin extends ActorQueryOperationTypedMediate if (operationOriginal.expression) { const rightMetadata = await entries[1].output.metadata(); const expressionVariables = rightMetadata.variables; - const evaluator = await this.expressionEvaluatorFactory - .run({ algExpr: operationOriginal.expression, context }); + const evaluator = await this.mediatorExpressionEvaluatorFactory + .mediate({ algExpr: operationOriginal.expression, context }); const bindingsStream = joined.bindingsStream .transform({ autoStart: false, @@ -86,5 +86,5 @@ export interface IActorQueryOperationLeftJoinArgs extends IActorQueryOperationTy * A mediator for joining Bindings streams */ mediatorJoin: MediatorRdfJoin; - expressionEvaluatorFactory: ActorExpressionEvaluatorFactory; + mediatorExpressionEvaluatorFactory: MediatorExpressionEvaluatorFactory; } diff --git a/packages/actor-term-comparator-factory-inequality-functions-based/lib/ActorTermComparatorFactoryInequalityFunctionsBased.ts b/packages/actor-term-comparator-factory-inequality-functions-based/lib/ActorTermComparatorFactoryInequalityFunctionsBased.ts index 59378f896a..f32635657e 100644 --- a/packages/actor-term-comparator-factory-inequality-functions-based/lib/ActorTermComparatorFactoryInequalityFunctionsBased.ts +++ b/packages/actor-term-comparator-factory-inequality-functions-based/lib/ActorTermComparatorFactoryInequalityFunctionsBased.ts @@ -1,4 +1,4 @@ -import { InternalEvaluator } from '@comunica/actor-expression-evaluator-factory-base/lib/InternalEvaluator'; +import { InternalEvaluator } from '@comunica/actor-expression-evaluator-factory-default/lib/InternalEvaluator'; import type { MediatorFunctions } from '@comunica/bus-functions'; import type { MediatorQueryOperation } from '@comunica/bus-query-operation'; import type { diff --git a/packages/actor-term-comparator-factory-inequality-functions-based/lib/InequalityFunctionBasedComparator.ts b/packages/actor-term-comparator-factory-inequality-functions-based/lib/InequalityFunctionBasedComparator.ts index 535440ffd7..2e6a4d3fc0 100644 --- a/packages/actor-term-comparator-factory-inequality-functions-based/lib/InequalityFunctionBasedComparator.ts +++ b/packages/actor-term-comparator-factory-inequality-functions-based/lib/InequalityFunctionBasedComparator.ts @@ -1,4 +1,4 @@ -import type { InternalEvaluator } from '@comunica/actor-expression-evaluator-factory-base/lib/InternalEvaluator'; +import type { InternalEvaluator } from '@comunica/actor-expression-evaluator-factory-default/lib/InternalEvaluator'; import type { ITermFunction } from '@comunica/bus-functions'; import type { ITermComparator } from '@comunica/bus-term-comparator-factory'; import type * as E from '@comunica/expression-evaluator/lib/expressions'; diff --git a/packages/actor-term-comparator-factory-inequality-functions-based/package.json b/packages/actor-term-comparator-factory-inequality-functions-based/package.json index d1080a0202..7a42946a5f 100644 --- a/packages/actor-term-comparator-factory-inequality-functions-based/package.json +++ b/packages/actor-term-comparator-factory-inequality-functions-based/package.json @@ -32,7 +32,7 @@ "lib/**/*.js.map" ], "dependencies": { - "@comunica/actor-expression-evaluator-factory-base": "^1.0.0", + "@comunica/actor-expression-evaluator-factory-default": "^1.0.0", "@comunica/bus-functions": "^1.0.0", "@comunica/bus-term-comparator-factory": "^1.0.0", "@comunica/core": "^2.8.2", diff --git a/packages/expression-evaluator/README.md b/packages/expression-evaluator/README.md index fb125a3a2e..77470160fe 100644 --- a/packages/expression-evaluator/README.md +++ b/packages/expression-evaluator/README.md @@ -58,7 +58,7 @@ For regular functions, the sync and async evaluation is the same, to avoid overh ### Layout and control flow The only important external facing API is creating an Evaluator. -When you create one, the SPARQL Algebra expression that is passed will be transformed to an internal representation (see [AlgebraTransformer.ts](../actor-expression-evaluator-factory-base/lib/AlgebraTransformer.ts)). +When you create one, the SPARQL Algebra expression that is passed will be transformed to an internal representation (see [AlgebraTransformer.ts](../actor-expression-evaluator-factory-default/lib/AlgebraTransformer.ts)). This will build objects (see [expressions module](./lib/expressions)) that contain all the logic and data for evaluation, for example the implementations for SPARQL functions (see [functions module](./lib/functions)). After transformation, the evaluator will recursively evaluate all the expressions. diff --git a/packages/jest/lib/expressions.ts b/packages/jest/lib/expressions.ts index 35457e9c37..d059db3f5a 100644 --- a/packages/jest/lib/expressions.ts +++ b/packages/jest/lib/expressions.ts @@ -1,7 +1,7 @@ import { - ActorExpressionEvaluatorFactoryBase, -} from '@comunica/actor-expression-evaluator-factory-base'; -import { InternalEvaluator } from '@comunica/actor-expression-evaluator-factory-base/lib/InternalEvaluator'; + ActorExpressionEvaluatorFactoryDefault, +} from '@comunica/actor-expression-evaluator-factory-default/lib'; +import { InternalEvaluator } from '@comunica/actor-expression-evaluator-factory-default/lib/InternalEvaluator'; import { BindingsFactory } from '@comunica/bindings-factory'; import type { ActorExpressionEvaluatorFactory, IActorExpressionEvaluatorFactoryArgs, @@ -98,7 +98,7 @@ export function getMockEEFactory({ mediatorQueryOperation, mediatorFunctions, }: Partial = {}): ActorExpressionEvaluatorFactory { - return new ActorExpressionEvaluatorFactoryBase({ + return new ActorExpressionEvaluatorFactoryDefault({ bus: new Bus({ name: 'testBusMock' }), name: 'mockEEFactory', mediatorQueryOperation: mediatorQueryOperation || getMockMediatorQueryOperation(), diff --git a/packages/jest/package.json b/packages/jest/package.json index 7da724964c..1c10503ce8 100644 --- a/packages/jest/package.json +++ b/packages/jest/package.json @@ -34,7 +34,7 @@ "lib/**/*.js.map" ], "dependencies": { - "@comunica/actor-expression-evaluator-factory-base": "^1.0.0", + "@comunica/actor-expression-evaluator-factory-default": "^1.0.0", "@comunica/bindings-factory": "^2.7.0", "@comunica/bus-bindings-aggeregator-factory": "^1.0.0", "@comunica/bus-expression-evaluator-factory": "^1.0.0",