## 3 System Framework Overview
### Middleware Layer
#### 3.2.1 Context Acquisition
In this way the Simple Object Access Protocol (SOAP) allows clients to call upon web services and receive responses on all languages and platforms considering that web protocols such as Hypertext Transfer Protocol (HTTP) and Simple Mail Transfer Protocol (SMTP) are applied. A generic overview of the flows performed by a classifier of a context provider is illustrated in Figure 6.  
While context providers perform the primal abstraction, the reasoning mechanism of the context aggregator performs the conversion into standard information, which is appropriate for recognition by the total of the system entities. The context aggregator refers to a distributed cloud service equipped with computational logic [94] for integrating as well as for interpreting all context which is essential for the interoperability among sensors data information and the service-providing entities. The aggregator is specifically assigned with the following operations:  
* Gather incoming raw data from sensor nodes of the WSANs in various PF facilities. * Assort the collected data for sending it to the appropriate context provider to obtain context classification. * Identify the type of the PF facilities as well as their particular devices and the related context providers. * Compile high-level output as context from various providers after performing a process of classification. * Resolve any imminent conflicts among duplicate data in case the same context is reported by various providers. * Select the optimum and most reliable value among those coming from various providers by executing, through context provisioning, a calculation of their performance score. * Aggregate all contextual information in single context model for each particular system. Figure 6: Generic overview of the flows performed by a classifier of a context provider. Forward the context model for finding context-aware services and actions in the context-aware middleware cloud. Furthermore, it is a fact that sensors involved in WSAN's deployed in agricultural environments produce an extended amount of heterogeneous data which is structured in various forms. In order these data to be of proper use, it is essential to be specified and stored in a machine readable and editable form. This can be achieved by employing a modeling structure which defines, represents, and edits the contextual data in such a unified format that can be comprehended and shared. Without a precise, distinct, and flexible modeling structure, applications will be unable to comprehend and use contextual data in a sufficient way. Furthermore, the structure should be able to integrate not only the current features, but also any future changes and requirements. The context modeling structure is compiled by the aggregator after the identification of the key contexts and it involves a hierarchical list of topics with respective attributes. It specifies the contextual data to be stored in a data source, retrieved with simple queries, and transmitted in a proper format, while it also defines whether the information is permanent or transitory. The structure is required to be transformed only in the case that new information is to be processed by the system (i.e., when a new sensing device is added or terminated). A great number of modeling techniques can be found in the literature among which the most popular are logic-based, markup, key-value, object-oriented, domain-focused, asser-centric, multidisciplinary, graphical and ontology-based [43; 44; 95; 96; 97]. In the proposed system, the ontology-based modeling technique is being adopted because it is more competitive over the other methods in terms of formality, interoperability and reusability [95; 97], focusing on a generalized model design which can assist the composition of context-aware services for the benefit of PA. In Figure 7 an indicative proposed ontology-based context modeling structure in terms of Web Ontology Language (OWL) is being illustrated.