(discontinued) An RDFLib store around Ivan Herman et al.'s SPARQL service wrapper, with namespace bindings
Python Shell
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
documentation
examples
rdflib_sparqlstore
test
.gitignore
.travis.yml
CHANGELOG
MANIFEST.in
README.md
requirements.txt
setup.cfg
setup.py
tox.ini

README.md

#NOTE

rdflib-sparqlstore was merged into core rdflib on 2013-05-01 

Future development will happen in core rdflib. 

RDFLib SPARQLstore

This is an RDFLib extension that provides an RDFLib Store around Ivan Herman et al.'s SPARQL service wrapper.

In essence, it allows a SPARQL 1.0 endpoint to behave as if it were a read-only RDFLib Store.

The extension also provides a read/write SPARQLUpdateStore, for use when the SPARQL endpoint supports SPARQL 1.1 update operations.

This extension has revived support for namespace bindings.

Install with:

$ pip install rdflib_sparqlstore

Basic usage is

  1. instantiate an RDFLib ConjunctiveGraph with "SPARQLStore" as the first positional arg and then

  2. opening a known SPARQL endpoint

e.g.

import rdflib
g = rdflib.ConjunctiveGraph('SPARQLStore')
g.open("http://dbpedia.org/sparql")

A SPARQLUpdateStore is also available, the example below shows how a graph of updates can be applied to an existing endpoint / store:

import rdflib
g = rdflib.ConjunctiveGraph('SPARQLUpdateStore')
g.open("http://localhost:3030/dataset/sparql",
       "http://localhost:3030/dataset/update")

If the store object is explicitly created with the context_aware keyword param set to False, then rdflib.Graph can be used:

import rdflib
import rdflib_sparqlstore

store = rdflib_sparqlstore.SPARQLStore("http://dbpedia.org/sparql",
                                       context_aware=False)
g =  rdflib.Graph(store)

Build Status