<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
Hi Manuel,
<div class=""><br class="">
</div>
<div class="">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.</div>
<div class=""><br class="">
</div>
<div class=""><a href="https://github.com/ncbo/ontologies_linked_data/blob/master/lib/ontologies_linked_data/models/ontology_submission.rb#L42" class="">https://github.com/ncbo/ontologies_linked_data/blob/master/lib/ontologies_linked_data/models/ontology_submission.rb#L42</a></div>
<div class=""><br class="">
</div>
<div class="">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:</div>
<div class=""><br class="">
</div>
<div class=""><a href="https://github.com/ncbo/ncbo_rest_sample_code" class="">https://github.com/ncbo/ncbo_rest_sample_code</a> </div>
<div class=""><br class="">
</div>
<div class="">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.</div>
<div class=""><br class="">
</div>
<div class=""><a href="https://github.com/ncbo/ontologies_api/blob/master/test/controllers/test_ontology_submissions_controller.rb#L58" class="">https://github.com/ncbo/ontologies_api/blob/master/test/controllers/test_ontology_submissions_controller.rb#L58</a></div>
<div class=""><a href="https://github.com/ncbo/ontologies_api/blob/master/controllers/ontology_submissions_controller.rb#L32" class="">https://github.com/ncbo/ontologies_api/blob/master/controllers/ontology_submissions_controller.rb#L32</a> </div>
<div class=""><a href="https://github.com/ncbo/ontologies_api/blob/959eb70b72c3cf1e159c668ceb46e6deb25ba281/helpers/ontology_helper.rb#L8" class="">https://github.com/ncbo/ontologies_api/blob/959eb70b72c3cf1e159c668ceb46e6deb25ba281/helpers/ontology_helper.rb#L8</a> </div>
<div class=""><br class="">
</div>
<div class="">Michael</div>
<div class=""><br class="">
</div>
<div class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On Nov 17, 2020, at 7:29 AM, Manuel Fiorelli <<a href="mailto:manuel.fiorelli@gmail.com" class="">manuel.fiorelli@gmail.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div dir="auto" class="">Hi john
<div dir="auto" class=""><br class="">
</div>
<div dir="auto" class="">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. </div>
<div dir="auto" class=""><br class="">
</div>
<div dir="auto" class="">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. </div>
<div dir="auto" class=""><br class="">
</div>
<div dir="auto" class="">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? </div>
<div dir="auto" class=""><br class="">
</div>
<div dir="auto" class="">Regards</div>
<div dir="auto" class="">Manuel</div>
</div>
<br class="">
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">Il mar 17 nov 2020, 08:31 John Graybeal <<a href="mailto:jgraybeal@stanford.edu" class="">jgraybeal@stanford.edu</a>> ha scritto:<br class="">
</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word;line-break:after-white-space" class="">I'm not the final authority, but I do not recall that order can be preserved. 
<div class=""><br class="">
</div>
<div class="">John<br class="">
<div class=""><br class="">
<blockquote type="cite" class="">
<div class="">On Nov 16, 2020, at 3:00 PM, Manuel Fiorelli <<a href="mailto:manuel.fiorelli@gmail.com" target="_blank" rel="noreferrer" class="">manuel.fiorelli@gmail.com</a>> wrote:</div>
<br class="">
<div class="">
<div dir="ltr" class="">
<div class="">Hi everybody</div>
<div class=""><br class="">
</div>
<div class="">I need to make ontology submissions programmatically, uploading the ontology file as part of the submission (instead of providing a fetch URL).</div>
<div class="">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.<br class="">
</div>
<div class="">However, I had a problem with the property <i class="">contact</i>, which is supposed to contain the list of the contacts for the ontology.</div>
<div class="">Using PostMan, I defined the following parts, given as name:value pairs:</div>
<div class=""><br class="">
</div>
<div class="">contact[][name]:Manuel Fiorelli<br class="">
contact[][email]:<a href="mailto:manuel.fiorelli@gmail.com" target="_blank" rel="noreferrer" class="">manuel.fiorelli@gmail.com</a><br class="">
contact[][name]:Mario Rossi<br class="">
contact[][email]:<a href="mailto:mario.rossi@example.org" target="_blank" rel="noreferrer" class="">mario.rossi@example.org</a><br class="">
contact[][name]:Mario Bianchi<br class="">
contact[][email]:<a href="mailto:mario.bianchi@example.org" target="_blank" rel="noreferrer" class="">mario.bianchi@example.org</a><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">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.</div>
<div class=""><br class="">
</div>
<div class="">Please, can you tell me whether the order is supposed to be preserved, and if so, how to guarantee that it is preserved.</div>
<div class=""><br class="">
</div>
Best regards,<br class="">
<div class="">
<div dir="ltr" data-smartmail="gmail_signature" class="">Manuel Fiorelli</div>
</div>
</div>
_______________________________________________<br class="">
bioontology-support mailing list<br class="">
<a href="mailto:bioontology-support@lists.stanford.edu" target="_blank" rel="noreferrer" class="">bioontology-support@lists.stanford.edu</a><br class="">
<a href="https://mailman.stanford.edu/mailman/listinfo/bioontology-support" target="_blank" rel="noreferrer" class="">https://mailman.stanford.edu/mailman/listinfo/bioontology-support</a><br class="">
</div>
</blockquote>
</div>
<br class="">
<div class="">
<div style="letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; word-wrap: break-word; line-break: after-white-space;" class="">
<div style="letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; word-wrap: break-word; line-break: after-white-space;" class="">
<div style="letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; word-wrap: break-word; line-break: after-white-space;" class="">
<div style="letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; word-wrap: break-word; line-break: after-white-space;" class="">
<div style="letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; word-wrap: break-word; line-break: after-white-space;" class="">
<div style="letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; word-wrap: break-word; line-break: after-white-space;" class="">
<div style="letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; word-wrap: break-word; line-break: after-white-space;" class="">
========================
<div class="">John Graybeal</div>
<div class="">Technical Program Manager</div>
<div class="">Center for Expanded Data Annotation and Retrieval /+/ NCBO BioPortal</div>
<div class="">Stanford Center for Biomedical Informatics Research<br class="">
650-736-1632  | ORCID  0000-0001-6875-5360</div>
<div class=""><br class="">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br class="">
</div>
<br class="">
</div>
</div>
</blockquote>
</div>
_______________________________________________<br class="">
bioontology-support mailing list<br class="">
<a href="mailto:bioontology-support@lists.stanford.edu" class="">bioontology-support@lists.stanford.edu</a><br class="">
https://mailman.stanford.edu/mailman/listinfo/bioontology-support<br class="">
</div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>