Skip to content

Conversation

@teolemon
Copy link
Member

@teolemon teolemon commented Nov 4, 2025

What

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

@github-actions github-actions bot added the 🧬 Taxonomies https://wiki.openfoodfacts.org/Global_taxonomies label Nov 4, 2025
@github-project-automation github-project-automation bot moved this to To discuss and validate in 🍊 Open Food Facts Server issues Nov 4, 2025
@sonarqubecloud
Copy link

sonarqubecloud bot commented Nov 4, 2025

@codecov-commenter
Copy link

codecov-commenter commented Nov 4, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 51.75%. Comparing base (0cb2931) to head (ee73bc6).
✅ All tests successful. No failed tests found.

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     
Flag Coverage Δ
integration-test-group-1 31.19% <ø> (?)
integration-test-group-2 27.06% <ø> (?)
integration-test-group-3 8.74% <ø> (?)
integration-test-group-4 10.69% <ø> (?)
integration-test-group-5 19.93% <ø> (?)
integration-test-group-6 24.79% <ø> (?)
integration-test-group-7 10.26% <ø> (?)
integration-test-group-8 8.75% <ø> (?)
integration-test-group-9 8.94% <ø> (?)
unit-test-group-1 26.27% <ø> (ø)
unit-test-group-2 21.77% <ø> (ø)
unit-test-group-3 20.45% <ø> (ø)
unit-test-group-4 31.22% <ø> (ø)
unit-test-group-5 20.31% <ø> (ø)
unit-test-group-6 29.23% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@teolemon teolemon requested review from a team and Freso November 6, 2025 09:54
Copy link
Collaborator

@Freso Freso left a 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:
Copy link
Collaborator

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

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?

Copy link
Collaborator

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🧬 Taxonomies https://wiki.openfoodfacts.org/Global_taxonomies

Projects

Status: To discuss and validate

Development

Successfully merging this pull request may close these issues.

4 participants