I have a rails app that includes tagging for blog posts using the gem acts-as-taggable-on. My idea is to extend the tagging mechanism of this gem using a moderate-link approach where I can choose to create a few users as tag owners and they can choose to link one tag to another as parent/child.
Presently the system has independent tags like Education
, Child Education
and Distance Education
The tag owner of Education
can choose to select Child Education
and Distance Education
as first level child and link them together. This relationship wont be visible until its approved by the Taxonomist(A tag administrator).
Similarly, an end user can also suggest Distance Education
tag to be the child of Education
and this request will become visible to the tag administrator. Based on his approval the relationship will be established.
These are the few questions I have pertaining to the requirement above:-
Is it recommended to extended the gem or should I use an independent tagging model written from scratch to support this hierarchical system ?
If I go ahead with the schema provided by the gem , what kind of a model should be used to design such a requirement. Specifically, should I use a single table with a parent_id column with the tag id and tag name ? Or should I maintain their relationship in a separate table with many-to-many associations (tag_id, parent_tag_id (as Foreign key)).
I am also new to data structures so I will need some initial inputs on the choice of algorithms to efficiently traverse between a tag family. Using linked list was one my options however considering Rails mantra of convention over configuration , I am really unsure of how to proceed on this.