## 3 Description of the Solution
### Description of a Middleware for Underwater Environments
\(\circ\) The _Publish/Subscription Manager_ is a DDS-based component responsible to provide reliable non-blocking communications between the middleware and the underwater vehicles. It is the component responsible for implementing a Publish/Subscribe paradigm for communications, as the semantic middleware architecture will use it to subscribe both the autonomous maritime vehicles and the Command and Control Station to the events that they generate in both sides of the communications. Typically, The Publish/Subscribe Manager generates a collection of DDS topics matched with similar names at other components of the middleware architecture responsible for data transfers (CDT and VDT) so when there is information to transfer it will be done so if received under one of the topics present in both sides of the middleware (due to the fact that the middleware has been distributed to autonomous vehicles as well). 2. _High Level Services_: these services represent the interface offered by middleware to the MMT. The modules in charge of this responsibility are the Missions and _Task Register and Reporter_, the _Vehicle and Service Register_, the _Semantic Query_ and the _Rules and Policies Creator_: \(\circ\) The Missions and Task Register and Reporter receives the tasks assigned by the MMT to the robots, and stores this information in the SWARMs ontology. This module is responsible for forwarding the assigned tasks to the corresponding physical robots. As vehicles will follow a Publish/Subscription paradigm, the communication between the Middleware Core and the robots will involve both the Publish/Subscription Manager module and the specific _DDS Proxy_ which is able to communicate with a specific vehicle. Note, however, that the middleware will only execute simple tasks and no service composition will be considered, thus any complex task to be carried out by the vehicles will be divided into simple tasks by the MMT. If a specific vehicle needs a more detailed execution, this sub-division of tasks should be implemented by the vehicle itself. Once a task has been executed, this module collects the task status information send by vehicles as a response to the task assigned. \(\circ\) The Vehicle and Service Register provides the middleware holistic awareness of all available vehicles and services, so that it will be able to offer real-time and precise information for other modules. This module registers all vehicles with their own features, such as appearance, capabilities, location, status and services provided in the SWARMs ontology. This process is performed every time a new vehicle joins the swarm. The registration process will be initiated from the graphical interface of the MMT. * The Semantic Query processes any semantic query made by the MMT. Semantic queries are the mechanism used by the MMT to consult any information from the SWARMs Ontology. The result of the query will involve a semantic piece of information that will be used for information processing at higher level applications (commonly, Graphical User Interfaces) which will contain relevant data related to the autonomous maritime vehicles involved in the area. * The Rules and Policies Creator allows the insertion of rules and policies by users. Users-defined rules can be used for reasoning more useful information and knowledge, (for instance, finding out which vehicles' battery level is above or below a certain threshold). Any semantic query obtains an answer, which is filtered according to the rules defined, however, this filtering is not applied at the moment of calculating the answer: rules are pre-defined and embedded in the ontology, so are executed as soon as new data is inserted in the ontology. This ensures that the responsibility of the ontology is not affected by the rules defined. * _Low Level Services_: these services represent the interface offered by the middleware to the vehicles, in order to monitor the system.