{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,4,20]],"date-time":"2026-04-20T19:05:18Z","timestamp":1776711918001,"version":"3.51.2"},"reference-count":41,"publisher":"MDPI AG","issue":"2","license":[{"start":{"date-parts":[[2025,6,13]],"date-time":"2025-06-13T00:00:00Z","timestamp":1749772800000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/creativecommons.org\/licenses\/by\/4.0\/"}],"funder":[{"DOI":"10.13039\/501100010198","name":"Research Chair of Artificial Intelligence in Aeronautics and Aerospace (C\u00e1tedra de Inteligencia Artificial en Aeron\u00e1utica y Aeroespacio)","doi-asserted-by":"publisher","award":["TSI-100920-2023-1"],"award-info":[{"award-number":["TSI-100920-2023-1"]}],"id":[{"id":"10.13039\/501100010198","id-type":"DOI","asserted-by":"publisher"}]},{"DOI":"10.13039\/501100010198","name":"Research Chair of Artificial Intelligence in Aeronautics and Aerospace (C\u00e1tedra de Inteligencia Artificial en Aeron\u00e1utica y Aeroespacio)","doi-asserted-by":"publisher","award":["PLEC2023-010251"],"award-info":[{"award-number":["PLEC2023-010251"]}],"id":[{"id":"10.13039\/501100010198","id-type":"DOI","asserted-by":"publisher"}]},{"DOI":"10.13039\/100014440","name":"project \u201cTecnolog\u00edas Inteligentes para la Fabricaci\u00f3n, el dise\u00f1o y las Operaciones en entornos iNdustriales\u201d (TIFON)","doi-asserted-by":"publisher","award":["TSI-100920-2023-1"],"award-info":[{"award-number":["TSI-100920-2023-1"]}],"id":[{"id":"10.13039\/100014440","id-type":"DOI","asserted-by":"publisher"}]},{"DOI":"10.13039\/100014440","name":"project \u201cTecnolog\u00edas Inteligentes para la Fabricaci\u00f3n, el dise\u00f1o y las Operaciones en entornos iNdustriales\u201d (TIFON)","doi-asserted-by":"publisher","award":["PLEC2023-010251"],"award-info":[{"award-number":["PLEC2023-010251"]}],"id":[{"id":"10.13039\/100014440","id-type":"DOI","asserted-by":"publisher"}]}],"content-domain":{"domain":[],"crossmark-restriction":false},"short-container-title":["MAKE"],"abstract":"<jats:p>Question answering over domain-specific knowledge graphs implies several challenges. It requires sufficient knowledge of the world and the domain to understand what is being asked, familiarity with the knowledge graph\u2019s structure to build a correct query, and knowledge of the query language. However, mastering all of these is a time-consuming task. This work proposes a prompt-based approach that enables natural language to generate SPARQL queries. By leveraging the advanced language capabilities of large language models (LLMs), we constructed prompts that include a natural-language question, relevant contextual information from the domain-specific knowledge graph, and several examples of how the task should be executed. To evaluate our method, we applied it to an aviation knowledge graph containing accident report data. Our approach improved the results of the original work\u2014in which the aviation knowledge graph was first introduced\u2014by 6%, demonstrating its potential for enhancing SPARQL query generation for domain-specific knowledge graphs.<\/jats:p>","DOI":"10.3390\/make7020052","type":"journal-article","created":{"date-parts":[[2025,6,13]],"date-time":"2025-06-13T06:19:28Z","timestamp":1749795568000},"page":"52","update-policy":"https:\/\/doi.org\/10.3390\/mdpi_crossmark_policy","source":"Crossref","is-referenced-by-count":2,"title":["Context-Aware Few-Shot Learning SPARQL Query Generation from Natural Language on an Aviation Knowledge Graph"],"prefix":"10.3390","volume":"7","author":[{"given":"Ines-Virginia","family":"Hernandez-Camero","sequence":"first","affiliation":[{"name":"Departamento de Ciencias de la Computaci\u00f3n, Universidad de Alcal\u00e1, 28801 Alcal\u00e1 de Henares, Madrid, Spain"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-7598-3289","authenticated-orcid":false,"given":"Eva","family":"Garcia-Lopez","sequence":"additional","affiliation":[{"name":"Departamento de Ciencias de la Computaci\u00f3n, Universidad de Alcal\u00e1, 28801 Alcal\u00e1 de Henares, Madrid, Spain"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-0298-3237","authenticated-orcid":false,"given":"Antonio","family":"Garcia-Cabot","sequence":"additional","affiliation":[{"name":"Departamento de Ciencias de la Computaci\u00f3n, Universidad de Alcal\u00e1, 28801 Alcal\u00e1 de Henares, Madrid, Spain"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-3192-8499","authenticated-orcid":false,"given":"Sergio","family":"Caro-Alvaro","sequence":"additional","affiliation":[{"name":"Departamento de Ciencias de la Computaci\u00f3n, Universidad de Alcal\u00e1, 28801 Alcal\u00e1 de Henares, Madrid, Spain"}],"role":[{"role":"author","vocabulary":"crossref"}]}],"member":"1968","published-online":{"date-parts":[[2025,6,13]]},"reference":[{"key":"ref_1","doi-asserted-by":"crossref","first-page":"113648","DOI":"10.1016\/j.knosys.2025.113648","article-title":"Prompting Large Language Models with Knowledge Graphs for Question Answering Involving Long-Tail Facts","volume":"324","author":"Huang","year":"2024","journal-title":"Knowl.-Based Syst."},{"key":"ref_2","doi-asserted-by":"crossref","first-page":"419","DOI":"10.1007\/978-981-97-5492-2_32","article-title":"An In-Context Schema Understanding Method for Knowledge Base Question Answering","volume":"14884","author":"Liu","year":"2024","journal-title":"Int. Conf. Knowl. Sci. Eng. Manag."},{"key":"ref_3","doi-asserted-by":"crossref","unstructured":"Wei, Y., Huang, Q., Zhang, Y., and Kwok, J. (2023). KICGPT: Large Language Model with Knowledge in Context for Knowledge Graph Completion. Findings of the Association for Computational Linguistics: EMNLP 2023, Association for Computational Linguistics.","DOI":"10.18653\/v1\/2023.findings-emnlp.580"},{"key":"ref_4","doi-asserted-by":"crossref","first-page":"1","DOI":"10.1007\/s00778-021-00711-3","article-title":"A survey of RDF stores & SPARQL engines for querying knowledge graphs","volume":"31","author":"Ali","year":"2022","journal-title":"VLDB J."},{"key":"ref_5","doi-asserted-by":"crossref","first-page":"55","DOI":"10.3390\/analytics2010004","article-title":"A Brief Survey of Methods for Analytics over RDF Knowledge Graphs","volume":"2","author":"Papadaki","year":"2023","journal-title":"Analytics"},{"key":"ref_6","doi-asserted-by":"crossref","first-page":"2855","DOI":"10.1007\/s11280-023-01166-y","article-title":"An Empirical Study of Pre-Trained Language Models in Simple Knowledge Graph Question Answering","volume":"26","author":"Hu","year":"2023","journal-title":"World Wide Web"},{"key":"ref_7","unstructured":"Wu, X., and Tsioutsiouliklis, K. (2024). Thinking with Knowledge Graphs: Enhancing LLM Reasoning Through Structured Data. arXiv."},{"key":"ref_8","doi-asserted-by":"crossref","first-page":"205","DOI":"10.1016\/j.aiopen.2021.12.001","article-title":"A review of deep learning in question answering over knowledge bases","volume":"2","author":"Zhang","year":"2021","journal-title":"AI Open"},{"key":"ref_9","doi-asserted-by":"crossref","unstructured":"Lan, Y., He, G., Jiang, J., Jiang, J., Zhao, W.X., and Wen, J.R. (2021). A Survey on Complex Knowledge Base Question Answering: Methods, Challenges and Solutions. arXiv.","DOI":"10.24963\/ijcai.2021\/611"},{"key":"ref_10","unstructured":"Haluptzok, P., Bowers, M., and Kalai, A.T. (2023). Language Models Can Teach Themselves to Program Better. arXiv."},{"key":"ref_11","doi-asserted-by":"crossref","first-page":"125057","DOI":"10.1109\/ACCESS.2024.3453215","article-title":"A Comprehensive Evaluation of Neural SPARQL Query Generation From Natural Language Questions","volume":"12","author":"Diallo","year":"2024","journal-title":"IEEE Access"},{"key":"ref_12","unstructured":"Klager, G.G., and Polleres, A. (June, January 28). Is GPT fit for KGQA?\u2014Preliminary Results. Proceedings of the TEXT2KG 2023: Second International Workshop on Knowledge Graph Generation from Text, Hersonissos, Greece."},{"key":"ref_13","first-page":"18608","article-title":"FlexKBQA: A Flexible LLM-Powered Framework for Few-Shot Knowledge Base Question Answering","volume":"38","author":"Li","year":"2024","journal-title":"Proc. AAAI Conf. Artif. Intell."},{"key":"ref_14","first-page":"24824","article-title":"Chain-of-Thought Prompting Elicits Reasoning in Large Language Models","volume":"35","author":"Wei","year":"2022","journal-title":"Adv. Neural Inf. Process. Syst."},{"key":"ref_15","doi-asserted-by":"crossref","unstructured":"Chen, W. (2023, January 2\u20136). Large Language Models are few(1)-shot Table Reasoners. Proceedings of the Findings of the Association for Computational Linguistics: EACL 2023, Dubrovnik, Croatia.","DOI":"10.18653\/v1\/2023.findings-eacl.83"},{"key":"ref_16","doi-asserted-by":"crossref","unstructured":"Xiong, G., Bao, J., and Zhao, W. (2024, January 11\u201316). Interactive-KBQA: Multi-Turn Interactions for Knowledge Base Question Answering with Large Language Models. Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics, Bangkok, Thailand.","DOI":"10.18653\/v1\/2024.acl-long.569"},{"key":"ref_17","unstructured":"Agarwal, A., Gite, R., Laddha, S., Bhattacharyya, P., Kar, S., Ekbal, A., Thind, P., Zele, R., and Shankar, R. (2022, January 20\u201325). Knowledge Graph\u2014Deep Learning: A Case Study in Question Answering in Aviation Safety Domain. Proceedings of the Thirteenth Language Resources and Evaluation Conference, Marseille, France."},{"key":"ref_18","doi-asserted-by":"crossref","unstructured":"Jaradeh, M.Y., Oelen, A., Farfar, K.E., Prinz, M., D\u2019Souza, J., Kismih\u00f3k, G., Stocker, M., and Auer, S. (2019, January 19\u201321). Open Research Knowledge Graph: Next Generation Infrastructure for Semantic Scholarly Knowledge. Proceedings of the 10th International Conference on Knowledge Capture, Marina Del Rey, CA, USA.","DOI":"10.1145\/3360901.3364435"},{"key":"ref_19","doi-asserted-by":"crossref","first-page":"1","DOI":"10.1145\/3447772","article-title":"Knowledge Graphs","volume":"54","author":"Hogan","year":"2022","journal-title":"ACM Comput. Surv."},{"key":"ref_20","unstructured":"Meloni, A., Recupero, D.R., Osborne, F., Salatino, A., Motta, E., Vahadati, S., and Lehmann, J. (2024, January 13). Assessing Large Language Models for SPARQL Query Generation in Scientific Question Answering. Proceedings of the Special Session on Harmonising Generative AI and Semantic Web Technologies (HGAIS 2024), Baltimore, MD, USA."},{"key":"ref_21","unstructured":"Meyer, L.-P., Frey, J., Brei, F., and Arndt, N. (2025). Assessing SPARQL capabilities of Large Language Models. arXiv."},{"key":"ref_22","doi-asserted-by":"crossref","first-page":"102124","DOI":"10.1016\/j.ipm.2019.102124","article-title":"Building a morpho-semantic knowledge graph for Arabic information retrieval","volume":"57","author":"Bounhas","year":"2020","journal-title":"Inf. Process. Manag."},{"key":"ref_23","doi-asserted-by":"crossref","first-page":"13071","DOI":"10.1007\/s10462-023-10465-9","article-title":"Knowledge Graphs: Opportunities and Challenges","volume":"56","author":"Peng","year":"2023","journal-title":"Artif. Intell. Rev."},{"key":"ref_24","doi-asserted-by":"crossref","unstructured":"Zheng, D., Song, X., Ma, C., Tan, Z., Ye, Z., Dong, J., Xiong, H., Zhang, Z., and Karypis, G. (2020). DGL-KE: Training Knowledge Graph Embeddings at Scale. arXiv.","DOI":"10.1145\/3397271.3401172"},{"key":"ref_25","unstructured":"Jia, R., Zhang, B., M\u00e9ndez, S.J.R., and Omran, P.G. (2024). Leveraging Large Language Models for Semantic Query Processing in a Scholarly Knowledge Graph. arXiv."},{"key":"ref_26","doi-asserted-by":"crossref","unstructured":"Huang, X., Kim, J.-J., and Zou, B. (2021). Unseen Entity Handling in Complex Question Answering over Knowledge Base via Language Generation. Findings of the Association for Computational Linguistics: EMNLP 2021, Association for Computational Linguistics.","DOI":"10.18653\/v1\/2021.findings-emnlp.50"},{"key":"ref_27","doi-asserted-by":"crossref","unstructured":"Das, R., Zaheer, M., Thai, D., Godbole, A., Perez, E., Lee, J.Y., Tan, L., Polymenakos, L., and McCallum, A. (2021, January 7\u201311). Case-based Reasoning for Natural Language Queries over Knowledge Bases. Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, Association for Computational Linguistics, Punta Cana, Dominican Republic.","DOI":"10.18653\/v1\/2021.emnlp-main.755"},{"key":"ref_28","unstructured":"Liu, Y., Ott, M., Goyal, N., Du, J., Joshi, M., Chen, D., Levy, O., Lewis, M., Zettlemoyer, L., and Stoyanov, V. (2019). RoBERTa: A Robustly Optimized BERT Pretraining Approach. arXiv."},{"key":"ref_29","first-page":"17283","article-title":"Big Bird: Transformers for Longer Sequences","volume":"33","author":"Zaheer","year":"2020","journal-title":"Adv. Neural Inf. Process. Syst."},{"key":"ref_30","unstructured":"Wu, Y., Hu, N., Bi, S., Qi, G., Ren, J., Xie, A., and Song, W. (2023). Retrieve-Rewrite-Answer: A KG-to-Text Enhanced LLMs Framework for Knowledge Graph Question Answering. arXiv."},{"key":"ref_31","doi-asserted-by":"crossref","unstructured":"Sima, A.C., Mendes de Farias, T., Anisimova, M., Dessimoz, C., Robinson-Rechavi, M., Zbinden, E., and Stockinger, K. (2021, January 6\u20137). Bio-SODA: Enabling Natural Language Question Answering over Knowledge Graphs without Training Data. Proceedings of the 33rd International Conference on Scientific and Statistical Database Management, Tampa, FL, USA.","DOI":"10.1145\/3468791.3469119"},{"key":"ref_32","unstructured":"Rangel, J.C., Farias TMde Sima, A.C., and Kobayashi, N. (2024). SPARQL Generation: An analysis on fine-tuning OpenLLaMA for Question Answering over a Life Science Knowledge Graph. arXiv."},{"key":"ref_33","doi-asserted-by":"crossref","unstructured":"Baek, J., Aji, A.F., and Saffari, A. (2023, January 13). Knowledge-Augmented Language Model Prompting for Zero-Shot Knowledge Graph Question Answering. Proceedings of the 1st Workshop on Natural Language Reasoning and Structured Explanations (@ACL 2023), Toronto, ON, Canada.","DOI":"10.18653\/v1\/2023.nlrse-1.7"},{"key":"ref_34","first-page":"19080","article-title":"Graph Neural Prompting with Large Language Models","volume":"38","author":"Tian","year":"2024","journal-title":"Proc. AAAI Conf. Artif. Intell."},{"key":"ref_35","unstructured":"Grattafiori, A., Dubey, A., Jauhri, A., Pandey, A., Kadian, A., Al-Dahle, A., Letman, A., Mathur, A., Schelten, A., and Vaughan, A. (2024). The Llama 3 Herd of Models. arXiv."},{"key":"ref_36","doi-asserted-by":"crossref","unstructured":"Wolf, T., Debut, L., Sanh, V., Chaumond, J., Delangue, C., Moi, A., Cistac, P., Rault, T., Louf, R., and Funtowicz, M. (2020). HuggingFace\u2019s Transformers: State-of-the-art Natural Language Processing. arXiv.","DOI":"10.18653\/v1\/2020.emnlp-demos.6"},{"key":"ref_37","doi-asserted-by":"crossref","unstructured":"Ben Amor, M., Strappazzon, A., Granitzer, M., Egyed-Zsigmond, E., and Mitrovi\u0107, J. (2025, January 24\u201328). Instruct-to-SPARQL: A text-to-SPARQL dataset for training SPARQL Agents. Proceedings of the 2025 ACM SIGIR Conference on Human Information Interaction and Retrieval, Melbourne, Australia.","DOI":"10.1145\/3698204.3716476"},{"key":"ref_38","doi-asserted-by":"crossref","unstructured":"D\u2019Abramo, J., Zugarini, A., and Torroni, P. (2025, January 3). Investigating Large Language Models for Text-to-SPARQL Generation. Proceedings of the 4th International Workshop on Knowledge-Augmented Methods for Natural Language Processing, Albuquerque, NM, USA.","DOI":"10.18653\/v1\/2025.knowledgenlp-1.5"},{"key":"ref_39","unstructured":"ICAO (2024). ICAO Safety Report, International Civil Aviation Organization. [2024th ed.]."},{"key":"ref_40","doi-asserted-by":"crossref","first-page":"127306","DOI":"10.1016\/j.eswa.2025.127306","article-title":"Retrieval-Augmented Generation-aided causal identification of aviation accidents: A large language model methodology","volume":"278","author":"Ren","year":"2025","journal-title":"Expert Syst. Appl."},{"key":"ref_41","unstructured":"Heist, N., Hertling, S., Ringler, D., and Paulheim, H. (2020). Knowledge Graphs on the Web\u2014An Overview. arXiv."}],"container-title":["Machine Learning and Knowledge Extraction"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/www.mdpi.com\/2504-4990\/7\/2\/52\/pdf","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2025,10,9]],"date-time":"2025-10-09T17:51:20Z","timestamp":1760032280000},"score":1,"resource":{"primary":{"URL":"https:\/\/www.mdpi.com\/2504-4990\/7\/2\/52"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2025,6,13]]},"references-count":41,"journal-issue":{"issue":"2","published-online":{"date-parts":[[2025,6]]}},"alternative-id":["make7020052"],"URL":"https:\/\/doi.org\/10.3390\/make7020052","relation":{},"ISSN":["2504-4990"],"issn-type":[{"value":"2504-4990","type":"electronic"}],"subject":[],"published":{"date-parts":[[2025,6,13]]}}}