A set of SPARQL examples that are used in LOTUS
Compounds found in Arabidopsis thaliana (Q158695) or children taxa.
PREFIX bd: <http://www.bigdata.com/rdf#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wikibase: <http://wikiba.se/ontology#>
#title: Compounds found in Arabidopsis thaliana (Q158695) or children taxa.
SELECT DISTINCT ?compound ?compoundLabel ?compound_inchikey WHERE {
VALUES ?taxon {
wd:Q158695 # You can remove the Qxxxxxx and hit Ctrl+space, type the first letters and it should autocomplete
}
?children (wdt:P171*) ?taxon. # Include children taxa
?compound wdt:P235 ?compound_inchikey; # Get the InChIKey
wdt:P703 ?children. # Found in given taxon/taxa
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en". }
}
LIMIT 10000
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?children")
v3("?compound"):::projected
v4("?compound_inchikey"):::projected
v1("?taxon")
c5([http://www.bigdata.com/rdf#serviceParam]):::iri
c7(["#91;AUTO_LANGUAGE#93;,mul,en"]):::literal
bind0[/VALUES ?taxon/]
bind0-->v1
bind00(["wd:Q158695"])
bind00 --> bind0
v2 --"wdt:P171"--> v1
v3 --"wdt:P235"--> v4
v3 --"wdt:P703"--> v2
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c5 --"wikibase:language"--> c7
end