Skip to content

Commit

Permalink
broken: almost all specs pass
Browse files Browse the repository at this point in the history
  • Loading branch information
jitsedesmet committed Mar 27, 2024
1 parent 7f4c323 commit 61a6e23
Show file tree
Hide file tree
Showing 28 changed files with 20,357 additions and 13,147 deletions.
Empty file.
18 changes: 9 additions & 9 deletions engines/query-sparql-file/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
],
"license": "MIT",
"bin": {
"comunica-dynamic-sparql-file": "./bin/query-dynamic.js",
"comunica-sparql-file": "./bin/query.js",
"comunica-sparql-file-http": "./bin/http.js",
"comunica-dynamic-sparql-file": "./bin/query-dynamic.js"
"comunica-sparql-file-http": "./bin/http.js"
},
"bugs": {
"url": "https://github.com/comunica/comunica/issues"
Expand All @@ -47,11 +47,6 @@
"engine-browser.js"
],
"dependencies": {
"@comunica/actor-context-preprocess-source-to-destination": "^2.8.2",
"@comunica/actor-dereference-fallback": "^2.8.2",
"@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",
Expand All @@ -60,6 +55,11 @@
"@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-context-preprocess-source-to-destination": "^2.8.2",
"@comunica/actor-dereference-fallback": "^2.8.2",
"@comunica/actor-dereference-file": "^2.8.2",
"@comunica/actor-dereference-http": "^2.8.2",
"@comunica/actor-dereference-rdf-parse": "^2.8.2",
"@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 @@ -198,7 +198,7 @@
"integration": "rdf-test-suite-ldf spec/sparql-engine.js https://comunica.github.io/manifest-ldf-tests/sparql-file/file-manifest.ttl -d 200000 -c ../../.rdf-test-suite-ldf-cache/"
},
"browser": {
"./lib/index.js": "./lib/index-browser.js",
"./engine-default.js": "./engine-browser.js"
"./engine-default.js": "./engine-browser.js",
"./lib/index.js": "./lib/index-browser.js"
}
}
2 changes: 1 addition & 1 deletion engines/query-sparql-rdfjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
"engine-default.js"
],
"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",
Expand All @@ -48,6 +47,7 @@
"@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-context-preprocess-source-to-destination": "^2.8.2",
"@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
12 changes: 6 additions & 6 deletions engines/query-sparql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
],
"license": "MIT",
"bin": {
"comunica-dynamic-sparql": "bin/query-dynamic.js",
"comunica-sparql": "bin/query.js",
"comunica-sparql-http": "bin/http.js",
"comunica-dynamic-sparql": "bin/query-dynamic.js"
"comunica-sparql-http": "bin/http.js"
},
"bugs": {
"url": "https://github.com/comunica/comunica/issues"
Expand All @@ -46,10 +46,6 @@
"engine-default.js"
],
"dependencies": {
"@comunica/actor-context-preprocess-source-to-destination": "^2.8.2",
"@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",
Expand All @@ -58,6 +54,10 @@
"@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-context-preprocess-source-to-destination": "^2.8.2",
"@comunica/actor-dereference-fallback": "^2.8.2",
"@comunica/actor-dereference-http": "^2.8.2",
"@comunica/actor-dereference-rdf-parse": "^2.8.2",
"@comunica/actor-hash-bindings-sha1": "^2.8.2",
"@comunica/actor-http-fetch": "^2.8.2",
"@comunica/actor-http-proxy": "^2.8.2",
Expand Down
23 changes: 19 additions & 4 deletions engines/query-sparql/test/QuerySparql-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,21 @@ describe('System test: QuerySparql', () => {
});

describe('query', () => {
it('playground', async() => {
// TODO: I do wonder how this ever passed... Should group concat know what to do with a language tag? Did it ever?
const res = await engine.queryBoolean(`
PREFIX : <http://www.example.org/>
ASK {
{SELECT (GROUP_CONCAT(?o) AS ?g) WHERE {
VALUES ?o { "1"@en "2"@en }
}
}
FILTER(?g = "1 2"@en || ?g = "2 1"@en)
}
`, { sources: [ 'https://www.rubensworks.net/' ]});
expect(res).toBe(true);
});

describe('simple SPO on a raw RDF document', () => {
it('with results', async() => {
const result = <QueryBindings> await engine.query(`SELECT * WHERE {
Expand Down Expand Up @@ -806,8 +821,8 @@ SELECT * WHERE {

// Execute query
const result = <RDF.QueryVoid> await engine.query(`INSERT DATA {
<ex:s> <ex:p> <ex:o>.
}`, {
<ex:s> <ex:p> <ex:o>.
}`, {
sources: [ 'dummy' ],
destination: store,
});
Expand All @@ -825,8 +840,8 @@ SELECT * WHERE {

// Execute query
const result = <RDF.QueryVoid> await engine.query(`INSERT DATA {
<ex:s> <ex:p> <ex:o>.
}`, {
<ex:s> <ex:p> <ex:o>.
}`, {
sources: [ store ],
});
await result.execute();
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@
"packages/*"
],
"devDependencies": {
"@types/benchmark": "^2.0.0",
"benchmark": "^2.1.4",
"@babel/core": "^7.20.2",
"@babel/preset-env": "^7.20.2",
"@pollyjs/adapter-node-http": "^6.0.5",
"@pollyjs/core": "^6.0.5",
"@pollyjs/persister-fs": "^6.0.5",
"@rubensworks/eslint-config": "^2.0.0",
"@types/benchmark": "^2.0.0",
"@types/jest": "^29.4.0",
"@types/node": "^18.14.6",
"@types/object-inspect": "^1.8.1",
Expand All @@ -23,6 +22,7 @@
"arrayify-stream": "^2.0.1",
"asynciterator": "^3.8.1",
"babel-loader": "^9.1.0",
"benchmark": "^2.1.4",
"componentsjs-generator": "^3.1.0",
"depcheck": "^1.4.3",
"eslint": "^8.48.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import type {
IActorBindingsAggregatorFactoryArgs, IActorBindingsAggregatorFactoryOutput,
} from '@comunica/bus-bindings-aggeregator-factory';
import { ActorBindingsAggregatorFactory } from '@comunica/bus-bindings-aggeregator-factory';

import type { ActorExpressionEvaluatorFactory } from '@comunica/bus-expression-evaluator-factory';
import type { IActorTest } from '@comunica/core';
import { RegularOperator } from '@comunica/expression-evaluator';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,12 @@
],
"dependencies": {
"@comunica/bus-bindings-aggeregator-factory": "^1.0.0",
"@comunica/bus-expression-evaluator-factory": "^1.0.0",
"@comunica/bus-functions": "^1.0.0",
"@comunica/core": "^2.8.2",
"@comunica/expression-evaluator": "^2.9.0",
"@rdfjs/types": "*",
"@comunica/bus-expression-evaluator-factory": "^1.0.0",
"@comunica/bus-functions": "^1.0.0"
"@rdfjs/types": "*"
},
"devDependencies": {},
"scripts": {
"build": "npm run build:ts && npm run build:components",
"build:ts": "node \"../../node_modules/typescript/bin/tsc\"",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
"@rdfjs/types": "*",
"sparqlalgebrajs": "^4.2.0"
},
"devDependencies": {},
"scripts": {
"build": "npm run build:ts && npm run build:components",
"build:ts": "node \"../../node_modules/typescript/bin/tsc\"",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
"@comunica/expression-evaluator": "^2.9.0",
"@rdfjs/types": "*"
},
"devDependencies": {},
"scripts": {
"build": "npm run build:ts && npm run build:components",
"build:ts": "node \"../../node_modules/typescript/bin/tsc\"",
Expand Down
7 changes: 3 additions & 4 deletions packages/actor-bindings-aggregator-factory-sum/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,12 @@
],
"dependencies": {
"@comunica/bus-bindings-aggeregator-factory": "^1.0.0",
"@comunica/bus-expression-evaluator-factory": "^1.0.0",
"@comunica/bus-functions": "^1.0.0",
"@comunica/core": "^2.8.2",
"@comunica/expression-evaluator": "^2.9.0",
"@rdfjs/types": "*",
"@comunica/bus-expression-evaluator-factory": "^1.0.0",
"@comunica/bus-functions": "^1.0.0"
"@rdfjs/types": "*"
},
"devDependencies": {},
"scripts": {
"build": "npm run build:ts && npm run build:components",
"build:ts": "node \"../../node_modules/typescript/bin/tsc\"",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,11 @@ export class AlgebraTransformer extends TermTransformer {
if (!C.Operators.has(operator)) {
throw new Err.UnknownOperator(expr.operator);
}
const mediator: MediatorFunctions = await this.context.getSafe(this.mediatorFunctions);
const operatorFunc =
await mediator.mediate({ functionName: operator, arguments: expr.args, context: this.context });
await this.mediatorFunctions.mediate({ functionName: operator, arguments: expr.args, context: this.context });
const operatorArgs = await Promise.all(expr.args.map(arg => this.transformAlgebra(arg)));
if (!operatorFunc.checkArity(operatorArgs)) {
throw new Err.InvalidArity(operatorArgs, <C.Operator> operator);
throw new Err.InvalidArity(operatorArgs, <C.Operator>operator);
}
if (C.SpecialOperators.has(operator)) {
return new E.SpecialOperator(operatorArgs, operatorFunc.apply);
Expand All @@ -62,8 +61,11 @@ export class AlgebraTransformer extends TermTransformer {
const namedArgs = await Promise.all(expr.args.map(arg => this.transformAlgebra(arg)));
// Return a basic named expression
const op = <C.NamedOperator>expr.name.value;
const mediator: MediatorFunctions = await this.context.getSafe(this.mediatorFunctions);
const namedFunc = await mediator.mediate({ functionName: op, arguments: expr.args, context: this.context });
const namedFunc = await this.mediatorFunctions.mediate({
functionName: op,
arguments: expr.args,
context: this.context,
});
if (!namedFunc) {
throw new Err.UnknownNamedOperator(expr.name.value);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/actor-functions-wrapper-all/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
"lib/**/*.js.map"
],
"dependencies": {
"@comunica/core": "^2.8.2",
"@comunica/bus-functions": "^1.0.0",
"@comunica/context-entries": "^2.8.2",
"@comunica/core": "^2.8.2",
"@comunica/data-factory": "^2.7.0",
"@comunica/expression-evaluator": "^2.9.0",
"@comunica/types": "^2.8.2",
Expand Down
1 change: 0 additions & 1 deletion packages/actor-init-query/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
"@types/yargs": "^17.0.24",
"asynciterator": "^3.8.1",
"negotiate": "^1.0.1",
"process": "^0.11.10",
"rdf-quad": "^1.5.0",
"rdf-string": "^1.6.1",
"sparqlalgebrajs": "^4.2.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/actor-query-operation-extend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@
],
"dependencies": {
"@comunica/bindings-factory": "^2.7.0",
"@comunica/bus-expression-evaluator-factory": "^1.0.0",
"@comunica/bus-query-operation": "^2.9.0",
"@comunica/core": "^2.8.2",
"@comunica/expression-evaluator": "^2.9.0",
"@comunica/types": "^2.8.2",
"sparqlalgebrajs": "^4.2.0",
"@comunica/bus-expression-evaluator-factory": "^1.0.0"
"sparqlalgebrajs": "^4.2.0"
},
"scripts": {
"build": "npm run build:ts && npm run build:components",
Expand Down
4 changes: 2 additions & 2 deletions packages/actor-query-operation-filter-sparqlee/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@
],
"dependencies": {
"@comunica/bindings-factory": "^2.7.0",
"@comunica/bus-expression-evaluator-factory": "^1.0.0",
"@comunica/bus-query-operation": "^2.9.0",
"@comunica/core": "^2.8.2",
"@comunica/expression-evaluator": "^2.9.0",
"@comunica/types": "^2.8.2",
"sparqlalgebrajs": "^4.2.0",
"@comunica/bus-expression-evaluator-factory": "^1.0.0"
"sparqlalgebrajs": "^4.2.0"
},
"scripts": {
"build": "npm run build:ts && npm run build:components",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export class ActorQueryOperationGroup extends ActorQueryOperationTypedMediated<A
for (const aggregate of operation.aggregates) {
// Will throw for unsupported expressions
const _ = (await this.expressionEvaluatorFactory
.run({ algExpr: operation.expression, context })).expressionEvaluator;
.run({ algExpr: aggregate.expression, context })).expressionEvaluator;
}
return true;
}
Expand Down
6 changes: 3 additions & 3 deletions packages/actor-query-operation-group/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@
],
"dependencies": {
"@comunica/bindings-factory": "^2.7.0",
"@comunica/bus-bindings-aggeregator-factory": "^1.0.0",
"@comunica/bus-expression-evaluator-factory": "^1.0.0",
"@comunica/bus-hash-bindings": "^2.8.2",
"@comunica/bus-query-operation": "^2.9.0",
"@comunica/core": "^2.8.2",
"@comunica/types": "^2.8.2",
"@rdfjs/types": "*",
"asynciterator": "^3.8.1",
"rdf-data-factory": "^1.1.1",
"sparqlalgebrajs": "^4.2.0",
"@comunica/bus-expression-evaluator-factory": "^1.0.0",
"@comunica/bus-bindings-aggeregator-factory": "^1.0.0"
"sparqlalgebrajs": "^4.2.0"
},
"scripts": {
"build": "npm run build:ts && npm run build:components",
Expand Down
4 changes: 2 additions & 2 deletions packages/actor-query-operation-leftjoin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@
"lib/**/*.js.map"
],
"dependencies": {
"@comunica/bus-expression-evaluator-factory": "^1.0.0",
"@comunica/bus-query-operation": "^2.9.0",
"@comunica/bus-rdf-join": "^2.9.0",
"@comunica/core": "^2.8.2",
"@comunica/expression-evaluator": "^2.9.0",
"@comunica/types": "^2.8.2",
"sparqlalgebrajs": "^4.2.0",
"@comunica/bus-expression-evaluator-factory": "^1.0.0x"
"sparqlalgebrajs": "^4.2.0"
},
"scripts": {
"build": "npm run build:ts && npm run build:components",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class ActorQueryOperationOrderBySparqlee extends ActorQueryOperationTyped
for (let expr of operation.expressions) {
expr = this.extractSortExpression(expr);
const _ = (await this.expressionEvaluatorFactory
.run({ algExpr: operation.expression, context })).expressionEvaluator;
.run({ algExpr: expr, context })).expressionEvaluator;
}
return true;
}
Expand All @@ -50,7 +50,7 @@ export class ActorQueryOperationOrderBySparqlee extends ActorQueryOperationTyped
expr = this.extractSortExpression(expr);
// Transform the stream by annotating it with the expr result
const evaluator = (await this.expressionEvaluatorFactory
.run({ algExpr: operation.expression, context })).expressionEvaluator;
.run({ algExpr: expr, context })).expressionEvaluator;
interface IAnnotatedBinding {
bindings: Bindings; result: Term | undefined;
}
Expand Down
4 changes: 2 additions & 2 deletions packages/actor-query-operation-orderby-sparqlee/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@
"lib/**/*.js.map"
],
"dependencies": {
"@comunica/bus-expression-evaluator-factory": "^1.0.0",
"@comunica/bus-query-operation": "^2.9.0",
"@comunica/core": "^2.8.2",
"@comunica/expression-evaluator": "^2.9.0",
"@comunica/types": "^2.8.2",
"asynciterator": "^3.8.1",
"sparqlalgebrajs": "^4.2.0",
"@comunica/bus-expression-evaluator-factory": "^1.0.0"
"sparqlalgebrajs": "^4.2.0"
},
"scripts": {
"build": "npm run build:ts && npm run build:components",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@
"lib/**/*.js.map"
],
"dependencies": {
"@comunica/actor-expression-evaluator-factory-base": "^1.0.0",
"@comunica/bus-functions": "^1.0.0",
"@comunica/bus-query-operation": "^2.9.0",
"@comunica/bus-term-comparator-factory": "^1.0.0",
"@comunica/core": "^2.8.2",
"@comunica/expression-evaluator": "^2.9.0",
"@rdfjs/types": "*",
"@comunica/actor-expression-evaluator-factory-base": "^1.0.0",
"@comunica/bus-functions": "^1.0.0"
"@rdfjs/types": "*"
},
"scripts": {
"build": "npm run build:ts && npm run build:components",
Expand Down
Loading

0 comments on commit 61a6e23

Please sign in to comment.