A Hybrid Semantic Knowledge Integration and Sharing Approach for Distributed Smart Environments

Distributed systems provide smart functionality to everyday objects with the help of wireless sensors using the internet. Since the last decade, the industry is struggling to develop efficient and intelligent protocols to integrate a huge number of smart objects in distributed computing environments. However, the main challenge for smart and distributed system designers lies in the integration of a large number of heterogeneous components for faster, cheaper, and more efficient functionalities. To deal with this issue, practitioners are using edge computing along with server and desktop technology for the development of smart applications by using Service-Oriented Architecture (SOA) where every smart object offers its functionality as a service, enabling other objects to interact with them dynamically. In order to make such a system, researchers have considered context-awareness and Quality of Service (QoS) attributes of device services. However, context modeling is a complicated task since it could include everything around the applications. Moreover, it is also important to consider non-functional interactions that may have an impact on the behavior of the complete system. In this regard, various research dimensions are explored. However, rich context-aware modeling, QoS, user priorities, grouping, and value type direction along with uncertainty are not considered properly while modeling of incomplete or partial domain knowledge during ontology engineering, resulting in low accuracy of results. In this paper, we present a semantic and logic-based formal framework (hybrid) to find the best service among many candidate services by considering the limitations of existing frameworks. Experimental results of the proposed framework show the improvement of the discovered results.


Introduction
Dynamic environments are based on different kinds of intelligent objects that work together without human involvement to make their life comfortable [1,2]. Such a smart environment aims to satisfy and to enhance the experience of individuals by replacing the risky work with smart IoT objects. These smart objects while working in a smart environment can provide services ranging Traditionally, context-awareness, which is considered as an integral part of smart systems operating in distributed computing environments, is defined as the location, speed, time, and similar physical attributes of an object or a device [22]. However, it should also consider the current state of the environment. Therefore, context modeling is a complicated task as it may include everything around the application. Moreover, the non-functional interactions among edge objects should also be considered in order to understand the behavior of the complete system. Particularly, in a scenario where, if more than one smart object is providing similar or identical functional services to other objects upon their request, in such scenarios, the biggest challenge for requesting an object would be to find the best service while considering context-awareness and QoS attributes.
In this regard, researchers have done a lot of work [23][24][25][26][27]. However, QoS metrics, user priorities, value type direction, service-ranking, and rich context-awareness along with the uncertainty of incomplete domain knowledge modeling for smart systems operating in distributed computing environments are not considered properly, resulting in low accuracy of results. Therefore, in this paper, • A logic-based semantic hybrid framework upon the above-discussed limitations is proposed that uses Semantic Web technologies to build dynamic context and QoS models for the sharing of knowledge.

•
The proposed framework provides a dynamic environment for the sharing of domain information among devices. The framework uses an ontology-based (QoS, application, and context-awareness) service discovery mechanism for modeling the request and a service-matching algorithm.

•
In order to verify the effectiveness of the proposed service discovery mechanism, we have statistically compared it with one of the best works available in literature along with the comparative evaluation.

•
Results show that the proposed framework has better performance as compared to the existing work.
The rest of the paper is organized as follows: related work is reviewed in Section 2; in Section 3, a mechanism on service discovery by semantic matching is provided; Section 4 presents the evaluation process followed by Section 5 for results and discussion and, finally, Section 6 concludes the paper.

Related Work
A number of dynamic service discovery approaches are already proposed by different researchers [23][24][25][26][27], considering context-awareness and quality of service criteria of the smart environments. The literature on service discovery approaches is quite large. So, the paper selection criteria are defined as: • Paper publication duration 2000 to 2020 • Application methods defined clearly • Paper titles, abstract, and the keywords related to the topic The exclusion criteria are: • Unclear, non-indexed papers • Journal editorials • Short notes of keynote speakers • Repeating papers In order to understand the limitations and their effects in the smart environments, different semantic service discovery approaches are investigated and analyzed in this section. In this regard, we have divided the literature into two categories. The first category is based on the service discovery frameworks that are highly influenced by QoS, while the other is influenced by context-awareness. Details of both categories are given below.

QoS-Based Service Discovery Frameworks
Baocai's Framework [23] is based on the QoS ontology for the automatic discovery of services. The ontology of the framework is described in the OWL to solve the issue of interoperability. The description of QoS ontology can help the service applicant in finding the best available service. However, neither the discovery of the service nor the services operations are organized and discussed in detail. MA and colleagues [28] have proposed a QoS-based framework for advertising and the discovery of semantic web services. The framework uses the description logic reasoning to investigate the compatibility of demand and service concepts. However, the framework has not been studied for its performance nor has it been studied in detail for parameters of QoS. Chua's framework [29] performs service discovery based on the QoS attributes in a visual context. The framework uses QoS criteria along with the graphical user interface (GUI) pattern to model the user request in a visual context to discover services by taking into account the user priorities. However, the existing design cannot be implemented because the represented adaptability mechanism does not consider rich QoS attributes and service discovery and selection process. Another framework proposed by Ayadi et al. [30] uses canonical web service models for flexible matching of services. In this framework, the deductive technique is used to resolve and relax query constraints before seeking services. The proposed service selection and ranking process takes into account the weights assigned by the user while considering the candidate services. However, the framework was not evaluated for efficiency, and the ranking process of services was not clearly defined. In addition, Zhao's framework [31] can congregate, consolidate, and store data from various QoS Web services. The author had performed an experiment to show the flexibility of the framework. They have used Web Services Description Language (WSDL) along with Java data structures to collect QoS data from web services. However, no mechanism has been proposed to effectively and completely assemble QoS data in the distributed environment. Whereas, the framework proposed by Li et al. [32] uses QoS and Web Service Modeling Ontology (WSMO) for Web service in the execution environment (based on the core and expansion parts). Services are assembled functionally in the core part while keeping in view the QoS points and the feedback is sent back to the service user. Nevertheless, the framework does not provide the context description of the relationship between the service provider and the service applicant. Similarly, a framework proposed by Cao et al. [33] uses QoS-aware service recommendation and factorization-based relational topic model for IoT Mashup application. Authors have used risk terrain modeling (RTM) to model and predict the relationships among Mashup and services by mining the latent topics. The framework recommends top N web application programming interface (API) for targeting IoT Mashup applications, but the framework neither considers user priorities nor returns the categorized list of APIs.

Context-Aware Services Discovery Frameworks
Framework based on the TPSSMA algorithm is proposed by Zhu [34] to select and categorize services by considering user's functional and non-functional requirements. However, the framework is not properly implemented and evaluated for accuracy and performance. Moreover, the framework returns the partially ordered list of services that correspond to the functional requirements of the user. Another framework, proposed by Jimenez-Molina et al. [35] provides support to chronic patients, medical staff, and other relevant participants during the primary health attention process. To treat chronic patients, the framework considers medical organizational requirements. The authors have used Business Process Management (BPM) notation to infer requirements from any support system. However, the framework does not analyze or include existing medical domain ontologies for developing an ontology through the alignment method. The framework proposed by Arabshian [36] has been developed for personalized ontology-based context-aware research. The authors had used the extended ontology developed by Newman [37] to draw the knowledge from a hybrid hierarchical peer-to-peer network. However, the framework does not consider location, timeliness, role, and resources during the discovery of the services. Likewise, Ahmed et al. [38] have proposed a framework for ubiquitous environments to manage the context. The framework uses Resource Description Framework (RDF) and RDF(s) languages for the semantic representation of the context. With this framework, developers can express the context without a unified context model. Although their mechanism maintains a log of context changes to minimize the cost of communication, the impact of change in the context model triggered by the developer was not considered at all. Further, SOCOM [39] explores sensor characteristics to provide relationships between sensors and the context. It described the general knowledge of the real world and its usage in a context-aware middleware. Moreover, the framework [40] proposed by Santos discover and compose dynamic services based on the user-defined goal. For this purpose, the author has used context-awareness along with the requester's requirements to define goals and to reduce user involvement. The framework is based on domain ontologies (assuming that experts have defined them clearly) to provide a solid foundation (semantically) to the terms used in the framework for defining and achieving the goal. Furthermore, the framework proposed by Jia et al. [41] aggregate IoT services dynamically, based on real-time sensing of information. In order to achieve the goal, the author created service combination categories according to user needs and QoS parameters (functional and non-functional requirements). They used semantic technology and dynamic programming for creating service category combinations and quality of service parameters, defined in terms of requirements for selecting the best service among candidate services. However, the framework does not consider user priorities and context-awareness context modeling.

Comparative Evaluation of Discovery Frameworks
Comparative evaluation is used for analyzing similarities and differences in a system. Comparative evaluation criteria are always interpreted in the context of some requirements that are sometimes based on research and/or theoretical frameworks.
In this regard, Zeshan et al. [9,42,43] have proposed a framework that provides criteria to compare information systems. The criteria are classified into two categories: General Requirements (Table 1) and Dynamic Requirements (Table 2). This is a minimal set of criteria requirements that must be addressed by every successful real-time system. Table 1. Smart system's general criteria requirements.

Grouping
In order to apply group rules on requirements, it is necessary to group similar nature of requirements. The groups are defined based on the objectives. In this study, two groups of requirements are defined.

Value type direction
By using value type direction, the user can instruct the system on how to process the requirement. For example, in the reliability case, a higher value might be preferable for the user, in this case, the value type direction should be positive. However, in the case of response time, the value type direction should be opposite.

Prioritization
The system should allow the user to assign priorities to each requirement. In this case, the automatic selection from candidate services may become more accurate to meet the user needs.

Group prioritization
The system should allow users to assign priority to each group along with the assignment of priorities to each requirement. For example, users should be allowed to assign priority to each group (Context-Awareness and QoS) cumulating to 1 (between 0 to 1).

Categorization
The system should categorize each device service according to its fulfillment of user-defined criteria. This is an important requirement because if a device suddenly stops its services, the system may automatically pick the second service to use from the list meeting most of the user-defined requirements.

Approximate matching
It is the measure of the degree of matching between the use request and the device services. This requirement is particularly important in the scenario where if exact services are not found, the service requester might be interested to use the service meeting most of the user-defined requirements.

Metric matching
QoS metric measures the QoS value of a service. Hence, it is necessary that the explicit description QoS metric must be defined in the discovery framework.

Requirement Description
Location Smart systems can automatically track the location of objects in real-time in order to use their services.

Activity
Activity is a measurable amount of action that any device can perform. For example, a device can measure temperature or humidity in the room, etc.

Timeliness
It is a time required to access a service and the use of information. It can be measured as the time of request submission and the use of device services.

Interoperability
Interoperability means that devices from different operating platforms and speaking different languages can operate together. It is an essential property of smart objects.

Robustness
It is the ability of the system to provide functionality even if some device services become unavailable. In dynamic systems, the appearance and disappearance of services are not unusual.

Adaptability
Adaptability means that the system can detect if new devices services become available, and recompose with better services to perform well.
The development of successful distributed smart systems depends on the correct requirements. In this regard, the minimal set of requirements for smart systems are defined in Table 2.
In Table 3, the work reviewed in Sections 2.1 and 2.2 is compared and analyzed on the criteria requirements defined in Tables 1 and 2. The main objective of this comparison is to evaluate the usefulness of existing approaches and to estimate the degree of effectiveness in the discovery ranking and selection of smart services.
In this section, a large number of research works are investigated and analyzed with regard to their scope and functionality. We have compared different service discovery mechanisms (Table 3) based on the defined criteria requirements. By analyzing the data of Table 3, it is observed that the work proposed by Bandara et al. [44] and Kritikos and Plexousakis [45] are mature works as both fulfills eight requirements each. Whereas, the work proposed by Bandara et al. [44] mostly fulfills the dynamic requirements, while the work of Kritikos and Plexousakis [45] mostly fulfills the general requirements.
Although the above-discussed work has addressed a lot of issues of efficient and effective discovery of services, few issues remain that need the attention of researchers for the effective discovery of device services. The main limitations observed in these approaches are a theoretical model along with the lack of richness in context modeling, the absence of grouping, value type direction, group prioritization, and timeliness, etc. These limitations, if not considered properly, may result in the difficulty to find the best service among many functionally similar services.

Service Discovery by Semantic Matching
Due to heterogeneity and domain-specific requirements, smart systems need a dynamic object discovery mechanism, which should consider the objects' semantic descriptions in terms of their attributes (QoS and context), location, and access methods, as a service. Depending on the application, discovery can be a stand-alone service or integrated with the entity. In this context, several service discovery approaches have been proposed [45,[54][55][56][57], which consists of identifying a similarity degree between concepts semantically. Particularly, researchers kept much of their focus on word semantics and sentence semantics. However, the calculation of semantic similarity of services is not clearly defined due to the complexity of dynamic environments where devices have massive information, which makes it hard to measure their semantic similarity.
The proposed service discovery framework, as depicted in Figure 1, consists of a standard service search-and-discovery mechanism. The framework consists of a service repository and two servers for managing ontology and knowledge bases. This framework addresses many limitations of techniques (discussed in the literature) for describing and discovering qualified services. It is supported by an algorithm to select the best services from many available functional similar services. Context Knowledge Base stores all contexts of devices along with the states of entities. In the services profiling process, the QoS information along with context specification of device services are provided to algorithms from the service repository and the context knowledge base. The following sections present the process for calculating the semantic similarity of services (advertisements and the request attributes). discovery of services, few issues remain that need the attention of researchers for the effective discovery of device services. The main limitations observed in these approaches are a theoretical model along with the lack of richness in context modeling, the absence of grouping, value type direction, group prioritization, and timeliness, etc. These limitations, if not considered properly, may result in the difficulty to find the best service among many functionally similar services.

Service Discovery by Semantic Matching
Due to heterogeneity and domain-specific requirements, smart systems need a dynamic object discovery mechanism, which should consider the objects' semantic descriptions in terms of their attributes (QoS and context), location, and access methods, as a service. Depending on the application, discovery can be a stand-alone service or integrated with the entity. In this context, several service discovery approaches have been proposed [45,[54][55][56][57], which consists of identifying a similarity degree between concepts semantically. Particularly, researchers kept much of their focus on word semantics and sentence semantics. However, the calculation of semantic similarity of services is not clearly defined due to the complexity of dynamic environments where devices have massive information, which makes it hard to measure their semantic similarity.
The proposed service discovery framework, as depicted in Figure 1, consists of a standard service search-and-discovery mechanism. The framework consists of a service repository and two servers for managing ontology and knowledge bases. This framework addresses many limitations of techniques (discussed in the literature) for describing and discovering qualified services. It is supported by an algorithm to select the best services from many available functional similar services. Context Knowledge Base stores all contexts of devices along with the states of entities. In the services profiling process, the QoS information along with context specification of device services are provided to algorithms from the service repository and the context knowledge base. The following sections present the process for calculating the semantic similarity of services (advertisements and the request attributes).

Score Calculation Using Context Matching
In order to reduce human involvement while composing service to achieve the maximum degree of automaticity, researchers [21,55,58] have considered context-awareness in service-based solution applications from a couple of decades. Moreover, to decrease the issues of interoperability, they have used context-aware ontologies (machine-readable contents). However, to achieve the said goal, different researchers have adopted different methods but none of them clearly demonstrate how to use their proposed technique to select the best service from a number of candidate services available

Score Calculation Using Context Matching
In order to reduce human involvement while composing service to achieve the maximum degree of automaticity, researchers [21,55,58] have considered context-awareness in service-based solution applications from a couple of decades. Moreover, to decrease the issues of interoperability, they have used context-aware ontologies (machine-readable contents). However, to achieve the said goal, different researchers have adopted different methods but none of them clearly demonstrate how to use their proposed technique to select the best service from a number of candidate services available for composition. While using the taxonomy information for score calculation, some rules for semantic similarity score calculation are defined below.
To determine the semantic deviation among demand and offer concepts of service, the following rules are used.
where CountAttribs(SrvOffer) defines the total number of attributes of class Offer. Aziz et al. [20] has used the description logic technique along with the ontology for describing services. Whereas, for computing semantic similarity among services, he has used description logic reasoner, but the proposed technique has not used priority and group priority techniques, resulting in compromised accuracy of matching results. Based on these limitations, below (Equation (3)) is a proposed method for considering user-assigned priorities.
where W D (charAttrib) is the weight of character attributes of user demand.

Score Calculation Using QoS Metric Matching
One of the biggest challenges for SOA-based service discovery techniques is to ensure the quality of service (QoS) in dynamic environments [59,60]. In this regard, considerable research [23,25,26] has been done to support dynamic attributes of services ranging from expanding Universal Description, Discovery, and Integration (UDDI) to register dynamic attributes of services to store and manipulate dynamic attributes. However, the enhanced techniques do not involve QoS factors that can affect dynamic score calculation, resulting in compromised service selection. Therefore, to address the problem, user-defined priorities, group priorities along with the context-awareness and value type direction has been considered in this study. Whereas, to calculate the semantic similarity between offer and demand concepts, the rules defined by Cortes [61] and modified by Kritikos [45] are used while keeping in mind the OWL descriptions of QoS metric. The equivalence rules proposed by Cortes [61] are mathematically expressed below.
Equivalence rules take offer and demand as input and try to solve the constraints defined over the set of input. Conformance metric returns true if the problem is resolved and false otherwise by using function S. However, to calculate the closeness between two QoS metric descriptions, the rules proposed by Kritikos as OWL-Q [45] are extended as follows.  (5)) can be used.
However, in case of lower values are preferable, the following proposed formula (Equation (6)) can be used.
Whereas, user-defined priorities can be calculated by using Equation (7).

Service Ranking
Service ranking is the procedure of rating the candidate services according to the user-defined criteria (context-awareness and the numerical QoS values). The mobility and the heterogeneity of devices operating in a dynamic environment may lead to the ever-changing of available services. Therefore, the service discovery process should return the best suitable service to the requester as per his/her requirements while keeping track of all candidate services in the descending order in requirements. The proposed technique performs this task by using the following formula (Equation (8)).
After score calculation, the next step is to rank them based on their final score and the user-defined criteria. Therefore, in order to achieve this goal, the method defined by Kritikos [45] along with the expert judgment is used. However, before defining the ranking criteria, a focus group with experts was conducted and, upon consensus, the following rules were defined.

Service Ranking Algorithm
To find a service that addresses the maximum number of user-defined criteria requirements from many similar services is the key challenge in the device services discovery [62,63]. Services are usually defined in their functional parameters, whereas QoS parameters are used to define the behavior of the service. In this regard, context awareness as additional criteria can be used to select the best service. Therefore, QoS and context awareness as a main service selection tool are used in the proposed approach to select the best service. Hence, an algorithm (Algorithm 1) for the discovery and selection of the best service among many functional similar services based on the limitations of the existing work [44,45] is proposed below.  The above algorithm calculates service scores and ranks them in two steps. In the first step, QoS and the context-aware score is calculated while considering the user-defined priorities. Whereas in the second step, group priorities are considered before computing the final score and ranking the services, Equations (1)-(7) are used.
The framework proposed in this section is based on the limitations of techniques discussed in the literature review section for describing and discovering smart device services. It is supported by an algorithm to select the best services from many available functional similar services. This algorithm uses equations defined in the text to calculate the semantic similarity of services. Upon users' request submission, the proposed framework computes service scores in two steps. In the first step, the similarity of context attributes is measured using Equations (1)- (3). While, in the second step, the score of QoS attributes is measured using Equations (4)- (7). Equation (8) calculates the final score of service by considering the user-defined priorities, whereas, Equation (9) categorizes the discovered services according to their score.

Evaluation
Before applying a system in a real-world scenario, it is required to test it thoroughly to ensure that the system will perform well without major problems. In this regard, an experimental evaluation of the proposed technique is performed using a case study of a hospital's dynamic environment. Nowadays, many hospitals are equipped with devices like sensors, where the integration of device features to make a service is a challenging task. In such a dynamic environment, services may allow better caring of patients (room/ward temperature, humidity level, as well as differential pressure) by monitoring conditions to restrict the bacteria to promote in the rooms requiring constant supervision. Such services not only ensure the comfort of patients but also guarantee the good health of people working in the hospital. If these conditions are not controlled, then the risk of the spread of harmful bacteria among health care professionals along with patients increases, resulting in spread of disease. However, it is a big challenge in the healthcare environment to manage multiple connected devices and their interoperability. In order to handle such issues, ontologies can be used. Therefore, context-aware ontology [43] along with application ontologies [54] are used to model requests to discover services. However, for creating the service request, both ontologies were merged as presented in Figure 2. In this regard, Protégé editor is used that works on the idea of mapping and merging of ontological concepts. To create a new single extended knowledge sharing ontology, the editor takes a union of the terms like classes, slots, facets, and instances, followed by mapping and alignment processes. Since ontologies are merged using protégé editor, therefore, to make sure that sharing and exchange of complex information messages are well understood, a meta-model that can facilitate semantic interoperation between heterogeneous information resources is defined in Figure 3.
Sensors 2020, 20, x 12 of 24 a union of the terms like classes, slots, facets, and instances, followed by mapping and alignment processes. Since ontologies are merged using protégé editor, therefore, to make sure that sharing and exchange of complex information messages are well understood, a meta-model that can facilitate semantic interoperation between heterogeneous information resources is defined in Figure 3.    To share information on the web without disputes, Description Logic (DL, formal knowledge representation language) can be used. DL is based on first-order logic to represent the knowledge of a particular domain and then the use of domain concepts (knowledge) to specify relationships among objects and individuals occurring in that domain.
Moreover, since the knowledge-representing systems answer the queries of a user in a reasonable time, DL can be used to describe the information of services as:  To share information on the web without disputes, Description Logic (DL, formal knowledge representation language) can be used. DL is based on first-order logic to represent the knowledge of a particular domain and then the use of domain concepts (knowledge) to specify relationships among objects and individuals occurring in that domain.
Moreover, since the knowledge-representing systems answer the queries of a user in a reasonable time, DL can be used to describe the information of services as: If the hospital administration wants to measure the level of carbon dioxide in the medical ward to take necessary actions if needed, they can use the services of devices installed on those premises. The services offered by different devices from different locations in a human-understandable format might be as given in Table 4. From Table 4, the last row, marked with Service Id SrvDemand, could be a demanding service by hospital administration, while rests are the services offered by different devices. Due to the non-availability of the publicly available data, we have used a random number generator to generate a dataset for 100 services. In order to get confidence that data is properly generated and represents the original dataset, several domain experts were consulted. Upon consensus, a dataset was finalized, among which 10 services were selected to demonstrate the application of the proposed technique. The high-level detail of these services can be seen in Table 4. Moreover, the following attribute priorities were also decided in the meeting.
Context A query may consist of two types of concepts that either belong to the context-awareness or QoS. In the case of a concept belonging to the context-awareness, the similarity is judged through the mechanism defined in Section 3.1. For example, a user query defined in the last row of Table 4 has its first attribute of Activity since this attribute belongs to context-awareness; therefore, its closeness is judged through taxonomic relation as defined in Section 3.1.
While, in the case of QoS variables, users may define which values are preferable (higher values or lower values). For example, in the case of reliability attribute, higher values are preferable, while in the case of response time, lower values are preferable. The proposed system uses Equation (5) if higher values are required by the user in his/her request, while the system uses Equation (6) if lower values are required.
However, after submitting a request, the proposed system starts calculating the semantic similarity score (Equations (1)-(6)) of offered services (Table 5) and return category wise ordered list of services. Table 5 presents the computed score of these services through the proposed technique, while in Table 6 score of services is computed using the technique proposed by Bandara [44] (best work found in literature as it fulfills most of the requirements). In Table 5, the score of Activity attribute of service Offer1 is zero because both attributes are disjoint, whereas the value of Activity attribute of service Offer7 is 0.3 because this score is calculated according to the rules defined in Section 3.1, by considering the semantic deviation.
Similarly, the value of Reliability attribute of service Offer1 is 0.941, calculated using Equation (5) after conformance metric matching rules for two QoS metrics as proposed in Equation (7). The scores for the rest of the services are calculated similarly. The sorted list of services is: SrvOffer3, SrvOffer7, SrvOffer10, SrvOffer9, SrvOffer5, SrvOffer6, SrvOffer1, SrvOffer4, SrvOffer8, and SrvOffer2 (given in Table 7). In Table 6, scores of the same set of services as described in Table 5 are calculated by the technique proposed by Bandara et al. [44]. An ordered list of services is: SrvOffer3, SrvOffer10, SrvOffer7, SrvOffer5, SrvOffer6, SrvOffer9, SrvOffer2, SrvOffer4, SrvOffer8, and SrvOffer1.

Expert Judgment
Most of the researchers conduct surveys to answer their research questions. Through a survey, respondents provide meaningful opinions, comments, and feedback based on their real-world observations. By analyzing these results, researchers can give the guidelines on how to address the issue instead of wasting resources on the issues having less or no importance by making sensible decisions. Therefore, we also conducted a survey. In this regard, we distributed a questionnaire among domain users and requested them to sort the services in ascending order. Details of their responses are given in Table 7.
In the above experiment, it was observed that by varying the wait of user priorities the final score of services also changes, but the order of services does not change. Whereas this is not the case with the survey, in a survey by changing priorities, the results of the ordered list are changed altogether.

Results and Discussion
In the above section, service score computation with the help of three different methods (proposed, best from literature and human) is performed. In this section, an explanation is given on how the proposed method is better than existing techniques by comparing the results with earlier findings and the possible reasons behind the betterment of the proposed technique.
By looking at the service list of Table 5 Table 6, none exactly match nor totally fails to fulfill the user demand, while SrvOffer2, SrvOffer4, SrvOffer5, SrvOffer6, SrvOffer8, SrvOffer9 meet most of the user requirements whereas SrvOffer2, SrvOffer4, SrvOffer8, SrvOffer1 fulfill the least set of requirements. In the same fashion, if we look at the data collected from human through a questionnaire (Table 7), only SrvOffer3 services fulfill all of the user-defined requirements. On the other hand, services SrvOffer4, SrvOffer8 do not fulfill any of the requirements as reported by the experts. However, SrvOffer7, SrvOffer10 are the services that meet most of the requirements after service SrvOffer3, whereas SrvOffer1, SrvOffer2, SrvOffer9, SrvOffer5, SrvOffer6 meet the least requirements in descending order.
Similarly, if we look at the top five results of all three techniques by making a sorted list of each, we can observe the resemblance between the proposed technique and the human services list. According to the observation, the order of the first three services of both techniques (our proposed and the human) is the same. However, the technique proposed by Bandara et al. [44] also produces the same set of the first three services, but the order is different. This means that the proposed technique can produce more accurate results than the technique proposed by Bandara et al. [44]. Moreover, it can also produce results according to human perception. For example, a set of three services produced by our technique is SrvOffer3, SrvOffer7, SrvOffer10, which is the same set of services produced by humans while the order is changed (SrvOffer3, SrvOffer10, SrvOffer7) by Bandara et al. [44] approach. Bandara et al. [44] approach suggests that service SrvOffer10 meets second-highest requirements of users that is actually not right because it is confirmed by the human response.
In order to understand the causes of variation in score resulting in a different ordered list, we have drawn a line graph, which is presented in Figure 4. In order to understand the causes of variation in score resulting in a different ordered list, we have drawn a line graph, which is presented in Figure 4. X-axis represents the services while service scores are plotted on Y-axis. Blue line of the graph represents the proposed approach, green for humans, and the red line represents the Bandara et al. [44] approach. By analyzing results, it is now clear that the variation in service scores is due to the consideration of a number of factors like the consideration of user assigned priorities (individual concept as well as group), value type direction, along with the consideration of rich context- X-axis represents the services while service scores are plotted on Y-axis. Blue line of the graph represents the proposed approach, green for humans, and the red line represents the Bandara et al. [44] approach. By analyzing results, it is now clear that the variation in service scores is due to the consideration of a number of factors like the consideration of user assigned priorities (individual concept as well as group), value type direction, along with the consideration of rich context-awareness.

Significance Test
In the above section, it is concluded that the proposed technique can produce results near to human understanding. In this section, we are using statistical methods to explain the data and relationships in a meaningful way. In this regard, an independent samples t test experiment is conducted. Test statistics are given in Table 8. However, before executing the test, the hypothesis for the test is: The consideration of prioritization, grouping, value direction, and the context-aware knowledge of devices during service discovery can produce accurate results.
The Sig. (2-Tailed) value of the proposed method is 0 (Table 9); therefore, it is concluded that there is a statistically significant difference between the techniques which considers prioritization, grouping priorities, value direction, and context knowledge during the services discovery process and the technique that does not consider all these parameters. Moreover, to measure uncertainty, the standard deviation can be used because it tells the data distribution information around mean value. In this regard, from Table 8, one can observe the standard deviation of the proposed technique is 0.212, which is less than the standard deviation (0.352) of the technique proposed by Bandara et al. [44]. This fact indicates that the proposed technique produces more stable results with respect to the Bandara et al. [44] technique. Similarly, in order to prove it statistically that the proposed technique can produce results as per human understanding, null and the alternate hypotheses are designed as: Hypothesis 0 (H0). A technique considering prioritization, grouping, value direction, quality of service, and rich knowledge of context-awareness during the services discovery process still cannot produce results according to human understanding.

Hypothesis 1 (H1).
A technique considering prioritization, grouping, value direction, quality of service, and rich knowledge of context-awareness during the services discovery process can produce results according to human understanding.
Test statistics are given in Table 10 while the Sig. (2-Tailed) value is 0.001 (Table 11); therefore, it is concluded that the null hypothesis is rejected and an alternate hypothesis is accepted, which states that the proposed technique can produce results according to human understanding. By analyzing Tables 7  and 8, one can observe the big difference between standard deviations of the proposed technique and human understanding. The possible reason behind this difference could be, since, survey respondents were asked to rank services between 1 and 10 while considering the priorities. Whereas the proposed technique computes the score of individual service attributes between 0 and 1 and multiplies, the individual service attributes score with the priority assigned to it. Therefore, the score of standard deviation is reduced as compared to the human participants.

Performance Evaluation
Information retrieval has been developed as a high empirical discipline requiring a careful and complete evaluation to show the performance of techniques on the representative service collections. The standard approach for measuring the performance of such techniques revolves around the notion of relevant and non-relevant service. A service is said to be relevant if it addresses the requirements of the user; not only as it just happens to contain all of the concepts in the query. In order to evaluate a technique, an explicit expression is required for the judgment of returned results as relevant or non-relevant. In this regard, the two most frequent and basic measures (precision and recall) for judging the performance [64] is used. These measures are presented in Figure 5, where, I is an information request, R is the set of relevant documents for I, A is the answer set for I, and finally R ∩ A is the intersection of the sets R and A.
Precision (Equation (10)) is the fraction of the retrieved services that are relevant (Number of retrieved resources that are relevant/Number of retrieved resources).
Recall (Equation (11)) is the fraction of the relevant services that has been retrieved (Number of retrieved resources that are relevant/Number of relevant resources).
The F1 Metric (Equation (12)) attempts to combine Precision and Recall into a single value for comparison purposes. It is the weighted harmonic mean of precision and recall used to gain a more balanced view of performance.
Sensors 2020, 20, x 18 of 24 the performance [64] is used. These measures are presented in Figure 5, where, I is an information request, R is the set of relevant documents for I, A is the answer set for I, and finally R ∩ A is the intersection of the sets R and A. Precision (Equation (10)) is the fraction of the retrieved services that are relevant (Number of retrieved resources that are relevant/Number of retrieved resources).
Recall (Equation (11)) is the fraction of the relevant services that has been retrieved (Number of retrieved resources that are relevant/Number of relevant resources).
The F1 Metric (Equation (12)) attempts to combine Precision and Recall into a single value for comparison purposes. It is the weighted harmonic mean of precision and recall used to gain a more balanced view of performance.
Precision, recall, and F-measure values of proposed OWLQ [45] and Bandara's Techniques [44] according to the Equations (10)- (12) are presented in Table 12. The precision, recall, and F-measure values given in Table 12 are plotted in Figures 6-8. The average precision and recall values of the proposed technique are 0.46 and 0.84, respectively, whereas these values for the OWLQ framework are 0.34 and 0.64. It is observed that the proposed technique has better precision and recall values as compared to the OWLQ framework, which is a 26% increase in precision and a 23.8% increase in recall. The F-measure (weighted harmonic mean of precision and recall) for the proposed technique is 0.164 as opposed to the OWLQ framework, which has 0.127 for the first group. The average Fmeasure of proposed technique is 0.55, while the average F-measure of OWLQ framework is 0.42, which is 23.64% less to the proposed technique. Precision, recall, and F-measure values of proposed OWLQ [45] and Bandara's Techniques [44] according to the Equations (10)- (12) are presented in Table 12. The precision, recall, and F-measure values given in Table 12 are plotted in Figures 6-8. The average precision and recall values of the proposed technique are 0.46 and 0.84, respectively, whereas these values for the OWLQ framework are 0.34 and 0.64. It is observed that the proposed technique has better precision and recall values as compared to the OWLQ framework, which is a 26% increase in precision and a 23.8% increase in recall. The F-measure (weighted harmonic mean of precision and recall) for the proposed technique is 0.164 as opposed to the OWLQ framework, which has 0.127 for the first group. The average F-measure of proposed technique is 0.55, while the average F-measure of OWLQ framework is 0.42, which is 23.64% less to the proposed technique. Similarly, the precision, recall, and F-measure values for both of the frameworks (proposed and Bandara's) are given in Table 12 and plotted in Figures 6-8. The average precision and recall values of the proposed technique are 0.46 and 0.84, respectively, whereas these values for the Bandara's framework are 0.18 and 0.32. It is observed that the proposed technique has better precision and recall values as compared to Bandara's framework, which is a 61% increase in the precision and a 62% increase in recall.   Similarly, the precision, recall, and F-measure values for both of the frameworks (proposed and Bandara's) are given in Table 12 and plotted in Figures 6-8. The average precision and recall values of the proposed technique are 0.46 and 0.84, respectively, whereas these values for the Bandara's framework are 0.18 and 0.32. It is observed that the proposed technique has better precision and recall values as compared to Bandara's framework, which is a 61% increase in the precision and a 62% increase in recall.   The F-measure (weighted harmonic mean of precision and recall) for the proposed technique is 0.164 as opposed to the Bandara's framework, which has 0.055 for the first group. The averaged Fmeasure of the proposed technique is 0.55, while the averaged F-measure of Bandara's framework is 0.21, which is 61.82% less to the proposed technique.
From the above analysis, it is concluded that the proposed technique has better service discovery performance compared to the OWLQ and Bandara's frameworks. It is also observed that better performance is due to the consideration of comparison, context-awareness, grouping, group priorities, and value type direction.

Conclusions
Smart systems operating in distributed computing environments are much different from traditional dynamic systems as they may interconnect hundreds of IoT nodes. This massive interconnection and the advanced microprocessor technology had made smart systems competitive and complex. The complexity in terms of heterogeneity restricts different devices to share integrated knowledge effectively with each other. In order to address the issue of heterogeneity of devices effectively, SOA methodology can be used, where every device can participate in the activity of production, integration, and transferring data between them regardless of device complexity. SOA relies on web services and semantic web, the advanced form of web, handles the complexity with the help of ontologies. Whereas, techniques like case-based reasoning, probabilistic graphical models, and artificial neural networks cannot be used to model incomplete domain knowledge effectively. Therefore, the proposed logic and semantic-based hybrid framework can handle the issue of uncertainty for uniform knowledge sharing in distributed computing environments. Evaluation Similarly, the precision, recall, and F-measure values for both of the frameworks (proposed and Bandara's) are given in Table 12 and plotted in Figures 6-8. The average precision and recall values of the proposed technique are 0.46 and 0.84, respectively, whereas these values for the Bandara's framework are 0.18 and 0.32. It is observed that the proposed technique has better precision and recall values as compared to Bandara's framework, which is a 61% increase in the precision and a 62% increase in recall.
The F-measure (weighted harmonic mean of precision and recall) for the proposed technique is 0.164 as opposed to the Bandara's framework, which has 0.055 for the first group. The averaged F-measure of the proposed technique is 0.55, while the averaged F-measure of Bandara's framework is 0.21, which is 61.82% less to the proposed technique.
From the above analysis, it is concluded that the proposed technique has better service discovery performance compared to the OWLQ and Bandara's frameworks. It is also observed that better performance is due to the consideration of comparison, context-awareness, grouping, group priorities, and value type direction.

Conclusions
Smart systems operating in distributed computing environments are much different from traditional dynamic systems as they may interconnect hundreds of IoT nodes. This massive interconnection and the advanced microprocessor technology had made smart systems competitive and complex. The complexity in terms of heterogeneity restricts different devices to share integrated knowledge effectively with each other. In order to address the issue of heterogeneity of devices effectively, SOA methodology can be used, where every device can participate in the activity of production, integration, and transferring data between them regardless of device complexity. SOA relies on web services and semantic web, the advanced form of web, handles the complexity with the help of ontologies. Whereas, techniques like case-based reasoning, probabilistic graphical models, and artificial neural networks cannot be used to model incomplete domain knowledge effectively. Therefore, the proposed logic and semantic-based hybrid framework can handle the issue of uncertainty for uniform knowledge sharing in distributed computing environments. Evaluation results confirm the correctness of the proposed framework. In the future, the impact of the network, the issues of scalability, and fault tolerance in the framework will be investigated.