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
Wed Mar 27 09:59:59 PDT 2019


Thanks so much for your answer! Now i can get it to work. Your support is really
helpful.
Regards,
Rayyan

________________________________
From: Michael Dorf <mdorf at stanford.edu>
Sent: Wednesday, March 27, 2019 4:28 AM
To: Rayyan Aziz Ansari
Cc: John Graybeal; support at bioontology.org
Subject: Re: [bioontology-support] Python API - Specifying ontology ID

Hi Rayyan,

You shouldn’t use the curly braces in your ontologies parameter that you send to BioPortal. The REST URL should look like:

http://data.bioontology.org/annotator?text=eye%20injury&ontologies=MEDDRA&longest_only=false&exclude_numbers=false&whole_word_only=true&exclude_synonyms=false&expand_class_hierarchy=true&class_hierarchy_max_level=3

You can simulate your query in our UI by pasting your text into the text field and selecting the other parameters you are interested in. Once your get the results back, you can see the REST API link at the bottom of the page under "To reproduce these results:"

http://bioportal.bioontology.org/annotator

Hope this helps!

Michael


On Mar 26, 2019, at 3:12 AM, Rayyan Aziz Ansari <r.ansari at se17.qmul.ac.uk<mailto:r.ansari at se17.qmul.ac.uk>> wrote:

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<mailto:jgraybeal at stanford.edu>>
Sent: Monday, March 25, 2019 10:27 PM
To: Rayyan Aziz Ansari
Cc: support at bioontology.org<mailto: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

_______________________________________________
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/20190327/6ece2ce3/attachment-0001.html>


More information about the bioontology-support mailing list