A set of SPARQL examples that are used in LOTUS
Parent taxa containing the most oleanane triterpenoids (Q108544891) similar to those found in Quillaja saponaria (Q2382775).
PREFIX hint: <http://www.bigdata.com/queryHints#>
PREFIX idsm: <https://idsm.elixir-czech.cz/sparql/endpoint/>
PREFIX sachem: <http://bioinfo.uochb.cas.cz/rdf/v1.0/sachem#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
#title: Parent taxa containing the most oleanane triterpenoids (Q108544891) similar to those found in Quillaja saponaria (Q2382775).
SELECT DISTINCT ?parent_taxon ?parent_taxon_name (COUNT(DISTINCT ?compound) AS ?count) WHERE {
SERVICE idsm:wikidata {
VALUES ?CUTOFF {
"0.9"^^xsd:double
}
SERVICE <https://query.wikidata.org/bigdata/namespace/wdq/sparql> {
VALUES ?taxon_1 {
wd:Q2382775
}
VALUES ?class {
wd:Q108544891
}
?compound wdt:P233 ?compound_smiles;
wdt:P703/(wdt:P171*) ?taxon_1;
wdt:P279 ?compound_class.
FILTER(?compound_class = ?class)
}
?compound sachem:similarCompoundSearch [
sachem:query ?compound_smiles;
sachem:cutoff ?CUTOFF
].
} hint:Prior hint:runFirst true.
?compound wdt:P703/wdt:P171 ?parent_taxon.
?parent_taxon wdt:P225 ?parent_taxon_name.
}
GROUP BY ?parent_taxon ?parent_taxon_name
ORDER BY DESC (?count)
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?CUTOFF")
v6("?class")
v6("?compound"):::projected
v3("?compound_class")
v7("?compound_smiles")
v10("?count")
v8("?parent_taxon"):::projected
v9("?parent_taxon_name"):::projected
v5("?taxon_1")
a1((" "))
a2((" "))
a3((" "))
c10([http://www.bigdata.com/queryHints#Prior]):::iri
c12(["true^^xsd:boolean"]):::literal
subgraph s1["https://idsm.elixir-czech.cz/sparql/endpoint/wikidata"]
style s1 stroke-width:4px;
bind0[/VALUES ?CUTOFF/]
bind0-->v2
bind00(["0.9^^xsd:double"])
bind00 --> bind0
subgraph s2["https://query.wikidata.org/bigdata/namespace/wdq/sparql"]
style s2 stroke-width:4px;
f1[["?compound_class = ?class"]]
f1 --> v3
f1 --> v6
bind2[/VALUES ?taxon_1/]
bind2-->v5
bind20(["wd:Q2382775"])
bind20 --> bind2
bind3[/VALUES ?class/]
bind3-->v6
bind30(["wd:Q108544891"])
bind30 --> bind3
v6 --"wdt:P233"--> v7
v6 --"wdt:P703"--> a1
a1 --"wdt:P171"--> v5
v6 --"wdt:P279"--> v3
end
a2 --"sachem:query"--> v7
a2 --"sachem:cutoff"--> v2
v6 --"sachem:similarCompoundSearch"--> a2
end
c10 --http://www.bigdata.com/queryHints#runFirst--> c12
v6 --"wdt:P703"--> a3
a3 --"wdt:P171"--> v8
v8 --"wdt:P225"--> v9
bind5[/"count(?compound)"/]
v6 --o bind5
bind5 --as--o v10