ipython_sparql

Jupyter/IPython Extension for Sparql queries


Keywords
sparql, jupyter, extension, magic, ipython
License
MIT
Install
pip install ipython_sparql==0.1

Documentation

IPython Sparql Extension

IPython extension for SPARQL integration.

IPython SPARQL Extension

Install

Via pip:

pip install ipython-sparql

Usage

Load the extension:

%load_ext ipython_sparql

Define the sparql endpoint:

%sparql_endpoint http://dbpedia.org/sparql/

Query ;)

%%sparql
PREFIX dct: <http://purl.org/dc/terms/>
PREFIX dcb: <http://dbpedia.org/resource/Category:>
PREFIX dbp: <http://dbpedia.org/property/>

SELECT ?capital ?populationTotal WHERE {
    ?capital dct:subject dcb:Capitals_in_Europe ;
             dbp:populationTotal ?populationTotal .
}
LIMIT 5

All magic commands

  • %sparql_endpoint: set the sparql endpoint
  • %%sparql: query
  • %sparql_last_result: returns the last result