stuchalk / OSDB

The Open Spectral Database - Its all about the data
Creative Commons Zero v1.0 Universal
17 stars 2 forks source link

support for links to Wikidata #20

Closed egonw closed 8 years ago

egonw commented 8 years ago

It would be nice to have links to Wikidata too. That is, a field for compounds for the Wikidata Q-number. Some examples:

1-aminopropane -> Q417852 toluene -> Q15779

Context: http://dx.doi.org/10.3897/rio.1.e7573

stuchalk commented 8 years ago

Done! https://github.com/stuchalk/OSDB/commit/3f331e64961bfd5aadae56ff9a507018bb2f061e I have also added the Wikidata codes for the chemicals we already have, but I could not search by InChIKey only the name of the compound. Any ideas how to do that on Wikidata. FYI: I really like the paper and will be integrating Wikidata into a semantic ELN project I am working on...

egonw commented 8 years ago

You can use the SPARQL end point for this, with a query like:

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
select ?compound where {
  ?compound wdt:P235 "WGYKZJWCGVVSQN-UHFFFAOYSA-N"
}

You can copy/paste that onto this website: https://query.wikidata.org/

stuchalk commented 8 years ago

Thanks that makes the code more robust. https://github.com/stuchalk/OSDB/commit/bec84d2a6929545bd047c99af28c0c89cfed3a6f