SPARQL Blockly

SPARQL Blockly is an app for visualising and constructing SPARQL queries.

It supports SPARQL 1.1 Query (try), Update (try) and SPARQL* (try).

See the Source code on Github.

Use the JavaScript library from npm.

Features

Parsing

Text written into the textarea at the top is parsed by SPARQL.js. Valid queries are visualised into blocks on the canvas below:

The textarea will turn green for a valid and red for an invalid query.

Parsing errors for invalid queries are displayed below the textarea.

Context menus

Query blocks can be constructed by right-clicking the canvas and the blocks to add appropriate clauses from the context menus:

Only appropriate blocks can be added, so the context menus enforce the SPARQL grammar.

Drag & drop

Queries can also be constructed by dragging blocks from the toolbox, dropping them unto the canvas and attaching them to existing blocks:

Only appropriate blocks can be attached.

Collapsing/expanding blocks

Blocks can be collapsed from the context menus:

Collapsed blocks show the SPARQL they represent.

Sharing

The app takes URL-encoded SPARQL queries from the URL fragment, so queries and their visual representations can be shared.