User:Egonw/Organophosphates

From Chemical Compounds of Interest
Jump to navigation Jump to search

Adding organophosphates

Using this query to get organophosphates from Wikidata:

SELECT ?smiles (SUBSTR(STR(?organophosphate),32) AS ?qid) ?organophosphateLabel  WHERE {
  ?organophosphate wdt:P31/wdt:P279* wd:Q411097 .
  OPTIONAL { ?organophosphate wdt:P233 ?canSMI }
  OPTIONAL { ?organophosphate wdt:P2017 ?isoSMI }
  BIND (COALESCE(?isoSMI, ?canSMI) AS ?smiles)
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}

Save the output as TSV file, e.g. organophosphates.tsv.

This is processed with:

groovy createWDitemsFromSMILES.groovy -w compoundcloud.wikibase.cloud -s -c Q216 -d P5 -l -i wikidata -a P11

Removed the unit (broken in Wikibase), fixed the "-c" which still uses P31.