Skip to content

Instantly share code, notes, and snippets.

@egonw
Last active May 26, 2017 14:45
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/8a15e4a1d75ca5e2003163eef2f7344f to your computer and use it in GitHub Desktop.
Save egonw/8a15e4a1d75ca5e2003163eef2f7344f to your computer and use it in GitHub Desktop.
Find stereoisomers and charge states
SELECT ?mol ?molLabel ?InChIKey ?CAS ?ChemSpider ?CID ?ChEBI ?HMDB WHERE {
?mol wdt:P235 ?InChIKey .
OPTIONAL { ?mol wdt:P231 ?CAS }
OPTIONAL { ?mol wdt:P661 ?ChemSpider }
OPTIONAL { ?mol wdt:P662 ?CID }
OPTIONAL { ?mol wdt:P683 ?ChEBI }
OPTIONAL { ?mol wdt:P2057 ?HMDB }
FILTER (regex(str(?InChIKey), "^YTFVRYKNXDADBI-"))
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment