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

Consistent naming conventions for plural collection objects #176

Open
ktaletsk opened this issue Dec 2, 2021 · 9 comments
Open

Consistent naming conventions for plural collection objects #176

ktaletsk opened this issue Dec 2, 2021 · 9 comments
Labels
enhancement Improvement of existing feature

Comments

@ktaletsk
Copy link
Collaborator

ktaletsk commented Dec 2, 2021

Description
Currently, naming conventions endpoints and JSON keys for different collection types are slightly inconsistent when it comes to plural of the collection object (images, csvs, datas). To demonstrate the issue, take a look at the table below:

Collection type API endpoint Collection element endpoint JSON key containing elements of collection
Image Collections /api/imagesCollections /api/imagesCollections/{imagesCollectionId}/images _embedded -> images
CSV Collections /api/csvCollections /api/csvCollections/{csvCollectionId}/csv _embedded -> csvs
Generic Data Collections /api/genericDatas /api/genericDatas/{genericDataId}/genericFile _embedded -> genericFiles

So, you can see that the same word images is used in both the endpoint and JSON key in this case, but different words (csv and csvs, genericFile and genericFiles) are used in other cases.

Proposal
Use the plural form for objects; use the same form in all places in the API. The following naming scheme would be more consistent:

Collection type API endpoint Collection element endpoint JSON key containing elements of collection
Image Collections /api/imagesCollections /api/imagesCollections/{imagesCollectionId}/images _embedded -> images
CSV Collections /api/csvCollections /api/csvCollections/{csvCollectionId}/csvs _embedded -> csvs
Generic Data Collections /api/genericDataCollections /api/genericDatas/{genericDataId}/genericFiles _embedded -> genericFiles
@ktaletsk ktaletsk added the feature New feature or request label Dec 2, 2021
@MyleneSimon
Copy link
Collaborator

That's a good point, it seems that it happening for the most recent additions to the API, I will fix the endpoints.
Did you notice any other places besides CSVs and GenericData?
GenericData could probably use another name as well...

@MyleneSimon MyleneSimon added enhancement Improvement of existing feature and removed feature New feature or request labels Dec 2, 2021
@ktaletsk
Copy link
Collaborator Author

ktaletsk commented Dec 3, 2021

I'll probably look through the most of the API endpoints in the near future as I'm working on the Python client for the API (here: PolusAI/data-tools#1). I will report any findings of the inconsistent names in this thread

@mohamedOuladi
Copy link
Collaborator

mohamedOuladi commented Dec 8, 2021

That's a good point, it seems that it happening for the most recent additions to the API, I will fix the endpoints. Did you notice any other places besides CSVs and GenericData? GenericData could probably use another name as well...

In this case, I should rename GenericData in my PR #184. Should we go for GenericDataCollection?

@MyleneSimon
Copy link
Collaborator

I am good with GenericDataCollection, this is how it is displayed in the UI for now so it would keep it consistent (and avoid dealing with singular/plural for the word data). If you are updating your PR could you check that all Swagger annotations are properly added/updated? (see #177, you also need to merge #178 in your branch). Thanks!

@MyleneSimon
Copy link
Collaborator

If anyone has an idea for a better name though, now is a good time to voice it :)

@MyleneSimon
Copy link
Collaborator

MyleneSimon commented Dec 8, 2021

I think at some point someone floated the idea of introducing the word raw instead of generic, I would not be opposed to RawDataCollection for example. Another option could be UnstructuredDataCollection.

@pbajcsy
Copy link
Collaborator

pbajcsy commented Dec 8, 2021

Following the comment about using plurals, the names should be XXXCollections. I would vote for RawDataCollections (GenericDataCollections would be fine too) since UnstructuredDataCollections is used by text mining researchers for unstructured text.

@mohamedOuladi
Copy link
Collaborator

I am good with GenericDataCollection, this is how it is displayed in the UI for now so it would keep it consistent (and avoid dealing with singular/plural for the word data). If you are updating your PR could you check that all Swagger annotations are properly added/updated? (see #177, you also need to merge #178 in your branch). Thanks!

@MyleneSimon Yeah I will make sure that Swagger annotations are updated.

@mohamedOuladi
Copy link
Collaborator

I think at some point someone floated the idea of introducing the word raw instead of generic, I would not be opposed to RawDataCollection for example. Another option could be UnstructuredDataCollection.

I think @NHotaling was the one who suggested RawDataCollection. So, I thought I should include him in the conversation.

I have already renamed GenericData to GenericDataCollection in the WIPP-frontend Labshare fork (see PolusAI/WIPP-frontend@94fa379). The reason why I opted for GenericDataCollection and not RawDataCollection was because of the addition of image conversion options that @MyleneSimon was working on. Having a conversion option raw might confuse the user, especially if the raw tags are created for image collections.

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

No branches or pull requests

4 participants