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.