query-d3061c9f30ed292e97a28b7c2ac6abb9
Individuals
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT
?individuals
?taxon ?taxonLabel
(CONCAT("#taxon/", SUBSTR(STR(?taxon), 32)) AS ?taxonUrl)
?taxonDescription
?example_individual ?example_individualLabel
WHERE {
{
SELECT
(COUNT(DISTINCT ?individual) AS ?individuals)
?taxon
(SAMPLE(?individual) AS ?example_individual)
WHERE {
?taxon wdt:P31 wd:Q16521 .
# wdt:P31 could also be considered
?individual wdt:P10241 ?taxon .
}
GROUP BY ?taxon
} SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY DESC(?individuals)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?example_individual"):::projected
v3("?individual")
v4("?individuals"):::projected
v2("?taxon"):::projected
v5("?taxonUrl")
c5(["bd:serviceParam"]):::iri
c7(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c2(["wd:Q16521"]):::iri
v2 --"wdt:P31"--> c2
v3 --"wdt:P10241"--> v2
bind2[/"count(?individual)"/]
v3 --o bind2
bind2 --as--o v4
bind3[/"sample(?individual)"/]
v3 --o bind3
bind3 --as--o v4
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c5 --"wikibase:language"--> c7
end
bind4[/"concat('#taxon/',substring(str(?taxon),'32^^xsd:integer'))"/]
v2 --o bind4
bind4 --as--o v5