convert Master Bill of materials into parent-child relations