query-f205818658a25f41e7b2620be2ce5539

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 schema: <http://schema.org/>
PREFIX bd: <http://www.bigdata.com/rdf#>
select ?item ?itemLabel ?number
where {
  # include the numbers of sitelinks from above and filter out any numbers lower than n
  # the higher the number here, the fewer items there are to check and the faster this query will run
   { # select all the numbers of sitelinks
  select ?number (count(*) as ?total) { # we don't use ?total but without it the query times out, so we'll just ignore it
    [] wikibase:sitelinks ?number .
  } group by ?number
}.
  filter (?number > 50) .

  # find items where the number of sitelinks is one of the remaining numbers, i.e. greater than 40
  ?item wikibase:sitelinks ?number .

  # filter out various uninteresting things
  minus { ?item wdt:P31/wdt:P279* wd:Q11266439 . } # No templates
  minus { ?item wdt:P31/wdt:P279* wd:Q4167836 . } # No categories
  minus { ?item wdt:P31 wd:Q14204246 } # No project pages
  minus { ?item wdt:P31/wdt:P279* wd:Q15184295 . } # No modules
  minus { ?item wdt:P31 wd:Q17442446 } # No other Wikipedia/Help pages

  # filter out items which have an fa.wiki sitelink
  minus { ?article schema:about ?item ; schema:isPartOf <https://fa.wikipedia.org/> }

  service wikibase:label { bd:serviceParam wikibase:language "en" }
} order by desc(?number)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?article") v3("?item"):::projected v1("?number"):::projected v2("?total") a1((" ")) a2((" ")) a3((" ")) a4((" ")) c7(["wd:Q14204246"]):::iri c16(["en"]):::literal c12([https://fa.wikipedia.org/]):::iri c9(["wd:Q17442446"]):::iri c14(["bd:serviceParam"]):::iri c6(["wd:Q4167836"]):::iri c8(["wd:Q15184295"]):::iri c5(["wd:Q11266439"]):::iri f0[["?number > '50^^xsd:integer'"]] f0 --> v1 a1 --"wikibase:sitelinks"--> v1 bind2[/"count(*)"/] bind2 --as--o v2 v3 --"wikibase:sitelinks"--> v1 subgraph minus3["MINUS"] style minus3 stroke-width:6px,fill:pink,stroke:red; v3 --"wdt:P31"--> a2 a2 --"wdt:P279"--> c5 end subgraph minus4["MINUS"] style minus4 stroke-width:6px,fill:pink,stroke:red; v3 --"wdt:P31"--> a3 a3 --"wdt:P279"--> c6 end subgraph minus5["MINUS"] style minus5 stroke-width:6px,fill:pink,stroke:red; v3 --"wdt:P31"--> c7 end subgraph minus6["MINUS"] style minus6 stroke-width:6px,fill:pink,stroke:red; v3 --"wdt:P31"--> a4 a4 --"wdt:P279"--> c8 end subgraph minus7["MINUS"] style minus7 stroke-width:6px,fill:pink,stroke:red; v3 --"wdt:P31"--> c9 end subgraph minus8["MINUS"] style minus8 stroke-width:6px,fill:pink,stroke:red; v4 --"schema:about"--> v3 v4 --"schema:isPartOf"--> c12 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c14 --"wikibase:language"--> c16 end