# Towards a Hybrid Approach to Context Reasoning for Underwater Robots
## 3 Overview of the SWARMs Context-Aware Framework for Underwater Robots  
### The Context-Aware Framework  
The SWARMs middleware is capable of being context-aware when offering various information and services for vehicles or the mission management tool (MMT), which is located onshore or on a vessel and is in charge of the generation of missions, assignment of tasks to robots, and supervising the missions. Vehicles and MMT can make use of information and services provided by the middleware, such as adapting behaviors according to the ever-changing environment and making mission planning/re-planning better. A significant feature, context awareness, is enabled by the context-aware framework tailored to the domain of underwater robots. As part of the SWARMs middleware, the context-aware framework aims to provide a complete and well-defined management for context data that are exchanged between vehicles, such as information about the underwater environment, mission and planning, communications, and context from external data sources (e.g., marine experts and third-party information providers). Specifically, the objective of the context-aware framework is to abstract heterogeneous context in a unified format, enable data and capabilities sharing between vehicles, encase data with semantics, reason about contexts for high-level information, disseminate relevant data to entities, and provide a homogeneous application development interface. Thus, the SWARMs general architecture can be augmented by the context-aware framework in terms of context awareness. With the context-aware framework, vehicles and operators can have a better understanding of the complete picture of the SWARMs environment. The proposed architecture for the context-aware framework can be seen in Figure 2.  
The context-aware framework is conceived to be modular and distributed, which could imply a better potential to be employed in robot coordination and cooperation versus a centralized framework one. Specifically, the context-aware framework consists of six logic components, namely, _Ontology Model_, _Data Processor_, _Semantic Mapper_, _Rules Creator_, _Context Reasoner_, and _Semantic Query_. The functional capabilities of each component are described as follows:  
* _Data Processor_. The extreme underwater conditions impose more challenges in the data acquisition phase. Thus, context data obtained from the environment could be uncertain. A preliminary treatment for uncertain data is needed and this treatment is provided by the data processor component. This component can pre-process the data obtained by sensors or other sensing instruments. Statistics, such as probability distribution, can be learned using machine learning algorithms in this component. Operations, such as validating values, checking inconsistencies, calculating uncertainty degrees, removing outliers, and filling in missing values, can be executed in this component. * _Ontology Model_. This component, acting as a semantic repository, keeps the SWARMs' ontology and stores all data obtained as instances in the ontology model. Ontology is adopted to serve as a common information model to represent information and enable sharing, reuse, and integration of data between vehicles. The information model is structured in a hierarchical manner. The networkedinformation model consists of three levels of ontologies: core ontology (acting as an upper-level ontology to glue all domain specific ontologies), domain-specific ontology (providing information models for different domains, e.g., mission planning, vehicles, environment, and communications), and application-specific ontology (describing information with a focus on particular applications, e.g., oil spill detection, plume tracking, sperm construction). Therefore, data, including but not limited to contextual measurements, vehicle-related data, data from external sources (Global Positioning System, oceanic weather forecast, etc. ), and marine experts' knowledge, can be abstracted and formalized in an ontological format.