Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include column for Wikidata identifier, suggestion #11

Open
ppKrauss opened this issue Oct 26, 2017 · 1 comment
Open

Include column for Wikidata identifier, suggestion #11

ppKrauss opened this issue Oct 26, 2017 · 1 comment

Comments

@ppKrauss
Copy link
Contributor

Wikipedia have stable pages for all cities, and Wikidata supply an ID for it.
Today Wikidata IDs are playing important role as "concept identifier", for Web Semantic in general and for open projects like OpenStreetMaps, etc.

Example: the instances of municipalities of Brazil have a simple query at Wikidata,

SELECT ?item ?itemLabel
WHERE { 
  ?item wdt:P31 wd:Q3184121 .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }    
} LIMIT 500
@valerio-bozzolan
Copy link

This Wikidata query may be a starting point to get cities with GeoName IDs and Wikidata ID:

SELECT DISTINCT ?wikidataIDLabel ?geonameID ?wikidataID
WHERE 
{
  ?wikidataID wdt:P31/wdt:P279 wd:Q7930989. # must be city/town
  ?wikidataID wdt:P131  ?region.
  ?wikidataID wdt:P1566 ?geonameID.
  ?wikidataID wdt:P1082 ?population.

  FILTER (?population > 15000)

  SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
ORDER BY ASC(?wikidataIDLabel)

The results can be downloaded as a simple CSV file from here:

https://w.wiki/56bG

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants