Updated code to get derives_from relationship.