Skip to content

Convert SPARQL results to a pandas dataframe

License

Notifications You must be signed in to change notification settings

marijane/sparql-dataframe

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sparql-dataframe

Helper to convert SPARQLWrapper results to Pandas dataframes.

Build Status

See this blog post for examples. You might also be interested in these related examples from Su Labs tutorial.

Install

Directly from PyPi for Python 3.4+.

$ pip install sparql-dataframe

From Github. This should support Python 2.7 as well.

$ pip install git+https://github.com/lawlesst/sparql-dataframe.git

Usage

import sparql_dataframe

endpoint = "http://dbpedia.org/sparql"

q = """
    SELECT ?label ?wikiPageID
    WHERE {
    <http://dbpedia.org/resource/Baseball> rdfs:label ?label ;
         <http://dbpedia.org/ontology/wikiPageID> ?wikiPageID
    }
"""

df = sparql_dataframe.get(endpoint, q)
...

Tests

$ python -m unittest

About

Convert SPARQL results to a pandas dataframe

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%