# Querying and Extracting Timeline Information from Road Traffic Sensor Data
## 3 Timeline Modeling
### Traffic Sensor Data
#### 3.1.1 Definition of Traffic Sensor Data  
To explain traffic sensor data in more detail, we provide the formal definition of crucial concepts used in our QET system. Typically, a city road network can be represented as a graph \(G\), including a collection of nodes \(V\) and edges \(E\) (road segments) where each edge connects two nodes. A road segment is the smallest granularity in the road network (occasionally, we use the terms \"road segment\" and \"road link\" interchangeably), whereas a node can be located at an intersection or turning point where several road segments meet. In this work, every road segment is defined as a one-way road segment. Thus, each road segment has a source node and a destination node to illustrate the direction. The formal definitions of a road and road segment are the following:  
**Definition 1**. : _(Road) Let \(R_{i}=<r_{name},[n_{1},n_{2},n_{3},\ldots,n_{k}]>\) denote a road in a city, where \(r_{name}\) is its unique name in the city and \([n_{1},n_{2},n_{3},\ldots,n_{k}]\) denotes a sequential list of nodes along the road._  
**Definition 2**. : _(Road network and road segment) Let a directed graph \(G_{R_{1},R_{2},\ldots,R_{i}}=(V,E)\) represent a road network of \(R_{1},R_{2},\ldots,R_{i}\), such that \(V\) is a set of nodes \(n_{j}\) located in \(R_{1},R_{2},\ldots,R_{i}\) and \(E\) is a set of one-way road segments \(L_{k}\) connecting two nodes. A road segment (in the following sections, we use the terms \"road segments\"and \"road links\" interchangeably) \(L_{k}\) can be defined as \(L_{k}=(lid,n_{from},n_{to})\), such that \(lid\) is the unique identifier number for \(L_{k}\) and \(n_{from}\) and \(n_{to}\) are the start node and the end node of \(L_{k}\), respectively._  
**Example 1**. : _Figure 2 illustrates an example of a road network. This road network includes several roads, such as \(R_{1},R_{2},R_{3},R_{4},R_{5}\), and \(R_{6}\), which are printed in a different color. A circle denotes a node located in the road. For example, road \(R_{1}\) contains nodes \(n_{1},n_{2},n_{3},n_{4}\), and road \(R_{6}\) contains nodes \(n_{1},n_{12},n_{11}\). Consider a section of road network displaying the road segments including \(L_{1}\), \(L_{2}\), \(L_{3}\), \(L_{7}\), \(L_{8}\), and \(L_{9}\). Nodes \(n_{1}\), \(n_{2}\), \(n_{3}\), and \(n_{4}\) are connected with two road links in different directions \(d_{1}\) and \(d_{2}\)._  
We now formally define the notions of traffic sensor data. Although some devices create different types of information, such as speed, volume, occupancy, flow, or a combination of the preceding, we focus on the road network speed data. **Definition 3**. : _(Traffic sensor data) Let \(tr_{i,d,l_{id}}=v\) represent traffic sensor data, where \(lid\) is the identified road segment \(L_{id}\), \(v\) is the speed value of the road segment \(L_{id}\) at a certain time point on date \(d\), and \(i\) is the \(i_{th}\) sequence number of date \(d\). A set of traffic sensor data \(\{tr_{1,d,l_{id}},\)\(tr_{2,d,l_{id}},\)\(tr_{3,d,l_{id}},\)\(\ldots,\)\(tr_{k,d,l_{id}}\}\) on the same date represents the daily traffic data of the road segment. If raw traffic data are collected and recorded every five minutes in a day, then the value of \(k\) becomes 288, which is computed by the equation \(\frac{1440}{5}\)._  
**Example 2**. : _Table 1 presents an example of traffic data from the same road link. From the second row, we find a road link 1D (\(1410046200\)) and a speed value (\(55\)). After calculating the sequence of traffic data on  
Figure 2: Road network model. 2016-02-14, we construct traffic data as \(tr_{85,2016-02-14,1410046200}=57\). In the same way, we identify four traffic data as \(tr_{86,2016-02-14,1410046200}=45\), \(tr_{87,2016-02-14,1410046200}=48\), \(tr_{88,2016-02-14,1410046200}=51\), and \(tr_{89,2016-02-14,1410046200}=58\). Note that this table only displays a fragment of traffic data.