ZHAI Sheping, MA Mengyao, ZHANG Wenjing, YANG Rui
Accepted: 2025-05-08
Existing knowledge graph completion methods fail to adequately differentiate semantic distinctions across paths of varying hierarchies, and the representations of relationships do not sufficiently leverage neighborhood context information for dynamic adjustments, resulting in an incomplete understanding of contextual semantics. To address the above issues, a knowledge graph completion model, RCSKGC, is proposed, aiming to solve these problems by enhancing the semantic representation of learning paths and neighborhood information. Initially, local and global encodings of multi-hop paths at various levels are performed using bidirectional gated recurrent units and attention mechanisms, enabling the effective extraction of relevant path information. Moreover, relation embedding contrastive learning is employed to further refine the fine-grained semantic features of the path information. Subsequently, a dual attention mechanism and dynamic weighting strategy are utilized to capture hierarchical neighborhood information, with the semantics of relations being learned through a “neighborhood-entity-relation” framework. Finally, the two types of relational representations are aggregated to obtain the final representations of relationships, which is then input into the decoder for completion. Experimental results demonstrate that on the FB15k-237 dataset, RCSKGC outperforms the best results among the baseline methods, achieving improvements of 1.4, 0.8, 1.3, and 2.1 percentage points in MRR, Hits@1, Hits@3, and Hits@10, respectively. On the WN18RR dataset, RCSKGC achieves comparable performance to the best baseline result in Hits@1, while improving MRR and Hits@3 by 0.8 and 1 percentage points, respectively, thereby validating the efficacy of the proposed method.