converting parent child relationships to links