A set of SPARQL examples that are used in LOTUS
Chemical classes defined by canonical SMILES.
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
#title: Chemical classes defined by canonical SMILES
SELECT * WHERE {
    VALUES ?instance {
        wd:Q15711994 # group of isomeric entities
        wd:Q17339814 # group or class of chemical substances
        wd:Q47154513 # structural class of chemical entities
        wd:Q55640599 # group of chemical entities
        wd:Q56256173 # class of chemical entities with similar applications or functions
        wd:Q56256178 # class of chemical entities with similar source or occurrence
        wd:Q55662456 # group of ortho, meta, para isomers
        # wd:Q59199015 # group of stereoisomers # TODO see later on when fast enough
        wd:Q72070508 # group or class of chemical entities
        wd:Q74892521 # imprecise class of chemical entities
    }
    ?class wdt:P31 ?instance.
    ?class wdt:P233 ?structure.
    OPTIONAL { ?class p:P2017 ?isomeric. }
    FILTER(!(BOUND(?isomeric)))
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v3("?class"):::projected 
  v2("?instance"):::projected 
  v1("?isomeric"):::projected 
  v4("?structure"):::projected 
  f0[["not bound(?isomeric)"]]
  f0 --> v1
  bind1[/VALUES ?instance/]
  bind1-->v2
  bind10(["wd:Q15711994"])
  bind10 --> bind1
  bind11(["wd:Q17339814"])
  bind11 --> bind1
  bind12(["wd:Q47154513"])
  bind12 --> bind1
  bind13(["wd:Q55640599"])
  bind13 --> bind1
  bind14(["wd:Q56256173"])
  bind14 --> bind1
  bind15(["wd:Q56256178"])
  bind15 --> bind1
  bind16(["wd:Q55662456"])
  bind16 --> bind1
  bind17(["wd:Q72070508"])
  bind17 --> bind1
  bind18(["wd:Q74892521"])
  bind18 --> bind1
  v3 --"p:direct/P31"-->  v2
  v3 --"p:direct/P233"-->  v4
  subgraph optional0["(optional)"]
  style optional0 fill:#bbf,stroke-dasharray: 5 5;
    v3 -."p:P2017".->  v1
  end