General comments on this method:

* I think the variable names can be more self-documenting to facilitate understandability
* You use, name, but conceptually it is ID. The same name can show up multiple times, but only the ID once and from an implementation standpoint I believe you are using id.
* Though am a k, v minimalist, I think it my be worth using id, descriptor if possible.
* I comment below, but I am not sure the use of the nested id keys you are generating vs. using just the id. Seems that would simplify things.
* Seems descriptor_name_prefix is closer to parent_id, is that true?