query-3fa07b473100378958e90a7c53bb9205

rq turtle/ttl

TODO

Use at

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 ?NC_PEOPLE ?NC_PEOPLELabel ?lastname ?lastnameLabel ?count 

WHERE
{
   { SELECT ?NC_PEOPLE ?lastname ?count WHERE {
   {
  SELECT (COUNT(*) AS ?count) ?lastname WHERE {
    ?person wdt:P27 wd:Q20 . 
    ?person wdt:P734 ?lastname . 
  } GROUP BY ?lastname HAVING (?count > 99) }  ?NC_PEOPLE wdt:P734 ?lastname .
  FILTER NOT EXISTS {?NC_PEOPLE wdt:P27 [] .}
  } }  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],nn,en". }
}
ORDER BY DESC(?count)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?NC_PEOPLE"):::projected v5("?count"):::projected v4("?lastname"):::projected v3("?person") a1((" ")) c6(["bd:serviceParam"]):::iri c3(["wd:Q20"]):::iri c8(["#91;AUTO_LANGUAGE#93;,nn,en"]):::literal f0[["not "]] subgraph f0e0["Exists Clause"] e0v1 --"wdt:P27"--> e0a1 e0v1("?NC_PEOPLE"):::projected e0a1((" ")):::projected end f0--EXISTS--> f0e0 f0 --> v2 f0 --> c1 f0 --> a1 v2 --"wdt:P27"--> a1 f1[["?count > '99^^xsd:integer'"]] f1 --> v5 v3 --"wdt:P27"--> c3 v3 --"wdt:P734"--> v4 bind3[/"count(*)"/] bind3 --as--o v5 v2 --"wdt:P734"--> v4 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c6 --"wikibase:language"--> c8 end