## 3 The Temporal Knowledge Graph Recommender System  
The increasing complexity of user-item interactions has necessitated more sophisticated recommendation systems in recent years. Conventional methods have been found to fall short, especially in accounting for temporal dynamics and intricate user-item relationships. This need for advancement has been emphasized in seminal studies such as those by [20; 21]. Our study aimed to address these limitations by introducing the TKGRS algorithm, which makes novel contributions to capturing both temporal and contextual nuances. The TKGRS algorithm uses a multi-faceted approach to enhance movie recommendations' accuracy and contextual relevance. Specifically, it starts with matrix factorization techniques for the initial embeddings of the user and item. This captures the linear relationships effectively. The algorithm then utilizes GCNs to update these embeddings, offering a nuanced understanding of complex, non-linear relationships. Additionally, a time decay factor is incorporated to prioritize more recent interactions, adding a temporal dimension to the recommendation process. The TKGRS algorithm aims to provide robust movie recommendations by combining these diverse techniques. It is uniquely positioned to address the static and dynamic aspects of user-item interactions, setting a new benchmark in personalized movie recommendation systems. Data preprocessing serves as a foundational step in the TKGRS algorithm. One key aspect is the incorporation of a temporal decay factor, set at 0.9, to emphasize more recent user-item interactions. This value was chosen on the basis of preliminary testing and aligns with best practices in the field. The decay factor modifies the original ratings, thereby allowing the model to prioritize newer interactions over older ones. Mathematically, the updated rating \(r^{\prime}\) is computed as follows:  
\[r^{\prime}=r\times\text{decay\_factor}^{(\text{max\_timestamp-timestamp})} \tag{1}\]  
The model's architecture is a neural network with three primary components:1. Embedding layer (matrix factorization): This converts the users' and movies' IDs into fixed-size vectors (\(Eu\) and \(Em\)). 2. GCN layer: This updates the embeddings using GCN. The mathematical representation for a single-layer GCN is: \[H_{u}^{(1)}=GCN(E_{u}(u),G_{u})\text{ and }H_{m}^{(1)}=GCN(E_{m}(m),G_{m})\]
3. Fully connected layers: A fully connected layer sequence maps the updated embeddings to the output prediction. The model is trained using the Adam optimizer with a learning rate and weight decay. The loss function is RMSE and is defined as  
\[RMSE=\sqrt{1/N\sum_{i=1}^{N}(r_{i}-\hat{r}_{i})^{2}} \tag{2}\]  
where \(r_{i}\) is the real rating and \(\hat{r}_{i}\) is the predicted rating. Next, we can depict our algorithm as shown in Figure 1.  
Next, we detail each component of the proposed algorithm as follows. 1. Embedding layer: The embedding layer uses matrix factorization through embeddings for users and movies. The embeddings are then used to predict the rating a user would give to a movie. Let \(\mathbf{R}\) be the original user-item interaction matrix, where \(R_{ij}\) represents the rating given by user \(i\) to item \(j\). The neural collaborative filtering step aims to approximate \(\mathbf{R}\) by learning two matrices, \(\mathbf{U}\) and \(\mathbf{M}\), for users and movies, respectively. Each row in \(\mathbf{U}\) and \(\mathbf{M}\) represents the latent factors of a user and a movie to satisfy the equation:  
Figure 1: The processes of the proposed algorithm.