There are many cities in Wikipedia/Wikidata named Akron. Perhaps this?

SELECT ?wikipedia ?cityLabel ?city
WHERE {
  VALUES ?label {
    "Aachen"@en
    "Akron"@en
  }
  ?wikipedia schema:name ?page;
    schema:isPartOf <https://en.wikipedia.org/>;
    schema:about ?city.
  ?city rdfs:label ?label .
  SERVICE wikibase:label { bd:serviceParam wikibase:language 
"[AUTO_LANGUAGE],en". }
}


From: Wikidata <[email protected]> on behalf of Zsolt Ero 
<[email protected]>
Date: Sunday, February 21, 2021 at 8:34 PM
To: [email protected] <[email protected]>
Subject: [External] [Wikidata] SPARQL with wikipedia redirects
Hi,

I'm trying to make this query work with Wikipedia redirects: 
https://w.wiki/$sF<https://w.wiki/$sF>


SELECT * WHERE {
  VALUES ?page {
    "Aachen"@en
    "Akron"@en
  }
  ?sitelink schema:name ?page;
    schema:isPartOf <https://en.wikipedia.org/<https://en.wikipedia.org/>>;
    schema:about ?city.
}

Aachen works, Akron does not, as it is a redirect. How can I make a query which 
works with such redirects?

I'm trying to get Wikidata ids for the links from this table: 
https://en.wikipedia.org/wiki/List_of_cities_by_GDP<https://en.wikipedia.org/wiki/List_of_cities_by_GDP>
(The html has mw-redirect class for the redirects).

Regards,
Zsolt


_______________________________________________
Wikidata mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikidata

Reply via email to