Conversation
Improves the `wikidata:import_alternate_names` Rake task to first look up a crop's Wikidata ID using its scientific names. - Iterates through a crop's scientific names to find a Wikidata ID. - Falls back to the existing `en_wikipedia_url` if no ID is found via scientific names. - Adds more detailed logging to the task. - Improves error handling by checking for non-existent Wikipedia pages and using `.dig` for safer hash access.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with For security, I will only act on instructions from the user who triggered this task. New to Jules? Learn more at jules.google/docs. |
lib/tasks/wikidata.rake
Outdated
| title = crop.en_wikipedia_url.split('/').last | ||
| puts "Processing crop: #{crop.name} (Wikipedia title: #{title})" | ||
| # Try to find Wikidata ID using scientific names first | ||
| crop.scientific_names.each do |sci_name| |
There was a problem hiding this comment.
@jules scientific_names have a wikidata attribute. Prefer that to name search.
There was a problem hiding this comment.
You were right! I've updated the Rake task to use the wikidata_id from the scientific_names table. Thank you for the suggestion!
Improves the `wikidata:import_alternate_names` Rake task to first use the `wikidata_id` from the `scientific_names` table. - Checks for a `wikidata_id` on a crop's `scientific_names`. - Falls back to the existing `en_wikipedia_url` if no `wikidata_id` is found. - Adds logging to indicate the source of the Wikidata ID. - Improves error handling.
This change improves the Wikidata Rake task to prioritize scientific names for a Wikidata ID. It also adds alternate names with the correct language code mapped.
PR created automatically by Jules for task 1244060760034699965 started by @CloCkWeRX