-
Notifications
You must be signed in to change notification settings - Fork 575
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 #53
Comments
Good suggestion @ppKrauss Is there any listing of these stable country pages on wikidata? I've not found a listing/category for these or a way to crawl/fetch them all programmatically |
Hi @ewheeler, thanks (!), I will check best strategy next week. There are two ways,
The item 2 is the ideal solution and generates an automatic CSV. |
Testing solution of item 2, SELECT ?item ?itemLabel
WHERE {
?item wdt:P31 wd:Q6256.
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} run this query here and download as CSV to check JOIN. Perhaps better! A CSV with only Wikidata-ID and 2-letter-country-code columns: SELECT *
WHERE {
?item wdt:P297 ?code
} ORDER BY ?code here. |
Migration problemHi @ewheeler , can you help to check cause of errors at https://github.com/ppKrauss/country-codes ? Wikidata minor problemI am using SQL to check and JOIN... The JOIN is: SELECT c.*, w.item as "wdId"
FROM dataset.vw_country_codes c LEFT JOIN wikidata_country w
ON w.code=c.iso3166_1_alpha_2 AND c.iso3166_1_alpha_2 IS NOT NULL
AND w.item NOT IN ('Q165783', 'Q2895', 'Q1249802', 'Q29999', 'Q407199', 'Q838261') The
The duplicated pairs are about Wikidata's records on "grouping nations" as "Kingdom of the Netherlands" in the NL pair. |
Hi @ewheeler, sorry for coming back so late ... Now the problems are solved, all be automatic. Submiting pull request 65 to add Supposing that you prefer to adapt your Python scripts to the join, a new column Only Sark is not there, because have no iso2_code, but you can add as Q3405693. Wikidata have persistent IDs (it's safe!), so the rule of the thumb is to preserve the older Wikidata ID ( |
What is the blockage at the moment? Is any help needed on this? :) Thank you so much! |
@valerio-bozzolan PR is welcome to add this. |
Cool stuff - I'm only seeing this now 👍🏼 we have this old PR that we should merge #65 |
Wikipedia have stable pages for all countries, 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: BR is https://www.wikidata.org/wiki/Q155 , so the column
wd_id
of lineBR
isQ155
. With Wikidata API we can fill automatically thewd_id
column.The text was updated successfully, but these errors were encountered: