I have a couple of paths, it could be unlimited i depth and amount of paths.
Im using backbone, and getting data from a server, each model containing a path field for example:
"/home/harry/"
"/home/sally/"
"/home/sally/personal"
"/home/harry/files"
"/home/harry/photos"
"/home/harry/videos"
"/home/harry/files/documents"
"/home/harry/files/personal"
"/home/harry/photos/2012"
"/home/harry/photos/2011"
"/home/harry//videos/2012"
"/home/harry/videos/edited"
"/home/harry/videos/edited/other/trash_this"
I want to group the models so that I can represent the file structure in my web app, so that you can click on "home" and it lists all its relative directories and so on. So you can click further into the structure until there is no more files or directories in that folder/directory.