A set of SPARQL examples that are used in LOTUS
Pigments found in taxa, with reference.
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX pr: <http://www.wikidata.org/prop/reference/>
PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdsubgraph: <https://query.wikidata.org/subgraph/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
#title: Pigments found in taxa, with reference.
# special thanks goes to User:Lmichan for updating this information!
SELECT DISTINCT ?compound ?compoundLabel ?taxon ?taxonname ?DOI WHERE {
?compound p:P703 ?P703statement;
((wdt:P31*)/(wdt:P279*)) wd:Q161179.
?P703statement ps:P703 ?taxon;
(prov:wasDerivedFrom/pr:P248) _:b26.
_:b26 wdt:P356 ?DOI.
?taxon wdt:P225 ?taxonname.
?compound rdfs:label ?compoundLabel.
FILTER((LANG(?compoundLabel)) = "en")
}
ORDER BY (?compoundLabel)
LIMIT 10000
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v5("?DOI"):::projected
v3("?P703statement")
v2("?compound"):::projected
v1("?compoundLabel"):::projected
v4("?taxon"):::projected
v6("?taxonname"):::projected
a3((" "))
a1((" "))
a2((" "))
c5(["wd:Q161179"]):::iri
f0[["?compoundLabel = 'en'"]]
f0 --> v1
v2 --"p:P703"--> v3
v2 --"p:direct/P31"--> a1
a1 --"p:direct/P279"--> c5
v3 --"p:statement/P703"--> v4
v3 --"prov:wasDerivedFrom"--> a2
a2 --"p:reference/P248"--> a3
a3 --"p:direct/P356"--> v5
v4 --"p:direct/P225"--> v6
v2 --"rdfs:label"--> v1