SPARQL Interface for CKAN
by georgepm

CKAN Sparql Interface Extension

Note: The ckanext-sparql extension was tested using Virtuoso sparql instances such as

I will try to make it work for other type of sparql instances ;)

  • Version: 1.01
  • Status: Development
  • CKAN Version: >= 2.*


This is a simple extension, but may be useful for someone that wants to include a Sparql Interface Editor in their CKAN instances. The idea is based on the Sparql Editor of the LODUM project from the University of Munsters Open Data initiative (


The extension use:

May be extended to use SPARQLWrapper ( library - SPARQL Endpoint interface to Python


$ cd /usr/lib/ckan/default/src
$ git clone
$ cd ckanext-sparql/
$ sudo python develop

Add it in your configuration file: :

$ vim /etc/ckan/default/production.ini

Go the plugins line and add the sparql_interface plugin :: ckan.plugins = sparql_interface ….. (other plugins…)

Reload Apache: :

$ sudo service apache2 reload


Go to: :: [http://Custom URL]/sparql

Querys work in: :: [http://Custom URL]/query?query=

To send code through http to the sparql interface: :: [http://Custom URL]/sparql?view_code=


In your ckan.ini file set ` ckanext.sparql.endpoint_url = <your default endpoint url> (defaults to ckanext.sparql.hide_endpoint_url = (true | false) (defaults to false)`


To configure your own custom query ` Line 54, After <textarea id="sparql_code" name="sparql_code" resize="both"> Here replace the query ... </textarea>`


  • Version: 1.01: Fix Bugs



  • internationalize
  • externalize configuration of default query

Recent Activity