-
-
Notifications
You must be signed in to change notification settings - Fork 499
taxonomy: matches for French wines + script to match wikidata entries to a taxonomy #12620
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
base: main
Are you sure you want to change the base?
Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #12620 +/- ##
==========================================
+ Coverage 46.37% 51.75% +5.37%
==========================================
Files 94 95 +1
Lines 24693 24751 +58
Branches 5915 5924 +9
==========================================
+ Hits 11451 12809 +1358
+ Misses 11687 10223 -1464
- Partials 1555 1719 +164
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Freso
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if there’s anything specific I should look at/for, but here are some comments. :)
| import re | ||
|
|
||
| # Load the query.json file | ||
| with open('/Users/pierre/development/openfoodfacts-server/taxonomies/food/query-off-ing.json', 'r') as f: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you mean to hardcode this (and other) paths? Would it be possible to use a path relatively to the script (../food/query-off-ing.json)? I’m pretty sure there’s a Python function/method to get location of current script/file which might be useful for this, but I don’t remember what it is offhand.
|
|
||
| block = updated_content[block_start:block_end] | ||
|
|
||
| # Check if the block has a #wikidata:en: line |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to also have an else if 'wikidata:en:' not in block:? Or maybe even wrap this in that check like
if 'wikidata:en:' not in block:
if '#wikidata:en:' in block:
…
else:
…
(possibly the updated_content, _count, print, and break here)There is bound to be a bunch of potential candidates that don’t have a commented-out wikidata:en line. But maybe it’s too cumbersome to figure out where to insert it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this file? convert-wikidata-igp.py looks for query-off-ing.json, not query.json. This also seems to just be a bunch of hardcoded WD Q-ids and their labels, not a query… Is it the result of a query? Is the query available/documented somewhere?



What
taxonomy: matches for French wines + script to match wikidata entries to a taxonomy