🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

sparql-dataframe

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sparql-dataframe

Convert SPARQL results to Pandas dataframes

0.4
PyPI
Maintainers
1

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)
...

By default, the query will be passed to the server as a GET request. To pass the query to the server as a POST request, use the post=True keyword.

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

Tests

$ python -m unittest

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts