query-15a6af74343ef0fb9b9a501beb8ca78b

rq turtle/ttl

Top Spanish given name without property assigned

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 ?givenCandidate (COUNT(?item) AS ?count) WHERE {
  {
    SELECT ?item ?itemLabel WHERE {
      {
        SELECT ?item WHERE {
          ?item wdt:P27 wd:Q29;
            wdt:P31 wd:Q5.
          FILTER(NOT EXISTS { ?item wdt:P735 ?given. })
        }
      }
      SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],es". }
    }
  }
  BIND(STRBEFORE(STR(?itemLabel), " ") AS ?givenCandidate)
}
GROUP BY ?givenCandidate
ORDER BY DESC(COUNT(?item))

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?_anon_d00291b7e9a143df8ec0be8c8ebd714c126461") v5("?count") v2("?given") v3("?givenCandidate"):::projected v1("?item"):::projected a1((" ")) c3(["wd:Q29"]):::iri c7(["bd:serviceParam"]):::iri c9(["#91;AUTO_LANGUAGE#93;,es"]):::literal c5(["wd:Q5"]):::iri f0[["not "]] subgraph f0e0["Exists Clause"] e0v1 --"wdt:P735"--> e0v2 e0v2("?given"):::projected e0v1("?item"):::projected end f0--EXISTS--> f0e0 f0 --> v1 f0 --> c1 f0 --> v2 v1 --"wdt:P735"--> v2 v1 --"wdt:P27"--> c3 v1 --"wdt:P31"--> c5 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c7 --"wikibase:language"--> c9 end bind1[/"substring-before(str(?itemLabel),' ')"/] null --o bind1 bind1 --as--o v3 bind4[/"count(?item)"/] v1 --o bind4 bind4 --as--o v4 bind5[/"count(?item)"/] v1 --o bind5 bind5 --as--o v5