Manuscript Offprint

arXiv:2609.08869

OntoKG-EQ: A provenance-grounded, competency-question-governed knowledge graph for auditable analyst querying

Furqan Nasir, Muhammad Atif Saeed, Muhammad Ehsan, Sher Jeel Ahmad, Abdul Moiz Altaf

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Analysts in emerging equity markets keep answering the same questions. Did fundamentals match the market's response? How does the local currency co-move with returns? Which firms outperform sector and benchmark, and which disclosures coincide with abnormal trading? These answers come from ad-hoc spreadsheets that are hard to reproduce, audit, or trust. We present OntoKG-EQ, a knowledge-based system that makes such queries reproducible, evidence-linked, temporally explicit, valid, and inspectable. It couples a bounded, competency-question-governed core ontology with a provenance-aware knowledge graph in which every class, property, shape, and metric is justified by one of five frozen questions. The system materialises market data into the graph, computes the metrics, validates its structure against declarative shape constraints, answers each competency question with a graph query, derives typed findings, and generates an explanation tracing each result to its observations, evidence, sources, and provenance. We evaluate on curated datasets from three emerging markets (Pakistan, Malaysia, Indonesia). Once each market's data is mapped into the common

*Corresponding author.

Email addresses: furqannr@gmail.com (Furqan Nasir), atif.saeed@isb.nu.edu.pk (Muhammad Atif Saeed), me@cusit.edu.pk (Muhammad Ehsan), Sherjeel4all@gmail.com (Sher Jeel Ahmad), moizaltaf8080@gmail.com (Abdul Moiz Altaf) schema, the ontology, shapes, queries, and rules are reused unchanged. A relational-database baseline shows the graph changes no analytics. Its value is governance, provenance, and self-explaining structure. Because answers are rendered deterministically from the validated graph, their consistency with it is guaranteed by construction. Used as a reference, the system measures how consistently eight open language models transcribe the same evidence (provenance coverage 0.00 to 1.00). A study with a 17-participant convenience panel finds the evidence bundle significantly increased perceived trust and completeness. Code and data are openly released.

Keywords: Knowledge graphs, Ontology engineering, Competency questions, Provenance, SHACL, Explainable querying

1. Introduction

Equity analysts working in emerging markets answer a small set of recurring questions whenever a company reports results. Did a firm's reported strength translate into a commensurate market response? How does movement in the local currency relate to company-, sector-, and benchmark-level returns over a defined window? Which firms outperform both their sector peers and the broad-market benchmark over the same period? And which official disclosures coincide with abnormal return or trading-volume activity in short event windows? In practice these questions are answered with bespoke spreadsheets that stitch together company fundamentals, daily prices, sector and benchmark comparators, exchange-rate series, and exchange disclosures. The answers are useful, but they are difficult to reproduce, hard to audit, and they rarely carry an explicit, inspectable link back to the underlying evidence and its provenance. That link is precisely what a reviewer, regulator, or risk committee needs in order to trust an analyst note. Fig. 1 illustrates this setting with a worked example from the Indonesia market: an analyst question, the company returned, and the full evidence-and-provenance path that justifies the result.

This paper addresses that gap as a problem of data and knowledge engineering, not prediction. The goal is not to forecast prices or recommend trades. It is to make analyst-oriented queries over heterogeneous market data reproducible, evidence-linked, temporally explicit, structurally valid, and inspectable. Every returned entity is then traceable, by construction, to the observations that justify it, the window over which they were

Figure

Figure 1: A worked analyst example (Indonesia, CQ3). ISAT is returned as a relative-outperformer. The inspectable trail traces the result through its deciding observations (company, sector, and benchmark window returns) to the official FY2025 IDX disclosure and the provenance record. The underlying knowledge graph is SHACL-valid.

measured, the official source, and a provenance record.

Our approach builds on established knowledge-graph foundations and surveys [1, 2], SPARQL query semantics [3], and the explainable-AI literature [4], adapting them to the bounded, provenance-first setting of analyst querying. No existing line of work delivers this combination for emerging-market analytical querying. Financial-domain ontologies such as FIBO model the concepts of finance comprehensively, but do not, on their own, provide a bounded, executable path from a parameterised query to the evidence and provenance that justify each result. Recent financial knowledge graphs emphasise large-scale, often LLM-driven, extraction, and explicitly flag interpretability and provenance as open challenges [5, 6]. Graph-based retrieval-augmented generation (GraphRAG) grounds language-model answers in retrieved subgraphs, but its faithfulness is estimated rather than guaranteed, because a generated answer may not be entailed by the retrieved evidence.

We present OntoKG-EQ, a knowledge-based system that operationalises explainable analyst querying over equity data. OntoKG-EQ is built around five frozen competency questions (CQ1–CQ5) that bound its scope: no ontology class, property, SHACL shape, derived metric, or inference rule exists unless it is required to answer one of them. Given a market's data, the system (i) materialises it into a provenance-aware RDF knowledge graph aligned to a compact core ontology; (ii) computes the derived analytical metrics the questions require (window returns, year-on-year growth, sector and benchmark returns, exchange-rate association, and event-window abnormal return and volume); (iii) validates structure with SHACL; (iv) answers each competency question with SPARQL that computes its stated condition; (v) applies inference rules that derive typed, queryable analytical findings (e.g., relative-outperformer, fundamentals-market divergence, abnormal-event reaction); and (vi) generates, automatically and for every result, an evidence bundle that exposes the inspectable path from the executed query to its supporting observations, evidence items, official sources, and provenance. Faithfulness is therefore enforced structurally: there is no generative step that can drift from the evidence. We position this as a complement to, and a provenance-grounded reference for, GraphRAG-style answering.

A central claim of the paper is reuse of the apparatus: the contribution is a method, not a one-off dataset. This reuse is demonstrated over structurally aligned datasets, not proven across arbitrarily heterogeneous reporting structures. We demonstrate this on three independent emerging markets (curated datasets): the Pakistan Stock Exchange (PSX, KSE-100 index), Bursa Malaysia (MSX, FBM KLCI index), and the Indonesia Stock Exchange (IDX, Jakarta Composite). The core ontology, SHACL shapes, the five competency-question queries, and the inference rules are reused byte-identical across all three markets. Only the data and a small per-market adapter configuration change. Every market is SHACL-conformant and answers the competency questions with fully traceable explanations.

The contributions of this paper are threefold. (1) A reusable, competency-question-governed construction method that bounds scope with five frozen competency questions, computes the analytics in a provenance-aware RDF graph, and validates structure with SHACL. It is reused byte-identical across three markets (100% of the ontology, shapes, queries, and rules, once each market's data is mapped into the common schema) and demonstrated at a 64-stock scale, with the unchanged competency-question SPARQL executing on a standard triplestore. This reuse is scoped to structurally aligned datasets rather than arbitrary structures. (2) An automated, self-explaining evidence mechanism in which every result and inferred finding carries an inspectable query→observation→evidence→source→provenance path rendered deterministically from the validated graph. Graph-grounded transcription consistency is therefore a design guarantee, which lets OntoKG-EQ serve as a provenance-grounded reference for measuring the faithfulness of GraphRAG/LLM answerers over the same graph. (3) An empirical evaluation with honest, condition-computing query semantics, in which a family legitimately returns nothing when the data do not satisfy it. It spans competency-question coverage, quantified portability, a relational baseline that isolates a deliberate negative result (the graph changes no analytics), a reference-based faithfulness study of eight open language models with confidence intervals and pairwise significance tests, component ablations, at-scale triplestore execution, and an executed user study (n = 17, participant-level) showing large gains in perceived trust and completeness. All code, data, and the evaluation harness are openly released.

References (36)