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] Python API - Specifying ontology ID

Rayyan Aziz Ansari r.ansari at se17.qmul.ac.uk
Tue Mar 26 03:12:55 PDT 2019


Hi! With regard to my previous mail for the python api; This works:

annotations = get_json(REST_URL + "/annotator?max_level=3&text=" + urllib.parse.quote(text_to_annotate))

This line below does NOT (when i try to specify a particular ontology, for example: MEDDRA, I'm not sure if I'm putting the ontology id correctly, or even where to find it):

annotations = get_json(REST_URL + "/annotator?max_level=3&ontologies={MEDDRA}&text=" + urllib.parse.quote(text_to_annotate))

Please help, thanks,
Rayyan

________________________________
From: John Graybeal <jgraybeal at stanford.edu>
Sent: Monday, March 25, 2019 10:27 PM
To: Rayyan Aziz Ansari
Cc: support at bioontology.org
Subject: Re: [bioontology-support] Python API - Specifying ontology ID

Just a quick tip (all I can manage this morning!): This 'line' is inserted as a segment of the original API query (generally this attributes are separated by &, as I recall. So whatever query you issued would have "&ontologies={...}" added to it.

If that doesn't unlock the problem for you, send the exact query you are using and someone will likely offer a more explicit answer.

John

On Mar 25, 2019, at 7:53 AM, Rayyan Aziz Ansari <r.ansari at se17.qmul.ac.uk<mailto:r.ansari at se17.qmul.ac.uk>> wrote:

P.S. Just as a follow up, I am trying to get a piece of text annotated, and am looking for particular (3 ontologies) ontologies only. I went through the API documentation where it describes ontology selection as follows:

ontologies={ontology_id1,ontology_id2..,ontology_idN}

But I do not know where to put the above line in the sample python code. Can someone please help?
Thanks,
Rayyan
________________________________
From: Rayyan Aziz Ansari
Sent: Monday, March 25, 2019 4:02 PM
To: support at bioontology.org<mailto:support at bioontology.org>; bioontology-support at lists.stanford.edu<mailto:bioontology-support at lists.stanford.edu>
Subject: Python API - Specifying ontology ID

Hi, I am getting very long results when I do not specify the ontology ID (the sample python code does not specify the ID). I have tried to find a way to specify a particular ontology id in the sample python code available on the website. But I could not figure it out successfully.
Could someone please help me with this? I've spent a lot of time on this.
Thanks,
Rayyan


_______________________________________________
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/20190326/fb8499a2/attachment.html>


More information about the bioontology-support mailing list