query-f350a1ededc51bd908a096e4c10b3231

rq turtle/ttl

Tatort episodes by year

Use at

PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
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#>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX v: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>

SELECT ?year (COUNT(?ordinal) AS ?count) WHERE {

SELECT ?ordinal (MIN(?publication) AS ?pub) (YEAR(?pub) AS ?year) WHERE {
    ?film p:P179 ?series . ?series v:P179 wd:Q689438 . ?series pq:P1545 ?ordinal . FILTER(xsd:integer(?ordinal)<10000)
    ?film wdt:P577 ?publication
    SERVICE wikibase:label { bd:serviceParam wikibase:language "de" }
}
GROUP BY ?ordinal
}
GROUP BY ?year
ORDER BY ?year

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v7("?count") v3("?film") v2("?ordinal"):::projected v6("?pub") v5("?publication") v4("?series") v7("?year"):::projected c10(["de"]):::literal c8(["bd:serviceParam"]):::iri c4(["wd:Q689438"]):::iri f0[["http://www.w3.org/2001/XMLSchema#integer(?ordinal) < '10000^^xsd:integer'"]] f0 --> v2 v3 --"p:P179"--> v4 v4 --"p:statement/P179"--> c4 v4 --"p:qualifier/P1545"--> v2 v3 --"p:direct/P577"--> v5 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c8 --"wikibase:language"--> c10 end bind2[/"min(?publication)"/] v5 --o bind2 bind2 --as--o v6 bind3[/"year-from-dateTime(?pub)"/] v6 --o bind3 bind3 --as--o v7 bind5[/"count(?ordinal)"/] v2 --o bind5 bind5 --as--o v7