An Integrated Approach for Knowledge Graph Generation and Semantic Querying of Invoice Data
Querying financial documents, using Large Language Models (LLMs) has become increasingly prevalent in recent years, supported by technologies such as RAG (Retrieval Augmented Generation)/ GraphRAG and the Model Context Protocol (MCP). We propose a solution consisting of an MCP server and client that enables users to perform data ingestion, processing, and querying within a single unified interface, significantly reducing the technical barrier and streamlining the entire workflow. To fully leverage the well-structured nature of financial documents, information is stored in a Knowledge Graph (KG). The MCP client enables natural-language interaction, with an MCP server executing user requests through integrated tools that manage the entire pipeline. For querying, we propose an approach that uses LLMs to transform natural language questions into SPARQL queries, eliminating the need for prior technical knowledge. In addition, we integrate two retrieval approaches that can be used with GraphDB: SPARQL-based retrieval and vector-based retrieval. The approaches use GPT-4.1 as the underlying LLM, and their performance is evaluated through six competency questions and 5 additional evaluation queries using a public KG constructed from 538 invoices. The insights gained during the evaluation of the methods provide guidelines for selecting the most appropriate approach depending on the query type as well as to highlight the extent to which natural language queries can be effectively used in real-world business scenarios. SPARQL-based approaches are more reliable for validation and aggregation queries, while the vector-based plugin is better suited for descriptive questions but returns incomplete result sets because of top-k retrieval. JEL Classification: M15, C63, C88
Authors
- Ana-Maria Ghiran (ORCID: https://orcid.org/0000-0001-7890-9386)
- Teodora-Cristiana NEMTOC
Publication Details
- Journal
- Studia Universitatis Babeş-Bolyai. Oeconomica
- Published
- 2026-12-03
- DOI
- https://doi.org/10.2478/subboec-2026-0005
- Primary Topic
- Semantic Web and Ontologies
- Type
- article
- Field-Weighted Citation Impact
- 0.00