Skip to main content

Get a Pandas dataframe from SPARQL queries

Project description

A Python library that can send SPARQL queries to a SPARQL endpoint and retrieve a Pandas dataframe from the result.


pip install sparqldataframe


Here is an example how to run a SPARQL query on the Wikidata endpoint:

import sparqldataframe

sparql_query = """
SELECT ?item ?itemLabel
  ?item wdt:P31 wd:Q146.
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
df = sparqldataframe.query("", sparql_query)

Wikidata and DBPedia can be both used without adding the SPARQL endpoint url by using the wikidata_query() and dbpedia_query() functions respectively:

df = sparqldataframe.wikidata_query(sparql_query)
df = sparqldataframe.dbpedia_query(sparql_query)


This project is licensed under the MIT license. See the LICENSE for details.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for sparqldataframe, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size sparqldataframe-0.1.0-py3-none-any.whl (4.2 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size sparqldataframe-0.1.0.tar.gz (2.6 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page