## 3 Construction Methodology of the Traffic Accident Knowledge Graph
### Construction of the Traffic Accident Knowledge Graph
In a knowledge graph, relationships between entities are represented as triples of the form (head entity-relation-tail entity), where the head and tail entities denote traffic accident elements or information and are depicted as nodes. Relations, which connect two entities, are depicted as edges. In this study, we regard the constructed knowledge graph as the triple set \(\text{G}=\{(h,r,t)\}\), and define the following matrices over its entities and attributes:  
1. Relation matrix \(R\)  
\[R\in\{0,1\}^{n\times n},\ R_{ij}=\left\{ \begin{array}{ll}1,&\exists r\text{ s.t. }(s_{i},r,s_{j})\in G,\\ 0,&\text{otherwise}\end{array} \right. \tag{1}\]  
Here, \(n\) denotes the total number of entities, and \(R_{ij}=1\) indicates that there exists a semantic edge between entities \(s_{i}\) and \(s_{j}\). 2. Attribute matrix \(S\)  
\[S\in\mathbb{R}^{n\times N},\ S_{i,q}=v_{i,q} \tag{2}\]  
\(N\) denotes the total number of attribute categories, and \(v_{i,q}\) represents the value of entity \(S_{i}\) for the \(q\)th attribute (numerical attributes are used directly, whereas categorical attributes are encoded via one-hot encoding or integer mapping). 3. Attribute co-occurrence matrix \(A\)  
\[A\in\mathbb{R}^{N\times N},\ A_{I,k}=\sum_{i=1}^{n}\mathbb{I}(S_{i,l}\
eq 0 \wedge S_{i,k}\
eq 0) \tag{3}\]  
Here, \(\mathbb{I}\) (\(\cdot\)) denotes the indicator function, and \(A_{I,k}\) measures the number of times attribute \(l\) and attribute \(k\) co-occur in the same entity, thus capturing the strength of association between these attributes. The detailed construction workflow is depicted in Figure 3.  
Table 2 presents a subset of the key entities and relations in the constructed Traffic Accident Knowledge Graph, integrating multidimensional information--such as accident identifiers, spatiotemporal localization, environmental factors, and damage assessment--into a graph-structured fusion of multi-source heterogeneous data. By designating Accident.case_id as the primary indexing node, reference consistency is maintained across different temporal and spatial contexts, thus enabling cross-period and cross-domain analyses. The REPORTED_IN_YEAR relation links accident nodes to DBYear.year nodes, supporting temporal distribution and trend analysis of accident occurrences by year. The HAS_JURISDICTION relation connects ac  
Figure 2: Schematic diagram of the top-down knowledge graph construction process. cident nodes to Jurisdiction.value nodes, facilitating the generation of administrative-area heat maps and comparative studies. Environmental factors are incorporated via relationships such as HAS_SPECIAL_CONDITION \(\rightarrow\) SpecialCondition.condition and HAS_WEATHER1 \(\rightarrow\) Weather1.condition, effectively capturing special road conditions and meteorological variables that serve as critical covariates in modeling accident causation and severity. Road spatial information is accurately encoded through HAS_PRIMARY_ROAD and HAS_DIRECTION relations and their corresponding nodes, pinpointing the road name and direction of travel for each incident. The HAS_LIGHTING \(\rightarrow\) Lighting.condition node characterizes diurnal lighting conditions, which are essential for analyzing daytime-versus-nighttime accident patterns. Distance measures, introduced via HAS_DISTANCE \(\rightarrow\) Distance.value, support micro-spatial offset analyses and buffer-zone studies. Finally, victim impact is quantified by HAS_KILLED_VICTIMS \(\rightarrow\) KilledVictims.count and HAS_INJUREED_VICTIMS \(\rightarrow\) InjuredVictims.count relations; when combined with causal relations such as HAS_PRIMARY_COLLISION_FACTOR and HAS_TYPE_OF_COLLISION, they collectively profile accident outcomes and provide a robust data foundation for downstream tasks like data mining and link prediction [29].