Skip to main content
Log in

KG2Lib: knowledge-graph-based convolutional network for third-party library recommendation

  • Published:
The Journal of Supercomputing Aims and scope Submit manuscript

Abstract

In the process of software system evolution, software users constantly put forward a large number of expectations. For these expectations, software developers usually use the existing third-party libraries and other software resources to accelerate their development processes. At present, tons of third-party libraries are available. Therefore, appropriate recommendation methods are very important for developers to find suitable libraries for their development projects. In this paper, we present KG2Lib, a recommendation method to assist software developers in selecting suitable software libraries for their current projects. KG2Lib exploits a knowledge-graph-based convolutional network to recommend software libraries by relying on a set of libraries which were already called by current projects. The interaction matrix, weight matrix and knowledge graph are the inputs of KG2Lib. What’s more, KG2Lib recommends libraries to developers from project level and library level, which can better capture the fine-grained information to achieve better recommend performance. The performance of KG2Lib was evaluated on three datasets with four existing baseline models. The experimental results show that KG2Lib achieves better performance and helps software developers accurately select the appropriate third-party libraries.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7

Similar content being viewed by others

Data availability statement

All the datasets analyzed during the current study are available from the corresponding author on reasonable request.

References

  1. Alnusair A, Rawashdeh M, Alhamid MF, Hossain MA, Muhammad G (2016) Reusing software libraries using semantic graphs. In: 2016 IEEE 17th international Conference on information reuse and integration (IRI), pp 531–540. IEEE. doi: https://doi.org/10.1109/IRI.2016.79

  2. Yang F, Hong M, Li K (1999) Software reuse and software component technology. Acta Electronica Sinic A

  3. Bauer V, Heinemann L, Deissenboeck F (2012) A structured approach to assess third-party library usage. IEEE. https://doi.org/10.1109/ICSM.2012.6405311

    Article  Google Scholar 

  4. Thung F, Lo D, Lawall J (2013) Automated library recommendation. Reverse Engineering. IEEE

  5. Nagarnaik P, Thomas A (2015) Survey on recommendation system methods. In: 2015 2nd international Conference on electronics and communication systems (ICECS). IEEE, 2015, pp 1603–1608

  6. Wang X, Liu X, Liu J, Chen X, Wu H (2021) A novel knowledge graph embedding based API recommendation method for Mashup development. World Wide Web 24(3):869–894. https://doi.org/10.1007/s11280-021-00894-3

    Article  Google Scholar 

  7. Null LI, Han N (2021) A time-aware hybrid recommendation scheme combining content-based and collaborative filtering. Front Comput Sci. https://doi.org/10.1007/s11704-020-0028-7

    Article  Google Scholar 

  8. Chen J, Yu J, Lu W, Qian Y, Li P (2021) IR-Rec: an interpretive rules-guided recommendation over knowledge graph. Inf Sci 563:326–341. https://doi.org/10.1016/j.ins.2021.03.004

    Article  MathSciNet  Google Scholar 

  9. Pan H, Yang X (2021) Intelligent recommendation method integrating knowledge graph and Bayesian network. Soft Comput, pp 1–10. doi:https://doi.org/10.1007/s00500-021-05735-z

  10. Yang Z, Dong S (2020) HAGERec: hierarchical attention graph convolutional network incorporating knowledge graph for explainable recommendation. Knowl-Based Syst 204:106194. https://doi.org/10.1016/j.knosys.2020.106194

    Article  Google Scholar 

  11. Ohtomo K, Harakawa R, Ogawa T, Haseyama M, Iwahashi M (2021) Personalized recommendation of tumblr posts using graph convolutional networks with preference-aware multimodal features. ITE Trans Media Technol Appl 9(1):54–61. https://doi.org/10.3169/mta.9.54

    Article  Google Scholar 

  12. Zhong T, Zhang S, Zhou F, Zhang K, Trajcevski G, Wu J (2020) Hybrid graph convolutional networks with multi-head attention for location recommendation. World Wide Web 23(6):3125–3151. https://doi.org/10.1007/s11280-020-00824-9

    Article  Google Scholar 

  13. Zheng Y, Gao C, He X, Li Y, Jin D (2020) Price-aware recommendation with graph convolutional networks. In: 2020 IEEE 36th international Conference on data engineering (ICDE). IEEE, pp 133–144

  14. Zheng Y, Gao C, He X, Li Y, Jin D (2020a) Price-aware recommendation with graph convolutional networks. In: 2020 IEEE 36th international Conference on data engineering (ICDE). IEEE, pp 133–144

  15. Katsuragawa D, Ihara A, Kula RG, Matsumoto K (2018) Maintaining third-party libraries through domain-specific category recommendations. In: 2018 IEEE/ACM 1st international workshop on software health (SoHeal), pp 2–9. IEEE

  16. Sun X, Xu C, Li B, Duan Y, Lu X (2019) Enabling feature location for API method recommendation and usage location. IEEE Access 7:49872–49881

    Article  Google Scholar 

  17. Sun Z, Liu Y, Cheng Z, Yang C, Che P (2020) Req2Lib: a semantic neural model for software library recommendation. In: 2020 IEEE 27th international Conference on software analysis, evolution and reengineering (SANER), pp 542–546. IEEE. doi:https://doi.org/10.1109/SANER48275.2020.9054865

  18. Xu C, Sun X, Li B, Lu X, Guo H (2018) MULAPI: Improving API method recommendation with API usage location. J Syst Softw 142:195–205. https://doi.org/10.1016/j.jss.2018.04.060

    Article  Google Scholar 

  19. Deshpande N, Mkaouer MW, Ouni A, Sharma N (2022) Search-based third-party library migration at the method-level. In: International Conference on the applications of evolutionary computation (Part of EvoStar). Springer, Cham, pp 173–190

  20. Ouni A, Kula RG, Kessentini M, Ishio T, German DM, Inoue K (2017) Search-based software library recommendation using multi-objective optimization. Inf Softw Technol 83:55–75. https://doi.org/10.1016/j.infsof.2016.11.007

    Article  Google Scholar 

  21. Zhao X, Li S, Yu H, Wang Y, Qiu W (2019) Accurate library recommendation using combining collaborative filtering and topic model for mobile development. IEICE Trans Inf Syst 102(3):522–536. https://doi.org/10.1587/transinf.2018EDP7227

    Article  Google Scholar 

  22. D’Souza AR, Yang D, Lopes CV (2016) Collective intelligence for smarter API recommendations in python. In: 2016 IEEE 16th international working Conference on source code analysis and manipulation (SCAM). IEEE, pp 51–60

  23. Yun W, Zhang X, Li Z, Liu H, Han M (2021) Knowledge modeling: a survey of processes and techniques. Int J Intell Syst 36(4):1686–1720

    Article  Google Scholar 

  24. Heiko P (2016) Knowledge graph refinement: a survey of approaches and evaluation methods. Semantic Web 8(3):489–508. https://doi.org/10.3233/SW-160218

    Article  Google Scholar 

  25. Wang HM, Nie GH (2007) Research on collaborative filtering algorithm based on fusing user and item's correlative information. J Wuhan Univ Technol

  26. Lei R, Gu J, Xia W (2010) An item-based collaborative filtering algorithm utilizing the average rating for items. In: Signal processing & multimedia-international Conferences. DBLP

  27. Liu A, Li B (2015) Collaborative filtering algorithm based on the similarity of user ratings and item attributes. In: 2015 3rd international Conference on mechatronics and industrial informatics (ICMII 2015). Atlantis Press, pp 451–455

  28. Guan Z (2018) Multi-feature collaborative filtering recommendation for sparse dataset. Springer, Cham

    Book  Google Scholar 

  29. Jiang B, Yang J, Qin Y, Wang T, Wang M, Pan W (2021a) A service recommendation algorithm based on knowledge graph and collaborative filtering. IEEE Access 9:50880–50892. https://doi.org/10.1109/ACCESS.2021.3068570

    Article  Google Scholar 

  30. Zhang L, Li X, Li W, Zhou H, Bai Q (2021) Context-aware recommendation system using graph-based behaviours analysis. J Syst Sci Syst Eng 30(4):482–494. https://doi.org/10.1007/s11518-021-5499-z

    Article  Google Scholar 

  31. Dong B, Zhu Y, Li L, Wu X (2021) Hybrid collaborative recommendation of co-embedded item attributes and graph features. Neurocomputing 442:307–316. https://doi.org/10.1016/j.neucom.2021.01.129

    Article  Google Scholar 

  32. Zhang Y, Wang J, Luo J (2020) Knowledge graph embedding based collaborative filtering. IEEE Access, 2020. https://doi.org/10.1109/ACCESS.2020.3011105

  33. Yu B, Zhou C, Zhang C, Wang G, Fan Y (2020) A privacy-preserving multi-task framework for knowledge graph enhanced recommendation. IEEE Access 8:115717–115727

    Article  Google Scholar 

  34. Dang D, Chen C, Li H, Yan R, Guo Z, Wang X (2021) Deep knowledge-aware framework for web service recommendation. J Supercomput 77(12):14280–14304

    Article  Google Scholar 

  35. Zhang Y, Wang J, Luo J (2020) Knowledge graph embedding based collaborative filtering. IEEE Access, 2020

  36. Mei D, Huang, Li X (2021) Light graph convolutional collaborative filtering with multi-aspect information. IEEE Access, 2021, doi:https://doi.org/10.1109/ACCESS.2021.3061915

  37. Zhang Z, Bu J, Li Z, Yao C, Wang C, Wu J (2021) TigeCMN: on exploration of temporal interaction graph embedding via coupled memory neural networks. Neural Netw 140:13–26. https://doi.org/10.1016/j.neunet.2021.02.016

    Article  Google Scholar 

  38. Saied MA, Ouni A, Sahraoui H, Kula RG, Inoue K, Lo D (2018) Improving reusability of software libraries through usage pattern mining. J Syst Softw 145:164–179. https://doi.org/10.1016/j.jss.2018.08.032

    Article  Google Scholar 

  39. Nguyen PT, Di Rocco J, Di Ruscio D, Di Penta M (2020) CrossRec: supporting software developers by recommending third-party libraries. J Syst Softw 161:110460

    Article  Google Scholar 

  40. Chen J, Li B, Wang J, Zhao Y, Yao L, Xiong Y (2020) Knowledge graph enhanced third-party library recommendation for mobile application development. IEEE Access 8:42436–42446

    Article  Google Scholar 

  41. Noia TD, Ostuni VC (2015) Recommender systems and linked open data. In: Proceedings of the 11th international summer school reasoning web. web logic rules, Berlin, Germany, July 31–August 4, 2015, Tutorial Lectures, pp 88–113. doi: https://doi.org/10.1007/978-3-319-21768-0_4

  42. Hell F, Taha Y, Hinz G, Heibei S, Müller H, Knoll A (2020) Graph convolutional neural network for a pharmacy cross-selling recommender system. Information 11(11):525. https://doi.org/10.3390/info11110525

    Article  Google Scholar 

  43. Yin C, Shi L, Sun R, Wang J (2020) Improved collaborative filtering recommendation algorithm based on differential privacy protection. J Supercomput 76(7):5161–5174

    Article  Google Scholar 

  44. Tran DH, Sheng QZ, Zhang WE, Aljubairy A, Zaib M, Hamad SA, Khoa NLD (2021) HeteGraph: graph learning in recommender systems via graph convolutional networks. Neural Comput Appl, pp 1–17

  45. Robillard M, Walker R, Zimmermann T (2010) Recommendation systems for software engineering. IEEE Softw 27(4):80–86

    Article  Google Scholar 

  46. Jiang Y, Ma H, Liu Y, Li Z, Chang L (2021) Enhancing social recommendation via two-level graph attentional networks. Neurocomputing 449:71–84. https://doi.org/10.1016/j.neucom.2021.03.076

    Article  Google Scholar 

  47. Vargas S, Castells P (2014) Improving sales diversity by recommending users to items. In: Proceedings of the eighth ACM Conference on recommender systems, RecSys ’14, Foster City, Silicon Valley, CA, USA–October 06–10, 2014, pp 145–152

  48. Blei DM, Ng A, Jordan MI (2003) Latent dirichlet allocation. J Mach Learn Res. https://doi.org/10.1162/jmlr.2003.3.4-5.993

    Article  MATH  Google Scholar 

Download references

Acknowledgements

This work is supported by the National Natural Science Foundation of China under Grant Nos. 61862063, 61502413, 61262025; the National Social Science Foundation of China under Grant No. 18BJL104; the Science Foundation of Young and Middle-aged Academic and Technical Leaders of Yunnan under Grant No. 202205AC160040; the Science Foundation of Yunnan Jinzhi Expert Workstation under Grant No. 202205AF150006; the Natural Science Foundation of Key Laboratory of Software Engineering of Yunnan Province under Grant No. 2020SE301; the Science Foundation of “Knowledge-driven intelligent software engineering innovation team.”

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Xuan Zhang.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Zhao, Jz., Zhang, X., Gao, C. et al. KG2Lib: knowledge-graph-based convolutional network for third-party library recommendation. J Supercomput 79, 1–26 (2023). https://doi.org/10.1007/s11227-022-04603-3

Download citation

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s11227-022-04603-3

Keywords

Navigation