query-e294755329f2305681cedc770600f0fb
title: Which pigments are found in which taxa, according to which reference?
special thanks goes to User:Lmichan for updating this information!
SELECT DISTINCT ?compound ?compoundLabel ?taxon ?taxonname ?DOI WITH { SELECT ?compound WHERE { ?compound (wdt:P31/wdt:P279) wd:Q161179. # get pigments } } AS %compounds WITH { SELECT ?compound ?P703statement WHERE { INCLUDE %compounds ?compound p:P703 ?P703statement. # check for "found in taxon" statements } } AS %P703statement WITH { SELECT ?compound ?taxon ?DOI WHERE { INCLUDE %P703statement ?P703statement ps:P703 ?taxon ; # get the respective taxa prov:wasDerivedFrom / pr:P248 [ # get the reference supporting that statement wdt:P356 ?DOI # get the DOI for the reference ] . } } AS %taxa WHERE { { INCLUDE %taxa
?taxon wdt:P225 ?taxonname . # get the taxon name
} ?compound rdfs:label ?compoundLabel . # get compound labels FILTER (LANG(?compoundLabel) = "en") . # filter for English } ORDER BY ASC(?compoundLabel) LIMIT 10000 title: Which pigments are found in which taxa, according to which reference?
special thanks goes to User:Lmichan for updating this information!
SELECT DISTINCT ?compound ?compoundLabel ?taxon ?taxonname ?DOI WITH { SELECT ?compound WHERE { ?compound (wdt:P31/wdt:P279) wd:Q161179. # get pigments } } AS %compounds WITH { SELECT ?compound ?P703statement WHERE { INCLUDE %compounds ?compound p:P703 ?P703statement. # check for "found in taxon" statements } } AS %P703statement WITH { SELECT ?compound ?taxon ?DOI WHERE { INCLUDE %P703statement ?P703statement ps:P703 ?taxon ; # get the respective taxa prov:wasDerivedFrom / pr:P248 [ # get the reference supporting that statement wdt:P356 ?DOI # get the DOI for the reference ] . } } AS %taxa WHERE { { INCLUDE %taxa
?taxon wdt:P225 ?taxonname . # get the taxon name
} ?compound rdfs:label ?compoundLabel . # get compound labels FILTER (LANG(?compoundLabel) = "en") . # filter for English } ORDER BY ASC(?compoundLabel) LIMIT 10000 title: Which pigments are found in which taxa, according to which reference?
special thanks goes to User:Lmichan for updating this information!
SELECT DISTINCT ?compound ?compoundLabel ?taxon ?taxonname ?DOI WITH { SELECT ?compound WHERE { ?compound (wdt:P31/wdt:P279) wd:Q161179. # get pigments } } AS %compounds WITH { SELECT ?compound ?P703statement WHERE { INCLUDE %compounds ?compound p:P703 ?P703statement. # check for "found in taxon" statements } } AS %P703statement WITH { SELECT ?compound ?taxon ?DOI WHERE { INCLUDE %P703statement ?P703statement ps:P703 ?taxon ; # get the respective taxa prov:wasDerivedFrom / pr:P248 [ # get the reference supporting that statement wdt:P356 ?DOI # get the DOI for the reference ] . } } AS %taxa WHERE { { INCLUDE %taxa
?taxon wdt:P225 ?taxonname . # get the taxon name
} ?compound rdfs:label ?compoundLabel . # get compound labels FILTER (LANG(?compoundLabel) = "en") . # filter for English } ORDER BY ASC(?compoundLabel) LIMIT 10000 title: Which pigments are found in which taxa, according to which reference?
special thanks goes to User:Lmichan for updating this information!
SELECT DISTINCT ?compound ?compoundLabel ?taxon ?taxonname ?DOI WITH { SELECT ?compound WHERE { ?compound (wdt:P31/wdt:P279) wd:Q161179. # get pigments } } AS %compounds WITH { SELECT ?compound ?P703statement WHERE { INCLUDE %compounds ?compound p:P703 ?P703statement. # check for "found in taxon" statements } } AS %P703statement WITH { SELECT ?compound ?taxon ?DOI WHERE { INCLUDE %P703statement ?P703statement ps:P703 ?taxon ; # get the respective taxa prov:wasDerivedFrom / pr:P248 [ # get the reference supporting that statement wdt:P356 ?DOI # get the DOI for the reference ] . } } AS %taxa WHERE { { INCLUDE %taxa
?taxon wdt:P225 ?taxonname . # get the taxon name
} ?compound rdfs:label ?compoundLabel . # get compound labels FILTER (LANG(?compoundLabel) = "en") . # filter for English } ORDER BY ASC(?compoundLabel) LIMIT 10000 title: Which pigments are found in which taxa, according to which reference?
special thanks goes to User:Lmichan for updating this information!
SELECT DISTINCT ?compound ?compoundLabel ?taxon ?taxonname ?DOI WITH { SELECT ?compound WHERE { ?compound (wdt:P31/wdt:P279) wd:Q161179. # get pigments } } AS %compounds WITH { SELECT ?compound ?P703statement WHERE { INCLUDE %compounds ?compound p:P703 ?P703statement. # check for "found in taxon" statements } } AS %P703statement WITH { SELECT ?compound ?taxon ?DOI WHERE { INCLUDE %P703statement ?P703statement ps:P703 ?taxon ; # get the respective taxa prov:wasDerivedFrom / pr:P248 [ # get the reference supporting that statement wdt:P356 ?DOI # get the DOI for the reference ] . } } AS %taxa WHERE { { INCLUDE %taxa
?taxon wdt:P225 ?taxonname . # get the taxon name
} ?compound rdfs:label ?compoundLabel . # get compound labels FILTER (LANG(?compoundLabel) = "en") . # filter for English } ORDER BY ASC(?compoundLabel) LIMIT 10000 title: Which pigments are found in which taxa, according to which reference?
special thanks goes to User:Lmichan for updating this information!
SELECT DISTINCT ?compound ?compoundLabel ?taxon ?taxonname ?DOI WITH { SELECT ?compound WHERE { ?compound (wdt:P31/wdt:P279) wd:Q161179. # get pigments } } AS %compounds WITH { SELECT ?compound ?P703statement WHERE { INCLUDE %compounds ?compound p:P703 ?P703statement. # check for "found in taxon" statements } } AS %P703statement WITH { SELECT ?compound ?taxon ?DOI WHERE { INCLUDE %P703statement ?P703statement ps:P703 ?taxon ; # get the respective taxa prov:wasDerivedFrom / pr:P248 [ # get the reference supporting that statement wdt:P356 ?DOI # get the DOI for the reference ] . } } AS %taxa WHERE { { INCLUDE %taxa
?taxon wdt:P225 ?taxonname . # get the taxon name
} ?compound rdfs:label ?compoundLabel . # get compound labels FILTER (LANG(?compoundLabel) = "en") . # filter for English } ORDER BY ASC(?compoundLabel) LIMIT 10000
Use at
- https://query.wikidata.org/sparql
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX pr: <http://www.wikidata.org/prop/reference/>
PREFIX p: <http://www.wikidata.org/prop/>
#title: Which pigments are found in which taxa, according to which reference?
# special thanks goes to User:Lmichan for updating this information!
SELECT DISTINCT ?compound ?compoundLabel ?taxon ?taxonname ?DOI
WHERE {
{
{
SELECT ?compound ?taxon ?DOI WHERE {
{
SELECT ?compound ?P703statement WHERE {
INCLUDE %compounds
?compound p:P703 ?P703statement. # check for "found in taxon" statements
}
} ?P703statement ps:P703 ?taxon ; # get the respective taxa
prov:wasDerivedFrom / pr:P248 [ # get the reference supporting that statement
wdt:P356 ?DOI # get the DOI for the reference
] .
}
}
?taxon wdt:P225 ?taxonname . # get the taxon name
}
?compound rdfs:label ?compoundLabel . # get compound labels
FILTER (LANG(?compoundLabel) = "en") . # filter for English
}
ORDER BY ASC(?compoundLabel)
LIMIT 10000
Query found at
- https://www.wikidata.org/wiki/Wikidata:WikiProject_Chemistry_Natural_products/de
- https://www.wikidata.org/wiki/Wikidata:WikiProject_Chemistry_Natural_products/en
- https://www.wikidata.org/wiki/Wikidata:WikiProject_Chemistry_Natural_products/fr
- https://www.wikidata.org/wiki/Wikidata:WikiProject_Chemistry_Natural_products/it
- https://www.wikidata.org/wiki/Wikidata:WikiProject_Chemistry_Natural_products/nl
- https://www.wikidata.org/wiki/Wikidata:WikiProject_Chemistry_Natural_products/ru