query-7fbc87ab02de0b68cbff7b3f298af364
TODO
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 (COUNT(?lastname) AS ?count) ?lastname ?lastnameLabel WHERE {
?person wdt:P27 wd:Q20.
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE]". }
OPTIONAL { ?person wdt:P734 ?lastname. }.
}
GROUP BY ?lastname ?lastnameLabel
ORDER BY DESC(?count)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?count")
v3("?lastname"):::projected
v2("?person")
c4(["bd:serviceParam"]):::iri
c6(["#91;AUTO_LANGUAGE#93;"]):::literal
c2(["wd:Q20"]):::iri
v2 --"wdt:P27"--> c2
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c4 --"wikibase:language"--> c6
end
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P734".-> v3
end
bind1[/"count(?lastname)"/]
v3 --o bind1
bind1 --as--o v4