I have a vertex label "group" and a group can have multiple "categories". For example, a group named "food" can have multiple categories like "Seafood, Chinese, Indian" which are connected by an edge labelled "label1". Now, a category can have further categories, like "Seafood" can have "fish, prawns" and so on. the depth is arbitrary and these all further categories are connected by edge labelled "label2".
food --label1--> seafood --label2--> fish --label2--> jellyfish --label2--> so on
--label2--> starfish
--label2--> prawns
--label2--> crab
--label1--> Indian
--label1--> Chinese
I want to recursively traverse all the vertices and get the data. I hope you understood the question. Please help me out.