Skip to content

Instantly share code, notes, and snippets.

@cgueret
Created February 25, 2011 16:18
Show Gist options
  • Save cgueret/844021 to your computer and use it in GitHub Desktop.
Save cgueret/844021 to your computer and use it in GitHub Desktop.
Redstore test put (Python2)
from rdflib import ConjunctiveGraph, RDF, URIRef
import httplib
if __name__ == '__main__':
graph = ConjunctiveGraph()
graph.add((URIRef("http://google.com"), RDF.type, URIRef("http://google.com")))
headers = { 'Accept' : '*/*', 'Content-Type': 'application/rdf+xml' }
conn = httplib.HTTPConnection("127.0.0.1:8080")
conn.request("PUT", "/data/http://google.com", body=graph.serialize(), headers=headers)
#response = conn.getresponse()
conn.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment