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_no_smiles_isomeric_no_mass

rq turtle/ttl

Chemicals without isomeric SMILES with InChI but no mass.

Use at


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

graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v3("?classes")
  v5("?inchi")
  v1("?mass")
  v2("?smiles"):::projected 
  v4("?structure"):::projected 
  f0[["not bound(?mass)"]]
  f0 --> v1
  f1[["not bound(?smiles)"]]
  f1 --> v2
  bind2[/VALUES ?classes/]
  bind2-->v3
  bind20(["wd:Q113145171"])
  bind20 --> bind2
  bind21(["wd:Q59199015"])
  bind21 --> bind2
  v4 --"wdt:P234"-->  v5
  v4 --"wdt:P31"-->  v3
  subgraph optional0["(optional)"]
  style optional0 fill:#bbf,stroke-dasharray: 5 5;
    v4 -."wdt:P2017".->  v2
  end
  subgraph optional1["(optional)"]
  style optional1 fill:#bbf,stroke-dasharray: 5 5;
    v4 -."wdt:P2067".->  v1
  end