{
  "version": "https://jsonfeed.org/version/1.1",
  "title": "chem-bla-ics",
  "description": "Chemblaics (pronounced chem-bla-ics) is the science that uses open science and computers to solve problems in chemistry, biochemistry and related fields.",
  "home_page_url": "https://chem-bla-ics.linkedchemistry.info/",
  "feed_url": "https://chem-bla-ics.linkedchemistry.info/2015/12/22/new-edition-getting-cas-registry.json",
  "icon": "https://chem-bla-ics.linkedchemistry.info/assets/images/chem-bla-ics_logo.png",
  "language": "en",
  "authors": [
    {
      "name": "Egon Willighagen",
      "url": "https://orcid.org/0000-0001-7542-0286",
      "_orcid": "0000-0001-7542-0286"
    }
  ],
  "items": [

    {
      "id": "https://doi.org/10.59350/vt6nr-28g72",
      "url": "https://chem-bla-ics.linkedchemistry.info/2015/12/22/new-edition-getting-cas-registry.html",
      "title": "New Edition! Getting CAS registry numbers out of WikiData",
      "content_html": "<p><span style=\"width: 30%; display: block; margin-left: auto; margin-right: auto; float: right\">\n<img src=\"/assets/images/aceticAcidCAS.png\" /> <br />\nSource: Wikipedia. <a href=\"https://en.wikipedia.org/wiki/File:Acetic_acid.jpg\">CC-BY-SA</a>\n</span>\nApril this year <a href=\"https://chem-bla-ics.linkedchemistry.info/2015/04/10/getting-cas-registry-numbers-out-of.html\">I blogged about an important SPARQL query <i class=\"fa-solid fa-recycle fa-xs\"></i></a>\nfor many chemists: getting CAS registry numbers from Wikidata. This is relevant for two reasons:</p>\n\n<ol>\n  <li><a href=\"http://commonchemistry.org/\">CAS works together with Wikimedia</a> on a large, free CAS-to-structure database</li>\n  <li><a href=\"http://wikidata.org/\">Wikidata</a> is <a href=\"https://creativecommons.org/choose/zero/\">CCZero</a></li>\n</ol>\n\n<p>The original effort validated about eight thousand registry numbers, made available via Wikipedia and the\n<a href=\"http://commonchemistry.org/\">Common Chemistry</a> website. However, the effort did not stop there, and Wikipedia\nnow contains many more CAS registry numbers. In fact, Wikidata picked up many of these and now lists almost\ntwenty thousand CAS numbers. That well exceeds what databases are allowed to aggregate and make available.</p>\n\n<p>Since the post in April, Wikidata put online a <a href=\"https://query.wikidata.org/\">new SPARQL end point</a> and\ncreated “direct” property links. This way, you loose the provenance information, but the query becomes simpler:</p>\n\n<div class=\"language-sparql highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"k\">PREFIX</span><span class=\"w\"> </span><span class=\"nn\">wdt</span><span class=\"o\">:</span><span class=\"w\"> </span><span class=\"nn\">&lt;http://www.wikidata.org/prop/direct/&gt;</span><span class=\"w\">\n</span><span class=\"k\">SELECT</span><span class=\"w\"> </span><span class=\"nv\">?compound</span><span class=\"w\"> </span><span class=\"nv\">?id</span><span class=\"w\"> </span><span class=\"k\">WHERE</span><span class=\"w\"> </span><span class=\"p\">{</span><span class=\"w\">\n  </span><span class=\"nv\">?compound</span><span class=\"w\"> </span><span class=\"nn\">wdt</span><span class=\"o\">:</span><span class=\"ss\">P231</span><span class=\"w\"> </span><span class=\"nv\">?id</span><span class=\"w\"> </span><span class=\"p\">.</span><span class=\"w\">\n</span><span class=\"p\">}</span><span class=\"w\">\n</span></code></pre></div></div>\n\n<p>The other thing that changed since April is that others and I requested the creation of more compound identifiers,\nand here’s an overview along with the current number of such identifiers in Wikidata:</p>\n\n<ul>\n  <li>CAS registry number (<a href=\"https://www.wikidata.org/wiki/Property:P231\">P231</a>): <a href=\"https://query.wikidata.org/#PREFIX%20wdt%3A%20%3Chttp%3A%2F%2Fwww.wikidata.org%2Fprop%2Fdirect%2F%3E%0ASELECT%20(count(%3Fid)%20as%20%3Fcount)%20WHERE%20%7B%0A%20%20%3Fcompound%20wdt%3AP231%20%3Fid%20.%0A%7D%0A\">19420</a></li>\n  <li>PubChem ID (CID) (<a href=\"https://www.wikidata.org/wiki/Property:P662\">P662</a>): <a href=\"https://query.wikidata.org/#PREFIX%20wdt%3A%20%3Chttp%3A%2F%2Fwww.wikidata.org%2Fprop%2Fdirect%2F%3E%0ASELECT%20%28count%28%3Fid%29%20as%20%3Fcount%29%20WHERE%20%7B%0A%20%20%3Fcompound%20wdt%3AP662%20%3Fid%20.%0A%7D%0A\">16616</a></li>\n  <li>InChI (<a href=\"https://www.wikidata.org/wiki/Property:P234\">P234</a>): <a href=\"https://query.wikidata.org/#PREFIX%20wdt%3A%20%3Chttp%3A%2F%2Fwww.wikidata.org%2Fprop%2Fdirect%2F%3E%0ASELECT%20%28count%28%3Fid%29%20as%20%3Fcount%29%20WHERE%20%7B%0A%20%20%3Fcompound%20wdt%3AP234%20%3Fid%20.%0A%7D%0A\">14312</a></li>\n  <li>ChemSpider ID (<a href=\"https://www.wikidata.org/wiki/Property:P661\">P661</a>): <a href=\"https://query.wikidata.org/#PREFIX%20wdt%3A%20%3Chttp%3A%2F%2Fwww.wikidata.org%2Fprop%2Fdirect%2F%3E%0ASELECT%20%28count%28%3Fid%29%20as%20%3Fcount%29%20WHERE%20%7B%0A%20%20%3Fcompound%20wdt%3AP661%20%3Fid%20.%0A%7D%0A\">11566</a></li>\n  <li>ChEBI ID (<a href=\"https://www.wikidata.org/wiki/Property:P683\">P683</a>): <a href=\"https://query.wikidata.org/#PREFIX%20wdt%3A%20%3Chttp%3A%2F%2Fwww.wikidata.org%2Fprop%2Fdirect%2F%3E%0ASELECT%20%28count%28%3Fid%29%20as%20%3Fcount%29%20WHERE%20%7B%0A%20%20%3Fcompound%20wdt%3AP683%20%3Fid%20.%0A%7D%0A\">4313</a></li>\n  <li>KEGG ID (<a href=\"https://www.wikidata.org/wiki/Property:P665\">P665</a>): <a href=\"https://query.wikidata.org/#PREFIX%20wdt%3A%20%3Chttp%3A%2F%2Fwww.wikidata.org%2Fprop%2Fdirect%2F%3E%0ASELECT%20%28count%28%3Fid%29%20as%20%3Fcount%29%20WHERE%20%7B%0A%20%20%3Fcompound%20wdt%3AP665%20%3Fid%20.%0A%7D%0A\">3983</a></li>\n  <li>Drugbank ID (<a href=\"https://www.wikidata.org/wiki/Property:P715\">P715</a>): <a href=\"https://query.wikidata.org/#PREFIX%20wdt%3A%20%3Chttp%3A%2F%2Fwww.wikidata.org%2Fprop%2Fdirect%2F%3E%0ASELECT%20%28count%28%3Fid%29%20as%20%3Fcount%29%20WHERE%20%7B%0A%20%20%3Fcompound%20wdt%3AP715%20%3Fid%20.%0A%7D%0A\">2518</a></li>\n  <li>KNApSAcK ID (<a href=\"https://www.wikidata.org/wiki/Property:P2064\">P2064</a>): <a href=\"https://query.wikidata.org/#PREFIX%20wdt%3A%20%3Chttp%3A%2F%2Fwww.wikidata.org%2Fprop%2Fdirect%2F%3E%0ASELECT%20%28count%28%3Fid%29%20as%20%3Fcount%29%20WHERE%20%7B%0A%20%20%3Fcompound%20wdt%3AP2064%20%3Fid%20.%0A%7D%0A\">9</a></li>\n  <li>HMDB ID (<a href=\"https://www.wikidata.org/wiki/Property:P2057\">P2057</a>): <a href=\"https://query.wikidata.org/#PREFIX%20wdt%3A%20%3Chttp%3A%2F%2Fwww.wikidata.org%2Fprop%2Fdirect%2F%3E%0ASELECT%20%28count%28%3Fid%29%20as%20%3Fcount%29%20WHERE%20%7B%0A%20%20%3Fcompound%20wdt%3AP2057%20%3Fid%20.%0A%7D%0A\">6</a></li>\n  <li>ZINC ID (<a href=\"https://www.wikidata.org/wiki/Property:P2084\">P2084</a>): <a href=\"https://query.wikidata.org/#PREFIX%20wdt%3A%20%3Chttp%3A%2F%2Fwww.wikidata.org%2Fprop%2Fdirect%2F%3E%0ASELECT%20%28count%28%3Fid%29%20as%20%3Fcount%29%20WHERE%20%7B%0A%20%20%3Fcompound%20wdt%3AP2084%20%3Fid%20.%0A%7D%0A\">4</a></li>\n  <li>LIPID MAPS ID (<a href=\"https://www.wikidata.org/wiki/Property:P2063\">P2063</a>): <a href=\"https://query.wikidata.org/#PREFIX%20wdt%3A%20%3Chttp%3A%2F%2Fwww.wikidata.org%2Fprop%2Fdirect%2F%3E%0ASELECT%20(count(%3Fid)%20as%20%3Fcount)%20WHERE%20%7B%0A%20%20%3Fcompound%20wdt%3AP2063%20%3Fid%20.%0A%7D%0A\">3</a></li>\n  <li>Leadscope ID (<a href=\"https://www.wikidata.org/wiki/Property:P2083\">P2083</a>): <a href=\"https://query.wikidata.org/#PREFIX%20wdt%3A%20%3Chttp%3A%2F%2Fwww.wikidata.org%2Fprop%2Fdirect%2F%3E%0ASELECT%20(count(%3Fid)%20as%20%3Fcount)%20WHERE%20%7B%0A%20%20%3Fcompound%20wdt%3AP2083%20%3Fid%20.%0A%7D%0A\">3</a></li>\n</ul>\n\n<p>Clearly, some identifiers are not well populated yet. This is what bots are for, like\n<a href=\"https://bitbucket.org/sulab/wikidatabots/overview\">those used by the Andrew Su team</a>.</p>\n\n<p>Because there is also a predicate for SMILES, we can also create a query that puts the CAS registry\nnumber alongside to the SMILES (or any other identifier):</p>\n\n<div class=\"language-sparql highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"k\">PREFIX</span><span class=\"w\"> </span><span class=\"nn\">wdt</span><span class=\"o\">:</span><span class=\"w\"> </span><span class=\"nn\">&lt;http://www.wikidata.org/prop/direct/&gt;</span><span class=\"w\">\n</span><span class=\"k\">SELECT</span><span class=\"w\"> </span><span class=\"nv\">?compound</span><span class=\"w\"> </span><span class=\"nv\">?id</span><span class=\"w\"> </span><span class=\"nv\">?smiles</span><span class=\"w\"> </span><span class=\"k\">WHERE</span><span class=\"w\"> </span><span class=\"p\">{</span><span class=\"w\">\n  </span><span class=\"nv\">?compound</span><span class=\"w\"> </span><span class=\"nn\">wdt</span><span class=\"o\">:</span><span class=\"ss\">P231</span><span class=\"w\"> </span><span class=\"nv\">?id</span><span class=\"w\"> </span><span class=\"p\">;</span><span class=\"w\">\n            </span><span class=\"nn\">wdt</span><span class=\"o\">:</span><span class=\"ss\">P233</span><span class=\"w\"> </span><span class=\"nv\">?smiles</span><span class=\"w\"> </span><span class=\"p\">.</span><span class=\"w\">\n</span><span class=\"p\">}</span><span class=\"w\">\n</span></code></pre></div></div>\n\n<p>Of course, then the question is, <a href=\"https://chem-bla-ics.blogspot.nl/2015/10/how-to-test-smiles-strings-in.html\">are these SMILES string valid</a>…\nAnd, importantly, this is nothing compared to the number of chemical compounds we know about, which currently is in\nthe order of 100 million, of which a quarter can be readily purchased:</p>\n\n<p><a href=\"https://twitter.com/chem4biology/status/679314144680513536\"><img src=\"/assets/images/twitter_chem4biology_679314144680513536.png\" alt=\"\" /></a></p>\n\n<p><a href=\"https://twitter.com/chem4biology/status/677593362640142336\"><img src=\"/assets/images/twitter_chem4biology_677593362640142336.png\" alt=\"\" /></a></p>\n\n<h4>References</h4>\n<div class=\"csl-bib-body\">\n    <div class=\"csl-entry\">Willighagen, E. (2015). <i>Getting CAS registry numbers out of WikiData</i>. Wiley. https://doi.org/10.15200/winn.142867.72538 <a href=\"https://doi.org/10.15200/winn.142867.72538\">CrossRef</a> <a href=\"https://qlever.scholia.wiki/doi/10.15200/winn.142867.72538\">Scholia</a></div>\n  </div>",
      "summary": "Source: Wikipedia. CC-BY-SA April this year I blogged about an important SPARQL query for many chemists: getting CAS registry numbers from Wikidata. This is relevant for two reasons:",
      "image": "https://chem-bla-ics.linkedchemistry.info/assets/images/aceticAcidCAS.png",
      "date_published": "2015-12-22T00:00:00+00:00",
      "date_modified": "2025-05-25T00:00:00+00:00",
      "tags": ["cas","wikidata","chemistry"],
      "_references": [
        
          
          
            { "url": "https://doi.org/10.15200/winn.142867.72538", "doi": "10.15200/winn.142867.72538"
             }
            
          
        ],
      
      
      
      
      
      
        "authors": [ { "name": "Egon Willighagen", "url": "https://orcid.org/0000-0001-7542-0286" } ]
      
    }

  ]
}
