Exploring Large Language Models for Generating RDF Triples from NL texts: Findings in the e-commerce domain
DOI:
https://doi.org/10.5753/jbcs.2026.6951Keywords:
E-commerce, Semantic Web, Natural Language Processing, Large Language ModelsAbstract
Knowledge Graphs (KGs) have been used to represent information in a structured way, preserving semantics and facilitating the refined retrieval and understanding of complex information through semantic queries. By expressing relationships and hierarchies among entities, KGs play a fundamental role in organizing and connecting heterogeneous data. In the context of e-commerce, KGs represent knowledge about products, stores, user behavior, and purchases. This knowledge originates from several sources, including natural-language (NL) texts from customers, partners, and retailers. Deep Learning techniques have been used in state-of-the-art approaches to process such texts, including the adoption of Large Language Models. In this article, we propose a novel method that leverages Large Language Models (LLMs) to generate RDF triples from natural-language questions in e-commerce. Our proposal comprises three key steps: preprocessing using ontology elements, LLM-based triple generation, and conceptual integration with the existing KG. This article’s experimental evaluation focuses specifically on the triple-generation step, while the appending of validated triples to the KG is addressed in a companion study. We combined the definitions present in the ontology with the instance examples of the KG and the text generation power of LLMs to generate new RDF triples. Experimental evaluations on compatibility questions from multiple stores in the automobile domain in Portuguese demonstrate the effectiveness of the proposed approach in generating semantically coherent triples aligned with predefined ontology definitions. Our contribution emphasizes the intersection of NL understanding, knowledge representation, and e-commerce, paving the way for advanced information retrieval and enrichment of software applications.
Downloads
References
Abonizio, H., Almeida, T. S., Laitz, T., Junior, R. M., Bonás, G. K., Nogueira, R., and Pires, R. (2024). Sabi$backslash$'a-3 technical report. arXiv preprint arXiv:2410.12049. DOI: 10.48550/arXiv.2410.12049.
Arnaout, H. and Elbassuoni, S. (2018). Effective searching of rdf knowledge graphs. Journal of Web Semantics, 48:66-84. DOI: 10.1016/j.websem.2017.12.001.
Auer, S., Bizer, C., Kobilarov, G., Lehmann, J., Cyganiak, R., and Ives, Z. (2007). Dbpedia: A nucleus for a web of open data. In international semantic web conference, pages 722-735. Springer. DOI: 10.1007/978-3-540-76298-052.
Balabin, H., Hoyt, C. T., Birkenbihl, C., Gyori, B. M., Bachman, J., Kodamullil, A. T., Plöger, P. G., Hofmann-Apitius, M., and Domingo-Fernández, D. (2022). Stonkgs: a sophisticated transformer trained on biomedical text and knowledge graphs. Bioinformatics, 38(6):1648-1656. DOI: 10.1093/bioinformatics/btac001.
Brown, T., Mann, B., Ryder, N., Subbiah, M., Kaplan, J. D., Dhariwal, P., Neelakantan, A., Shyam, P., Sastry, G., Askell, A., et al. (2020). Language models are few-shot learners. Advances in neural information processing systems, 33:1877-1901. DOI: 10.48550/arXiv.2005.14165.
Bytyci, A., Ramosaj, L., and Bytyci, E. (2023). Review of automatic and semi-automatic creation of knowledge graphs from structured and unstructured data. In RTA-CSIT, pages 72-79. Available at: [link].
Chen, P., Lu, Y., Zheng, V. W., Chen, X., and Yang, B. (2018). Knowedu: A system to construct knowledge graph for education. Ieee Access, 6:31553-31563. DOI: 10.1109/ACCESS.2018.2839607.
Ehrlinger, L. and Wöss, W. (2016). Towards a definition of knowledge graphs. SEMANTiCS (Posters, Demos, SuCCESS), 48(1-4):2. Available at: [link].
Grattafiori, A., Dubey, A., Jauhri, A., Pandey, A., Kadian, A., Al-Dahle, A., Letman, A., Mathur, A., Schelten, A., Vaughan, A., et al. (2024). The llama 3 herd of models. arXiv preprint arXiv:2407.21783. DOI: 10.48550/arXiv.2407.21783.
Grimm, S. (2009). Knowledge representation and ontologies. In Scientific data mining and knowledge discovery: principles and foundations, pages 111-137. Springer. DOI: 10.1007/978-3-642-02788-86.
Grover, A. and Leskovec, J. (2016). node2vec: Scalable feature learning for networks. In Proceedings of the 22nd ACM SIGKDD international conference on Knowledge discovery and data mining, pages 855-864. DOI: 10.1145/2939672.2939754.
Gruber, T. (1993a). What is an ontology. Ksl. Available at: [link].
Gruber, T. R. (1993b). A translation approach to portable ontology specifications. Knowledge Acquisition, 5(2):199-220. DOI: 10.1006/knac.1993.1008.
Gruber, T. R. (1995). Toward principles for the design of ontologies used for knowledge sharing. International Journal of Human-Computer Studies, 43(5):907 - 928. DOI: 10.3115/1073083.1073135.
Guarino, N., Oberle, D., and Staab, S. (2009). What is an ontology? In Handbook on ontologies, pages 1-17. Springer. DOI: 10.1007/978-3-540-92673-3_0.
Ji, T., Wu, Y., and Lan, M. (2019). Graph-based dependency parsing with graph neural networks. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 2475-2485. DOI: 10.18653/v1/P19-1237.
Jin, Y., Fu, G., Qian, L., Liu, H., and Wang, H. (2021). Representation and extraction of diesel engine maintenance knowledge graph with bidirectional relations based on bert and the bi-lstm-crf model. In 2021 IEEE International Conference on e-Business Engineering (ICEBE), pages 126-133. IEEE. DOI: 10.1109/ICEBE52470.2021.00025.
Lee, J., Yoon, W., Kim, S., Kim, D., Kim, S., So, C. H., and Kang, J. (2020). Biobert: a pre-trained biomedical language representation model for biomedical text mining. Bioinformatics, 36(4):1234-1240. DOI: 10.1093/bioinformatics/btz682.
Li, F.-L., Chen, H., Xu, G., Qiu, T., Ji, F., Zhang, J., and Chen, H. (2020). Alimekg: Domain knowledge graph construction and application in e-commerce. In Proceedings of the 29th ACM International Conference on Information & Knowledge Management, pages 2581-2588. DOI: 10.1145/3340531.3412685.
Liu, S., Grau, B., Horrocks, I., and Kostylev, E. (2021). Indigo: Gnn-based inductive knowledge graph completion using pair-wise encoding. Advances in Neural Information Processing Systems, 34:2034-2045. Available at: [link].
Liu, Y., Zhang, T., Liang, Z., Ji, H., and McGuinness, D. L. (2018). Seq2rdf: An end-to-end application for deriving triples from natural language text. In CEUR Workshop Proceedings, volume 2180. CEUR-WS. Available at: [link].
Martinez-Rodriguez, J. L., López-Arévalo, I., and Rios-Alvarado, A. B. (2018). Openie-based approach for knowledge graph construction from text. Expert Systems with Applications, 113:339-355. DOI: 10.1016/j.eswa.2018.07.017.
Ora, L. (1999). Resource description framework (rdf) model and syntax specification. Available at: [link].
Papineni, K., Roukos, S., Ward, T., and Zhu, W.-J. (2002). Bleu: a method for automatic evaluation of machine translation. In Proceedings of the 40th annual meeting of the Association for Computational Linguistics, pages 311-318. DOI: 10.3115/1073083.1073135.
Regino, A. and dos Reis, J. C. (2025). Can llms be knowledge graph curators for validating triple insertions? In Genet Asefa Gesese, Harald Sack, H. P. A. M.-P. and Chen, L., editors, Proceedings of the Workshop on Generative AI and Knowledge Graphs (GenAIK) co-located with the 31st International Conference on Computational Linguistics (COLING 2025), pages 87-99, Abu Dhabi, UAE. International Committee on Computational Linguistics. Available at: [link].
Regino, A. G., Caus, R. O., Hochgreb, V., and dos Reis, J. C. (2023a). From natural language texts to rdf triples: A novel approach to generating e-commerce knowledge graphs. In Coenen, F., Fred, A., Aveiro, D., Dietz, J., Bernardino, J., Masciari, E., and Filipe, J., editors, Knowledge Discovery, Knowledge Engineering and Knowledge Management, pages 149-174. Springer Nature Switzerland. DOI: 10.1007/978-3-031-43471-6_7.
Regino, A. G., Caus, R. O., Hochgreb, V., and Reis, J. C. d. (2023b). Leveraging knowledge graphs for e-commerce product recommendations. SN Computer Science, 4(5):689. DOI: 10.1007/s42979-023-02149-6.
Rossanez, A., Dos Reis, J. C., Torres, R. d. S., and de Ribaupierre, H. (2020). Kgen: a knowledge graph generator from biomedical scientific literature. BMC medical informatics and decision making, 20(4):1-24. DOI: 10.1186/s12911-020-01341-5.
Sant’Anna, D. T., Caus, R. O., dos Santos Ramos, L., Hochgreb, V., and dos Reis, J. C. (2020). Generating knowledge graphs from unstructured texts: Experiences in the e-commerce field for question answering. In Advances in Semantics and Linked Data: Joint Workshop Proceedings from ISWC 2020, pages 56-71. Available at: [link].
Scao, T. L., Fan, A., Akiki, C., Pavlick, E., Ili'c, S., Hesslow, D., Castagné, R., Luccioni, A. S., Yvon, F., Gallé, M., et al. (2022). Bloom: A 176b-parameter open-access multilingual language model. arXiv preprint arXiv:2211.05100. DOI: 10.48550/arXiv.2211.05100.
Schneider, P., Schopf, T., Vladika, J., Galkin, M., Simperl, E., and Matthes, F. (2022). A decade of knowledge graphs in natural language processing: A survey. DOI: 10.18653/v1/2022.aacl-main.46.
Suchanek, F. and Weikum, G. (2013). Knowledge harvesting from text and web sources. In 2013 IEEE 29th International Conference on Data Engineering (ICDE), pages 1250-1253. DOI: 10.1109/ICDE.2013.6544916.
Tang, J., Xu, C., and Zhang, W. (2023). Construction and accurate retrieval method of knowledge graph of automobile engine fault. In 2023 IEEE 2nd International Conference on Electrical Engineering, Big Data and Algorithms (EEBDA), pages 336-345. IEEE. DOI: 10.1109/EEBDA56825.2023.10090855.
Wang, L., Hao, H., Yan, X., Zhou, T. H., and Ryu, K. H. (2025). From biomedical knowledge graph construction to semantic querying: a comprehensive approach. Scientific Reports, 15(1):8523. DOI: 10.1038/s41598-025-93334-5.
Wu, X., Tang, Y., Zhou, C., Zhu, G., Song, J., and Liu, G. (2022). An intelligent search engine based on knowledge graph for power equipment management. In 2022 5th International Conference on Energy, Electrical and Power Engineering (CEEPE), pages 370-374. IEEE. DOI: 10.1007/978-981-99-4761-4_59.
Xie, T., Tao, S., Li, Q., Wang, H., and Jin, Y. (2022). A lattice lstm-based framework for knowledge graph construction from power plants maintenance reports. Service Oriented Computing and Applications, 16(3):167-177. DOI: 10.1007/s11761-022-00338-4.
Yasunaga, M., Ren, H., Bosselut, A., Liang, P., and Leskovec, J. (2021). QA-GNN: Reasoning with language models and knowledge graphs for question answering. In Toutanova, K., Rumshisky, A., Zettlemoyer, L., Hakkani-Tur, D., Beltagy, I., Bethard, S., Cotterell, R., Chakraborty, T., and Zhou, Y., editors, Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 535-546. Association for Computational Linguistics. DOI: 10.18653/v1/2021.naacl-main.45.
Zhang, T., Kishore, V., Wu, F., Weinberger, K. Q., and Artzi, Y. (2019). Bertscore: Evaluating text generation with bert. arXiv preprint arXiv:1904.09675. DOI: 10.48550/arXiv.1904.09675.
Downloads
Published
How to Cite
Issue
Section
License
Copyright (c) 2026 André Gomes Regino, Julio Cesar dos Reis

This work is licensed under a Creative Commons Attribution 4.0 International License.

