The thread I linked describes the limitations of the approach you suggest, in particular, the ability to associate metadata not just with leaf nodes but also internal nodes, and not requiring the names of children to be unique. Of course you can express hierarchies in YAML, but the result ends up being more verbose and more prone to syntax errors; the point of comma-separated trees is to be easier to read and edit.