## 3 The Semantic Social Network of Things Middleware (S2 NeTM)
### S2 NeTM Architecture  
#### 3.2.1 General Context  
The SIoT is a new paradigm that enables the integration of social relationships into the IoT ecosystem, creating a more personalized and human-centric environment. The S2 NeTM is a solution designed to address the challenges of the SIoT paradigm, such as interoperability and efficient collaboration, by leveraging semantic technologies, dynamic relationship selection, and trustworthiness management. The S2 NeTM is a distributed system, wherein each component is assigned a specific role to provide the necessary functionalities that are crucial for smart applications. The collaborative nature of the components allows them to work in tandem with each other to create a seamless and smooth experience for the end-users. The distributed design of \begin{table}
\begin{tabular}{c c c} \hline \hline
**Social Relationship** & **Description** & **Static/Dynamic** \\ \hline Co-Location & Develops between entities that are in proximity at a specific time. & Dynamic \\ Co-Work & Develops between entities that work together to meet a user’s & Dynamic \\  & need at a specific point in time. & \\ Co-Semantics & Develops between entities that have common semantics and can & Dynamic \\  & work for some common goal. & Dynamic \\ Users & Develops between two different users of an application at a & Dynamic \\  & specific time. & \\ Friend of a Friend (FOAF) & Develops between entities who have mutual friends and can & Dynamic \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Social relationships in the S2 NeTM. the S2 NeTM architecture allows each component to be located on different nodes within the system. Figure 1 offers a high-level perspective of the S2 NeTM architecture and its operational environment. S2 NeTM serves as a distributed software layer positioned between the _Data Collection Platform_ and the _Applications_, facilitating efficient processing and improved scalability. The _Data Collection Platform_ is a crucial part of the operational environment, comprising the _Perception and Communication subsystems_. It involves deploying IoT devices, sensors, and actuators in the physical environment, integrating data from open sources, and crowdsourcing. With a focus on establishing reliable connectivity through diverse communication protocols, it enables reliable, secure, and efficient data transfer for subsequent processing and decision making in the S2 NetM. The S2 NeTM provides the necessary components for implementing an SIoT solution, including context management, owner control, profiling, service discovery, trustworthiness management, friendship selection, relationship management, and semantic engines. The semantic engines use an ontology based on OWL2 (Web Ontology Language) to represent information, which allows for the fusion and interpretation of data based on social relationships. The data are stored in an RDF triple store as a knowledge base, using Neo4j ([[https://neo4j.com/](https://neo4j.com/)]([https://neo4j.com/](https://neo4j.com/)), accessed on 8 May 2023) graph database management system, and semantic interpretation is based on reasoning techniques and query execution to extract more relevant data about the users and social groups of the objects/entities. Additionally, the S2 NeTM includes a semantic annotation module to facilitate the annotation of IoT data with semantic metadata. By leveraging the social relationships between users and devices, the S2 NeTM enables the creation of more personalized and context-aware IoT applications. The S2 NeTM implements the foundational concepts examined previously in the paper to create social networks among IoT devices and their users, wherein users can interact and collaborate with devices and other users in a more intelligent and personalized way. This is achieved through the use of semantic technologies such as ontologies, which enable the devices to  
Figure 1: S2 NeTM architecture and operational environment. understand and interpret the context and meaning of the data they exchange with other devices and users.