User:William Avery/Taxonomic SPARQL
Incomplete recombination data
editSELECT ?item ?taxonname
WHERE
{
?item p:P225 ?name.
?name ps:P225 ?taxonname.
?name pq:P3831 wd:Q14594740.
FILTER NOT EXISTS {
?item ps:1403 [].
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
LIMIT 100
List of tephritid taxa and who named them by exploded parent_taxon relationship
editSELECT ?taxonname ?authLabel ?year
WHERE
{
?tephs wdt:P171+ wd:Q626843.
?tephs p:P225 ?name.
?name ps:P225 ?taxonname.
?name pq:P405 ?auth.
?name pq:P574 ?year.
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
ORDER BY ?authLabel
Taxa published by Alexey Diakonoff ordered by year of publication
editSELECT ?taxonname ?authLabel ?year
WHERE
{
?taxa p:P225 ?name.
?name ps:P225 ?taxonname.
?name pq:P405 wd:Q4721312.
?name pq:P405 ?auth.
?name pq:P574 ?year.
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
ORDER BY ?year
Iguania species names that have a year of publication but no author
editSELECT ?taxonitem ?taxonname
WHERE
{
?taxonitem wdt:P171+ wd:Q661136. # Iguania
?taxonitem p:P105 ?rank.
?rank ps:P105 wd:Q7432. # species
?taxonitem p:P225 ?name.
?name ps:P225 ?taxonname.
FILTER EXISTS {
?name pq:P574 [] . # Year of taxon publication
}
FILTER NOT EXISTS {
?name pq:P405 [] . # taxon author
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
Supposed tribes of butterflies that don't have an English Wikipedia article
editSELECT ?taxonitem ?taxonname
WHERE
{
?taxonitem wdt:P171+ wd:Q756153. # Papilionoidea
?taxonitem p:P105 ?rank.
?rank ps:P105 wd:Q227936. # tribe
?taxonitem p:P225 ?name.
?name ps:P225 ?taxonname.
FILTER NOT EXISTS {
?sitelink schema:about ?taxonitem;
schema:isPartOf <https://en.wikipedia.org/>;
schema:name [].
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
Saturniidae that have a GBIF Id and an English Wikipedia article, but no taxon author
editSELECT ?taxonitem ?taxonname
WHERE
{
?taxonitem wdt:P171+ wd:Q843104. # Saturniidae
?taxonitem p:P105 ?rank.
?taxonitem p:P225 ?name.
?taxonitem p:P846 ?gbif_id.
?name ps:P225 ?taxonname.
FILTER NOT EXISTS {
?name pq:P405 [] . # taxon author
}
FILTER EXISTS {
?sitelink schema:about ?taxonitem;
schema:isPartOf <https://en.wikipedia.org/>;
schema:name [].
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
Taxon names that are "instance of" recombination instead of "object has role"
editSELECT (COUNT(?name) AS ?count)
WHERE
{
?taxa p:P225 ?name.
?name pq:P31 wd:Q14594740.
}
Pairs of gastropod names that are a recombination and its protonym, and both have site links on English Wikipedia
editSELECT ?recombination ?taxonname ?ocitem ?octaxonname
WHERE
{
?recombination wdt:P171+ wd:Q4867740. #Gastropoda
?recombination p:P225 ?name.
?name ps:P225 ?taxonname.
?ocitem wdt:P2868 wd:Q14192851. #Role of protonym
?ocitem p:P225 ?ocname.
?ocname ps:P225 ?octaxonname.
?ocitem p:P2868 ?protonym.
?protonym pq:P642 ?recombination.
?sitelink schema:about ?recombination;
schema:isPartOf <https://en.wikipedia.org/>;
schema:name [].
?sitelink2 schema:about ?ocitem;
schema:isPartOf <https://en.wikipedia.org/>;
schema:name [].
} LIMIT 100
ButMoth WiP
editSELECT DISTINCT ?item ?islep WHERE {
?item wdt:P171* wd:Q7674891.
?item p:P3060 [].
bind(if( exists { ?item wdt:P171+ wd:Q28319}, true, false) AS ?islep)
filter not exists { ?item wdt:P171+ wd:Q28319}
}
limit 10
SELECT DISTINCT ?item WHERE {
?item p:P3060 [].
MINUS {
?item wdt:P171+ wd:Q28319
}
}
SELECT DISTINCT ?item ?itemLabel WHERE {
?item wdt:P171+ wd:Q22671.
?item p:P3060 [].
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
Protonyms with duplicate names
editSELECT ?taxonname (count(?item) as ?count)
WHERE
{
?item wdt:P171+ wd:Q980146.
?item p:P225 ?name.
?name ps:P225 ?taxonname.
?item p:P2868 ?statement0.
?statement0 ps:P2868 wd:Q14192851.
} group by ?taxonname having( count(?item) > 1)
order by DESC(?count)
A bit fishy
editSELECT ?itemLabel (COUNT(?item) AS ?ct)
WHERE
{
?item wdt:P171+ wd:Q127282.
?item p:P31 ?inst.
?inst ps:P31 wd:Q16521. # extant, not extinct or fossil
?item p:P225 ?name.
?name ps:P225 ?taxonname.
?item p:P105 ?rank.
?rank ps:P105 wd:Q7432. # species
?item schema:description ?itemLabel.
FILTER (LANG(?itemLabel) = "en" && STR(?itemLabel) != 'species of fish')
} GROUP BY ?itemLabel
ORDER BY DESC(?ct)