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] Parsing the BioPortal web service response

Pradnya Gawade pgawade at openclinica.com
Fri Jan 20 06:23:52 PST 2012


Hello,

 

I am planning to integrate my web application with BioPortal by using
REST web services API and would like to know more about how people parse
the web service response from BioPortal.

Some where I found the sample code to parse these xmls using DOM parser
which I am using right now and it works for simple cases but I think it
is not reliable because it is difficult to handle nested elements and
things like this with this way where you fetch the elements using
methods like getElementsByTagName(String ..).

Some sample code is here:

 

DocumentBuilderFactory docBuilderFactory =
DocumentBuilderFactory.newInstance();

DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();

Document doc = docBuilder.parse(uri);                 

doc.getDocumentElement().normalize();

NodeList listClassBean1 = doc.getElementsByTagName("classBean");

 

 

 I am not able to specify the level of elements in the hierarchy I want
to go up to as in the BioPortal web service response, "classBean" is at
multiple levels. I am thinking there might be better ways to do this may
be using APIs like castor or some how making use of schema files.
However BioPortal say they do not provide schema files. Could any body
please provide any suggests as to how they are doing it? Presently I am
planning to take a look at castor to see how I can use it with BioPortal
web services. 

I will really appreciate the quick response from some body.

 

- Pradnya

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.stanford.edu/pipermail/bioontology-support/attachments/20120120/4496b169/attachment.html>


More information about the bioontology-support mailing list