The compelling applications of Low earth orbit (LEO) satellite networks in our daily lives have been witnessed in recent years, ranging from weather forecasts to military monitoring. LEO satellite networks have grown in importance as a complement to terrestrial networks aiming at delivering global, ubiquitous communication. However, due to the LEO network topology keeps changing dynamically, the development of efficient routing algorithms becomes one of the challenges in the LEO network. Traditional routing policies hardly solve the rerouting problem caused by link switchover and the high calculation cost caused by large-scale irregular satellite topology. In this paper, we propose a knowledge graph-aided representation of satellite network topologies and routing architecture to optimize path selection and calculation cost for lower packet loss ratio and average delay. Moreover, we generate a routing policy by predicting potential relations between data packets and nodes to select the best relay nodes with the maximum probability of forwarding relations. Finally, extensive simulations are performed to evaluate the performance and availability of our proposed algorithm.