lotus-sparql-examples

A set of SPARQL examples that are used in LOTUS

View the Project on GitHub lotusnprod/lotus-sparql-examples

wd_maintenance_chemicals_inchi_no_inchikey

rq turtle/ttl

Chemicals with InChI but no InChIKey.

Use at


PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
#title: Chemicals with InChI but no InChIKey
SELECT ?structure ?inchi WHERE {
    VALUES ?classes {
        wd:Q113145171
        wd:Q59199015
    }
    ?structure wdt:P234 ?inchi.
    ?structure wdt:P31 ?classes.
    OPTIONAL { ?structure wdt:P235 ?inchikey. }
    FILTER(!(BOUND(?inchikey)))
}

graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v2("?classes")
  v4("?inchi"):::projected 
  v1("?inchikey")
  v3("?structure"):::projected 
  f0[["not bound(?inchikey)"]]
  f0 --> v1
  bind1[/VALUES ?classes/]
  bind1-->v2
  bind10(["wd:Q113145171"])
  bind10 --> bind1
  bind11(["wd:Q59199015"])
  bind11 --> bind1
  v3 --"wdt:P234"-->  v4
  v3 --"wdt:P31"-->  v2
  subgraph optional0["(optional)"]
  style optional0 fill:#bbf,stroke-dasharray: 5 5;
    v3 -."wdt:P235".->  v1
  end