Innovation and diversity: the role of knowledge networks in the inventive capacity of cities