I believe there could be many hierarchy driven use cases for Dgraph. Directory → subdirectory → files or assembly → subassembly → machine part etc.
How could I traverse ('downwards '/ ‘upwards’) e.g a file system data and e.g. summarise total file size by file type extension to answer questions like: what are the 5 most space consuming file types in a given directory + subdirectories? How many files there are by file type?
The same analogy for machine parts could be e.g. a summary of weight or price or count by part type. In hierarchy each object would have exactly a one parent (expect a root), circular references would not be a problem.
There’s no recursion in the query I mentioned. When asking for Instance "File", it’s just picking up all files. We can then filter them by a particular directory etc.
The Type edge is "PDF", and the Instance edge is for all things which are files, as opposed to directories.
So, the biggest change here is to have each file type be a node in the graph, as opposed to a string directly.