Determining if a relationship represents a function