query-03e510cfa9c9bb6bb6368db2c9567665

rq turtle/ttl

Count only certain identifiersHi! Through the following query

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
SELECT ?type (COUNT(DISTINCT ?item) AS ?count) WHERE {
  ?item wdt:P9114 ?id .
  ?item wikibase:identifiers ?ids .
  BIND((?ids) AS ?type)
}
GROUP BY ?type
ORDER BY ?type

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v5("?count") v3("?id") v4("?ids") v2("?item"):::projected v5("?type"):::projected v2 --"wdt:P9114"--> v3 v2 --"wikibase:identifiers"--> v4 bind0[/"?ids"/] v4 --o bind0 bind0 --as--o v5 bind2[/"count(?item)"/] v2 --o bind2 bind2 --as--o v5