A set of SPARQL examples that are used in LOTUS
Compounds found in taxa and their families.
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
#title: Compounds counts in taxa and their families.
SELECT DISTINCT ?compound ?compound_inchikey ?taxon ?taxon_name ?supertaxon ?supertaxon_name WHERE {
VALUES ?rank {
wd:Q35409 # family
}
?compound wdt:P235 ?compound_inchikey;
wdt:P703 ?taxon.
?taxon (wdt:P171+) ?supertaxon;
wdt:P225 ?taxon_name.
?supertaxon wdt:P105 ?rank;
wdt:P225 ?supertaxon_name.
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?compound"):::projected
v3("?compound_inchikey"):::projected
v1("?rank")
v5("?supertaxon"):::projected
v7("?supertaxon_name"):::projected
v4("?taxon"):::projected
v6("?taxon_name"):::projected
bind0[/VALUES ?rank/]
bind0-->v1
bind00(["wd:Q35409"])
bind00 --> bind0
v2 --"wdt:P235"--> v3
v2 --"wdt:P703"--> v4
v4 --"wdt:P171"--> v5
v4 --"wdt:P225"--> v6
v5 --"wdt:P105"--> v1
v5 --"wdt:P225"--> v7