automatically determine the link type in the model