Search Mailing List Archives


Limit search to: Subject & Body Subject Author
Sort by: Reverse Sort
Limit to: All This Week Last Week This Month Last Month
Select Date Range     through    

[bioontology-support] accessing bioportal sparql endpoint from sesame

manuelso manuelso at stanford.edu
Fri Sep 27 10:08:30 PDT 2013


Hi Laura,

It seems that your example sends the apikey in the HTTP header. Our SPARQL endpoint only supports the api key parameter as a HTTP parameter:

http://sparql.bioontology.org/?query=YOUR_QUERY&apikey=YOUR_KEY

You probably need to find a way to send extra HTTP parameters with sesame. I know you can with Jena-ARQ.

Best,

Manuel

On Sep 26, 2013, at 8:58 AM, "Hollink, L." <l.hollink at vu.nl> wrote:

> Dear Manuel, Trish, others, 
> 
> I am trying to access the Bioportal SPARQL endpoint using the sesame library. However, I keep getting the following error message: 
> 
> ----------------
> Forbidden (403)
> 
> CSRF verification failed. Request aborted.
> 
> Help
> 
> Reason given for failure:
> 
>    No CSRF or session cookie.
> 
> In general, this can occur when there is a genuine Cross Site Request Forgery, or when Django's CSRF mechanism has not been used correctly. For POST forms, you need to ensure:
> 
> 	• The view function uses RequestContext for the template, instead of Context.
> 	• In the template, there is a {% csrf_token %} template tag inside each POST form that targets an internal URL.
> 	• If you are not using CsrfViewMiddleware, then you must use csrf_protect on any views that use the csrf_token template tag, as well as those that accept the POST data.
> You're seeing the help section of this page because you have DEBUG = True in your Django settings file. Change that to False, and only the initial error message will be displayed.
> 
> You can customize this page using the CSRF_FAILURE_VIEW setting.
> ----------------
> 
> Do you have any idea what this means, and what the reason could be? I've attached the simple test program in which I try to access the SPARQL endpoint. I've also tried the code in the library of examples at https://github.com/ncbo/sparql-code-examples/blob/master/java/src/org/ncbo/stanford/sparql/examples/OpenRDFAlibabaTest.java . However, this does not compile on my machine. I guess that is because it is done with an older version of sesame. I use the current version, 2.7.3, which does not have convenience methods for adding the api key to the endpoint connection. 
> 
> If you can help me with the above error, of if you can share your experience in accessing Bioportal from Sesame, that would be great. 
> 
> Best regards,
> Laura
> 
> ps. thanks for your answers to previous questions, it's very helpful!
> 
> 
> <Test2.java>_______________________________________________
> bioontology-support mailing list
> bioontology-support at lists.stanford.edu
> https://mailman.stanford.edu/mailman/listinfo/bioontology-support



More information about the bioontology-support mailing list