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_inchi

rq turtle/ttl

Chemicals which should have an isomeric SMILES but do not.

Use at


PREFIX wdt: <http://www.wikidata.org/prop/direct/>
#title: Chemicals which should have an isomeric SMILES but do not
SELECT ?structure ?inchi WHERE {
    ?structure wdt:P234 ?inchi.
    OPTIONAL { ?structure wdt:P2017 ?smiles_i. }
    FILTER(!(BOUND(?smiles_i)))
    FILTER(REGEX(STR(?inchi), "/[btsmi]"))
}

graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v1("?inchi"):::projected 
  v2("?smiles_i")
  v3("?structure"):::projected 
  f0[["regex(str(?inchi),'/#91;btsmi#93;')"]]
  f0 --> v1
  f1[["not bound(?smiles_i)"]]
  f1 --> v2
  v3 --"wdt:P234"-->  v1
  subgraph optional0["(optional)"]
  style optional0 fill:#bbf,stroke-dasharray: 5 5;
    v3 -."wdt:P2017".->  v2
  end