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] [BioPortal] Feedback from marwa811

Michael Dorf mdorf at stanford.edu
Mon Aug 31 14:39:02 PDT 2020


Hi Marwa,

Thank you for contacting us. I don’t have a working Java environment setup to test my recommendation (we are a Ruby/Rails shop), but since you are already have a working code that retrieves the ontologies, you only need to add a parameter “display=…” for the REST service to bring in the list of categories (domains) for each ontology. Your code should look like this:


// Follow the ontologies link by looking for the media type in the list of links
String link = resources.get("links").findValue("ontologies").asText();
link += "?display=acronym,name,summaryOnly,flat,ontologyType,hasDomain";

Then, as you iterate over the ontologies, you should be able to do something like this:


for (JsonNode ontology : ontologies) {
    ontNames.add(ontology.get("name").asText() + "\n" + ontology.get("@id").asText() + "\n\n");
    ArrayList<String> categories = (new ObjectMapper()).convertValue(ontology.get("hasDomain"), ArrayList.class);

I don’t know if this exact code works as written, but you should be able to tweak it to a working version.

Hope this helps.

Michael



On Aug 30, 2020, at 5:23 PM, support at bioontology.org<mailto:support at bioontology.org> wrote:


Name: marwa811

Email: marwa.abdelrehem at fci.au.edu.eg<mailto:marwa.abdelrehem at fci.au.edu.eg>

Location: https%3A%2F%2Fbioportal.bioontology.org<http://2Fbioportal.bioontology.org>%2Fhelp

Feedback:

Hi,
I am using your API for retrieving data about Bioportal ontologies. https://github.com/ncbo/ncbo_rest_sample_code/blob/master/java/src/ListOntologies.java
This example is efficient and simple and outputs a list of the ontologies' names and ids. I also need to output the categories (Domains) for each ontology. Could you guide me (with code snippet) on how to make this?
Regards,
Marwa

_______________________________________________
bioontology-support mailing list
bioontology-support at lists.stanford.edu<mailto:bioontology-support at lists.stanford.edu>
https://mailman.stanford.edu/mailman/listinfo/bioontology-support

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.stanford.edu/pipermail/bioontology-support/attachments/20200831/1ca16aab/attachment.html>


More information about the bioontology-support mailing list