4Store sparql endpont settings

333 views
Skip to first unread message

Laurens

unread,
Aug 3, 2012, 4:24:52 AM8/3/12
to sur...@googlegroups.com
4store has 2 endpoint but I do not know which one to use with surf RDF the sparql/ or update/ endpoint.

Anyone experiences with using 4store and surfrdf?

If I use update/ I get this error:

Exception: EndPointInternalError: endpoint returned code 500 and response. 

Response:
500 SPARQL protocol error, update requests must use POST
This is a 4store SPARQL server v1.1.5-3-gc289dc2

If I use sparql/ I get this error:

Bad query: DELETE   {  ?s ?p ?o  } WHERE {  {  ?s ?p ?o .  FILTER (?s = <http://localhost/>)  }  }\

Laurens

unread,
Aug 3, 2012, 4:58:28 AM8/3/12
to sur...@googlegroups.com
Found this:  http://code.google.com/p/surfrdf/issues/detail?id=79 

but it does not resolve the issue.

Cosmin Basca

unread,
Aug 3, 2012, 5:02:56 AM8/3/12
to sur...@googlegroups.com
Hi Laurens, 

Which version of surf are you using? also what is the surf.sparql_protocol plugin version?. I did not use surf with 4store before, but it appears that the /sparql endpoint only accepts read queries (select / ask) (this is a guess just by looking at the error traces you posted). The problem with the /update endpoint is the http method used. 4store requires Post, I'm looking in the source code and I see that the writer plugin uses post. What was the query that caused the error? Turn on logging in surf to find out.

Cheers,
Cosmin

Cosmin Basca

unread,
Aug 3, 2012, 5:25:35 AM8/3/12
to sur...@googlegroups.com
Another alternative (similar to the solution in issue 79) is to use preconfigured reader and writer plugins for the store.
Check out revision r382, here you have access to the get_reader and get_writer methods. 

create a reader and assign it the /sparql endpoint,
while for the writer use the /update endpoint. 

Let me know if this works out

Cheers,
Cosmin 

On Friday, August 3, 2012 11:24:52 AM UTC+3, Laurens wrote:

Laurens

unread,
Aug 3, 2012, 5:59:56 AM8/3/12
to sur...@googlegroups.com
Currently it looks like this:

r = ReaderPlugin(endpoint="http://192.168.80.128:8000/sparql/")
rw = ReaderPlugin(endpoint="http://192.168.80.128:8000/update/")
w = WriterPlugin(RDFReader(), endpoint="http://192.168.80.128:8000/update/")
s_store = Store(reader = r, writer = w, default_graph   =   "http://example.com")

The error happens on a .save() operation which executes two SPARQL update queries.

A DELETE operation followed by an ADD obviously to update the data.

Exception: EndPointInternalError: endpoint returned code 500 and response. 

Response:
500 SPARQL protocol error
This is a 4store SPARQL server v1.1.5-3-gc289dc2
 (query: DELETE   {  ?s ?p ?o  } WHERE {  {  ?s ?p ?o .  FILTER (?s = <http://localhost/dynresalign1>)  }  })

I use SurfRDF 1.1.4 r352
sparql_protocol 1.0.0 r336

Cosmin Basca

unread,
Aug 3, 2012, 6:43:17 AM8/3/12
to sur...@googlegroups.com
Hi Laurens, 

it seems that 4store has a problem with the query itself. I do not have a 4store instance running and cannot verify this, but try to run the query directly on 4store (if possible) and see if the error persists (e detailed error message would also be helpful):

DELETE   {  ?s ?p ?o  } WHERE {  {  ?s ?p ?o .  FILTER (?s = <http://localhost/dynresalign1>)  }  }

the HTTP 500 error code is not very useful in this case. Just a quick question, does 4store accept FILTER in DELETE queries?

Cheers,
Cosmin

Laurens

unread,
Aug 3, 2012, 7:35:31 AM8/3/12
to sur...@googlegroups.com
Yes it should, but I found this:


It seems that WHERE { ?s ?p ?o .  } does not work properly if all three ?s ?p ?o are in one single statement.

Laurens

unread,
Aug 7, 2012, 6:03:28 AM8/7/12
to sur...@googlegroups.com
Got same issue with Jena Fuseki, same error, but in the logs of Fuseki I get something that makes sense, should be possible to fix I guess in short term

after HTTP POST to SPARQL Update endpoint:

03:00:59 INFO  Fuseki               :: [16] POST http://192.168.80.130:3030/store/update
03:00:59 INFO  Fuseki               :: [16] 400 SPARQL Update: No update= in HTML form

The Python error:

Bad query: DELETE   {  ?s ?p ?o  } WHERE {  {  ?s ?p ?o .  FILTER (?s = <http://localhost/dynresalign1>)  }  }
Request Method:GET
Request URL:http://localhost:8000/done/
Django Version:1.4.1
Exception Type:SparqlWriterException
Exception Value:
Bad query: DELETE   {  ?s ?p ?o  } WHERE {  {  ?s ?p ?o .  FILTER (?s = <http://localhost/dynresalign1>)  }  }
Exception Location:C:\Python27-32\lib\site-packages\sparqlwrapper-1.5.0-py2.7.egg\SPARQLWrapper\Wrapper.py in _query, line 350
Reply all
Reply to author
Forward
Message has been deleted
0 new messages