Adding compounds: Difference between revisions
Jump to navigation
Jump to search
(Created page with "Compounds can be added with a Groovy script using [https://github.com/egonw/bacting Bacting] available from [https://github.com/egonw/ons-wikidata/blob/master/Wikidata/createWDitemsFromSMILES.groovy here]. The script needs to know the properties equivalent to a number of Wikidata properties. It can discover these using the 'exact match' (P11) property that links properties in this Wikibase to their respective properties in Wikidata. <pre> groovy createWDitemsFromSMILES....") |
No edit summary |
||
(2 intermediate revisions by the same user not shown) | |||
Line 4: | Line 4: | ||
<pre> | <pre> | ||
groovy createWDitemsFromSMILES.groovy -w | groovy createWDitemsFromSMILES.groovy -w compoundcloud.wikibase.cloud -a P11 | ||
</pre> | </pre> | ||
This script starts with a plain text file with one SMILES string on each line. | |||
If you add a tab-separated label/name on the same line, you can use this command: | |||
<pre> | |||
groovy createWDitemsFromSMILES.groovy -w compoundcloud.wikibase.cloud -a P11 -l | |||
</pre> | |||
The output of the command is a file called ''output.quickstatements''. Due to a [https://phabricator.wikimedia.org/T325871 bug in the Wikibase software], the unit annotation should removed by removing the "U3" string from the | |||
file. After that, enter it via the [https://compoundcloud.wikibase.cloud/tools/quickstatements/ QuickStatements API]. |
Latest revision as of 07:50, 27 December 2022
Compounds can be added with a Groovy script using Bacting available from here. The script needs to know the properties equivalent to a number of Wikidata properties. It can discover these using the 'exact match' (P11) property that links properties in this Wikibase to their respective properties in Wikidata.
groovy createWDitemsFromSMILES.groovy -w compoundcloud.wikibase.cloud -a P11
This script starts with a plain text file with one SMILES string on each line. If you add a tab-separated label/name on the same line, you can use this command:
groovy createWDitemsFromSMILES.groovy -w compoundcloud.wikibase.cloud -a P11 -l
The output of the command is a file called output.quickstatements. Due to a bug in the Wikibase software, the unit annotation should removed by removing the "U3" string from the file. After that, enter it via the QuickStatements API.