make sure that relationships always have type and typeKey set