<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Dear Antanas,<div class=""><br class=""></div><div class="">Thanks a lot for your quick reply! Could you please show in more details about how to do it in MySQL level? Sorry I was a beginner of SQL.</div><div class=""><br class=""></div><div class="">For example, I would like to query all entries only with elements “Ca”, “C”, “O”, what would the MySQL query like?</div><div class=""><br class=""></div><div class="">I tried the query below but it doesn’t work.</div><div class="">mysql -u cod_reader -h <a href="http://www.crystallography.net" class="">www.crystallography.net</a> -e '<b class="">select file from data where formula like "- C Ca O -“ and nel=3</b>' cod</div><div class=""><br class=""></div><div class="">BTW, how about using RESTful API, it seems to have the “el1, el2, ..., el8” and “strictmin, strictmax” parameters according to the wiki doc. But I don’t know how to use it.</div><div class=""><br class=""></div><div class=""><div class="">
<div style="color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Thank you!</div><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br class="">Best Regards,<br class=""></div><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br class=""></div><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Long</div></div></div></div></div></div>
</div>
<br class=""><div><blockquote type="cite" class=""><div class="">On Dec 30, 2018, at 3:08 PM, Antanas Vaitkus <<a href="mailto:antanas.vaitkus90@gmail.com" class="">antanas.vaitkus90@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div dir="ltr" class=""><div class=""><div class="">Dear Long Yang,<br class=""><br class=""></div>the specific elements are only listed in the chemical formula fields ('formula', 'calcformula', 'cellformula'). The formula fields all follow the same format:<br class=""></div>"- el1[no1] el2[no2] el3[no3] -", for example, "- F16 H3 O6 Sr5 V3 -".<br class=""><br class=""></div><div class="">On a pure MySQL level You can use the "LIKE" or "RLIKE" operators to construct the appropriate queries.<br class=""><br class=""></div><div class="">Hope that helps.<br class=""><br class=""></div><div class="">Sincerely,<br class=""></div><div class="">Antanas Vaitkus<br class=""></div></div><br class=""><div class="gmail_quote"><div dir="ltr" class="">On Sun, 30 Dec 2018 at 21:59, Long Yang <<a href="mailto:long.yang@columbia.edu" class="">long.yang@columbia.edu</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="overflow-wrap: break-word;" class="">Hi,<div class=""><br class=""></div><div class="">I am Long Yang, graduate student from Columbia University, USA. I am trying to query COD by specifying elements. It works as expected on your website, by entering the elements, for example, “Ca”, “C”, “O”. But when I do the SQL query, it doesn’t have similar schema as search in the website. The schema (<a href="http://wiki.crystallography.net/cod_mysql_schema/" target="_blank" class="">http://wiki.crystallography.net/cod_mysql_schema/</a>) only have “ nel” to specify the number of elements, but does not have “elements” thing to enter “Ca”, “C”, “O”. How to do it?</div><div class=""><br class=""></div><div class=""><div class=""><div style="overflow-wrap: break-word;" class=""><div style="overflow-wrap: break-word;" class=""><div style="overflow-wrap: break-word;" class=""><div style="overflow-wrap: break-word;" class=""><div style="overflow-wrap: break-word;" class="">Thank you!</div><div style="overflow-wrap: break-word;" class=""><div style="overflow-wrap: break-word;" class=""><br class="">Best Regards,<br class=""></div><div style="overflow-wrap: break-word;" class=""><br class=""></div><div style="overflow-wrap: break-word;" class="">Long</div></div></div></div></div></div></div></div></div>_______________________________________________<br class="">
Cod-bugs mailing list<br class="">
<a href="mailto:Cod-bugs@lists.crystallography.net" target="_blank" class="">Cod-bugs@lists.crystallography.net</a><br class="">
<a href="http://lists.crystallography.net/cgi-bin/mailman/listinfo/cod-bugs" rel="noreferrer" target="_blank" class="">http://lists.crystallography.net/cgi-bin/mailman/listinfo/cod-bugs</a><br class="">
</blockquote></div><br clear="all" class=""><br class="">-- <br class=""><div dir="ltr" class="gmail_signature"><div dir="ltr" class=""><div class=""><div class="">Antanas Vaitkus,<br class=""></div>PhD student at Vilnius University Institute of Biotechnology,<br class=""><span class=""><span class=""><span class="">room V325, </span></span></span>Saulėtekio al. 7,<br class="">LT-10257 Vilnius, Lithuania<br class=""></div><div class=""><div class=""><div class=""><div class=""><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><br class=""><br class=""></div></div></div></div></div></div></div></div></div></div></div>
</div></blockquote></div><br class=""></div></body></html>