Unmanned aerial vehicles (UAVs) are playing an increasing critical role in industrial, agricultural and military Scenario. However, the energy consuming cannot be ignored, which constrains the flying time and quality of service (QoS), especially in large UAV swarm. In this paper, a knowledge graph completion assisted graph neural network (KGC-GNN) is proposed for UAV swarm aiming at optimizing the spectrum resource to improve the energy efficiency (EE). The proposed network consists of two parts: a graph attention network based on relational coding (GATRC) encoder and a task-oriented decoder based on InteractE model named CP-IE. The further simulation demonstrates that our approach can attain near-optimal spectrum resource optimization scheme with higher energy efficiency and achieve rapid convergence with the channel distribution information (CDI), UAV and environment parameters.