query-8a0bb0a36554d656155ff6e493b8e49a

rq turtle/ttl

18:45, 16 January 2016 (UTC)) talk (Jobu0101Why does this query not work and how do I fix it? --: I think what you want is this:Jobu0101@

Use at

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
SELECT ?prefix (COUNT(DISTINCT(?imdb)) AS ?number) WHERE {
  ?item wdt:P345 ?imdb
  BIND (SUBSTR(?imdb,1,2) AS ?prefix)     
} GROUP BY ?prefix ORDER BY DESC(?number)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?imdb"):::projected v2("?item") v5("?number") v4("?prefix"):::projected v2 --"wdt:P345"--> v3 bind0[/"substring(?imdb,'1^^xsd:integer','2^^xsd:integer')"/] v3 --o bind0 bind0 --as--o v4 bind2[/"count(?imdb)"/] v3 --o bind2 bind2 --as--o v5