The Internet of Things in the Cognitive Era