1

I want to do a Wikidata Query about every item, that has at least a certain number of sidelinks. I already know, how to do this for a specific Group of Items

SELECT  ?item ?itemLabel ?itemDescription ?sitelinks WHERE {
   ?item wdt:P31 wd:Q223557 .
   ?item wikibase:sitelinks ?sitelinks .
   #MINUS {?item wd:Q5 }
   #MINUS {?item wd:Q8253}
   #MINUS {?item wd:Q9174}
   FILTER (?sitelinks > 20) 
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE]". }
} ORDER BY DESC(?sitelinks)

But I want to do this with EVERY item, that has a Wikipedia page. Is there a property, that every item has or some other way?

The number of results shouldnt be an issue, if the number of sidelinks is high enough...

  • `?item wikibase:sitelinks ?sitelinks . ?article schema:about ?item . ?article schema:isPartOf .` would return all items with an English Wikipedia page - for obvious reasons your query will most likely timeout as the data is just too huge and the public Wikidata endpoint is a shared service. Luckily you can download the Wikidata dump and setup your own service – UninformedUser Jul 26 '22 at 10:07
  • If you need it for any Wikipedia chapter, replace the last triple pattern of my sketch with `?article schema:isPartOf/wikibase:wikiGroup "wikipedia" .` – UninformedUser Jul 26 '22 at 10:09

0 Answers0