Jump to content

Taxonomy editor: Difference between revisions

(Add some images of the editor)
 
(8 intermediate revisions by 3 users not shown)
Line 1: Line 1:
[[Category:Taxonomy editor]]
Welcome to the Taxonomy Editor documentation.
Welcome to the Taxonomy Editor documentation.


This editor is a tool designed to make editing taxonomies easy for everyone.
This editor is a tool designed to make editing taxonomies easy for everyone.
== Where is it ? ==
* https://ui.taxonomy.openfoodfacts.org/
* Source code: https://github.com/openfoodfacts/taxonomy-editor
== Important links & files ==
* Taxonomy Editor page in the Mobile app Figma file (there's another web dedicated file): https://www.figma.com/design/nFMjewFAOa8c4ahtob7CAB/Mobile-App-Design-(Quentin)?node-id=3811-11147
* Empty folder on Canva for Marketing and visuals: https://www.canva.com/folder/FAF7FAwiA6E


== But first, what is a taxonomy ? ==
== But first, what is a taxonomy ? ==
Line 35: Line 45:


=== Contribution process ===
=== Contribution process ===
Contributing a set of changes will goes to the following process:
Contributing a set of changes will go through the following process:


Create a project edit entries → when you are done, export to a Pull Request Pull Request is reviewed by maintainers → fix issues and re-export  → Pull Request is accepted Your changes go to production.
{{#mermaid:flowchart TD
    Create[Create a project] --> Edit[edit entries]
    Edit --> Ready{Ready ?}
    Ready -->|No| Edit
    Ready -->|Yes| Export[export to a Pull Request]
    Export --> Review[Pull Request is reviewed by maintainers]
    Review --> Correct{All is ok}
    Correct -->|No| Edit
    Correct -->|Yes| Accepted[Pull Request is accepted]
    Accepted --> Release[Your changes are in the code]
    Release --> Visible[After a release changes are visible in production]
}}


As you can see changes are not immediate and goes under a review in a Pull Request, this is a request for changes in github (the tool we use to manage source code contributions). In the future, this validation step, might take place directly in taxonomy editor.
As you can see, changes are not immediate and go under a review in a Pull Request. This is a request for changes in GitHub (the tool we use to manage source code contributions). In the future, this validation step might take place directly in taxonomy editor.


Note that currently when your changes go to production, it does not necessarily affects products in the database, they have to be refreshed first, which will happen on next edit or once in a while.
Note that currently when your changes go to production, they do not necessarily affect products in the database, which have to be refreshed first. This will happen on next edit or once in a while.


== Using Taxonomy Editor ==
==Using Taxonomy Editor==
First you arrive at the home page where you have two options :
First you arrive at the home page where you have two options:


* create a new project for taxonomy editing : Start with a currently used taxonomy of your choice and begin editing.
*create a new project for taxonomy editing : Start with a currently used taxonomy of your choice and begin editing.
* open an existing project for taxonomy editing : Continue you editions on a project, or collaborate with others on editing a taxonomy together.
*open an existing project for taxonomy editing : Continue your editions on a project, or collaborate with others on editing a taxonomy together.
[[File:ImageHomePage.png|thumb|alt=|400x400px]]
[[File:ImageHomePage.png|thumb|alt=|400x400px]]


=== Create a new project ===
===Create a new project===
As you create a new project, you have some important informations to provide:
As you create a new project, you have some important informations to provide:


* the taxonomy you want to edit
*the taxonomy you want to edit ;
* the GitHub branch name: this is a name you choose but try to be as much explicit as you can. You can't use spaces, but you can add "_" instead
*the GitHub branch name: this is a name you choose but be as explicit as you can. You can't use spaces, but you can add "_" instead ;
* a description: please try to explain what is your contribution about. Maybe you are adding synonyms to recognize an ingredient, maybe you are adding translations in a specific language, maybe you are adding wikidata links, etc. Describe what you intend to do, and why. This description is important also to maintainers who will inspect your changes before they are accepted.
*a description: please try to explain what is your contribution about. Maybe you are adding synonyms to recognize an ingredient, maybe you are adding translations in a specific language, maybe you are adding wikidata links, etc. Describe what you intend to do, and why. This description is important also to maintainers who will inspect your changes before they are accepted.


After you project is created, you can edit nodes. But beware, if something wrong happen while importing the taxonomy, you will be notified. You should not attempt to edit a taxonomy with error, but inspect errors instead, and eventually talk with the Open Food Facts team.
After your project is created, you can edit nodes. But beware, if something wrong happen while importing the taxonomy, you will be notified. You should not attempt to edit a taxonomy with error, but inspect errors instead, and eventually talk with the Open Food Facts team.


[[File:Existing projects.png|left|thumb|400x400px|Existing projects page ]]
[[File:Existing projects.png|left|thumb|400x400px|Existing projects page ]]


=== Collaborate with others (or continue editing you project) ===
===Collaborate with others (or continue editing you project)===
To join an existing project, simply click on "OPEN EXISTING PROJECT" from the home page. You will then be directed to the existing projects page.
To join an existing project, simply click on "OPEN EXISTING PROJECT" from the home page. You will then be directed to the existing projects page.


Please not that it's better to coordinate your effort with the initiator of a project. '''Don't edit a project without first asking permission''' !
Please note that it's better to coordinate your effort with the initiator of a project. '''Don't edit a project without first asking permission'''!


Here, you'll find a list of projects that contributors have already initiated. Each project includes information such as the taxonomy being edited and a description outlining its goals, ensuring clarity for potential contributors. The status indicates the progress of the project:
Here, you'll find a list of projects that contributors have already initiated. Each project includes information such as the taxonomy being edited and a description outlining its goals, ensuring clarity for potential contributors. The status indicates the progress of the project:


* '''''OPEN''''': The project has been created, but no changes have been exported to GitHub yet
*'''''OPEN''''': The project has been created, but no changes have been exported to GitHub yet
* '''''EXPORTED''''': Changes have been exported to GitHub. Normally at this point, the changes are under review by others, and contributions should only concern fixing issues.
*'''''EXPORTED''''': Changes have been exported to GitHub. Normally at this point, the changes are under review by others, and contributions should only concern fixing issues.
* '''''CLOSED''''': The project has been accepted (merged), and further contributions is not possible<br />
*'''''CLOSED''''': The project has been accepted (merged), and further contributions are not possible<br />
[[File:Nodes page.png|thumb|300x300px|Nodes page : list of root nodes]]
[[File:Nodes page.png|thumb|300x300px|Nodes page : list of root nodes]]
While additional information such as the GitHub branch name and error count encountered by the parser are provided in the table, they are not essential for contributing.
While additional information such as the GitHub branch name and error count encountered by the parser are provided in the table, they are not essential for contributing.
Line 76: Line 97:
To contribute to a project, simply click on the pencil icon!
To contribute to a project, simply click on the pencil icon!


=== Edit the taxonomy ===
===Edit the taxonomy===
First you arrive on a page listing all the root nodes, which are nodes without parents. Most probably you would want to use the search page to search for specific nodes using a simple search query.
First you arrive on a page listing all the root nodes, which are nodes without parents. Most probably you would want to use the search page to search for specific nodes using a simple search query.


Line 84: Line 105:
[[File:Edit a node page.png|left|thumb|400x400px|Edit a node]]
[[File:Edit a node page.png|left|thumb|400x400px|Edit a node]]


=== Edit a node ===
===Edit a node===
Once you've selected the node you wish to edit, you'll be directed to the edit page.
Once you've selected the node you wish to edit, you'll be directed to the edit page.


Here, you'll find the parent nodes and children of the selected node. You navigate through the taxonomy graph by clicking on their parent or child nodes.
Here, you'll find the parent nodes and children of the selected node. You navigate through the taxonomy graph by clicking on their parent or child nodes.


Next, you'll encounter the translations for the node. The primary language of the node and any "universal" translations (if they exist) are automatically displayed. To add or check translations for a specific language, simply click on "n LANGUAGES SHOWN" and select the desired languages. If "All languages" is not visible and you wish to add a universal translation, simply check the corresponding checkbox.
Next, you'll encounter the translations for the node. The primary language of the node and any "universal" translations (if they exist) are automatically displayed. To add or check translations for a specific language, simply click on "LANGUAGES SHOWN" and select the desired languages. If "All languages" is not visible and you wish to add a universal translation, simply check the corresponding checkbox.


For each language, you can add a translation by clicking in the designated area. You can also adjust the order of translations within a section, allowing you to rearrange them as needed, even setting a new first translation.
For each language, you can add a translation by clicking in the designated area. You can also adjust the order of translations within a section, allowing you to rearrange them as needed, even setting a new first translation.
Line 97: Line 118:
Once you've completed editing the node, remember to save your changes by clicking the blue button; otherwise you would lose your modifications.
Once you've completed editing the node, remember to save your changes by clicking the blue button; otherwise you would lose your modifications.


=== Add a node ===
===Add a node===
You can either:
You can either:


* add a root node by going to Nodes page and clinking on the + icon. Always consider English as main language, if possible.
*add a root node by going to Nodes page and clinking on the + icon. Always consider English as main language, if possible.
* even better, you can also add a child node by navigating to a node, and using the "+" icon  
*even better, you can also add a child node by navigating to a node, and using the "+" icon


At creation time, you will have to choose a main language code (two letter code) and a name for the node.
At creation time, you will have to choose a main language code (two letter code) and a name for the node.
Line 108: Line 129:
[[File:Add a children node.png|left|thumb|400x400px|Add children to a node]]
[[File:Add a children node.png|left|thumb|400x400px|Add children to a node]]


=== Adding relations ===
===Adding relations===
If you want to put a node under a new parent, navigate to the parent node and use the "+" icon next to children, then enter main language code of the entry and it's name. The existing node will be retrieved and put under the parent node.
If you want to put a node under a new parent, navigate to the parent node and use the "+" icon next to children, then enter main language code of the entry and it's name. The existing node will be retrieved and put under the parent node.


Line 116: Line 137:




[[File:Export.png|thumb|400x400px|Export your changes to Github]]
[[File:Export.png|thumb|400x400px|Export your changes to GitHub]]


=== Publish your contributions ===
===Publish your contributions===
Navigate to the export tab in the header bar to export your edited taxonomy.
Navigate to the export tab in the header bar to export your edited taxonomy.


Line 124: Line 145:


Upon submission, your PR will undergo review, and upon approval, it will be merged. Through this process, you'll have contributed to improving the quality of the taxonomy and gave an important contribution to food transparency.
Upon submission, your PR will undergo review, and upon approval, it will be merged. Through this process, you'll have contributed to improving the quality of the taxonomy and gave an important contribution to food transparency.
== Get in touch ==
{{Box
| 1    =  Slack channel
| 2    =  [https://openfoodfacts.slack.com/messages/C03MEM1CMJ4/ #taxonomy-editor]
}}
[[Category:Taxonomies]]