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] Ordering issues while making ontology submissions programmatically

Michael Dorf mdorf at stanford.edu
Tue Nov 17 15:03:58 PST 2020


Hi Manuel,

Just as John indicated, the Contact field ordering isn’t enforced in our system. The field “contact" is defined as a generic list, which is dumped into a triple store database.

https://github.com/ncbo/ontologies_linked_data/blob/master/lib/ontologies_linked_data/models/ontology_submission.rb#L42

The ability to assign multiple contacts to a submission object does not necessarily imply a specific order of priority for those contacts. We have sample REST code examples below, but I don’t think they include a code for inserting a submission:

https://github.com/ncbo/ncbo_rest_sample_code

The best I can offer is our unit test code that uses POST to create a submission. Unfortunately, this is only in Ruby and may not be exactly what you’re looking for. The trial-and-error approach you’ve taken will probably take you much further than any of the sample code we can provide.

https://github.com/ncbo/ontologies_api/blob/master/test/controllers/test_ontology_submissions_controller.rb#L58
https://github.com/ncbo/ontologies_api/blob/master/controllers/ontology_submissions_controller.rb#L32
https://github.com/ncbo/ontologies_api/blob/959eb70b72c3cf1e159c668ceb46e6deb25ba281/helpers/ontology_helper.rb#L8

Michael


On Nov 17, 2020, at 7:29 AM, Manuel Fiorelli <manuel.fiorelli at gmail.com<mailto:manuel.fiorelli at gmail.com>> wrote:

Hi john

Thank you for the reply. Unfortunately, I've not found any example of making an ontology submission with file upload, so I tried by myself.

As I said, I eventually used the formdata approach, and looking on the web it seems to me that the order should have been preserved.

Since I don't no anything about Ruby and its conventions, can you reference some example code so I can be sure that I wrote the request correctly?

Regards
Manuel

Il mar 17 nov 2020, 08:31 John Graybeal <jgraybeal at stanford.edu<mailto:jgraybeal at stanford.edu>> ha scritto:
I'm not the final authority, but I do not recall that order can be preserved.

John

On Nov 16, 2020, at 3:00 PM, Manuel Fiorelli <manuel.fiorelli at gmail.com<mailto:manuel.fiorelli at gmail.com>> wrote:

Hi everybody

I need to make ontology submissions programmatically, uploading the ontology file as part of the submission (instead of providing a fetch URL).
I eventually figured out that it should be possible to encode the submission using as form data: each property of the JSON object is put into its own part, with a part for the uploaded file.
However, I had a problem with the property contact, which is supposed to contain the list of the contacts for the ontology.
Using PostMan, I defined the following parts, given as name:value pairs:

contact[][name]:Manuel Fiorelli
contact[][email]:manuel.fiorelli at gmail.com<mailto:manuel.fiorelli at gmail.com>
contact[][name]:Mario Rossi
contact[][email]:mario.rossi at example.org<mailto:mario.rossi at example.org>
contact[][name]:Mario Bianchi
contact[][email]:mario.bianchi at example.org<mailto:mario.bianchi at example.org>

Contrary to my understanding of how the API should work, I noticed (by fetching the newly created submission using the API) that the order of the contacts is not preserved.

Please, can you tell me whether the order is supposed to be preserved, and if so, how to guarantee that it is preserved.

Best regards,
Manuel Fiorelli
_______________________________________________
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

========================
John Graybeal
Technical Program Manager
Center for Expanded Data Annotation and Retrieval /+/ NCBO BioPortal
Stanford Center for Biomedical Informatics Research
650-736-1632  | ORCID  0000-0001-6875-5360



_______________________________________________
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/20201117/6aa9b653/attachment-0001.html>


More information about the bioontology-support mailing list