0

Asking the Wikidata service for all universities works. But when restricted to only EU universities, this query times out.

WHERE {
  ?item wdt:P31/wdt:P279* wd:Q3918 ;
         wdt:P17 ?country.
   ?country wdt:P463 wd:Q458 .
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}

Any idea?

Strangely, using FILTER EXISTS is returns the result (although quite slow).

SELECT ?item ?itemLabel ?countryLabel ?country
WHERE {
  ?item wdt:P31/wdt:P279* wd:Q3918 ;
         wdt:P17 ?country.
FILTER EXISTS { ?country wdt:P463 wd:Q458 }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}

Here's a link to the second query.

Ivo Velitchkov
  • 2,361
  • 11
  • 21
  • 1
    this maybe? `SELECT ?item ?itemLabel ?countryLabel ?country WITH { select distinct ?item {?item wdt:P31/wdt:P279* wd:Q3918} } AS %results WHERE { INCLUDE %results. ?item wdt:P17 ?country.?country wdt:P463 wd:Q458 . SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } }` – UninformedUser Oct 26 '20 at 14:40
  • https://w.wiki/is5 – Stanislav Kralin Oct 26 '20 at 17:36

0 Answers0