You are using 2 data sources, but it seems you are mixing both.
The only data is your entries in the list, which seem linear, not hierarchical.
For example, a list of films.
Another data source, its collection of hierarchical data ("tag catalog").
For example, a list of movie styles.
+ --- Styles
+ --- Comedy
+ --- KidsComedy
+ --- SomeComedy
+ --- LOLComedy
+ --- Action
+ --- SomeAction
+ --- GrabYourCouchSofaAction
+ --- Drama
+ --- SomeDrama
+ --- LotsOfTearsDrama
+ --- EvenToughGuysWillCryDrama
+ --- Horror
+ --- SoftHorror
+ --- HardHorror
+ --- Gore
+ --- SciFi
Each film can be associated with several styles of film:
- "StarWars: Phantom Threat": {"SciFi", "SomeDrama", "SoftHorror", "SomeAction"}
- "StarTrek: first contact": {"SciFi", "SomeDrama", "SomeComedy"}
From a database design perspective, you should have 3 tables or Entity Objects:
- List of entries = {ListEntryID, ListEntryTitle, ...}
- Genres for movies Tags / Styles = {TagID, TagTitle, ...}
- Styles for the movie = {TagForListEntryID, ListEntryID, TagID, ...}
Good luck.
source share