Skip to content
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

Support for addition of synonyms and stopwords in frontend #108

Open
aadarsh-ram opened this issue Oct 10, 2022 · 5 comments
Open

Support for addition of synonyms and stopwords in frontend #108

aadarsh-ram opened this issue Oct 10, 2022 · 5 comments
Labels

Comments

@aadarsh-ram
Copy link
Collaborator

aadarsh-ram commented Oct 10, 2022

The frontend currently allows only addition of nodes of type "ENTRY".

Addition of stopwords and synonyms through the frontend must be also supported, by changing the dropdown menu items in search/SearchResults.jsx and allentries/index.jsx.

The POST request for addition must be sent to the appropriate endpoint (/nodes) in the backend.

@vedant-z
Copy link

vedant-z commented Dec 2, 2022

Hey @aadarsh-ram I figured out that I need to add support for stopwords and synonyms in this part of code <option value={'entry'}>Entry</option> in search/SearchResults.jsx and allentries/index.jsx .

I need some help on what keywords should I add in option value or what needs to be done other than that?

Also in the backend part I need to make changes in backend/entries.py right?

@aadarsh-ram
Copy link
Collaborator Author

Hey @vedant-z. Sorry for the late reply :(

You're right about the changes in frontend part, options have to be added. The frontend currently has a function to send a POST request to add an entry which is handled by handleAddNode(). But, synonyms/stopwords need a separate handler function to POST the ID as the string synonym or stopword and the main_language to the same endpoint (newNode variable is not required for addition of synonyms and stopwords).

The backend part (entries.py) requires a lot of work to include this change, since many functions have to be changed, namely create_node(). The create_node() function needs to be changed to include the suffix number by looking up the last stopword/synonym (Eg: stopwords:1 where 1 is the suffix number).

Another function needs to be written to add this newly created node in the position next to the last stopwords/synonyms node in the Neo4j database. (The current add_node_to_beginning() function cannot be used, because order is important here).

If you'd like to work on this issue, you'd require understanding of the way in which a taxonomy is parsed and stored in the database. As a start, I'd suggest you to read this reference document for the parsing process and test out the application in dev using the instructions given here.

Sorry for the long comment, but hopefully this covers everything that needs to be changed in order to bring support for this. Feel free to ask any doubts!

@aadarsh-ram
Copy link
Collaborator Author

@alexgarel Feel free to include anything that I might have missed :)

@alexgarel
Copy link
Member

@aadarsh-ram we should create a separate issue for backend part.

Note that this issue is not a very high priority issue for me as stopword and global synonyms are rarely edited and we don't really seek a large number of contributors on this (this is specialist work as it may have a large impact with lot of possible pitfalls).

@alexgarel
Copy link
Member

We decided to avoid displaying synonyms and stopwords (for now) in the UI.

So once, again, this issue is a really low priority issue.

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

No branches or pull requests

4 participants