Hi together,
I was wondering how I should access the MC3D database of the Materials Cloud in an optimal manner. Of course, I can download the archive of the final structures or the final SCF’s but this would include all the entries.
Ideally, I would like to query certain formulas or entries directly via my python scripts to investigate these structures or final SCF WorkChains.
In principle, this might be possible using Optimade, at least for the structures, but since I am also interested in the corresponding final SCF WorkChains, I am looking for a solution/API that allows me to directly query the MC3D database.
Thanks a lot in advance.
Best,
Timo
Hi Timo, the website of the MC3D on the Materials Cloud provides some links to REST APIs that it provides: https://mc3d.materialscloud.org/
It provides an example of how to query for the results of an example compound, e.g. Ag20Gd8Mg6 : https://www.materialscloud.org/mcloud/api/v2/discover/mc3d/compounds/Ag20Gd8Mg6
That will give you a bunch of properties, amongst which under the [0]['[provenance_links'][0]['uuid']
the UUID of the final SCF calculation, which is 1f8eb9f2-0cd1-44ef-98a4-e882b7a680d2
in this case.
You could use that with the generic API (https://aiida.materialscloud.org/mc3d/api/v4 ) to get more information about that calculation, for example to list all the inputs: https://aiida.materialscloud.org/mc3d/api/v4/nodes/1f8eb9f2-0cd1-44ef-98a4-e882b7a680d2/links/incoming
To be honest, I am not quite sure if there is an easy way to download the node as an AiiDA archive, so you can actually import it into a database. According to the docs, there should be https://aiida.materialscloud.org/mc3d/api/v4/1f8eb9f2-0cd1-44ef-98a4-e882b7a680d2/download but that currently returns a 404. I will ping the admin to ask what might be going on.
eimrek
October 6, 2023, 10:02am
3
Hi both! Just to add to Sebastiaan’s answer: the docs for the AiiDA REST API (that is running at https://aiida.materialscloud.org/mc3d/api/v4 ) are here: AiiDA REST API — AiiDA 2.4.0.post0 documentation
To see which AiiDA nodes support downloading and in what formats, you can look at
https://aiida.materialscloud.org/mc3d/api/v4/nodes/download_formats/
and to download, an example for a StructureData node would be
https://aiida.materialscloud.org/mc3d/api/v4/nodes/ccf74efe-af52-475a-abd7-d363aa2ce63e/download?download_format=xyz
@sphuber , your example https://aiida.materialscloud.org/mc3d/api/v4/1f8eb9f2-0cd1-44ef-98a4-e882b7a680d2/download is missing /nodes/
in the url path and also is a CalcJobNode that doesn’t support download. However, one could download e.g. the input file with https://aiida.materialscloud.org/mc3d/api/v4/nodes/1f8eb9f2-0cd1-44ef-98a4-e882b7a680d2/repo/contents?filename=“aiida.in”
As far as i know, i don’t think the current REST API supports downloading any node as an AiiDA archive, although i agree that it could be very useful.
Hi both, thanks a lot for your comments.
I already used the different APIs separately but didn’t think about ‘combining’ them, this definitely makes sense!
system
Closed
October 13, 2023, 9:51am
5
This topic was automatically closed 4 hours after the last reply. New replies are no longer allowed.