## 3 Methods
### Neighborhood Information Attention Aggregation Layer  
Aggregating adjacent node information through message passing paradigms to update central node information is a key task of message passing graph neural networks, it extends convolutional operators to the field of irregular data to achieve information transfer between nodes. We used an attention mechanism messaging method to aggregate neighbor information, representing the correlation between node features by calculating the attention weight values between nodes and their neighbors. We utilized the self-attention calculation method to calculate the weight values of the interaction between each pair of nodes, and utilized the concatenation method to map the vector \(\overset{\rightharpoonup}{z}_{i}\) and \(\overset{\rightharpoonup}{z}_{j}\), which mapped to attribute-specific space transformation into a \(2d\)-dimensional vector, where \(\overset{\rightharpoonup}{z}_{i}\) represents the current node, \(\overset{\rightharpoonup}{z}_{j}\) represents the neighbor of \(\overset{\rightharpoonup}{z}_{i}\). We transformed the vector into a value that measures the weight of mutual influence between nodes based on the embedded features of the nodes; in this experiment, we selected the transposed vector \(\overset{\rightharpoonup}{a}\) and the concatenated vector for inner product operation. Figure 1: This figure is an example of relationship triplets and type triplets, where each color represents a kind of type information. We obtained \(e_{ij}\) through the activation function, which is the attention weight of node \(j\) to node \(i\). \[e_{ij}^{(l)}=LeakyReLU(\overset{\omega(l)}{a}^{(l)T}(z_{i}^{(l)}||z_{j}^{(l)})) \tag{2}\]  
We selected LeakyReLU activation function in this experiment, an activation function of neural network unit, which can effectively solve the problems of vanishing gradient and death ReLU. This attention weight is the interaction weight between all node pairs, representing the importance between each node pair without considering the graph structure information. Knowledge graph is a directed graph; the weight value also varies due to the different positions of entities in the triplet, and \(e_{ij}\) is not equal to \(e_{ji}\), this weight forms an asymmetric self attention matrix of \(|E|\times|E|\) dimensions. After obtaining the attention weight values between node pairs, they are normalized using softmax and then through masked attention to introduce attention weight into the graph structure. \[\alpha_{ij}^{(l)}=\frac{\exp{(e_{ij}^{(l)})}}{\sum_{k\in N_{(l)}}\exp{(e_{ik}^ {(l)})}} \tag{3}\]  
where \(\alpha_{ij}^{(l)}\) represents the normalized attention coefficients of the current node and its neighbor nodes. We aggregate the information of neighboring nodes and introduce a weight matrix \(W_{att}\), obtaining the implicit representation of nodes through linear transform. \[h_{i}^{(l+1)}=\Phi_{er}\bigg{\{}\sigma\bigg{(}\sum_{j\in N_{(l)}}\alpha_{ij}^ {(l)}z_{j}^{(l)}\bigg{)}\bigg{\}}+h_{i}^{(l)} \tag{4}\]  
We utilize the method of adding a vector representation of our own node that has been transformed by the weight matrix W to enhance the semantics of the node itself, \(h_{i}^{(l+1)}\) contains information about the node itself and aggregated neighborhood information. In order to better aggregate neighborhood information, we aggregate the relation embedding vectors in neighbor paths into the current node and propose a relationship fusion function \(\Phi_{er}(\cdot)\).