Skip to main content
Log in

Ontology-based code snippets management in a cloud environment

  • Original Research
  • Published:
Journal of Ambient Intelligence and Humanized Computing Aims and scope Submit manuscript

Abstract

A code snippet is a small region of reusable source code that is common to many functions. Skilled management and reuse of snippets can improve programming efficiency in practice. However, we find that most snippets are posted to online blogs or snippet management systems with little description and tagging, which leads to an embarrassing situation in which existing snippets are difficult to reuse. This occurs because snippets are usually hastily pushed to online services or saved in text files by programmers and also because existing management systems do not provide efficient labeling and reusing frameworks. In this paper, we propose to annotate snippets with a well-formed domain-specific ontology—programming ontology. With a thorough investigation of real world snippets, we designed a programming ontology to annotate and recommend snippets. We show how to annotate a snippet with ontology terms based on text classification models. In addition, we built a snippet management system that stores user snippets in the cloud and automatically recommends snippets, so that the retrieval of snippets becomes trivial in popular integrated developing environments, such as Eclipse and Visual Studio. Our evaluation results demonstrate that the ontology annotation algorithm is able to automatically annotate a snippet with a high degree of accuracy. The shared domain knowledge also makes it possible to share snippets among programmers and systems. As the number of labeled snippets increases, deep learning models can be trained and used to annotate code snippets with high accuracy.

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

References

  • Aggarwal CC, Reddy CK (2013) Data clustering: algorithms and applications. CRC press

  • Alnusair A, Zhao T (2012) Retrieving reusable software components using enhanced representation of domain knowledge. Springer, New York

    Book  Google Scholar 

  • Bagga A, Baldwin B (1998) Entity-based cross-document coreferencing using the vector space model. In: Proceedings of the 36th annual meeting of the association for computational linguistics and 17th international conference on computational linguistics, vol 1. Association for Computational Linguistics, pp 79–85

  • Baharudin B, Lee LH, Khan K (2010) A review of machine learning algorithms for text-documents classification. J Adv Inf Technol 1(1):4–20

    Google Scholar 

  • Bechhofer S (2009) Owl: web ontology language. In: Encyclopedia of information science & technology, 2nd edn, vol 63, no 45, pp 990–996

  • Borgelt C, Kruse R (2002) Induction of association rules: apriori implementation. Physica-Verlag, Heidelberg

    Google Scholar 

  • Borst WN (1997) Construction of engineering ontologies for knowledge sharing and reuse. Universiteit Twente, Enschede

    Google Scholar 

  • Busch JE, Lin AD, Graydon PJ, Caudill M (2006) Ontology-based parser for natural language processing. US Patent 7,027,974

  • Chen X, Li J, Weng J, Ma J, Lou W (2014) Verifiable computation over large database with incremental updates. Springer International Publishing, New York

    Book  MATH  Google Scholar 

  • CSDN (2015) http://code.csdn.net. Accessed 10 June 2015

  • Fang Y, Tan Y, Zhang Q, Fei WU, Cheng Z, Zheng J (2016) An effective raid data layout for object-based de-duplication backup system. Chin J Electron 25(5):832–840

    Article  Google Scholar 

  • Gist (2015) http://gist.github.com. Accessed 10 June 2015

  • Gupta B, Agrawal DP, Yamaguchi S (2016) Handbook of research on modern cryptographic solutions for computer and cyber security. IGI Global

  • Hearst MA, Dumais ST, Osman E, Platt J, Scholkopf B (1998) Support vector machines. Intell Syst Appl IEEE 13(4):18–28

    Article  Google Scholar 

  • Ibtihal M, Driss EO, Hassan N (2017) Homomorphic encryption as a service for outsourced images in mobile cloud computing environment. Int J Cloud Appl Comput 7(2):27–40

    Google Scholar 

  • Jimbo R, Miyata S, Matsuzawa K, Kinoshita H (2015) Rdfization of database for folk implements and ontology-assisted information retrieval system. In: IEEE international conference on consumer electronics, Taiwan, pp 490–491

  • Johnson DE, Oles FJ, Zhang T, Goetz T (2002) A decision-tree-based symbolic rule induction system for text categorization. IBM Syst J 41(3):428–437

    Article  Google Scholar 

  • Katifori A, Vassilakis C, Lepouras G, Torou E (2015) Effectiveness of visualization for information retrieval through ontologies with entity evolution: the impact of ontology modeling. Int J Inf Retr Res 5(2):66–91

    Google Scholar 

  • Keivanloo I, Roostapour L, Schugerl P, Rilling J (2010) Semantic web-based source code search

  • Kiefer C, Bernstein A, Tappolet J (2007) Mining software repositories with isparol and a software evolution ontology. In: Proceedings of the fourth international workshop on mining software repositories. IEEE Computer Society, p 10

  • Li S, Xia R, Zong C, Huang CR (2009) A framework of feature selection methods for text categorization, pp 692–700

  • Li J, Huang X, Li J, Chen X, Xiang Y (2014) Securely outsourcing attribute-based encryption with checkability. IEEE Trans Parallel Distrib Syst 25(8):2201–2210

    Article  Google Scholar 

  • Li Y, Thomas MA, Osei-Bryson KM (2016) Ontology-based data mining model management for self-service knowledge discovery. Inf Syst Frontiers:1–19

  • Li J, Zhang Y, Chen X, Xiang Y, Li J, Zhang Y, Chen X, Xiang Y (2017a) Secure attribute-based data sharing for resource-limited users in cloud computing. Comput Secur 72:1–2

  • Li P, Li J, Huang Z, Gao CZ, Chen WB, Chen K (2017b) Privacy-preserving outsourced classification in cloud computing. Cluster Computing. https://doi.org/10.1007/s10586-017-0849-9

    Google Scholar 

  • Noy NF, McGuinness DL et al (2001) Ontology development 101: a guide to creating your first ontology

  • Peng H, Long F, Ding C (2005) Feature selection based on mutual information criteria of max-dependency, max-relevance, and min-redundancy. Pattern Anal Mach Intell IEEE Trans 27(8):1226–1238

    Article  Google Scholar 

  • Pierrakeas C, Solomou G, Kameas A (2012) An ontology-based approach in learning programming languages, pp 393–398

  • Rehman Z, Kifor S (2015) Teaching natural language processing (NLP) using ontology based education design. In: Balkan region conference on engineering and business education, vol 1. De Gruyter Open

  • Rocchio JJ (1971) Relevance feedback in information retrieval. The SMART retrieval system: experiments in automatic document processing, pp 313–323

  • Snip2Code (2016) http://www.snip2code.com. Accessed 20 May 2016

  • Sosnovsky S, Gavrilova T (2006) Development of educational ontology for c-programming. Ontology-based code snippets management in a cloud environment

  • Staab S, Studer R, Schnurr HP, Sure Y (2001) Knowledge processes and ontologies. IEEE Intell Syst 1:26–34

    Article  Google Scholar 

  • Stergiou C, Psannis KE, Kim BG, Gupta B (2018) Secure integration of iot and cloud computing. Future Gener Comput Syst 78:964–975

    Article  Google Scholar 

  • Studer R, Benjamins VR, Fensel D (1998) Knowledge engineering: principles and methods. Data Knowl Eng 25(1):161–197

    Article  MATH  Google Scholar 

  • Sun Z, Zhang Q, Li Y, Tan YA (2016) Dppdl: a dynamic partial-parallel data layout for green video surveillance storage. IEEE Trans Circuits Syst Video Technol PP(99):1

  • Witte R, Li Q, Zhang Y, Rilling J (2007) Ontological text mining of software documents. In: Kedad Z, Lammari N, Métais E, Meziane F, Rezgui Y (eds) Natural language processing and information systems. NLDB 2007. Springer, Berlin, Heidelberg, pp 168–180

    Google Scholar 

  • Wu J, Guo S, Li J, Zeng D (2016a) Big data meet green challenges: big data toward green applications. IEEE Syst J 10(3):888–900

    Article  Google Scholar 

  • Wu J, Guo S, Li J, Zeng D (2016b) Big data meet green challenges: greening big data. IEEE Syst J 10(3):873–887

    Article  Google Scholar 

  • Yang Y, Pedersen JO (1997) A comparative study on feature selection in text categorization, vol 97. ICML, Stockholm

    Google Scholar 

  • Yu X, Zhang C, Xue Y, Zhu H, Li Y, Tan YA (2017) An extra-parity energy saving data layout for video surveillance. Multimed Tools Appl (C):1–21

  • Zhang ML, Zhou ZH (2007) Ml-knn: A lazy learning approach to multi-label learning. Pattern Recogn 40(7):2038–2048

    Article  MATH  Google Scholar 

  • Zhang Y, Chen X, Li J, Wong DS, Li H, You I (2016) Ensuring attribute privacy protection and fast decryption for outsourced data security in mobile cloud computing. Inf Sci 379:42–61

  • Zhao L, Huang M, Yao Z, Su R, Jiang Y, Zhu X (2016) Semi-supervised multinomial naive bayes for text classification by leveraging word-level statistical constraint. In: Proceedings of the thirtieth AAAI conference on artificial intelligence, AAAI, pp 2877–2884

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Weixing Ji.

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Shi, J., Ji, W., Gao, Z. et al. Ontology-based code snippets management in a cloud environment. J Ambient Intell Human Comput 10, 2971–2985 (2019). https://doi.org/10.1007/s12652-018-0701-y

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s12652-018-0701-y

Keywords

Navigation