Experiment handler with custom SPARQL queries for JBR
npm install @jbr-experiment/sparql-custom


A jbr experiment type for a custom defined set of queries.
* Node.js _(1.12 or higher)_
* Docker _(required for invoking WatDiv Docker)_
* jbr _(required for initializing, preparing, and running experiments on the command line)_
jbr is a command line tool that enables experiments to be initialized, prepared, and started.
It can be installed from the npm registry:
``bash`
$ npm install -g jbr`
orbash`
$ yarn global add jbr
Using the jbr CLI tool, initialize a new experiment:
`bash`
$ jbr init sparql-custom my-experiment
$ cd my-experiment
This will create a new my-experiment directory with default configs for this experiment type.
This experiment type requires you to configure a certain SPARQL endpoint to send queries to for the hookSparqlEndpoint.sparql-endpoint-comunica
A value for this hook can be set as follows, such as :
`bash`
$ jbr set-hook hookSparqlEndpoint sparql-endpoint-comunica
In order to run all preprocessing steps, such as creating all required datasets, invoke the prepare step:
`bash`
$ jbr prepare
Once the experiment has been fully configured and prepared, you can run it:
`bash`
$ jbr run
Once the run step completes, results will be present in the output/ directory.
The following output is generated after an experiment has run.
output/query-times.csv:`csv`
name;id;results;time;timestamps
interactive-short-4;0;0;7;
interactive-short-4;1;0;5;
interactive-short-4;2;0;6;
interactive-short-4;3;0;3;
interactive-short-4;4;0;3;
interactive-short-5;0;0;0;
interactive-short-5;1;0;0;
interactive-short-5;2;0;0;
interactive-short-5;3;0;0;
interactive-short-5;4;0;0;
The default generated configuration file (jbr-experiment.json) for this experiment looks as follows:
`json`
{
"@context": [
"https://linkedsoftwaredependencies.org/bundles/npm/jbr/^2.0.0/components/context.jsonld",
"https://linkedsoftwaredependencies.org/bundles/npm/@jbr-experiment/sparql-custom/^1.0.0/components/context.jsonld"
],
"@id": "urn:jrb:test-sparql-custom2",
"@type": "ExperimentSparqlCustom",
"queriesPath": "input/queries/",
"endpointUrl": "http://localhost:3001/sparql",
"queryRunnerReplication": 3,
"queryRunnerWarmupRounds": 1,
"queryRunnerRecordTimestamps": true,
"queryRunnerUrlParamsInit": {},
"queryRunnerUrlParamsRun": {},
"hookSparqlEndpoint": {
"@id": "urn:jrb:test-watdiv2:hookSparqlEndpoint",
"@type": "HookNonConfigured"
}
}
Any config changes require re-running the prepare step.
* queriesPath: Path to a directory of SPARQL queries relative to the experiment root, which will be parsed using sparql-benchmark-runner.js.endpointUrl
* : URL through which the SPARQL endpoint of the hookSparqlEndpoint hook will be exposed.queryRunnerReplication
* : Number of replication runs for sparql-benchmark-runner.queryRunnerWarmupRounds
* : Number of warmup runs for sparql-benchmark-runner.queryRunnerRecordTimestamps
* : Flag to indicate if result arrival timestamps must be recorded by sparql-benchmark-runner.queryRunnerRecordHttpRequests
* : Flag to indicate if the number of http requests must be reported by sparql-benchmark-runner.queryRunnerUrlParamsInit
* : A JSON record of string mappings containing URL parameters that will be passed to the SPARQL endpoint during initialization to check if the endpoint is up.queryRunnerUrlParamsRun
* : A JSON record of string mappings containing URL parameters that will be passed to the SPARQL endpoint during query executions.queryTimeoutFallback`: An optional timeout value for a single query in milliseconds, to be used as fallback in case the SPARQL endpoint hook's timeout fails. This should always be higher than the timeout value configured in the SPARQL endpoint hook.
*
jbr.js is written by Ruben Taelman.
This code is copyrighted by Ghent University – imec
and released under the MIT license.