Skip to content

Instantly share code, notes, and snippets.

@egonw
Created January 17, 2023 19:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save egonw/01be540f50a620bddbe84f6cf86a8ac0 to your computer and use it in GitHub Desktop.
Save egonw/01be540f50a620bddbe84f6cf86a8ac0 to your computer and use it in GitHub Desktop.
clean up some import error
SELECT (SUBSTR(STR(?wikidata),32) AS ?qid)
(CONCAT("\"\"\"", ?inchikey_, "\"\"\"") AS ?inchikey)
(CONCAT("\"\"\"", ?inchi_, "\"\"\"") AS ?inchi)
(CONCAT("\"\"\"", ?chemform_, "\"\"\"") AS ?chemform)
(CONCAT("\"\"\"", ?smiles_, "\"\"\"") AS ?smiles)
(CONCAT(str(?mass_), "U483261") AS ?mass)
WHERE {
VALUES ?inchikey_ { "WSYNAKWAAXYNMW-DEOSSOPVSA-N" "PTCHLTYDAIWNSD-SSDOTTSWSA-N" "GAZIIOYXDWTTMC-GFCCVEGCSA-N" "CIUYPOUJRYWLDF-QFIPXVFZSA-N" "HAGZRCCJXLGJTR-BDAKNGLRSA-N" }
?wikidata wdt:P235 ?inchikey_ ;
wdt:P234 ?inchi_ ;
wdt:P274 ?chemform_ ;
wdt:P2017 ?smiles_ ;
wdt:P2067 ?mass_ .
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment