[Cod-bugs] question about using COD query by specifying elements

Long Yang long.yang at columbia.edu
Sun Dec 30 22:25:18 EET 2018


Dear Antanas,

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.

For example, I would like to query all entries only with elements “Ca”, “C”, “O”, what would the MySQL query like?

I tried the query below but it doesn’t work.
mysql -u cod_reader -h www.crystallography.net -e 'select file from data where formula like "- C Ca O -“ and nel=3' cod

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.

Thank you!

Best Regards,

Long

> On Dec 30, 2018, at 3:08 PM, Antanas Vaitkus <antanas.vaitkus90 at gmail.com> wrote:
> 
> Dear Long Yang,
> 
> the specific elements are only listed in the chemical formula fields ('formula', 'calcformula', 'cellformula'). The formula fields all follow the same format:
> "- el1[no1] el2[no2] el3[no3] -", for example, "- F16 H3 O6 Sr5 V3 -".
> 
> On a pure MySQL level You can use the "LIKE" or "RLIKE" operators to construct the appropriate queries.
> 
> Hope that helps.
> 
> Sincerely,
> Antanas Vaitkus
> 
> On Sun, 30 Dec 2018 at 21:59, Long Yang <long.yang at columbia.edu <mailto:long.yang at columbia.edu>> wrote:
> Hi,
> 
> 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 (http://wiki.crystallography.net/cod_mysql_schema/ <http://wiki.crystallography.net/cod_mysql_schema/>) only have “ nel” to specify the number of elements, but does not have “elements” thing to enter “Ca”, “C”, “O”. How to do it?
> 
> Thank you!
> 
> Best Regards,
> 
> Long
> _______________________________________________
> Cod-bugs mailing list
> Cod-bugs at lists.crystallography.net <mailto:Cod-bugs at lists.crystallography.net>
> http://lists.crystallography.net/cgi-bin/mailman/listinfo/cod-bugs <http://lists.crystallography.net/cgi-bin/mailman/listinfo/cod-bugs>
> 
> 
> -- 
> Antanas Vaitkus,
> PhD student at Vilnius University Institute of Biotechnology,
> room V325, Saulėtekio al. 7,
> LT-10257 Vilnius, Lithuania
> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.crystallography.net/pipermail/cod-bugs/attachments/20181230/a0a4d230/attachment-0001.html>


More information about the Cod-bugs mailing list