query-1e76748128730fdb93146ef74f1e0237

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/>
SELECT ?label (count(?film) AS ?count)
WHERE {
  [] wdt:P31/wdt:P279* wd:Q24716199; wikibase:directClaim ?p .
  ?film wdt:P31/wdt:P279* wd:Q11424; ?p [ wdt:P2899 ?age ] .
  BIND(IF( 0 <= ?age && ?age < 6, "00-05",
          IF( 6 <= ?age && ?age < 12, "06-11",
             IF( 12 <= ?age && ?age < 18, "12-17",
                IF( 18 <= ?age, "18+", "" ) ) ) )
       AS ?label)
} GROUP BY ?label ORDER BY ASC(?label)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?age") v5("?count") v3("?film"):::projected v5("?label"):::projected v2("?p") a1((" ")) a2((" ")) a3((" ")) a4((" ")) c3(["wd:Q24716199"]):::iri c5(["wd:Q11424"]):::iri a1 --"wdt:P31"--> a2 a2 --"wdt:P279"--> c3 a1 --"wikibase:directClaim"--> v2 v3 --"wdt:P31"--> a3 a3 --"wdt:P279"--> c5 a4 --"wdt:P2899"--> v4 v3 -->v2--> a4 bind0[/"if('0^^xsd:integer' <= ?age?age < '6^^xsd:integer','00-05',if('6^^xsd:integer' <= ?age?age < '12^^xsd:integer','06-11',if('12^^xsd:integer' <= ?age?age < '18^^xsd:integer','12-17',if('18^^xsd:integer' <= ?age,'18+',''))))"/] v4 --o bind0 bind0 --as--o v5 bind2[/"count(?film)"/] v3 --o bind2 bind2 --as--o v5