## 4 Representation Learning Methods for Traffic Accident Knowledge Graphs
### Representation Learning of the Traffic Accident Knowledge Graph Based on the Improved TransD Model  
In constructing and embedding the traffic accident knowledge graph, the standard TransD model leverages dual projections of entities and relations to capture fundamental semantics. However, because its projection matrices depend solely on the intrinsic vectors of entities and relations, TransD struggles to model the fine-grained influence of domain-specific attributes--such as accident severity or road surface conditions--on entity representations. Moreover, its single-margin loss function is inadequate for effectively separating positive and negative samples within complex, noise-laden accident data. To remedy these shortcomings, this study augments TransD's dynamic mapping mechanism with attribute projection vectors, thereby strengthening the coupling between inherent entity features and relation semantics. Simultaneously, we introduce a dual-limit scoring loss to independently adjust the margins for positive and negative samples, resulting in enhanced representational capacity and discriminative performance on the traffic accident knowledge graph. (1) Entity and Relation Representation  
For the traffic accident knowledge graph, entities of various types (e.g., Accident, Officer, Weather, Road Surface) exhibit distinct feature distributions in their initial embeddings, while relations (e.g., HAS_COLLISION_SEVERITY, HAS_VICTIM, HAS_REPORTING_DISTRICT) capture semantic linkages among different attributes. The core of the TransD model lies in creating dedicated projection vectors for each entity and each relation, which dynamically generate mapping matrices to enable adaptive projections of entities into relation-specific spaces, thereby fully modeling the complex interactions among entities in the traffic accident domain. Consider an arbitrary triple (\(h\), \(r\), \(t\)) in the traffic accident knowledge graph, where \(h\in\mathbb{R}^{d}\) is the embedding of the head entity (e.g., accident event, location, or jurisdiction), \(t\in\mathbb{R}^{d}\) is the embedding of the tail entity (e.g., collision severity, victim, or party), and \(r\in\mathbb{R}^{d}\) is the embedding of the relation (e.g., HAS_COLLISION_SEVERITY, HAS_VICTIM, HAS_PARTY). To capture each entity's intrinsic attributes and their diverse role under different relations, TransD assigns each entity \(h\) and \(t\) its own projection vector \(h_{p}\in\mathbb{R}^{d}\) and \(t_{p}\in\mathbb{R}^{d}\), and each relation r has its projection vector \(r_{p}\in\mathbb{R}^{d}\), where d represents the embedding dimension. These projection vectors construct dynamic mapping matrices that project \(h\) and \(t\) into a relation-specific space before applying the translational operation. (2) Construction of Dynamic Mapping Matrices  
For each triple (\(h\), \(r\), \(t\)) in the traffic accident knowledge graph, the TransD model constructs dynamic mapping matrices to obtain relation-specific entity representations. For the head entity \(h\) and relation \(r\) pair, the dynamic mapping matrix is defined as [35]\[M_{r}^{h}=r_{p}\otimes h_{p}^{\mathrm{T}}+I \tag{4}\]  
where \(I\) is the \(d\times d\) identity matrix. Similarly, for the tail entity \(t\) and relation \(r\) pair, the mapping matrix is  
\[M_{r}^{t}=r_{p}\otimes t_{p}^{\mathrm{T}}+I \tag{5}\]  
Each mapping matrix is constructed by taking the outer product of the entity (or attribute) projection vector with the relation projection vector, then adding an identity component. This design yields a full-rank transformation that remains efficient in parameter usage: the identity term preserves the original embedding's core features, while the low-rank outer-product term injects relation- or attribute-specific adjustments. As a result, each entity embedding undergoes a stable baseline shift together with a flexible, context-dependent transformation, enabling the model to capture complex one-to-many and many-to-one semantics without the overhead of fully dense matrices.