Skip to content

Commit

Permalink
rename base EE factory to default
Browse files Browse the repository at this point in the history
  • Loading branch information
jitsedesmet committed Apr 28, 2024
1 parent 2a80a94 commit 150bc74
Show file tree
Hide file tree
Showing 31 changed files with 64 additions and 64 deletions.
2 changes: 1 addition & 1 deletion .github/typedoc-json.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

typedocjson='{
"extends": [
"../../typedoc.base.json"
"../../typedoc.default.json"
],
"entryPoints": [
"lib/index.ts"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
}
]
}
2 changes: 1 addition & 1 deletion engines/query-sparql-file/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion engines/query-sparql-rdfjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion engines/query-sparql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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/).
Expand All @@ -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
Expand All @@ -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"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './ActorExpressionEvaluatorFactoryDefault';
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -18,7 +18,7 @@
"comunica",
"actor",
"expression-evaluator-factory",
"base"
"default"
],
"license": "MIT",
"bugs": {
Expand Down
Original file line number Diff line number Diff line change
@@ -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();
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -15,17 +13,17 @@ import type { Algebra } from 'sparqlalgebrajs';
* See https://www.w3.org/TR/sparql11-query/#sparqlAlgebra;
*/
export class ActorQueryOperationExtend extends ActorQueryOperationTypedMediated<Algebra.Extend> {
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<IActorTest> {
// 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;
}
Expand All @@ -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<void> => {
Expand Down Expand Up @@ -80,5 +78,5 @@ export class ActorQueryOperationExtend extends ActorQueryOperationTypedMediated<
}

interface IActorQueryOperationExtendArgs extends IActorQueryOperationTypedMediatedArgs {
expressionEvaluatorFactory: ActorExpressionEvaluatorFactory;
mediatorExpressionEvaluatorFactory: MediatorExpressionEvaluatorFactory;
}
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -14,16 +16,16 @@ import type { Algebra } from 'sparqlalgebrajs';
* A comunica Filter Sparqlee Query Operation Actor.
*/
export class ActorQueryOperationFilterSparqlee extends ActorQueryOperationTypedMediated<Algebra.Filter> {
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<IActorTest> {
// 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;
}
Expand All @@ -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<void> => {
try {
Expand Down Expand Up @@ -70,5 +72,5 @@ export class ActorQueryOperationFilterSparqlee extends ActorQueryOperationTypedM
}

interface IActorQueryOperationFilterSparqleeArgs extends IActorQueryOperationTypedMediatedArgs {
expressionEvaluatorFactory: ActorExpressionEvaluatorFactory;
mediatorExpressionEvaluatorFactory: MediatorExpressionEvaluatorFactory;
}
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
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';

/**
* A comunica LeftJoin Query Operation Actor.
*/
export class ActorQueryOperationLeftJoin extends ActorQueryOperationTypedMediated<Algebra.LeftJoin> {
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<IActorTest> {
Expand All @@ -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,
Expand Down Expand Up @@ -86,5 +86,5 @@ export interface IActorQueryOperationLeftJoinArgs extends IActorQueryOperationTy
* A mediator for joining Bindings streams
*/
mediatorJoin: MediatorRdfJoin;
expressionEvaluatorFactory: ActorExpressionEvaluatorFactory;
mediatorExpressionEvaluatorFactory: MediatorExpressionEvaluatorFactory;
}
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/expression-evaluator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Loading

0 comments on commit 150bc74

Please sign in to comment.