Search Mailing List Archives
[bioontology-support] Help on a small API script
Hu, Zhiliang [AN S]
zhu at iastate.edu
Fri Oct 1 08:29:42 PDT 2021
Hi Jennifer,
Thank you for your patience with me. The information are very helpful.
Now I get it to work!
Have a good weekend!
Zhiliang
From: Jennifer Leigh Vendetti <vendetti at stanford.edu>
Date: Thu, Sep 30, 2021 at 06:26 PM
To: Zhiliang Hu <zhu at iastate.edu>
Cc: "support at bioontology.org" <support at bioontology.org>
Subject: Re: [bioontology-support] Help on a small API script
Hello Zhiliang,
If you want check the version of the latest submission of a particular ontology, you can use the /latest_submission endpoint, e.g., for VT the REST API call would be the following:
http://data.bioontology.org/ontologies/VT/latest_submission
In the JSON results, you can check for the “version” key/value pair:
[cid:image001.png at 01D7B6AF.3CECE890]
You may also be interested in the /submissions endpoint, which would allow you to retrieve all of the submissions for a particular ontology, e.g.:
http://data.bioontology.org/ontologies/VT/submissions
You can iterate over the collection, looking at the “version” key/value pair for each ontology submission object.
We have some example code for interacting with our REST API in GitHub:
https://github.com/ncbo/ncbo_rest_sample_code
Kind regards,
Jennifer
On Sep 30, 2021, at 3:34 PM, Hu, Zhiliang [AN S] <zhu at iastate.edu<mailto:zhu at iastate.edu>> wrote:
Greetings,
I have a routine to watch the latest versions of a few ontologies (VT/LPT/CMO/etc).
I tried the following:
use LWP::Simple;
use JSON qw( decode_json );
my $bioprtAPIky = "720f4412-5a96-48cc-a39f-961570c9a94b";
my $url = "http://data.bioontology.org";
$url .= "/property_search?";
$url .= "apikey=$bioprtAPIky";
$url .= "&ontology=VT";
$url .= "&q=version";
my $get = get("$url");
and get lost at what to extract for.
I was on your doc http://data.bioontology.org/documentation but didn't get much. Could you help with this script? (to get just the latest version number).
Thanks in advance,
Zhiliang
PS:
I used to "get" "https://bioportal.bioontology.org/ontologies/VT/?p=summary" and apparently the scripting "get" is being blocked on your site lately.
_______________________________________________
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/20211001/0f1d7b37/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 165862 bytes
Desc: image001.png
URL: <http://mailman.stanford.edu/pipermail/bioontology-support/attachments/20211001/0f1d7b37/attachment-0001.png>
More information about the bioontology-support
mailing list