## 3 The Semantic Social Network of Things Middleware (S2 NeTM)
### S2 NeTM Architecture
#### 3.2.2 S2 NeTM Components  
The necessary components for the implementation of the foundational concepts of the S2 NeTM are discussed in the following section.  
**Context Management (CM)**  
CM is a crucial component of the S2 NeTM that collects, processes, and analyzes data from IoT devices and other sources to provide context-aware services. It manages data about users, devices, and their environment, such as location, temperature, humidity, and activity. The CM component works in conjunction with the semantic engines to create a unified view of an SIoT system that includes both the physical and social aspects. It uses this view to interpret and understand the context of the data generated by IoT devices and other sources. By doing so, it can identify patterns and relationships among different pieces of data, enabling the S2 NeTM to provide more intelligent and personalized services to the users.  
The CM component also facilitates the creation of context-aware applications by providing a mechanism to deliver relevant information to users based on their current context. For example, if a user is in a certain location, the CM component can provide information about nearby events or places of interest. In this way, CM enhances the user experience and enables the S2 NeTM to deliver more useful and relevant services.  
Moreover, CM enables the S2 NeTM to make decisions and take actions based on the current context of the system. For instance, if a user is approaching a smart home, the CM component can trigger the smart home to turn on the lights and adjust the temperature based on the user's preferences and the current environmental conditions. This functionality is essential for creating an intelligent and responsive system that can adapt to the needs and preferences of the users in real time.  
**Owner Control (OC)**  
The OC component is responsible for managing the access control of an SIoT system. It ensures that only authorized users can access and control the IoT devices and their data. This component provides a layer of security and privacy protection for the users.  
In an SIoT system, each IoT device has an owner, who has the right to control and manage the device. The OC component manages the access rights of the owners, allowing them to decide who can access their devices and data. This component also allows the owners to revoke access rights at any time.  
To implement OC, the S2 NeTM uses a decentralized access control mechanism. Each device owner has a set of access control policies that define who can access their devices and data. These policies are stored in the S2 NeTM knowledge base and can be updated by the device owners at any time.  
The OC component also provides a mechanism for managing device ownership. When a device is added to an SIoT system, the OC component verifies the ownership of the device and assigns the device to the correct owner. If the ownership of a device changes, the OC component updates the ownership information in the system. Thus, the OC component is critical for managing the access control and ownership of the IoT devices and their data. It provides a layer of security and privacy protection for the users, allowing them to control who can access their devices and data. The decentralized access control mechanism and device ownership management features ensure that an SIoT system is secure and trustworthy.