Internet of Conscious Things: Ontology-based Social Capabilities for Smart Objects

: Emerging distributed intelligence paradigms for the Internet of Things (IoT) call for flexible


Introduction
Smart cities and digital societies call for increasingly intelligent, distributed and flexible service and resource management.As cities evolve toward a living organism model on both physical and digital planes, [1] pervasive computing infrastructures based on Internet of Things (IoT) sensors and smart devices act as its nervous system.The Edge Computing (EC) paradigm is increasingly adopted instead of first-generation architectures, strongly relying on Cloud Computing infrastructures: with the adoption of capable devices, several key data management and processing tasks can be performed at the edge of the network, thus achieving lower response latencies, more efficient bandwidth usage and higher data privacy and security.Advanced IoT scenarios require highly flexible composition and dynamic reconfiguration of services, resources and devices, each endowed with well-defined roles and responsibilities.Due to the high heterogeneity of vendors, device classes as well as application areas, interoperability and decentralized autonomous decision are still challenging issues.In latest years, a few interesting novel paradigms have been proposed, which may be applied at the EC level in IoT architectures.They typically exploit Artificial Intelligence to emulate aspects of human decision-making behaviors [2] in networked multiagent systems.The Semantic Web of Things (SWoT) [3] vision merges the Semantic Web (SW) and the IoT.Basically, a subset of useful knowledge representation and autonomous reasoning capabilities mutuated from the Semantic Web are adapted and optimized for EC contexts.Its mission is to support user goals and provide innovative services by improving intelligence of embedded objects and autonomic information management in pervasive contexts.Orthogonally, the Social Internet of Things (SIoT) paradigm [4] introduces a layer of social networking principles into the IoT ecosystem to enhance the efficiency, usability, and intelligence of interconnected devices.Benefits of SIoT architectures include: • dynamic interactions: smart objects are designed to interact not only based on predefined technical protocols but also through social relationships, akin to human social networks.Relationships mirror human social connections, such as co-location, co-work, friendship, and ownership, and facilitate more intuitive interactions independent from user engagement and from human Social Networking Services (SNSs); • context-aware collaboration: IoT devices act as autonomous agents building networks of social relationships and exploiting them to share information and services, and perform tasks collaboratively [5].The social layer adds context and relational data to the interactions, enabling devices to make more informed and context-aware decisions; • resource optimization: by leveraging social relationships, smart devices can optimize the allocation and negotiate access to shared resources, like network bandwidth or energy power, based on their social standing or priority within the network.
SIoT approaches have found significant applications in real-world scenarios, including smart mobility [6], smart building [7], and smart manufacturing [8].Nevertheless, ensuring interoperability among diverse devices from different manufacturers remains a critical challenge for the seamless functioning of SIoT networks.Monitoring and maintaining social relationships among a large number of devices is a challenging task requiring sophisticated algorithms and frameworks.The analysis in Section 3 highlights benefits and drawbacks of existing SIoT proposals.Specifically to overcome these limitations, this paper proposes a comprehensive framework, aiming to combine the best of SWoT and SIoT paradigms for EC-oriented scenarios.SWoT enables knowledge representation and autonomous reasoning at the edge of the network through carefully optimized inference services and engines.Specifically, non-standard inferences for semantic matchmaking are adapted for service/resource discovery, by defining a decentralized collaborative social protocol, through which smart objects can interact with their friends and followers along well-defined patterns in order to search for needed services, based on articulated request descriptions with well-defined semantics.The outcomes of discovery, and particularly the ability (respectively, inability) of an object to provide useful information to another one, contribute to strengthen (resp.weaken) their social links over the course of time, such that low-utility relationships can be dropped and new ones can be formed, based on a fully dynamic model.This allows coping with the volatile nature of IoT networks, where devices and active services can appear or disappear without notice.
The main contributions of the paper are as follows: • a novel framework combining a SWoT-based distributed collaborative service discovery protocol with a SIoT dynamic relationship and trust management model.This work extends the early proposal in [9] defining a completely renewed approach for social interactions among smart objects; to the best of our knowledge, existing works have focused on either one or the other aspect, but not on both together or on their mutual influence, incurring in functional limitations with respect to the proposed approach, as discussed in Section 3; • a decentralized collaborative service discovery protocol [9] grounded on Linked Data Notifications (LDN) over LDP-CoAP [10], which combines the Linked Data Platform (LDP) [11] for semantically annotated resource management and the Constrained Application Protocol (CoAP) [12] for Machine-to-Machine (M2M) interactions; this explicit and standards-based formalization of interaction primitives improves on existing research proposals for SIoT architectures based on custom interaction models; • a completely novel dynamic model for SIoT relationship management, measuring trust with a reputation system based on the usefulness of service suggestions in the decentralized collaborative social discovery protocol with additional features to prevent device isolation due to a "cold start" situation (i.e., when a device joins a new network where it has no friends) or to network partitioning after a link removal; this zero-configuration approach is an improvement w.r.t.most existing SIoT proposals; • a case study on a Plug-in Electric Vehicle (PEV) charging service marketplace, to illustrate the features and benefits of the proposed approach for Mobility-as-a-Service (MaaS) in a smart city scenario; • an experimental evaluation assessing the efficiency and effectiveness of both the dynamic relationship management and the collaborative service discovery in device networks of various sizes and configurations.
The remainder of the paper is as follows.Section 2 recalls basics of SWoT knowledge representation and reasoning, whereas Section 3 discusses related work.Section 4 describes the overall framework, followed by the case study presentation in Section 5. Experiments are in Section 6, before conclusion.

Fundamentals of the Semantic Web of Things
The convergence of SIoT and SWoT technologies marks a significant advancement in the development of intelligent and context-aware IoT ecosystems.Combining the social relationships and interactions of SIoT with the rich, machine-interpretable metadata annotated by means of knowledge representation technologies significantly boosts the interoperability of IoT systems, allowing devices from different manufacturers and with varying protocols to interact with each other seamlessly.In the SWoT, knowledge representation involves the formalization of information in order to enhance the ability of interconnected devices to understand, reason, and act based on the rich contextual and relational information inherent in distributed networks.Semantic Web languages and technologies grounded on Description Logics (DLs) [13] are adopted to facilitate sharing and understanding of unambiguous knowledge across heterogeneous ubiquitous microdevices.When SIoT leverages the SWoT, it benefits from enhanced interoperability through the use of common semantic frameworks and vocabularies.Specifically, this work relies on a general framework for the SWoT [14] based on an evolution of the classical Knowledge Base (KB) model, named ubiquitous Knowledge Base (u-KB).A u-KB represents a distributed knowledge base whose individuals (i.e., assertional knowledge) are physically tied to micro-devices on the objects disseminated in a reference environment.As shown in Figure 1, the following key elements are exploited in the proposed approach for implementing the reference SWoT framework in a social IoT context: The following non-standard inference services [16], implemented in Tiny-ME (the Tiny Matchmaking Engine) [17], have been adopted to support approximate matches, resource ranking and aggregation for covering complex requests: Finally, Concept Contraction and Abduction also induce logic-based penalty functions, as metrics of semantic distance between R and S [16].

Related work
The SIoT aims at extended device collaboration.Service Oriented Architecture (SOA) is one of the dominant paradigms, where intelligent service/resource discovery is a core capability [5].Most SIoT approaches for ranking services/resources w.r.t. a request/profile specification are based on (i) object social connectivity, (ii) object mobility patterns and/or (iii) preference similarity.This work exploits (i) and (iii), while (ii) is taken into account implicitly through dynamic relationship set-up and tear-down.In [18] a cosine similarity was computed combining metrics (ii) and (iii), improving results w.r.t. each single metric, although preferences and resources were described by means of a simplistic set of keywords, lacking proper semantics.Similarly, [19] presented an automated service discovery process for mobile crowdsourcing applications.A large-scale IoT network was split into multiple virtual communities, grouping IoT devices which share common characteristics modeled using social relations.A Natural Language Processing (NLP) approach handled crowdsourcing textual requests and retrieved the list of IoT devices capable of accomplishing the requested tasks, although semantic processing was completely missing.
Semantics-based approaches improve context-awareness as well as discovery capabilities in multi-agent systems [20].In [21], a distributed OWL Knowledge Base (KB) management system has been exploited to enhance M2M social interactions in control networks.Unfortunately, supported inferences were very basic, limiting the applicability of the proposal.In [22], semantics-based situation detection and goal retrieval were exploited for matchmaking with task profiles for recommending activities to users, based on their current context.Nevertheless, social interactions occurred only between devices and users; furthermore, adopted rule-based reasoning could not retrieve approximate matches when exact ones did not exist.Likewise, [23] focused on activities of daily living in smart homes, generating task-oriented recommendations for user's situational goals.A coastal monitoring system has been proposed in [24] leveraging the Lysis [25] SIoT platform to virtualize physical IoT devices, supporting social relationships as well as semantic resource descriptions and queries in order to establish automatic device cooperation A similar approach was adopted in [26] for Social Internet of Industrial Things scenarios.In both works an ontology-based model describes social objects, but no formal framework is provided to exploit it for resource/service discovery.In [27], Near Field Communication (NFC) technology mediated social interactions between everyday objects and agents running on mobile devices.Ontology-based representations enabled both reactive and proactive behaviors by means of rule-based reasoning for planning toward situation-aware goals.Though interesting, the approach does not appear general enough to support a wide range of SIoT scenarios.A cognitive reasoning-based framework for SIoT services discovery in smart spaces was proposed in [28].Unfortunately, the dynamic evolution of social relationships between smart object pairs was not exploited for service recommendation in the reasoning phase.Similarly, the LDP-CoAP framework in [9] provides a social collaborative protocol for resource discovery based on standard Semantic Web technologies, but relationships among smart objects are essentially static.
Social connectivity management leverages the properties of things relationships.Several classifications exist in literature.In [29] and subsequent works, parental (same manufacturer), co-location (same environment), co-work (cooperation), co-ownership (same owner) and social (sporadic or frequent contact) were identified as basic object relationships.Similarly, [26] defined four types of relationships between industrial device assets: parental (component-of), same functionality, replacement, and cooperation; friend discovery, however, was based on a purely syntactic match of attributes.The analysis in [30] was inspired by literature on human SNS, instead, and resulted in an ontology allowing objects to manage their policies, friends and reputation.The ontology model developed in [31] included social relationships among events, people and objects in IoT environments.The SIoTPredict framework [32] predicted future relationships among devices in a dynamic and heterogeneous SIoT network with a Bayesian nonparametric learning model by exploiting the trajectories of IoT objects and their corresponding location.
Trust management is one of the most relevant issues in the SIoT [33,34].In this work the focus is on application-level trust, particularly in social objects relationships.Trust metrics can be retrieved from friends (recommendation), reliable intermediaries (reputation) or direct knowledge [5,35].[36] introduced a subjective and an objective (i.e., shared) model, exploiting techniques mutated from peer-to-peer networks.The collaborative cognitive radio framework in [37] leveraged the SIoT relationship types described above in [29] to improve both the reach of channel status queries and the trustworthiness of information through weights depending on the degree of friendship.A refinement was proposed by [38], where trust was defined as a function of reputation on past transactions, relationship type and energy status.Reputation combined direct and friend recommendation scores, while the relationship type between two devices was derived from a correlation of trustworthiness w.r.t.mutual friends.Similarly, [39] composed a honesty model out of spatial (object proximity), temporal (frequency and duration of interactions), relationship and credibility (cooperativeness and penalties) metrics.The credibility aspect is the closest to the proposal in this work.[40] adopted a similar approach, albeit in that case honesty referred to the absence of malicious behaviors.For this purpose, a trust propagation and aggregation scheme was introduced, conceptually similar to the objective trust model in [36].The above works, however, aimed only at improving transaction success and did not consider dynamic social relationships.That issue was tackled by [41], exploiting Bayesian belief propagation networks.Similarly, [42] proposed a hybrid trust management framework for SIoT networks.The Probabilistic Neighbourhood Overlap method estimated tie strengths between nodes in a social graph generated by combining the social networks of both devices and their owners.In a SIoT network, malicious connections should be kept to a minimum.A node behaviors analysis module based on machine learning was exploited in the trust assessment process by [43], enabling not only the discovery of malicious node connections but also the identification of the kind of performed attack, in order to prevent them in the future.The ConTrust [44] method proposed a context-dependent trust management technique for selecting a trustworthy service provider and allocating jobs in a SIoT environment.The trust model fused trust theory with social networks.
In summary, it can be noted that all the above works focus either on service discovery and composition or on dynamic relationship and trust management, disregarding or trivially simulating the other aspect.Table 1 summarizes relevant feature of some of the previously mentioned frameworks with respect to the approach proposed here.In particular, this work is the first proposal of a complete stack, including (i) semantics-based cooperative service discovery and composition, (ii) full standards-based implementation, (iii) device trust assessment and (iv) dynamic social relationships; the work enhances a previous proposal [9] w.r.t.dimensions (ii) and (iii), and it introduces a novel formal framework for (i) and (iv).

Social awareness in the Semantic Web of Things
This section outlines the proposal for social things intelligence and knowledge-based cooperation.A high-level SIoT architecture is defined, where every device can expose and request services (i.e., functionalities).When a device detects a context change which requires a reconfiguration, it issues a request on the social network.Then a collaborative discovery process starts, exploiting semantic matchmaking to retrieve the best available services from the network for covering the request.Technologies grounding the framework, collaborative service discovery and dynamic relationships management are detailed in the next subsections.

LDP-CoAP social framework
The reference framework, illustrated in Figure 2, is implemented through the Linked Data Notifications protocol [45], on top of the Linked Data Platform [11] mapping [10] for the Constrained Application Protocol, [12] a lightweight HTTP-like protocol for the Web of Things.LDP defines standard rules for accessing and managing Linked Data.LDN is a specialized use of LDP following an interaction model where servers (also called receivers) advertise a receiving endpoint (inbox) for messages (notifications) and receive RDF-based data pushed by generic applications (senders).Then, the receiver exposes the notification data (according to appropriate access control) for use by consumers.Messages can be retrieved and used according to consumer needs.According to the proposed architecture, a pair of devices can establish two basic kinds of social relationships: • Friend, a bidirectional relationship where nodes N i and N j can exchange both information and services.In particular, a device N j sends a friendship request; since the receiver N i accepts it, they became able to: (i) read and write on each other's wall, acting as a LDN receiver and a LDN sender (to write) or consumer (to read), respectively; (ii) request the friend's service descriptions; (iii) activate or deactivate the friend's services.
• Follower: a unidirectional relationship where a node N k is interested only in receiving the updates published by N i on its wall.In other words, if N k sends a follower request to N i , N k becomes a LDN consumer for N i .
As depicted in Figure 3, social devices expose an LDP interface composed of a set of resources described exploiting both several well-known RDFS vocabularies (e.g., Dublin Core [46] and Semantically-Interlinked Online Communities (SIOC) [47]) and an additional ontology, named Semantic Web of Social Things (SWST) 1 , proposed in [9] to model basic elements of a social network.The inference services described in Section 2 are used to regulate the interactions between nodes.Nodes (i.e., things) are divided in two types: smart devices, able to execute inference tasks; basic devices, endowed with low memory and processing capabilities, only providing sensing/acting services without performing autonomous reasoning.Regardless of type, each object is modeled as a LDN receiver and owns a wall.It is a LDN inbox containing one or more posts, defined as nested resources, including comments.Posts and comments are used to enable the proposed interaction model.For example, sensor devices can observe the surrounding environment and use posts to share observations with actuator agents on the network, which usually present limited or no sensing capabilities.By reading the posts, these devices can become aware of current conditions and activate or deactivate specific services.Similarly, smart devices, equipped with both sensing and actuating capabilities, can use posts to initiate a discovery process.If a smart agent cannot independently address the perceived changes, it can find other social agents that provide useful services.Moreover, a basic node, when becoming friend of a smart node, can also select it as semantic facilitator i.e., reasoning supporter.As detailed in [9], post descriptions have the following attributes: • creation date (dcterms:created); • sender device (swst:postedBy); • content of the post (sioc:about), as Internationalized Resource Identifier (IRI) of the individual representing the received OWL annotation; • like value (swst:likeValue).
Instead, comment annotations associated to a post include: • creation date; • sender device; • tagged (i.e., activated) services, selected through the covering process described in Section 4.2 (sioc:topic); • content of the comment, representing the part of the original post not covered by tagged services provided by the friend device.
Each social thing also exposes a semantic-based profile describing its own main properties: type of device, device name, supported ontologies used as reference vocabularies to define the OWL-based annotations of the services exposed by the device; location of the device (e.g., in an area, building, department, apartment), (possible) friend and followed devices.Finally, all functionalities exposed by a device are contained in the services resource and characterized by name, IRI of the OWL individual modeling the service within the reference KB, timestamp of the last modification of the individual description, service current state and specific value to be used to activate the functionality.

Cooperative service/resource discovery
The social network of things exists to support cooperative service discovery and configuration.Exploiting the non-standard inferences recalled in Section 2, whenever a device requires new services or a change to its current settings, its request is formalized as a DL annotation R. The proposed framework does not constrain when a device should issue a request, neither how to derive a proper request annotation.As outlined in [7], smart objects are expected to execute data mining and inference on perceptions collected from on-board or nearby sensors in order to characterize the environment and detect relevant events and changes (details on the data mining aspect are out of the scope of this paper).When the request is formulated, a cooperative multi-hop discovery process starts, using Concept Covering to satisfy it as much as possible through aggregation of available services/resources. Figure 4 shows the sequence diagram for a canonical discovery example.Three devices are considered: D 1 is the requester and D 2 is friend to both D 1 and D 3 .When D 1 generates its request R 1 , it will post it on its wall (post P 1 ).A local covering process starts, where D 1 exploits its embedded matchmaking engine to cover R 1 as much as possible with the   [48] is adopted to notify the device whenever a friend's service set changes.The covering result consists in a set of selected services and possibly the uncovered part U 1 of the request.This information is appended to P 1 as comment C 1 on D 1 's wall, along with the covering degree associated to P 1 as the like value L 1 .If there is some uncovered part U 1 , then D 1 picks some friends to help find further services.Selection criteria include the number of friend's services referring to the same ontology of the request and historical performance data concerning the number and relevance of retrieved services, as well as communication latency and bandwidth.
In the reference figure, D 1 picks D 2 and POSTs a new post P 2 on D 2 's wall, attaching U 1 as the new request.D 2 computes semantic matchmaking using its friends' service descriptions, while excluding its own services as they have already been considered by D 1 .The new covering process yields (possibly) further selected services, a new (smaller) uncovered part U 2 and an updated (higher) like value.D 2 adds this result as a comment to P 2 .Complying with LDN, this update is notified to D 1 through the Observe CoAP pattern 2 .
Then D 1 GETs the content of the comment and updates the like value associated to its own original request on its own wall.Supposing the request has not been fully covered yet, D 2 repeats the process recursively, writing a new post P 3 on its friend D 3 's wall (which is not a friend of D 1 ).D 3 executes matchmaking with cached service descriptions of its friends (except D 2 ).The outcome leads to a comment and updated like value on P 3 : they are notified to D 2 , which GETs the content of the comment and reports it as a new comment C 2 on post P 2 into its own wall.This in turn activates notification for D 1 , which GETs the comment.Finally, it updates its original post P 1 with the updated set of selected services, uncovered part and like value.The process goes on until at least one of the following conditions becomes true: • the request is fully covered or the covering procedure reaches a minimum threshold l min of like (i.e., satisfaction) value.When a device reaches this limit value, the covering procedure can be stopped, and there is no need to forward the potentially uncovered part of the request to other friends.In this way, each device can prevent network from being flooded with unnecessary communication which can degrade performance and lead to delays or lost messages; • a maximum distance d max from the request source is reached in the social graph.It represents the maximum number of hops a message can make from its original sender during the discovery process.In particular, a direct friend has depth 1, whereas a friend of a friend has depth 2. This parameter ensures that only nodes within a relevant proximity receive the message, improving the overall efficiency of the network by focusing communication on the most pertinent areas.Basically, the proposed protocol exploits a classic expanding ring search, with the peculiarity that it is not based on topological distance, but on social distance.
The proposed service/resource discovery is a distributed process, as outlined in Algorithm 1.When a device holds a request, after performing the local covering process, updating the comment (with the uncovered part of the request) and the like value (with the coverage ratio), (lines 1-4) is finally ready to exploit its social capabilities to identify friends who can advantageously help it in fulfilling the request (line 5-7).Every friend device receiving the updated request verifies that the distance constraint in the social graph from the original sender is satisfied and starts a new decentralized covering.Then the uncovered part of the request and the like value are updated.The Forward_To_Friends procedure (Algorithm 2) goes on recursively to the next level of friends until the request is fully covered, or the like threshold l min is met, or the social distance limit is reached.
Both l min and d max are tunable parameters.Furthermore, it is important to remark some points: • the natural hierarchic structure of social network items (comment ∈ post ∈ wall) is neatly mapped to LDP containers and resources, where each item can be uniquely addressed and explored; • the LDN notification framework accommodates the needs of social network applications; at a lower level, the proposed machine-to-machine SIoT approach implements LDN with the CoAP Observe pattern; • service discovery is collaborative and recursive, exploiting service descriptions shared between friends and the possibility to write posts and comments on each other's wall.Semantic matchmaking underpins logic-based service relevance ranking and request covering; • although not shown in Figure 4 for the sake of readability, selected services are activated at the end of each discovery step by tagging them through LDP-CoAP PATCH methods [9]; • becoming a follower of a device D grants automatic registration as observer for every post published on D's wall from that moment on, through the CoAP Observe pattern; • a discovery session produces, for each participating device D, exactly one wall post, with a number of comments equal to the devices D has directly or indirectly involved in the matchmaking process.As described in the next subsection, devices can exploit them as a log to adapt their relationships dynamically, calculating metrics of usefulness for each friend.

Managing dynamic social relationships
The proposal aims to extend the framework described in [9] to endow social objects with proactive adaptivity to environmental modifications in order to improve selforganization through social relationships refinement.Based on past experience (i.e., previous interactions over the social network), each object is able to adapt its relationships dynamically according to context changes, in order to improve not only the processing on the single node but also the overall network performance.Removing unnecessary relationships aims to reduce network traffic e.g., less messages will be forwarded during a service discovery process.Conversely, new meaningful interactions can increase the network effectiveness and reduce the relative computational load per node: a request could be satisfied with lower processing time and activating the minimum set of services.The following models are proposed to suggest and remove friendship relationships based on the experience of each social object.
Suggestion.After every time period T, each smart device queries its wall to retrieve the list of devices that sent a comment to or were tagged in a post.For each such device D, the suggest function S(D) is computed as follows: with The following symbols are used in the above formulae: • N c (D): number of comments created by D; • N u (D): number of useful services provided by D, i.e., D's services tagged as result of Concept Covering; • w (between 0 and 1): used to weigh the contribution of U(D), considering a device as direct provider of useful services, and C(D), representing the ability of D to contribute to service discovery by acting as a "bridge" toward other useful devices; • T: timestamp at which all functions are evaluated; • t i/j ≤ T: timestamp at which a comment/post was created; • X > 1: decay rate coefficient, weighing the past history of a device: the higher the value, the lower the relevance of older contributions.
Division by X X−1 normalizes S(D) w.r.t. the theoretical convergence value of the geometric series with ratio 1 X , implying that 0 ≤ S(D) ≤ 1.According to the proposed model, a device will be suggested as a good candidate friend if it provides services frequently and/or it is a friend of many useful devices.New friendship requests will be sent to devices with an S score higher than a reference threshold (TH-suggest).Considering the example in Figure 5 with where P(D) exploits past results of local Concept Covering processes.In detail: • N i (D) is the number of D's services, detected as incompatible w.r.t. the requests received in the period T; • t k ≤ T is the timestamp at which the covering process was performed and the incompatibility was identified; is the penalty score measured by Concept Contraction.
For each friend device, if R(D) (which is always in [−1, 1]) is less than a TH-retract threshold, the friendship will be removed: the meaning is that D often provides conflicting services (wasting processing and communication resources) and/or it does not have a useful impact in satisfying received requests.The example in Figure 5(c) shows device D 1 breaking its friendship with D 2 .
Satisfaction.In loosely connected networks, social devices could be without any friends, e.g., due to a "cold start" configuration with isolated objects (as shown in Figure 5(a)) or frequent friendships retractions.In the protocol described in Section 4.2 isolated objects are unable to both establish new friendship relations and cooperate.In order to overcome this problem, a satisfaction indicator, based on likes, identifies and solves object deadlocks.Periodically, each device D evaluates its satisfaction degree w.r.t. received or generated requests by means of the formula:

Case study: social smart mobility for electric vehicles
A smart mobility case study referring to power management of Plug-in Electric Vehicles is discussed to highlight capabilities and benefits of the proposed framework in dynamic environments.Figure 6 depicts the envisioned scenario.A 2017 BMW i3 plug-in electric taxi (T 1 ) usually serves "district A" of a large city.It has friendship relations with vehicles of its PEV taxi company and some of the charging stations in the city.
A possible ALN formalization of electric vehicle power management aspects (reported in OWL 2 Manchester syntax [49] w.r.t. the reference domain ontology) is in Figure 7.For the sake of conciseness, figures in this section show only some relevant classes of the ontology.A customer requests to be taken to "district Z", seldom visited by the taxi.After leaving the customer, the PEV taxi informs the driver that battery level is below 50% and recharge is needed.The taxi formulates the semantic-based recharge request depicted in Figure 8, corresponding to a charging rate of at least 25 km per charging hour, minimum available energy of 20 kWh at charging station and maximum distance of 5 km between taxi and charging station and 30 km between charging station and dispatcher, and maximum price of 50 cents per kWh.This is used in a Concept Covering task (Section 2) on the locally cached set of functionalities exposed by all direct friends of the taxi.Unfortunately, those service instances present some conflicting features and cannot be selected.As detailed in Figure 8, the charging station CS 1 is too far from the current taxi position (has_Distance), because it is located in "district A", and it is too expensive (has_Fee_Per_kWh).At the charging station CS 2 located in the "district Z", DC charger equipment is CHAdeMO (has_DC_Compatible_Plug) which is not suitable to charge taxi T 1 .Furthermore the price per kWh and the distance between charging station and dispatcher exceed the desired one.According to Section 4.3, the taxi periodically computes Retract R(D) scores for each friend.If CS 2 service of device D still remains incompatible with taxi needs, D's score will progressively decrease until friendship breaks up when it becomes less than the given TH-retract threshold.The request cannot be completely satisfied.So taxi fleet agents autonomously cooperate in order to share useful information about electricity suppliers among their friends and suggest the services they offer.A new charging station service CS 3 in "district Z", summarized in Figure 9, is selected and tagged (i.e., suggested) by the friend T 3 .Service description has a dispatching distance higher than the desired maximum but non-exact match is tackled by means of nonstandard reasoning services for semantic matchmaking recalled in Section 2. Furthermore, the experience factor suggest S(D) described in Section 4.3 is exploited to refine social relationships.Let us suppose the taxi becomes a frequent visitor of "district Z" and here it often needs charging.If CS 3 service of device D new is frequently tagged, S(D new ) value will increase during the social object's lifetime and a new friendship relation will be suggested to directly retrieve and use the services of the charging station.This is just a small example to highlight the benefits of the proposed semantic-based SIoT framework.In real smart mobility scenarios, more complex requests and service descriptions are expected, and non-standard inferences will be even more useful for service ranking and composition to satisfy detailed requests.

Experiments
In order to implement the proposed social intelligence framework, the LDP-CoAP proposal 3 described in [10] has been extended to support the LDN specification.Novel functionalities have been evaluated through the LDN Test Suite 4 .By default, the suite directly queries LDN resources by means of HTTP messages; therefore for LDP-CoAP tests, requests are sent and received through an enhanced version of the Californium [52] CoAP proxy 5 .The suite consists of three sets of tests referred to LDN sender, receiver and consumer.LDP-CoAP fully supports all LDN requirements as reported on the official test summary Web page 6 .
Evaluation about the efficiency and effectiveness of the collaborative social protocol, as well as the impact of the dynamic model proposed for SIoT relationship management, has been carried out testing social objects with 18 different network configurations, generated by combining the parameters reported in Table 2.A preliminary phase has been performed to empirically validate values (the same for all devices) of parameters used by the experience functions described in Section 4.3: decay rate X = 2, ensuring an adequate and not excessive decay for older elements of the time series; w = 0.3, to favor devices exposing tagged (i.e., selected) services over objects only sending comments; TH-suggest = 0.5, TH-retract = -0.1 and TH-satisfaction = 0.2, aiming to remove friendships only if really needed (in volatile contexts devices should be able to exploit availability opportunistically) and to suggest new relationships appropriately, while limiting the network overhead.Maximum hop count of the cooperative service discovery process -detailed in Section 4.2-has been set to 2 for all devices.
For each configuration, tests have been repeated 20 times (corresponding to 20 random initial topologies) monitoring the network evolution during 10 periods of 60 seconds.Experiments have been conducted exploiting three sets of 10, 100 and 1000 device descriptions, respectively.Each device exposes 5 services, each associated to an OWL annotation generated as the logical conjunction of 10 OWL classes (also including negated classes) randomly selected from a total of 168 classes in the reference ontology.After each period, the following output values have been computed to identify specific behaviors characterizing the social network and in particular to evaluate the capability to adapt social relationships dynamically according to context changes: (i) number of friends per node; (ii) like value received by a post; (iii) number of forwarded messages (i.e., how many devices are contacted to satisfy a request); (iv) number of activated services per request; (v) size of payload data exchanged on the network to satisfy a request (including uncovered part of requests forwarded to friends and comments retrieved from the wall of contacted objects).Obtained results have been averaged in order to filter out the bias deriving from conditions of single runs.Devices have been initialized at the beginning of each test whereas requests have been generated at random instants, with uniform probability distribution within the simulation time.
Small-size networks.Figure 10 shows test results for scenarios with 10 nodes.For loosely connected networks (RND), like values are very low (below 0.45) in the first period, as reported in Figure 10(b), due to the few friendship relationships (Figure 10(a)).For each request, a device starts a local covering process with few available services, so it is only partially satisfied through a minimal set of useful functionalities (Figure 10(d)) and a large amount of data (corresponding to the uncovered part of the request) is forwarded to friends (Figure 10(f)).Thanks to the Satisfaction and Suggestion indexes described in Section 4.3, unsatisfied devices (e.g., isolated nodes) promptly look for useful friendships.In the second period, it is possible to notice both a considerable increase of the like value and a reduction of the data exchanged on the network.Having more friends, each device is able to locally satisfy a request in a better way and to forward a smaller uncovered part.A similar trend can be also identified for BA and DM network configurations; in these cases, however, the network starts with a higher degree of connectivity in the first period, generating higher like values -as shown in Figure 10(c)-which increase more slowly w.r.t. the previous   scenario.Nevertheless, semantic-based experience factors allow satisfactory like values, reducing at the same time the network traffic.In fact, introducing more useful friendships and removing useless ones allows social things to select the most suitable services at each hop of the cooperative covering process, converging faster to the final result.Moreover, the request rate mainly affects the behavior of social networks with few connections: device relationships are modified more frequently, leading to lower like values and less efficient cooperative covering.Few messages are forwarded to friends, as reported in Figure 10(e), due to the more variable social network configuration.On the contrary, social devices are able to establish stable relationships after about 4 periods for all other configurations.
Medium-size networks.Also in scenarios with 100 nodes (results detailed in Figure 11) loosely connected networks take quickly advantage of dynamic relationship adaptivity.
Compared with small newtorks, mean like values are increased (Figure 11(b)) by virtue of a wider choice of possible friends to exploit as service providers.This also implies decreased transmitted data (Figure 11(f)), since the distributed discovery converges in fewer hops.
In small-world (BA) and strongly connected (DM) network scenarios, mean like values (Figure 11(c)) improve their performance over the periods, while results on exchanged data are very similar to small networks.The presence of many devices facilitates the discovery of additional useful friends, as reported in Figure 11(a).As a consequence, higher like scores have been obtained: all network parameters tend to steady-state values in about three (friendships and exchanged data) to five (activated services and forwarded messages) periods.
Large-size networks.Finally, results for scenarios with 1000 nodes are reported in Figure 12.Large networks follow similar trends highlighted for small and medium configurations.Main differences compared to medium scenarios concern: (i) fewer friends per device (Figure 12(a)), as friendships are removed more frequently in large networks, so the number of friends grows more slowly; (ii) fewer activated services per request (Figure 12(d)) because, when nodes reach the steady-state configuration, the covering process is able to select few services which largely satisfy a request, rather than many services each covering a small part.Thanks to these optimized relationships, mean like values in large loosely-connected (RND) networks (Figure 12(b)) increase w.r.t.small and medium ones; on the other hand, for BA and DM network models the is not a significant difference in like values between large (Figure 12(c) and medium networks, meaning in the latter case devices are already able to find a sufficient number of friends to satisfy their requests.Moreover, devices save storage space (activated functionalities are tagged and saved on the device wall) and keep the network overhead required to contact and activate remote services as low (Figure 12(f)) as in small (Figure 10(f)) and medium (Figure 11(f)) ones.This is a clear benefit of the approach, envisioning good scalability: even on large networks, nodes establish a balanced number of high-quality friends and share their resources without overloading the network.The same test suite has been exploited to compare results of the proposed dynamic approach with the static SIoT relationship management model in [9].A direct experimental comparison has been possible only with that framework, as the other state-of-the-art works reported in Section 3 have not published their code.Tests have been run using the same initial configurations, comparing the steady-state results after N = 10 time periods.The framework in [9] does not allow for dynamic relationship configuration; therefore, performance critically depends on the initial overlay network topology.Figure 13 highlights the deltas related to the different parameters for the 18 network configurations tested in the evaluation.Main discussion remarks are as in what follows: • medium-size networks exhibit higher variations in the average number of friendships per node (Figure 13(a)).With 100 nodes, the network is large enough to facilitate multiple connections without becoming overwhelmingly complex.Medium-sized networks often see the formation of dynamic tightly-knit communities or clusters, which naturally enhances the number of friendships as nodes within these clusters are more likely to be interconnected.In particular, novel friendships are created for small and medium networks with frequent device requests (i.e., RND_70, BA_70 and DM_70) where several interactions foster more connections and higher levels of friendships.
In large fully connected networks, the number of friendships tends to remain stable due to a dynamic equilibrium in the formation and retraction of connections.As the network grows, new relationships are established, but existing ones may also be retracted if they are deemed less useful or redundant; • with the proposed approach like values in Figure 13(b) become higher in all configurations, particularly in loosely connected networks with frequent isolated objects (i.e., RND configurations).In such networks, dynamic relationships allow nodes to continuously form and adjust connections based on evolving interactions and needs, and the like values tend to rise more noticeably due to the enhanced potential for discovering novel and useful connections.As nodes interact with a more diverse set of peers, they can uncover and leverage previously inaccessible resources and services.
On the contrary, in fully connected networks (i.e., DM configurations), new connections are relatively saturated.Many nodes are already connected and aware of existing services, leaving less room for discovering and activating new functionalities.As a consequence, the number of activated services tends to increase in small and loosely connected networks (cells with light colors in Figure 13(c)), whereas it even decreases in large and fully connected networks (blue cells).In these cases, the network tends to reach an optimal configuration by activating only the most suitable subset of services, as testified by high like values: this means that network efficiency is maximized and unnecessary complexity is avoided; • in small and medium networks, the number of forwarded messages remains stable or slightly increases due to the simplicity and directness of social interaction routes (Figure 13(d)).The limited network size allows for efficient message routing with fewer forwarding steps.In contrast, large networks exhibit an increase in the number of forwarded messages due to their complexity and the need for more indirect communication paths also in case of dynamic and re-configurable relationships.Nevertheless, across all network configurations (Figure 13(e)) there is a noticeable decrease in the amount of exchanged data related to service discovery.This trend reflects the improvements introduced by the proposed approach in the efficiency of the service discovery process, regardless of the network size or connectivity pattern.However, the decrease is particularly significant in loosely connected networks where the dynamic relationship management model significantly enhances the overall behavior of the social network.Devices are capable of quickly contact new nodes and active services while minimizing unnecessary data exchanges.As a result, the network operates more efficiently, with improved resource utilization and enhanced communication pathways.

Conclusion
This paper has introduced a novel comprehensive framework combining the Semantic Web of Things and the Social Internet of Things to enable dynamic autonomous management of smart object networks in Edge Computing.While basically general-purpose, the approach has been illustrated by means of a smart mobility case study.Key features of the proposal include: a decentralized collaborative service discovery protocol, grounded on Linked Data Notifications on top of LDP-CoAP and on non-standard inference services in Description Logics over service descriptions in Web Ontology Language; a dynamic social relationship management protocol, based on the friends' usefulness as a service and device recommender.Experimental evaluation has validated the sustainability and efficiency of the proposal for objects networks of various sizes and topologies, extending the preliminary results obtained in previous works about processing time and memory consumption of the service discovery procedure [7,9] and non-standard reasoning algorithms [17] on resource-constrained IoT devices.The dynamic relationship management based on a close SWoT-SIoT integration allows devices to increase their number of friends even in small or poorly connected networks, leading to higher request satisfaction rates and reduced network load, since the most effective service/resource providers are queried directly.As network scale grows, the framework remains able to reach steady-state conditions fairly quickly, with a balanced number of friends for each device, leading to consistently high request satisfaction and low network load.Experimental comparisons have shown improvements w.r.t.static relationship management in [9]: in random networks friendships are 50% to 250% higher, request satisfaction is 100% to 150% higher, and the number of activated services is 100% to 150% higer, all with a 100% lower amount of exchanged data; in Barabási-Albert networks established friendships are 100% to 400% higher, like values are 10% higher, while the number of activated services is 10% to 50% higher in small networks and decreases up to −50% in large networks, implying that the discovery of the best services is more effective, as demonstrated also by −60% exchanged data; in strongly connected (Dorogotsev-Mendes) networks, friendships are 50% to 150% higher, like values are 2% higher on average, the number of activated services increases up to 30% in small networks (implying more matches are found) and decrease up to −55% in medium-and large-size networks (implying requests are satisfied equally well or better with fewer services, as the high number of available services allows a more effective selection), with a 15% to 30% decrease in exchanged data.
Future work includes expanding on the type of social relationships, in order to diversify supported interaction patterns.Autonomic management of weights in the model described in Section 4.3 is also under early investigation, based on discovery performance as well as computational and network load.As the collaborative discovery protocol represents a form of dialogue among participating social objects, [53] emphasizing this aspect of the proposal is under scrutiny, by means of a more explicit formalization exploiting computational argumentation frameworks.From an infrastructure standpoint, integration into the cloud-to-thing continuum can enable leveraging a large-scale distributed architecture for collaborative tasks such as environmental monitoring and federated learning [54].Finally, increasing the Technology Readiness Level (TRL) of the proposal will be achieved through practical implementations in real-world use cases spanning from smart mobility to building management systems, smart grid, precision agriculture, and last-mile logistics.

Figure 1 .
Figure 1.Semantic Web of Things architecture for SIoT

Figure 2 .Figure 3 .
Figure 2. Social IoT framework and interaction model (a), if device D 1 frequently activates services of D 5 through intermediate friends D 2 and D 4 , it will learn and ask for D 5 's direct friendship as in Figure 5(b).Retraction.Along with the suggestion of new friends, a retraction score R(D) is calculated for each friend device D to identify worthless relationships: R(D) = S(D) − P(D)

Figure 8 .
Figure 8. Semantic annotations of taxi request and friends' services

CS 3 Figure 9 .
Figure 9. Semantic description of selected service

Figure 10 .
Figure 10.Test results for small-size networks.Legend denotes values of parameters for each configuration (<generation algorithm>_<number of nodes>_<request rate>).

Figure 11 .
Figure 11.Test results for medium-size networks.Legend denotes values of parameters for each configuration (<generation algorithm>_<number of nodes>_<request rate>).

Figure 12 .
Figure 12.Test results for large-size networks.Legend denotes values of parameters for each configuration (<generation algorithm>_<number of nodes>_<request rate>).
= {S 1 , S 2 , ... , S n } in order to satisfy an articulate request R. The (Abduction-based) Covering service finds a pair ⟨S c , H⟩ where S c ⊆ S includes concepts compatible with R whose conjunction covers R as much as possible; H is the residual part of R possibly not covered by concepts in S c .
• Concept Contraction: if a request R and a supplied resource S are not compatible with each other, Contraction determines which part of R is conflicting with S. By giving up only conflicting requirements G (for Give up) in R, an expression K (for Keep) remains, which is a contracted version of the original request.The solution G to Contraction represents "why" R and S are not compatible; • Concept Abduction: if request and resource are compatible, but S does not satisfy R completely, Abduction determines what should be hypothesized in S in order to obtain a full match, i.e., to make the subsumption relation true.The solution H (for Hypothesis) to Abduction can be interpreted as what is requested in R and not specified in S; • Concept Covering: in advanced distributed systems it is often useful to aggregate multiple low-complexity resources S

Table 1 .
Comparative analysis of SIoT frameworks (✓: supported, ✗: not supported, ✶: partial support) Device D, Request R, minimum threshold of like l min , maximum distance d max Procedure Distributed_Discovery(D, R, l min , d max ) Device D, Post P, Uncovered Part U, Like value like, minimum threshold of like l min , maximum distance d max Require:Require: Ensure: Forward request to friends 1: if calculate_social_distance(D, F) ≤ d max then 2: for F in select_friends(D) do 3: forward_post(F, P, U) {Forward the post to the friend F} 4: cover_request(F, U) {Cover the request U with F's available services} 5: U ← P.comments[−1].uncovered_part{Update the latest uncovered part} 6: like ← P.like_value {Update the latest like value} 7: if (like ≥ l min or U = null) then 8: break {Check if the request is fully covered or meets the like threshold} 9: end if 10: forward_to_friends(F, P, U, like, d max , l min ) {Recursively forward the request to the next level

Table 2 .
Network configuration parameters