Ontology-Enriched GraphRAG: A Case Study in Portuguese Geoscience Question Answering
Abstract
Retrieval-Augmented Generation (RAG) significantly enhances Large Language Models (LLMs) in Question-Answering (QA) tasks. However, traditional text-based retrieval may prove insufficient in specialized domains, such as geoscience, where critical information is highly interconnected and distributed across complex concepts, relations, and interpretative descriptions. While Graph-based Retrieval-Augmented Generation (GraphRAG) addresses part of this limitation by structuring evidence into entity-relation graphs, it remains susceptible to terminological inconsistencies, synonyms, and domain-specific variants. To bridge this gap, this paper presents a controlled empirical study evaluating ontology-enriched GraphRAG for Portuguese geoscience QA. We systematically compared four generation strategies: LLM-only, textual RAG, standard GraphRAG, and ontology-enriched GraphRAG. The ontology-driven approach grounds text-extracted entities in formal reference ontologies using a cascading matching strategy that starts with embedding-based semantic similarity, followed by URI-based, label-based, and alternative-label-based matching. Evaluated across semantic, lexical, contextual, and graph-level metrics, our results confirm that external retrieval is indispensable, as retrieval-based strategies outperform the LLM-only baseline. Textual RAG achieved the strongest lexical overlap, while ontology-enriched GraphRAG achieved the highest Correctness, Completeness, and Contextual Recall. GraphRAG provided stronger grounding and question alignment, as reflected by higher Faithfulness and Answer Relevancy. Beyond these answerand context-level gains, the most substantial effect of ontology enrichment was structural, driving a substantial expansion in graph semantic coverage, graph size, and matching rate. These findings suggest that ontology grounding acts primarily as a powerful enabling mechanism for semantic representation; however, its impact on answer quality depends on retrieval, subgraph selection, and prompt construction.