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

UI implementation plan to support new vocabs API #84

Closed
edmondchuc opened this issue Jul 24, 2023 · 2 comments · Fixed by #85
Closed

UI implementation plan to support new vocabs API #84

edmondchuc opened this issue Jul 24, 2023 · 2 comments · Fixed by #85

Comments

@edmondchuc
Copy link
Collaborator

Why is this needed?

Currently, when a vocabulary request is made to the Prez API, it loads the entire vocabulary from the database and returns it to the client. This works fine for small vocabularies but becomes a scaling issue for medium to large vocabularies.

The new vocabs API allows clients such as prez-ui to load vocabularies of any size in an incremental manner. The PR for the new API is at RDFLib/prez#134.

The new API provides a way to load sibling concepts at a hierarchy level in a paginated manner. Each concept that have narrower concepts will display an "expand" button. Once expanded, the button becomes a "minimise" button. Each concepts in the vocabulary are loaded incrementally and stored in the browser memory in a tree data structure based on events triggered by the user. These events perform AJAX requests to load more concepts from the API and are triggered either from the "expand" button or the "load more" button.

How will this look?

The following image is how the current prez-ui displays the data, after it has loaded the entire vocabulary from the API.

The state of the concept hierarchy is after the user has expanded the Petroleum concept and then the Unconventional Petroleum concept.

Screenshot 2023-07-24 at 2 14 27 pm

The following image showcases the exact same state but using the new API where pagination is considered.

Screenshot 2023-07-24 at 2 09 50 pm

@jamiefeiss
Copy link
Collaborator

Looks good, and should fit in just fine with the current implementation.

Are you planning on implementing this @edmondchuc ? I'm happy to take on this work if you like, should be pretty straightforward to implement.

@edmondchuc
Copy link
Collaborator Author

Hi @jamiefeiss, if you have the capacity to implement it, then go for it! Otherwise, I can have a crack at it as well.

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

Successfully merging a pull request may close this issue.

2 participants