Description
In populate.rs
, a long list of Collections are constructed - one for each class in Atomic Data (Class, Commit, Agent, etc.). This is because as an end-user, I want to browser this data. I want to be able to share a URL for each of these concepts. How should these collections be constructed?
Manually create collections
This is what I'm currently doing with the atomic_lib::populate::populate_collections
function. Not great. I've made things a bit cleaner by having a helper functionL CollectionBuilder::class_collection
.
In populate, iterate over all Classes
- It only generates the collections once, which is efficient.
- The collections themselves exist in the store this way, which means they are indexed and can be searched through.
Let the dynamic 'collections' collection generate dynamic collections
When a users requests the Collections collection, the back-end fetches all Classes, and generates a Collection for each class. But how would the individual Collections be resolved?
Let the front-end generate collection links
Since collections are fully dynamic, the URL can be created by the front-end. example.com/collection?property=isA&value=myClass
.
However, these cannot be discovered when browsing the API, and the URLs will be long and hard to read. Not good.
I feel like opting for option 2: In populate, iterate over all Classes