# Querying and Extracting Timeline Information from Road Traffic Sensor Data
## 3 Timeline Modeling
### Congestion  
Traffic congestion is the most important information that we exploit in the QET system. Many different definitions of traffic congestion can be found in the literature. However, vehicle speed is most often used as a congestion indicator, since a large amount of vehicle speed data is easily  
Figure 4: ER diagram of seattle traffic data. Figure 5: Road network of seattle traffic data. detected by the loop detector, DSRC devices, and GPS from an urban road traffic system. In addition, vehicle speed reflects the travel behavior on an urban road network, and changes with the actual matching status of traffic demand and supply [46]. In QET, we define the traffic congestion as the road status based on the speed information. Associated with congestion, we introduce two concepts: (1) a congestion event that focuses on the change of status; and (2) the affectedness of the congestion in establishing the effects of the congestion. The formal definition of these concepts are the following:  
**Definition 4**. : _(Congestion) A congestion \(c_{k}\) is denoted as a four-tuple \(c_{k}\ =\ \ <\ L_{id},t_{start},t_{end},type\ >\), where \(k\) is the unique identifier, and each \(c_{k}\) means that a road segment \(L_{id}\) has a traffic jam from time \(t_{start}\) to time \(t_{end}\) because its speed value is less than a given threshold value. The type of congestion will be determined after checking whether or not it is an affected congestion._  
**Definition 5**. : _(Congestion event) A congestion event \(e_{i,type}\) is denoted as a two-tuple \(e_{i,type}\ =\ <\ L_{id},t>\), which describes that road segment \(L_{id}\) has changed its \(i_{th}\) status to either congested or decongested at time \(t\). If the road segment starts to be congested or decongested, the event type of the congestion will be START or \(END\)._  
**Example 3**. : _Consider again the raw traffic data in Table 1. We assume that a road link \(1410046200\) was not formerly congested, and the speed threshold for congestion is \(55\) km/h. The third row shows the congestion status for the first time because the speed is reduced to \(45\) km/h. We can consider this the START event of congestion. Thus, congestion \(c_{1}=\{1410046200,2016/02/14\ 06:05,-,-\}\) is created along with congestion event \(e_{1,START}=\{1410046200,2016/02/14\ 06:05\}\) if we assume this event is the first event of \(c_{1}\). From the fourth and fifth rows, we find that the status of a congestion is maintained; thus, we do not create any events. The sixth row depicts a change in congestion because the speed value is higher than the threshold value. We generate a STOP event at that time point of the congestion. Thus, we can obtain a congestion event \(e_{1,STOP}\ =\{1410046200,2016/02/14\ 06:20\}\) and update \(c_{1}=\{1410046200,2016/02/14\ 06:05,2016/02/14\ 06:20,-\}\). The fourth attribute of \(c_{1}\) is explained in the next definition._  
Slow speed traffic data in a road segment may occur due to the same conditions of other adjacent road segments. Thus, we formally define an affectedness of a congestion. **Definition 6**. : _(Affected congestion) Given two congestions \(c_{i}=<L_{i},t_{i1},t_{i2},type_{i}\ >\) and \(c_{j}=<L_{j},t_{j1},t_{j2},type_{j}>\), congestion \(c_{j}\) is an affected congestion of \(c_{i}\) when the road link \(L_{j}\) is the following (next) road link of \(L_{j}\), and the start time \(t_{j1}\) of \(c_{j}\) is after (greater than) the start time \(t_{i1}\) of \(c_{i}\)._  
We classify a congestion as being one of two types, based on Definition 6. * An independent congestion that occurs due to several factors, such as traffic lights, accidents, and infrastructure maintenance, and not because of other congestion. This congestion can be considered the head of congestion. * A dependent congestion, which is an affected congestion. If we consider a congestion path in which several road links are congested, we can identify the head (earliest) of the congestion that appears in the path.