Comunica SPARQL jQuery Widget
This jQuery widget is a browser-based user interface to the Comunica SPARQL client. It allows users to execute SPARQL queries over one or multiple heterogeneous interfaces, such as Triple Pattern Fragments interfaces.
Using the code
yarn installto fetch dependencies and build the browser version of the client code.
yarn run startto run a local Web server.
- Edit datasources in
settings.jsonand queries in the
queriesfolder, and run
queries-to-jsonto compile both of them in a single JSON file.
yarn run productionto generate a production version in the
How the browser client works
The original Comunica SPARQL engine is written for the Node.js environment. The Webpack library makes it compatible with browsers.
The query engine itself runs in a background thread
using Web Workers.
The user interface (
instructs the worker (
ldf-client-worker.js) to evaluate queries
by sending messages,
and the worker sends results back.
(Optional) Running in a Docker container
If you want to rapidly deploy this widget as a microservice, you can build a Docker container as follows:
$ docker build -t comunica-sparql-widget .
Next, configure your widget by creating a
settings.json file in your working directory based on the example.
Next, create a
queries directory in which you should insert the queries that will be present by default in the widget, as is done here.
After that, you can run your newly created container by mounting your current folder to the Docker container:
$ docker run -p 3000:3000 -it --rm -v $(pwd)/:/tmp/ comunica-sparql-widget