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] Internal server error for programmatic search

Ray Fergerson ray.fergerson at
Fri Dec 20 15:23:35 PST 2013

This is really quite strange since it works in a browser. It works for us
as well. Do you get other connections to work?


I suggest perhaps cutting the command down to the minimum to see if the
connection can be established. Something like:
<> &apikey=...


If this works then try building up the command you want.


If even this does not work then perhaps there is some bizarre firewall
setting that only allows known browsers at your site to access the web. I
have no idea if this sort of thing is really even possible. I would be
worthwhile though trying the same command from your home internet
connection without going through the UW network. 




From: bioontology-support-bounces at
[mailto:bioontology-support-bounces at] On Behalf Of
Maxwell Neal
Sent: Friday, December 20, 2013 2:05 PM
To: Paul R Alexander
Cc: support at
Subject: Re: [bioontology-support] Internal server error for programmatic


Hi Paul,


Thanks very much for the help.  When I use the API key parameter in my
Java code I still get the same HTTP 500 error. Here's an example:


Again, this call works fine in a browser, but not from my Java code.






Maxwell Neal


Post-doctoral researcher

Department of Bioengineering

University of Washington

mneal at









On Dec 20, 2013, at 2:36 PM, Paul R Alexander wrote:

You will need to pass along your API Key using the 'apikey=YOUR_APIKEY'
parameter when you do the request from code. It gets stored in a browser
cookie and so you may be able to access from your browser just fine.

Here is some sample java code for doing search (The API key here gets set
in a header, but passing the apikey query string parameter works as well):


On Dec 19, 2013, at 12:16 PM, Maxwell Neal <mneal at> wrote:

Hi all,


I am in the process of adapting some existing Java code that I use to
programmatically search ontologies in BioPortal.  When I try to open a
connection to the following BioPortal REST URL, I get an HTTP 500 error.
exact_match=0> &ontologies=FMA&format=xml&exact_match=0


When I paste the same URL into my browser, I do get a successful search


Is this really an error on the BioPortal side, as the HTTP code indicates?
(I've included a snippet of my code below, in case it's useful.)


Many thanks,





String text = "brainstem";

String bioportalID = "FMA";

SAXBuilder builder = new SAXBuilder();

Document doc = null;

text = text.replace(" ", "+");

URL url = new URL(


                        + text + "&ontologies="

                        + bioportalID + "&format=xml" + "&exact_match=" +



URLConnection yc = url.openConnection();

yc.setReadTimeout(60000); // Timeout after a minute

BufferedReader in = new BufferedReader(new






Maxwell Neal


Post-doctoral researcher

Department of Bioengineering

University of Washington

mneal at











bioontology-support mailing list

bioontology-support at



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the bioontology-support mailing list