I want use the /sparql endpoint for READ-ONLY and the /sparql-auth endpoint for
writing UPDATEs (DROP, INSERT, etc.). I am using NAMED GRAPHs. I am using
Python with rdflib, and rdflib_sparqlstore instead of iODBC (which has a bug on
OSX 10.8).
Part I:
I can login to the /sparql-auth endpoint with a new account that has
SPARQL_UPDATE, SPARQL_SELECT, SPARQL_SPONGE roles and all rw privileges.
I can successfully run this query:
PREFIX vtkb: <http://www.epa.gov/ncct/vtkb#>
INSERT INTO vtkb:CSAngioSprout
{ vtkb:gene vtkb:perturbing_agent "bt" . }
WHERE {}
But it fails over HTTP when I use exactly the same query in my Python/RDFLIB
program that does use correct URL authentication.
rq = vtupdategraph.query(
'''PREFIX vtkb: <http://www.epa.gov/ncct/vtkb#>
INSERT INTO vtkb:CSAngioSprout
{ vtkb:gene vtkb:perturbing_agent "bt" . }
WHERE {}''')
I can successfully run other queries from my Python/RDFLIB program.
In the Virtuoso HTTP log I have:
127.0.0.1 Basic XXXXXX [26/Sep/2013:10:24:05 -0600] "GET
/sparql-auth?update=PREFIX+xml%3A+%3Chttp%3A%2F%2Fwww.w3.org%2FXML%2F1998%2Fnamespace%3E%0APREFIX+rdfs%3A+%3Chttp%3A%2F%2Fwww.w3.org%2F2000%2F01%2Frdf-schema%23%3E%0APREFIX+rdf%3A+%3Chttp%3A%2F%2Fwww.w3.org%2F1999%2F02%2F22-rdf-syntax-ns%23%3E%0APREFIX+xsd%3A+%3Chttp%3A%2F%2Fwww.w3.org%2F2001%2FXMLSchema%23%3E%0APREFIX+vtkb%3A+%3Chttp%3A%2F%2Fwww.epa.gov%2Fncct%2Fvtkb%23%3E+++++++++++%0A+++++++++++INSERT+INTO+vtkb%3ACSAngioSprout%0A+++++++++++++%7B+vtkb%3Agene+vtkb%3Aperturbing_agent+%22bt%22+.+%7D%0A+++++++++++%0A+++++++++++WHERE+%7B%7D
HTTP/1.1" 400 70 "" "sparqlwrapper 1.5.2
(http://sparql-wrapper.sourceforge.net/)"
On my program HTTP log I have:
send: 'GET
/sparql-auth?update=PREFIX+xml%3A+%3Chttp%3A%2F%2Fwww.w3.org%2FXML%2F1998%2Fnamespace%3E%0APREFIX+rdfs%3A+%3Chttp%3A%2F%2Fwww.w3.org%2F2000%2F01%2Frdf-schema%23%3E%0APREFIX+rdf%3A+%3Chttp%3A%2F%2Fwww.w3.org%2F1999%2F02%2F22-rdf-syntax-ns%23%3E%0APREFIX+xsd%3A+%3Chttp%3A%2F%2Fwww.w3.org%2F2001%2FXMLSchema%23%3E%0APREFIX+vtkb%3A+%3Chttp%3A%2F%2Fwww.epa.gov%2Fncct%2Fvtkb%23%3E+++++++++++%0A+++++++++++INSERT+INTO+vtkb%3ACSAngioSprout%0A+++++++++++++%7B+vtkb%3Agene+vtkb%3Aperturbing_agent+%22bt%22+.+%7D%0A+++++++++++%0A+++++++++++WHERE+%7B%7D
HTTP/1.1\r\nAccept-Encoding: identity\r\nAuthorization: Basic
XXXXXXXXXXXXXXXXXXXXXXX\r\nHost: localhost:8890\r\nConnection: close\r\nAccept:
application/sparql-results+xml\r\nUser-Agent: sparqlwrapper 1.5.2
(http://sparql-wrapper.sourceforge.net/)\r\n\r\n'
reply: 'HTTP/1.1 400 Bad Request\r\n'
And the RDFLIB basic error is:
SPARQLWrapper.SPARQLExceptions.QueryBadFormed: QueryBadFormed: a bad request
has been sent to the endpoint, probably the sparql query is bad formed.
Why is the HTTP query format not being accepted?
Thanks
------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk
_______________________________________________
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users