Extract the relation types