IPython extension for SPARQL integration.
Via pip:
pip install ipython-sparql
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
- %sparql_endpoint: set the sparql endpoint
- %%sparql: query
- %sparql_last_result: returns the last result