## 4 Method  
We designed a model called Att-GCN-DDI to discover unknown DDIs based on the drug KG. The workflow of Att-GCN-DDI is shown in Figure 2. Att-GCN-DDI mainly includes three main steps: (a) node embedding based on Att-GCN; (b) topology-preserving learning of the node embedding; (c) reconstruction of DDI matrix. Through step (a), the topological features of each node in the KG are extracted into an F-dimension vector, and the feature vectors of all drugs and diseases constitute the drug feature matrix and disease feature matrix, respectively (where X is the drug feature matrix, where each row represents the feature vector of a drug, and Y is the disease feature matrix, where each row represents the feature vector of a disease). Through step (b), we attempt to find an optimal projection from the drug space to the protein space by supervised learning so that the mapped drug feature vectors geometrically approach the diseases of their known interactions. The projection matrix Z is supervised by known drug-disease interactions and learns to minimize the difference between the known interaction matrix P and XZYT. Then, Att-GCN-DDI performs matrix operations on the projection matrix Z and feature matrix by step (c), and finally reconstructs DDIs matrix. Then, we can get the novel DDIs based on the reconstructed DDI matrix. Next, we will introduce the mathematical formulations of these three main steps. The given KG is defined as an undirected graph \(G=(\mathbf{V},\mathbf{E})\mathbf{V}=\{v_{1},v_{2},\ldots,v_{n}\}\) is the set of nodes and \(\mathbf{E}=\{e_{1},e_{2},\ldots,e_{m}\}\) is the set of edges; where \(m\) is the number of nodes, \(n\) is the number of edges and \(\mathbf{E}\in\mathbf{V}\times\mathbf{V}\). The adjacency matrix \(\mathbf{A}\) is usually represented in binary, 1 means that there is a connection between nodes, 0 means that there is no connection between nodes. The key step of topological feature extraction using Att-GCN is to construct the Laplace matrix, and in our model, the Laplacian matrix should be:  
\[\mathbf{L}=\mathbf{D}-\mathbf{A}=\mathbf{I}_{\mathbf{n}}-\mathbf{D}^{-\frac{ 1}{2}}\mathbf{A}\mathbf{D}^{-\frac{1}{2}} \tag{1}\] \begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline
**Relation** & **Drug–** & **Disease** & **Drug–Gene** & **Gene– Pathway** & **Drug–Drug** & **Drug–Side** & **Gene–Gene** & **Disease–**Gene** \\ \hline Number & 1659 & 1898 & 62 & 921 & 1432 & 263 & 877 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: The number of relations of each type in the KG for COVID-19. Figure 2: The workflow of the Graph Convolutional Network with Attentional mechanism for Drug–Disease Interaction (Att-GCN-DDI). where \(\mathbf{I_{n}}\) is an identity matrix and \(\mathbf{D}\) is the inverse degree matrix [9]. Finally, the topological feature of each node in the heterogeneous network can be extracted using the following formula:  
\[\mathbf{M}=\mathrm{Re}Lu(\mathbf{D}^{-\frac{1}{2}}\mathbf{A}\mathbf{D}^{-\frac {1}{2}}\mathbf{X}) \tag{2}\]  
where \(\mathbf{M}\) is a feature vector of the input entity, and \(\mathbf{X}\) is the characteristic of each node itself. The extracted features are used to form a drug feature matrix \(\mathbf{F_{drug}}\) and a disease feature matrix \(\mathbf{F_{disease}}\) in which each row represents a drug or disease feature vector \(\mathbf{M}\). Then, we use supervised learning to find the most appropriate projection matrix \(\mathbf{Z}\). The learning objectives are as follows:  
\[\min_{w}\lVert\mathbf{P}-\mathbf{F_{drug}}\mathbf{Z}_{w}\mathbf{F_{disease}}^{ \mathbf{T}}\rVert^{2}+\lambda\lVert w\rVert_{1} \tag{3}\]  
where \(\mathbf{P}\) is the known DDI matrix. Note that the same matrix construction method is also used in [1; 2] to solve the problem of relationship prediction. In order to achieve quick convergence, we use \(\lambda\lVert w\rVert_{1}\) as the regularizer. Then, we introduced the attention mechanism to assign weights to the feature matrix.