Created
November 13, 2014 16:24
-
-
Save nicholsn/9ba3ff60970ef57cd035 to your computer and use it in GitHub Desktop.
Use rdflib to update a graph on virtuoso
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # connect to virtuoso | |
| g = rdflib.ConjunctiveGraph('SPARQLUpdateStore', identifier='http://graphtoupdate') | |
| g.open((sparql_uri, update_uri)) | |
| g.store.setCredentials(update_usr, update_pwd) | |
| g.store.setHTTPAuth(update_auth) | |
| # create a graph to parse update file | |
| update = rdflib.graph() | |
| update.parse('file.ttl', format='turtle') | |
| update.skolemize(new_graph=g.store) | |
| #Note the skolemize thing is to deal with bnodes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment