Wireless sensor networks (WSNs) are an enabling technology of context-aware systems. The Internet of Things (IoT), which has attracted much attention in recent years, is an emerging paradigm where everyday objects and spaces are made context-aware and interconnected through heterogeneous networks on a global scale. However, the IoT system can suffer from poor performances when its underlying networks are not optimized. In this paper, an ontology model for representing and facilitating context sharing between network entities in WSNs is proposed for the first time. The context model aims to enable optimal context-aware management of WSNs in IoT, which will also harness the rich context knowledge of IoT systems