openfoodfacts / openfoodfacts-server

Open Food Facts database, API server and web interface - 🐪🦋 Perl, CSS and JS coders welcome 😊 For helping in Python, see Robotoff or taxonomy-editor
http://openfoodfacts.github.io/openfoodfacts-server/
GNU Affero General Public License v3.0
656 stars 385 forks source link

Normalize taxonomy directory structure #2703

Open VaiTon opened 4 years ago

VaiTon commented 4 years ago

Issue

Right now obf, opff and opf taxonomies are very messy. I guess they aren't even loaded.

Tags.pm is what deals with taxonomies in Product Opener and in retrieve_tags_taxonomy() we only load open food facts taxonomies: https://github.com/openfoodfacts/openfoodfacts-server/blob/f4774d12cf833c3a94b408e91f4561d767f851de/lib/ProductOpener/Tags.pm#L1577

Proposal

We should make rearrange the directory structure like this:

taxonomies
|-- openfoodfacts
|   |-- labels.txt
|   +-- etc...
|-- openbeautyfacts
|   |-- labels.txt
|   +-- etc...
|-- openpetfoodfacts
|   |-- labels.txt
|   +-- etc...
|-- openproductfacts
|   |-- labels.txt
|   +-- etc...
|-- labels.common.txt
|-- categories.common.txt
+-- ....common.txt

And then, when we build taxonomies, we should combine common taxonomies with site-specific ones and put them in a dir like taxonomies/openfoodfacts/build.

Then at software startup only relevant taxonomies would be loaded.

github-actions[bot] commented 4 years ago

Stale issue message