query-223920ee8f42783a0c826015c57edd4b

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/>
PREFIX bd: <http://www.bigdata.com/rdf#>
select ?championship ?championshipLabel (?total - ?numbefore as ?rank) where {
   {
      select (count(?allchampionship) as ?total) where {
        ?allchampionship wdt:P31 wd:Q9448.
      }
    }
    {
      SELECT ?championship (COUNT(?earlierChampionship) AS ?numbefore) WHERE {
        ?championship wdt:P31 wd:Q9448.

        ?earlierChampionship wdt:P31 wd:Q9448;
                             wdt:P155+ ?championship.
      }
      GROUP BY ?championship
    }
    SERVICE wikibase:label { bd:serviceParam wikibase:language "en". } 
}
ORDER BY ?rank

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?allchampionship") v4("?championship"):::projected v5("?earlierChampionship") v6("?numbefore"):::projected v7("?rank") v3("?total"):::projected c5(["bd:serviceParam"]):::iri c7(["en"]):::literal c2(["wd:Q9448"]):::iri v2 --"wdt:P31"--> c2 bind1[/"count(?allchampionship)"/] v2 --o bind1 bind1 --as--o v3 v4 --"wdt:P31"--> c2 v5 --"wdt:P31"--> c2 v5 --"wdt:P155"--> v4 bind3[/"count(?earlierChampionship)"/] v5 --o bind3 bind3 --as--o v6 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c5 --"wikibase:language"--> c7 end bind4[/"?total - ?numbefore"/] v3 --o bind4 v6 --o bind4 bind4 --as--o v7