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) ?ref.
SERVICE wdsubgraph:scholarly_articles {
?ref 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;
v6("?DOI"):::projected
v3("?P703statement")
v2("?compound"):::projected
v1("?compoundLabel"):::projected
v5("?ref")
v4("?taxon"):::projected
v7("?taxonname"):::projected
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"--> v5
subgraph s1["https://query.wikidata.org/subgraph/scholarly_articles"]
style s1 stroke-width:4px;
v5 --"p:direct/P356"--> v6
end
v4 --"p:direct/P225"--> v7
v2 --"rdfs:label"--> v1