#4099 (Import data using wikidata)
by Luc Saffre · in Developers · assigned to Luc Saffre
Kurzbeschreibung
In cd (the commondata main package) we now have a script make_code.py, which generates the commondata.countries module from data found on wikidata.
Kinder
Kommentare
- 2 Jahre, 7 Monate ago von Luc Saffre about #4099 (Import data using wikidata) : The book test suite fails on GL because commondata isn't released to pypi.
- 2 Jahre, 7 Monate ago von Luc Saffre about #4099 (Import data using wikidata) : I pushed my work (in cd, xl, book, welfare) after having all test suites pass on my machine. Documentation is -as usual- not finished.
- 2 Jahre, 7 Monate ago von Luc Saffre about #4099 (Import data using wikidata) : I am almost ready to push my work on this. There were a few avalanche effects, e.g. we now have a new plugin setting [url dev.lino-framework.org/specs/countries.html#setting-countries.full_data countries.full_data].
- 2 Jahre, 7 Monate ago von Luc Saffre about #4099 (Import data using wikidata) : I added a field "population" to the query, which seems to work, but caused a few duplicate countries in the response. And we have about 50 countries less than before and I am not sure whether I should explore this more in detail or not...
- 2 Jahre, 7 Monate ago von Luc Saffre about #4099 (Import data using wikidata) : Two minor changes confirm that it works: The countries.xml file used by all_countries didn't have Estonian language. Now we have it. Wikidata says "Kingdom of the Netherlands" instead of just "Netherlands".
- 2 Jahre, 7 Monate ago von Luc Saffre about #4099 (Import data using wikidata) : Cool! The all_countries fixture now uses data from wikidata via commondata instead of parsing it from countries.xml. Finally we have a full usage of wikidata in Lino!
- 2 Jahre, 7 Monate ago von Luc Saffre about #4099 (Import data using wikidata) : Based on Sharif's work I wrote a script that generates code like this:
# code generated by sparql.py # languages = ['en', 'de', 'fr', 'nl', 'et', 'bn', 'es'] FIELDS = ('entity', 'name', 'isoCode2', 'isoCode3', 'zipCode')
def get_countries(): yield ('www.wikidata.org/entity/Q219060', {'en': 'Sta... - 2 Jahre, 7 Monate ago von Luc Saffre about #4099 (Import data using wikidata) : I started reading the [url www.wikidata.org/wiki/Wikidata:SPARQL_tutorial SPARQL tutorial] and Sharif's lino_xl.lib.countries.wikidata module.
- 2 Jahre, 9 Monate ago von Luc Saffre about #4099 (Import data using wikidata) : I registered as participant for [url www.mediawiki.org/wiki/Wikimedia_Hackathon_2024 Wikimedia Hackaton 2024], which will be in Tallinn in May 2024. In the hope to find people who help me with using Wikidata for Lino. And yesterday I stumbled into an interesting [url mastodon.social/@egonw/111679758...
- 5 Jahre, 2 Monate ago von Luc Saffre about #4099 (Import data using wikidata) : We decided to interrupt here (put the project to sleep) because the wikidata structure is more sophisticated than we expected. This would also need consultations with people who know wikidata better. And then there is nobody to pay us for this work.
- 5 Jahre, 2 Monate ago von Luc Saffre about #4099 (Import data using wikidata) : Continue as said on Discord: next steps are the all_countries.py fixture, and then also convert the be.py and ee.py fixtures to use wikidata. Of course: this will probably break quite some doctests. Probably add a new Site.use_wikidata attribute. We would put this to True in the belref and estref pr...
- 5 Jahre, 2 Monate ago von Sharif Mehedi about #4099 (Import data using wikidata) : did some work on this. see: gitlab.com/lino-framework/xl/-/commit/05ca79e4
- 5 Jahre, 3 Monate ago von Luc Saffre about #4099 (Import data using wikidata) : Sharif and I designed a new inv command "update-fixtures", which calls our get_cities script. We now use jinja to build the SPARQL query. Sharif will continue to play... because getting the right results quires more exploration of the sparql language and the wikidata definitions.
- 5 Jahre, 3 Monate ago von Luc Saffre about #4099 (Import data using wikidata) : Sharif, where is your work on this? I seem to remember that you had some results but cannot find them. They might be interesting today because I will meet with Estonian Wikipedians this weekend. If you have unpublished work, try to send me an email.
- 5 Jahre, 3 Monate ago von Luc Saffre about #4099 (Import data using wikidata) : See also my blog entry [url luc.lino-framework.org/blog/2018/0723.html]
- 5 Jahre, 3 Monate ago von Luc Saffre about #4099 (Import data using wikidata) : Also see [url janakiev.com/blog/wikidata-mayors/] for an introducton.