query-aa8cefa553243dc873808cd94e283af3

rq turtle/ttl

TODO

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 schema: <http://schema.org/>
PREFIX bd: <http://www.bigdata.com/rdf#>
select distinct ?item ?itemLabel ?num (count(?link) as ?links) where {
  values ?item_class {wd:Q34 wd:Q183}
  ?item wdt:P27 ?item_class.
  ?item wdt:P21 wd:Q6581072.
  ?item wdt:P31 wd:Q5.
  optional {?link schema:about ?item; schema:isPartOf [wikibase:wikiGroup 'wikipedia']}
  bind(xsd:integer(substr(str(?item), 33)) as ?num).
  service wikibase:label {bd:serviceParam wikibase:language "de,[AUTO_LANGUAGE]".}
}
group by ?item ?itemLabel ?num
order by desc(?links) asc(?num)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?item"):::projected v3("?item_class") v5("?link"):::projected v6("?links") v6("?num"):::projected a1((" ")) c3(["wd:Q6581072"]):::iri c11(["bd:serviceParam"]):::iri c5(["wd:Q5"]):::iri c8(["wikipedia"]):::literal c13(["de,#91;AUTO_LANGUAGE#93;"]):::literal bind0[/VALUES ?item_class/] bind0-->v3 bind00(["wd:Q34"]) bind00 --> bind0 bind01(["wd:Q183"]) bind01 --> bind0 v4 --"wdt:P27"--> v3 v4 --"wdt:P21"--> c3 v4 --"wdt:P31"--> c5 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v5 -."schema:about".-> v4 a1 --"wikibase:wikiGroup"--> c8 v5 --"schema:isPartOf"--> a1 end bind1[/"http://www.w3.org/2001/XMLSchema#integer(substring(str(?item),'33^^xsd:integer'))"/] v4 --o bind1 bind1 --as--o v6 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c11 --"wikibase:language"--> c13 end bind3[/"count(?link)"/] v5 --o bind3 bind3 --as--o v6