Skip to content

Commit

Permalink
chore: add performance tests over timbl and foaf
Browse files Browse the repository at this point in the history
  • Loading branch information
jeswr committed Sep 16, 2022
1 parent 24876fb commit faefff3
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 5 deletions.
41 changes: 41 additions & 0 deletions engines/query-sparql-file-reasoning/perf/timbl-foaf.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { KeysRdfDereferenceConstantHylar } from '@comunica/reasoning-context-entries';
import { getTimblAndFoaf } from 'deep-taxonomy-benchmark';
import { promisifyEventEmitter } from 'event-emitter-promisify';
import { QueryEngine } from '../lib';

async function main() {
const engine = new QueryEngine();
const store = await getTimblAndFoaf();

// eslint-disable-next-line no-console
console.time('Reasoning over TIMBL and FOAF - RDFS');
const result = await engine.queryBindings(
'SELECT * WHERE { ?s ?p ?o }',
{
sources: [ store ],
rules: KeysRdfDereferenceConstantHylar.rdfs,
},
);
await promisifyEventEmitter(result.on('data', () => { /* Noop */ }));
// eslint-disable-next-line no-console
console.timeEnd('Reasoning over TIMBL and FOAF - RDFS');

// eslint-disable-next-line no-console
console.time('Reasoning over TIMBL and FOAF - OWL2RL');
const resultowl = await engine.queryBindings(
'SELECT * WHERE { ?s ?p ?o }',
{
sources: [ store ],
rules: KeysRdfDereferenceConstantHylar.owl2rl,
},
);
await promisifyEventEmitter(resultowl.on('data', () => { /* Noop */ }));
// eslint-disable-next-line no-console
console.timeEnd('Reasoning over TIMBL and FOAF - OWL2RL');
}

main()
.catch(error => {
// eslint-disable-next-line no-console
console.error(error);
});
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"colors": "^1.4.0",
"componentsjs-generator": "^3.1.0",
"cross-fetch": "^3.1.5",
"deep-taxonomy-benchmark": "^1.1.0",
"deep-taxonomy-benchmark": "^1.1.1",
"depcheck": "^1.4.3",
"eslint": "^8.23.1",
"eslint-config-es": "4.2.0",
Expand All @@ -50,6 +50,7 @@
"eslint-plugin-tsdoc": "^0.2.16",
"eslint-plugin-unicorn": "^37.0.1",
"eslint-plugin-unused-imports": "^2.0.0",
"event-emitter-promisify": "^1.1.0",
"follow-redirects": "^1.15.2",
"immutable": "^4.1.0",
"jest": "^28.1.3",
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6104,10 +6104,10 @@ deep-is@^0.1.3:
resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831"
integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==

deep-taxonomy-benchmark@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/deep-taxonomy-benchmark/-/deep-taxonomy-benchmark-1.1.0.tgz#8dff90ed662bfbe6f8a95501a59ac86f780f2fa9"
integrity sha512-c9dFilD32BfTtzC5RNxeWSYawV0yQsJrmaYsVqQkC3oMAmAt3tq5sO23CGRgV2JghQiyhABH0trh1Z4ytquF4A==
deep-taxonomy-benchmark@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/deep-taxonomy-benchmark/-/deep-taxonomy-benchmark-1.1.1.tgz#2dc504d4e6c094ce2527f60c293e7f86dfef7e5d"
integrity sha512-iNaV86/Ah7wyK5He326s0IFCiVf6NdYptN8XuKiIBLHHmAvB3x56Qrs0LuIXmDfipXxAwl07Hi3SeVAy+JD39w==
dependencies:
event-emitter-promisify "^1.1.0"
n3 "^1.16.2"
Expand Down

0 comments on commit faefff3

Please sign in to comment.