Selecting Wikipedia articles by InChI

  1. Using dbpedia + SPARQL:
    SELECT DISTINCT ?compound WHERE {  
      ?compound a <http://dbpedia.org/ontology/ChemicalCompound> .
      ?compound <http://dbpedia.org/property/section> ?section .
      ?section <http://dbpedia.org/property/inchi> "1/C6H3Cl3/c7-4-1-2-5(8)6(9)3-4/h1-3H"@en
    }
    
  2. In theory, using WikiXMLDB (Sedna) + XQuery:
    declare default element namespace "http://www.mediawiki.org/xml/export-0.3/";  
    declare ordering unordered; 
    doc("wiki")/mediawiki/page/revision/text/template[@head="Identifiers"]/field[@name="InChI"][. = "1/C6H3Cl3/c7-4-1-2-5(8)6(9)3-4/h1-3H"]
    
    but it times out due to lack of indexes (probably).
  3. Convert the InChI to a ChemSpider ID, then look up external references for that internal identifier:
    http://www.chemspider.com/InChI.asmx/InChIToCSID?inchi=InChI=1/C6H3Cl3/c7-4-1-2-5(8)6(9)3-4/h1-3H
    http://www.chemspider.com/Search.asmx/CSID2ExtRefs?token=YOUR_TOKEN&CSID=682&datasources=wikipedia
  4. As Egon points out in the comments, rdf.openmolecules.net provides a linking/metadata service for compounds (doesn't seem to work if the InChI is URL-encoded):
    http://rdf.openmolecules.net/?InChI=1/C6H3Cl3/c7-4-1-2-5(8)6(9)3-4/h1-3H

The infoboxes in Wikipedia don't seem to be using Standard InChIs yet - i'll be good if they can be updated programmatically from ChemSpider.