-
Notifications
You must be signed in to change notification settings - Fork 29
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
Schedule automatic execution of wikidata query and switching between visualizations #62
Conversation
@GonzaFP can you please fix the conflicts? Thanks for your work, it looks very interesting! |
@wikicurricula-uy Let me resolve them. Thank you for your feedback |
@wikicurricula-uy I have resolved the conflicts. Thanks |
@GonzaFP please resolve the new conflicts, so that I can merge your PR, thanks (I could've done it myself, but I have doubts about the first file) |
@SannitaSSJ , Let me resolve them. Thank you, |
@SannitaSSJ , I have resolved the conflicts. Thank you, |
@GonzaFP don't kill me please, but I recently merged another PR and... there are new conflicts. :( Please solve them, so that I can move on and finally merge your PR. |
@SannitaSSJ Haha, let me resolve them. |
@SannitaSSJ I have resolved them. Thanks |
@SannitaSSJ Please wait to merge, I have over-written my changes. |
@SannitaSSJ , It's Okay now. Thanks |
@SannitaSSJ Thank you. |
Hello, @GonzaFP ! Thanks for your work here So, I've got these questions for you @GonzaFP
Please, do not make any changes stemming from my questions. I just want to understand how this works, I'm not implying we should make changes. |
Hello @wikicurricula-uy, thanks for the feedback. Here are my answers.
Please let me know whether I have answered your questions. |
Hello @fernandouval @EneHacheCe @SannitaSSJ @wikicurricula-uy , this PR solves the folllowing issue as suggested by @EneHacheCe :
"I think that the Wikidata query and the excecution of bot.py should be done automatically but scheduled (monthly or weekly or daily). This should give us 2 voci files, one for Uruguay and one for Ghana, which are periodically updated.
Then, when the user clicks on the link, the visualization will switch between ghana's voci file and uruguay's voci file."
I have created an automation.batch file which can be scheduled (monthly. weekly or daily) to execute the bot.py and translate.py for all countries' curricula. When run, this file will make the wikidata query, write to query.csv, resultati.csv and then create a voci_file for each country. Behind the scenes, the batch file depends on bot.py and translate.py which I modified as follows:
I have modified bot.py so that it can execute the wikidata query and then write to query.csv. If run manually, a user will type "bot.py en 117" which will fetch Ghana's curricula in English wikipedia. "bot.py es 77" will fetch Uruguay's curricula.in spanish. Further, I modified translate.py so that it creates a voci file for each country so If the script is run manually, it will be like so "translate.py Ghana" which will create Ghana_voci_2023.tsv or "translate.py Uruguay " which will create Uruguay_voci_2023.tsv
Then, I added a link on Uruguay's visualization. This link allows a user to switch between Uruguay and Ghana's curricula. To do so, the visualization has to switch between Ghana's voci_file and Uruguay's voci_file hence I modified dv1.js and utilities.js so that they can read voci files dynamically.
I created a temporary config file to aid with dynamically executing bot.py but this PR #46 (comment) has a config file which can be used instead.
Here is a demo
Wikicurricula.Uy.-.Google.Chrome.2023-10-16.12-55-10.mp4
Here are some issues I faced:
Dynamically switching between languages in the tooltip and the legend. How can we do that?
Extracting subjects from the Wikidata query. In Ghana's case, I split the programLabel at the word "curriculum" But it feels hacky. For Uruguay, I used the hard coded subjects in the boilerplate.
I look forward to hearing from you.