Diversity-Aware API Recommendation Based on Heterogeneous Graph Network for Cyber–Physical–Social Systems

Xiangyu Zhao, Feng Zhu, Dengshuai Zhai, Rouchen Han, Sifeng Wang, Wanli Huang, Lianyong QiIEEE Transactions on Computational Social Systems 2025 · DOI

Abstract

In recent years, innovative Web application programming interfaces (APIs) have emerged, making it easier for software developers to create mashups for cyber–physical–social systems (CPSS). With the rapid increase in the number and variety of Web APIs, finding the right APIs for mashup development has become increasingly challenging. The overabundance of Web APIs with similar functionality makes it difficult for developers to locate the most suitable APIs quickly, and thus, introducing diversity in recommender systems becomes particularly important. Recently, recommender systems based on graph neural networks (GNNs) have garnered significant attention due to their outstanding accuracy. However, most existing studies focus on analyzing the interaction between mashups and APIs, ignoring the role of APIs in providing text descriptions and category information, limiting the system’s ability to capture diverse recommendations. To address this issue, we propose a method based on <underline xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">h</u>eterogeneous graphs and <underline xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">G</u>NNs for <underline xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">d</u>iversity-aware <underline xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">A</u>PI <underline xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">rec</u>ommendation, named HGDARec. The method constructs a mashup-API heterogeneous graph that integrates API category information and description text. Based on this, the BERT model is used to learn deep semantic representations of API descriptions and extract highly discriminative features. Then, we apply the GNN technique to aggregate information from diverse subsets of neighbors. Additionally, we introduce an attention mechanism to generate comprehensive node embeddings, ultimately achieving diverse recommendations for Top <italic xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">K</i> APIs. Finally, we performed extensive experiments on real datasets that validate the effectiveness of HGDARec in enhancing recommendation diversity and accuracy.
BibTeX
@article{zhao2025diversity,
  author = {Xiangyu Zhao and Feng Zhu and Dengshuai Zhai and Rouchen Han and Sifeng Wang and Wanli Huang and Lianyong Qi},
  title = {{Diversity-Aware API Recommendation Based on Heterogeneous Graph Network for Cyber–Physical–Social Systems}},
  journal = {IEEE Transactions on Computational Social Systems},
  year = {2025},
  doi = {10.1109/tcss.2025.3558997},
}

Loading related content...

Figure