Skip to content

A jQuery widget to query heterogeneous interfaces using Comunica SPARQL. Part of the fast-and-slow project.

License

Notifications You must be signed in to change notification settings

oSoc20/fast-and-slow-query

 
 

Repository files navigation

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. The widget is used here in order to primarily work with the data from the Fast and Slow project.

Using the code

  • Run yarn install to fetch dependencies and build the browser version of the client code.
  • Run yarn run dev to run a local Web server (yarn run dev-prod for minified production output).
  • Edit datasources in settings.json and queries in the queries folder, and run queries-to-json to compile both of them in a single JSON file.
  • Run yarn run build to generate a production version in the build folder.

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 (ldf-client-ui.js) instructs the worker (ldf-client-worker.js) to evaluate queries by sending messages, and the worker sends results back.

Running in a Docker container

Configure your widget by editing the settings.json file.

Next, edit the queries directory in which you should insert the queries that will be present by default in the widget.

Build the Docker container as follows:

docker build -t comunica-sparql-widget .

After that, you can run your newly created container by mounting your current folder to the Docker container:

docker run -p 3000:80 -it --rm comunica-sparql-widget

Settings and queries can be passed at runtime by mounting your custom queries.json to the Docker container:

# Compile queries.json from settings.json and the files in the queries folder
./queries-to-json

# Provide the compiled queries.json at runtime
docker run -v $(pwd)/queries.json:/usr/share/nginx/html/queries.json -p 3000:80 -it --rm comunica-sparql-widget

Access on http://localhost:3000

License

The Linked Data Fragments jQuery Widget was originally written by Ruben Verborgh and ported for Comunica SPARQL by Ruben Taelman.

The adaptation for the Fast and Slow project was made by the Fast and Slow team.

This code is copyrighted by Ghent University – imec and released under the MIT license.

About

A jQuery widget to query heterogeneous interfaces using Comunica SPARQL. Part of the fast-and-slow project.

Resources

License

Stars

Watchers

Forks

Languages

  • JavaScript 73.3%
  • CSS 19.7%
  • HTML 6.3%
  • Dockerfile 0.7%