Task: Discover Event Definitions in Sensor Data
Aim: Create a rule defining an event, evaluate it on historical data, and export it in RuleML.
- EnStreaM Portlet, configured for SOS service with sensor data for the given use case.
In various environmental contexts it is relevant to observe available data and its aggregates prior to the event of a certain type. It is important that the user is able to visualize the data from different sensors, different sensor nodes, and different types, and compare the data. With a good insight into the properties of the event studied combined with data visualization, expert user might come up with a hypothesis – a rule which could identify circumstances that trigger the event.
The EnStreaM Portlet can be used by domain experts to explore large datasets in order to define processing rules for environmental data. The rules can be created and validated on real data from Sensor Observation Services (SOS) through a graphical user interface (GUI). We consider the situation when the events of interest are already known and the possible causes of these events can be explored.
Creation and Validation of Rules
- The user can start by analyzing the events which have occurred in the past, listed in the bottom right corner of the interface.
- Next, the sensors related to the event selected are displayed on the map based on their geographical location. The sensor measurements can be visualized for different time periods as illustrated in the figure below.
- Next, the fields on the right-hand side of the GUI are used to specify the relations and operators to appear in the rules. For our example, we have three relations in conjunction (the logic operators supported are “AND” and “OR”) which constitute the conditions of the rule. The result of such conditions being fulfilled represents a type of event, whose name is given by the user in the “Event name” field.
- The validation step is done by running the query with all the conditions specified over the historical data and comparing the events returned by the query with the list of entire events available for the specified location. The user should decide the importance and quality of the rule defined.
The rules created through the interface are exported in RuleML Datalog format, which provides a simple and clean syntax for expressing “if-then” rules. Each condition is represented by one or more atomic formulas (“Atom”).
Concrete example: The condition that raindrop exceeds 24 mm in the current day and 16 mm in the previous day is represented in our scenario as illustrated in the figure.
- Go to the EnStreaM interface deployed at http://envision.ijs.si
- In the upper right corner select (if not by default) SOS10_BrgmSos service.
- Zoom into Guadeloupe island, marked in the map widget.
- Select an event, for example Blonde (on 2004-11-20). Visualize the event by clicking the “show” link next to the event.
- Set Chart parameters to specified event by clicking on the name of the event (the Event date should be set now to 2004-11-20).
- Select sensor “9-precipitation”, select aggregate type “SUM” (cumulative precipitation) and an aggregate timespan of a month.
- Click “Show chart” and observe high peak of precipitation in a month before the event. We will create such a rule.
- In the Event Definition widget select that we want to create a rule, based on sensors measuring precipitation – in the first three dropdowns select: “Phenomenon”, “==”, “urn:ogc:def:phenomenon:OGC:1.0:precipitation” and click “Add”. Note the rule in internal JSON format being generated below the widget.
- Further define type of the aggregates used. From dropdowns select “Type”, “==”, “SUM”. Click “Add”.
- Define timespan of the aggregates used. From dropdowns select “TimeSpan”, “==”, “M”. Click “Add”.
- Define value of the aggregate, which should be greater than 120mm. From dropdowns select “Value”, “>”, “120.5”. Click “Add”.
- Finally click “Execute query” button and the system will return a list of 8 possible events when this condition was fulfilled.