SPARQL queries are sent as a GET request, but UPDATE (such as INSERT, DELETE, etc.) requires that the query be sent as a POST request. Just add the following line before sparql.query ()
sparql.method = 'POST'
In addition, the update URL is different from the request. The update is based on a workbench, not a sesame URL. For example, if the request URL is:
http://localhost:8080/openrdf-sesame/repositories/test/
or
http://localhost:8080/openrdf-workbench/repositories/test/query
then the update url will be:
http://localhost:8080/openrdf-workbench/repositories/test/update
Therefore, the UPDATE / INSERT query should look like this:
queryString = "INSERT DATA { GRAPH <http://example.com/> { "b" a "c". } }" sparql = SPARQLWrapper("http://localhost:8080/openrdf-workbench/repositories/test/update") sparql.setQuery(queryString) sparql.method = 'POST' sparql.query()
source share