A set of SPARQL examples that are used in LOTUS
Chemicals with InChI but no isomeric SMILES.
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
#title: Chemicals with InChI but no isomeric SMILES
SELECT ?structure ?inchi WHERE {
VALUES ?classes {
wd:Q113145171
wd:Q59199015
}
?structure wdt:P234 ?inchi.
?structure wdt:P31 ?classes.
OPTIONAL { ?structure wdt:P233 ?smiles_can. }
FILTER(!(BOUND(?smiles_can)))
OPTIONAL { ?structure wdt:P2017 ?smiles_iso. }
FILTER(!(BOUND(?smiles_iso)))
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?classes")
v5("?inchi"):::projected
v2("?smiles_can")
v1("?smiles_iso")
v4("?structure"):::projected
f0[["not bound(?smiles_iso)"]]
f0 --> v1
f1[["not bound(?smiles_can)"]]
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:P233".-> v2
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v4 -."wdt:P2017".-> v1
end