Articles

Automated Data Preprocessing Using Parameterized SWRL Inference within a Local RAG Pipeline

Authors

Abstract

This work formalizes expert knowledge in data preprocessing through the Web Ontology Language (OWL) and parameterized Semantic Web Rule Language (SWRL) rules, integrated with a Retrieval-Augmented Generation (RAG) pipeline for natural-language queries. An OWL ontology comprising 47 classes, 42 individuals, and 19 SWRL rules was designed in Protégé and validated on the Netflix Movies and TV Shows dataset (8,807 records, 12 columns). A Python-implemented inference engine, which parses the SWRL rule structure from the RDF/XML serialization and evaluates antecedents through deterministic conditionals without invoking a native OWL DL reasoner, generated 15 preprocessing-technique recommendations across 9 analyzable columns; the remaining 3 columns (show_id, title, description) were excluded as identifiers and free-text fields, respectively, for which tabular preprocessing is not applicable. The system guides data scientists in selecting preprocessing techniques based on each column's statistical profile, reducing reliance on manual configuration. The novelty lies in parameterizing SWRL rules using dynamically computed statistical metrics and multilingual semantic retrieval, within a fully local RAG pipeline that supports traceability and privacy.

Keywords

data quality expert systems knowledge management ontology semantic web

How to Cite

Contreras Trujillo, M. de los Á., Quintuña Ramón, M. R., Serpa Flores, C. T., Ullauri Carrasco, M. P., & Orellana, M. (2026). Automated Data Preprocessing Using Parameterized SWRL Inference within a Local RAG Pipeline. Revista Tecnológica - ESPOL, 38(E1), 13-30. https://doi.org/10.37815/rte.v38nE1.1599
BibTeX

Statistics

References

Aggarwal, C. C. (2016). An introduction to outlier analysis. In Outlier analysis (pp. 1–34). Springer. https://doi.org/10.1007/978-3-319-47578-3_1

Alavi, M., Leidner, D., & Mousavi, R. (2024). Knowledge management perspective of generative artificial intelligence (GenAI). Journal of the Association for Information Systems, 25(1), 1–12. https://doi.org/10.17705/1jais.00859

Batini, C., & Scannapieco, M. (2016). Data and information quality. In Cham, Switzerland: Springer International Publishing. Springer International Publishing. https://doi.org/10.1007/978-3-319-24106-7

Batista, G., & Monard, M. (2002). A study of k-nearest neighbour as an imputation method. In A. Abraham, J. Ruiz-del-Solar, & M. Köppen (Eds.), Soft Computing Systems: Design, Management and Applications IOS Press (pp. 251–260). IOS Press.

Brys, G., Hubert, M., & Struyf, A. (2004). A robust measure of skewness. Journal of Computational and Graphical Statistics, 13(4), 996–1017. https://doi.org/10.1198/106186004X12632

Buehler, M. J. (2024). Generative retrieval-augmented ontologic graph and multiagent strategies for interpretive large language model-based materials design. ACS Engineering Au, 4(2), 241–277. https://doi.org/10.1021/acsengineeringau.3c00058

Cannataro, M., Comito, C., & others. (2003). A data mining ontology for grid programming. Proc. 1st Int. Workshop on Semantics in Peer-to-Peer and Grid Computing, 113–134. https://scalab.dimes.unical.it/papers/pdf/SemPGRID2003.pdf

Chawla, N. V, Bowyer, K. W., Hall, L. O., & Kegelmeyer, W. P. (2002). SMOTE: synthetic minority over-sampling technique. Journal of Artificial Intelligence Research, 16, 321–357. https://doi.org/10.1613/jair.953

Dumontier, M., Baker, C. J. O., Baran, J., Callahan, A., Chepelev, L., Cruz-Toledo, J., Del Rio, N. R., Duck, G., Furlong, L. I., Keath, N., & others. (2014). The Semanticscience Integrated Ontology (SIO) for biomedical research and knowledge discovery. Journal of Biomedical Semantics, 5(1), 14. https://doi.org/10.1186/2041-1480-5-14

Edge, D., Krzyzanowski, T., Basisty, F., & others. (2024). A Graph RAG Approach to Query-Focused Summarization. ArXiv Preprint ArXiv:2404.16130. https://doi.org/10.48550/arXiv.2404.16130

Fernandez-Lopez, M., & Corcho, O. (2010). Ontological Engineering: with examples from the areas of Knowledge Management, e-Commerce and the Semantic Web. Springer Publishing Company, Incorporated. https://doi.org/10.1007/b97353

Ghosh, D., & Vogt, A. (2012). Outliers: An evaluation of methodologies. Joint Statistical Meetings, 12(1), 3455–3460. http://www.asasrms.org/Proceedings/y2012/Files/304068_72402.pdf

Jaziri, W., & Sassi, N. (2026). Ontology Quality Improvement in the Semantic Web: Evidence from Educational Knowledge Graphs. Systems, 14(2), 154. https://doi.org/10.3390/systems14020154

Krötzsch, M., Rudolph, S., & Hitzler, P. (2013). Complexities of Horn Description Logics. ACM Transactions on Computational Logic, 14(1), 1–36. https://doi.org/10.1145/2422085.2422087

Lewis, P., Perez, E., Piktus, A., Petroni, F., Karpukhin, V., Goyal, N., Küttler, H., Lewis, M., Yih, W., Rocktäschel, T., & others. (2020). Retrieval-augmented generation for knowledge-intensive nlp tasks. Advances in Neural Information Processing Systems, 33, 9459–9474. https://proceedings.neurips.cc/paper_files/paper/2020/file/6b493230205f780e1bc26945df7481e5-Paper.pdf

Little, R. J. A., & Rubin, D. B. (2019). Statistical analysis with missing data. John Wiley & Sons. https://doi.org/10.1002/9781119482260

McGuinness, D. L., Van Harmelen, F., & others. (2004). OWL web ontology language overview. W3C Recommendation, 10(10), 2004.

Meyer, J. G., Urbanowicz, R. J., Martin, P. C. N., O’Connor, K., Li, R., Peng, P.-C., Bright, T. J., Tatonetti, N., Won, K. J., Gonzalez-Hernandez, G., & others. (2023). ChatGPT and large language models in academia: opportunities and challenges. BioData Mining, 16(1), 20. https://doi.org/10.1186/s13040-023-00339-9

Páez, A., & Boisjoly, G. (2022). Exploratory Data Analysis (pp. 25–64). https://doi.org/10.1007/978-3-031-20719-8_2

Paltin Chica, D. L., Mejía Mendieta, J. D., Orellana, M., & Zambrano-Martinez, J. L. (2025). Modelado Semántico de Emergencias del ECU 911 con NLP y Ontologías. Revista Tecnológica - ESPOL, 37(E1), 112–125. https://doi.org/10.37815/rte.v37nE1.1351

Park, Y., Witherell, P., Surovi, N. A., & Cho, H. (2024). Ontology-based Retrieval Augmented Generation (RAG) for GenAI-supported Additive Manufacturing. The 35th Annual International Solid Freeform Fabrication Symposium. https://tsapps.nist.gov/publication/get_pdf.cfm?pub_id=958349

Publio, G. C., Esteves, D., Panov, P., Soldatova, L., Soru, T., Vanschoren, J., Zafar, H., & others. (2018). ML-schema: exposing the semantics of machine learning with schemas and ontologies. ArXiv Preprint ArXiv:1807.05351. https://doi.org/10.48550/arXiv.1807.05351

Rattanasawad, T., Saikaew, K. R., Buranarach, M., & Supnithi, T. (2013). A review and comparison of rule languages and rule-based inference engines for the Semantic Web. 2013 International Computer Science and Engineering Conference (ICSEC), 1–6. https://doi.org/10.1109/ICSEC.2013.6694743

Reimers, N., & Gurevych, I. (2019, November). Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks. Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing. http://arxiv.org/abs/1908.10084

Sharma, K., Kumar, P., & Li, Y. (2025). OG-RAG: ontology-grounded retrieval-augmented generation for large language models. Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing, 32950–32969. https://doi.org/10.18653/v1/2025.emnlp-main.1674

Yang, Y., & Webb, G. I. (2009). Discretization for naive-Bayes learning: managing discretization bias and variance. Machine Learning, 74(1), 39–74. https://doi.org/10.1007/s10994-008-5083-5