Skip to content

Conversation

@google-labs-jules
Copy link
Contributor

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

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.
@google-labs-jules
Copy link
Contributor Author

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!


For security, I will only act on instructions from the user who triggered this task.

New to Jules? Learn more at jules.google/docs.

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|
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jules scientific_names have a wikidata attribute. Prefer that to name search.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
@CloCkWeRX CloCkWeRX marked this pull request as ready for review December 1, 2025 12:57
@CloCkWeRX CloCkWeRX merged commit e372ef3 into dev Dec 1, 2025
16 checks passed
@CloCkWeRX CloCkWeRX deleted the improve-wikidata-rake-task branch December 1, 2025 13:26
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

Successfully merging this pull request may close these issues.

2 participants