Source-linked AI summary

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

arXiv:2609.08869v1cs.ETcs.AIcs.DB

TL;DR

Emerging-market analyst queries are difficult to reproduce, audit, and trust when assembled from bespoke spreadsheets and heterogeneous data. OntoKG-EQ addresses this with a competency-question-governed, provenance-aware knowledge graph whose validated queries produce typed findings and deterministic evidence explanations. Across three curated markets, the apparatus is reused unchanged after data mapping, while its value is governance, provenance, and self-explaining structure rather than changed analytics.

  • Problem

    Emerging-market analysts need reproducible, auditable answers about fundamentals, returns, currencies, outperformance, and disclosures, but commonly rely on difficult-to-audit bespoke spreadsheets.

  • Method

    OntoKG-EQ bounds a provenance-aware RDF graph with five frozen competency questions, computes required metrics, validates structure with SHACL, derives typed findings, and generates evidence-linked explanations.

  • Results

    100% apparatus reuse across Pakistan, Malaysia, and Indonesia is achieved after market data mapping, with all markets SHACL-conformant and explanations complete and sound.

  • Takeaways & Limitations

    The system provides a governance and provenance reference for analyst querying and for measuring language-model faithfulness, while deterministic rendering guarantees consistency with the validated graph.

  • Takeaways & Limitations

    The 100% reuse result applies to manually mapped, structurally aligned data rather than arbitrary raw reporting structures.

Abstract

from arXiv · show

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 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.

1. Introduction

OntoKG-EQ addresses the reproducibility and auditability problems of bespoke emerging-market equity analysis by governing analyst queries with frozen competency questions and provenance-linked graph structure. It operationalises those queries through validated, explainable computation and demonstrates reusable apparatus across three markets.

  • Emerging-market analysts rely on bespoke spreadsheets combining fundamentals, prices, comparators, exchange rates, and disclosures, making answers difficult to reproduce, audit, and trust.
  • Every result is traceable to supporting observations, measurement windows, official sources, and provenance, while deterministic rendering prevents generated text from drifting from the evidence.
  • OntoKG-EQ bounds its scope with five frozen competency questions, admitting ontology terms, shapes, metrics, and rules only when required by one question.
  • The system materialises market data, computes analytical metrics, validates the graph with SHACL, answers competency questions with SPARQL, derives typed findings, and generates evidence bundles.
  • 100% of the ontology, shapes, queries, and rules are reused across Pakistan, Malaysia, and Indonesia after each market’s data is mapped into the common schema.
  • The evaluation spans competency-question coverage, a relational baseline, eight open language models, component studies, triplestore execution, and a participant-level user study showing gains in perceived trust and completeness.

2. Related work

Related work spans financial ontologies, automated financial knowledge graphs, competency-question engineering, provenance and SHACL, and GraphRAG. OntoKG-EQ differentiates itself by making bounded query computation and validated query-to-evidence-to-provenance paths first-class, while targeting reuse across aligned markets.

  • FIBO provides broad financial conceptual coverage, whereas OntoKG-EQ adopts a bounded core governed by competency questions and executable evidence paths.
  • Automated financial knowledge graphs prioritise extraction coverage, while OntoKG-EQ treats validated query-to-evidence-to-provenance paths and cross-market portability as evaluation targets.
  • Competency questions traditionally scope and evaluate ontologies; OntoKG-EQ makes a frozen CQ set govern what the graph may contain.
  • SHACL and provenance are established mechanisms, but OntoKG-EQ integrates them into automatically generated, per-result explanations and reports degradation when either layer is removed.
  • GraphRAG systems retrieve subgraphs for grounding, yet generated answers may not be entailed by retrieved context; OntoKG-EQ enforces faithfulness structurally through SPARQL over a validated graph.
  • The contribution is a bounded, competency-question-driven analytical-querying method whose explanations are automatically generated, validated, and reused across three independently curated markets.

3. Preliminaries and formal model

The formal model freezes five competency-question families as both functional requirements and governance boundaries. It represents observations, derived metrics, findings, evidence, and explanations in a CQ-bounded ontology and evaluates structural validity, evidence coverage, and explanation soundness.

  • 3.1. Frozen competency questions: Five frozen competency-question families cover fundamentals versus market response, exchange-rate context, relative outperformance, announcement reactions, and explainability with provenance.
  • 3.1. Frozen competency questions: CQ1–CQ4 ask analytical questions over market data, while CQ5 asks what evidence, metrics, temporal context, sources, and provenance explain each result.
  • 3.2. Core constructs: The ontology, properties, and SHACL schema are CQ-bounded: every class, property, or shape must be justified by at least one competency question.
  • 3.2. Core constructs: An observation records an entity, metric, value, temporal context, supporting evidence items, and provenance, with fundamental, market, and exchange-rate specialisations.
  • 3.2. Core constructs: Derived metrics map base observations and a window to first-class observations, while inference rules map CQ patterns to typed analytical findings.
  • 3.2. Core constructs: An evidence bundle collects supporting observations and evidence items, and an explanation closure links their metric values and temporal contexts to sources and provenance.
  • 3.3. Quality properties: The system evaluates structural validity, evidence coverage, and explanation soundness, requiring valid graph instances, official-source support, and rule-consistent metric values.

4. The OntoKG-EQ method and system architecture

OntoKG-EQ is a seven-layer, market-independent pipeline that maps sourced market sheets into a validated graph, computes metrics, answers competency questions, derives typed findings, and generates explanations. Its deterministic rule and evidence layers preserve query conditions and provenance while enabling reuse across markets.

  • Architecture: L0–L1 onboard data, L2 computes metrics, L3 validates, L4 answers competency questions, L5 derives findings, and L6 generates explanations.
  • Core ontology: The compact ontology covers companies, observations, periods, windows, sectors, indices, currencies, disclosures, sources, provenance, and validation status.
  • Architecture: Only market data and a small adapter vary; the ontology, SHACL shapes, queries, and inference rules remain market-independent and byte-identical.
  • Data onboarding: The materializer converts nine sourced tabular sheets into a provenance-aware RDF graph containing entities, temporal contexts, observations, announcements, and related evidence.
  • Metric computation: Metrics include window returns, comparator returns, exchange-rate associations, window-level currency changes, cumulative abnormal returns, and abnormal volume ratios.
  • Validation: SHACL shapes enforce structural requirements for observations, currencies, evidence bundles, and query executions before analytical answers are produced.
  • Query layer: Parameterised SPARQL templates compute competency-question conditions, including fundamentals–market divergence, exchange-rate associations, relative outperformance, and announcement reactions.
  • Inference and explanation: L5 deterministically materialises typed findings from CQ conditions, while L6 attaches each result to its observations, values, evidence items, official sources, and provenance.

5. Implementation and reproducibility

OntoKG-EQ uses a small, reproducible implementation stack whose components mirror the pipeline from data materialisation through validation, querying, inference, and explanation. The complete environment, code, data, and artifacts are openly released for inspection and reruns.

  • Pipeline architecture: The pipeline comprises a unified builder, SHACL shapes and CQ templates, and an inference-and-explanation generator.These components cover materialisation, derived metrics, validation, answering, inference, and evidence-bundle generation.
  • Portability: Each market is configured through one record, while the shared code path remains unchanged apart from the data.Onboarding a new market requires a configuration record and its nine input sheets.
  • Reproducibility: Python 3.10, pinned dependencies, and recorded workstation details make deterministic results tied to a reproducible software environment.The package versions and hardware are recorded in software_environment.md, requirements.txt, and requirements-lock.txt.
  • Open release: The released bundle includes the ontology, alignment, SHACL shapes, CQ templates, inference rules, builders, market data, graphs, evaluation outputs, and environment record.A citable Zenodo archive accompanies the public repository, with additional Indonesia acquisition scripts and source manifests.
  • Transparency: The authors report that a generative-AI assistant helped edit prose and selected scripts, while experiments and reported values were independently inspected and verified.The disclosure states that no data or results were generated, altered, or selected by the assistant.

6. Experimental setup

The evaluation uses three independently onboarded emerging-market datasets built from a deliberately small but auditable design. Each market combines fundamentals, market windows, comparators, exchange rates, and official disclosures, and all measurements run through the deterministic pipeline.

  • Evaluation markets: Three markets are evaluated with two sectors and two companies per sector, preserving auditability while exercising peer-basket and cross-sector comparisons.The design supports the CQ3 sector-peer baskets and cross-sector analysis.
  • Data assembly: Each market integrates EPS, profit growth, daily prices and volumes, sector and benchmark returns, exchange rates, and official annual-report announcements.The Indonesia data use exact trading-date intersections without interpolation, forward-filling, or synthetic rows.
  • Indonesia case: Indonesia contributes 83 common trading dates from 2026-01-15 to 2026-05-29 after strict exact-date alignment of six daily series.TOWR replaced TLKM because TLKM’s FY2025 release was too late for a completed post-event window.
  • Evaluation protocol: The five competency questions are evaluated alongside governance, portability, relational and GraphRAG contrasts, ablations, scalability, and explanation quality.All measurements use the deterministic pipeline and recorded execution environment.

7. Results and evaluation

The evaluation shows that OntoKG-EQ provides governed, portable, provenance-linked querying without changing the underlying analytics. Its deterministic reference is structurally faithful, whereas model transcription varies widely, and evidence bundles improve perceived trust and completeness.

  • Coverage and governance: Every ontology term maps to a competency question, and all five question families return results on at least one market.The governance check covers 24 classes, 22 object properties, 23 datatype properties, 9 derived metrics, and 15 SHACL shapes.
  • Portability: 100% of the ontology, shapes, queries, rules, and code logic is reused across the three markets after mapping data into the common schema.Only the nine data sheets and one adapter record differ by market.
  • Portability: Portability is bounded by manual source mapping: the unchanged apparatus is reused over an aligned representation, not arbitrary raw reporting structures.The effort required for new mappings was not measured.
  • Portability: All three markets conform to the same SHACL shapes and produce traceable explanations, but the four-firm slices are illustrative rather than strong statistical evidence.The portability claim instead rests on byte-identical reuse and the 64-stock scaled run.
  • Market findings: CQ3 on PSX returns OGDC (+8.11% > sector +7.28% > benchmark −9.11%), while CQ1 on MSX returns MAXIS despite +11.82% profit growth and −6.31% return versus a +0.16% benchmark.Empty cells are treated as valid data outcomes when conditions are not satisfied.
  • Relational baseline: The relational baseline produces identical analytical entities, showing that the graph adds no analytical value over SQL on the same derived metrics.The defensible distinction is portable open-standard governance, provenance, validation, and explanation rather than a better analytics engine.
  • Faithfulness evaluation: The system evaluates controlled transcription of evidence bundles rather than end-to-end GraphRAG retrieval, using a reference whose faithfulness is structurally guaranteed.Text-similarity metrics are unsuitable for the targeted grounding property, and the scorer is a graph-consistency heuristic rather than a general truth metric.

8. Discussion and threats to validity

OntoKG-EQ’s unchanged apparatus answers analyst questions across three markets with explanations faithful by construction, while its practical value lies in auditability and provenance. The discussion also identifies limits around demonstrator data, small samples, and breadth of generalization.

  • Interpretation: 100% apparatus reuse across three markets supports a method-level portability result, while the matching counts remain illustrative because each curated market has only four firms.The shared apparatus includes the ontology, shapes, queries, and rules; the portability claim rests on reuse and the 64-stock scaled run.
  • Interpretation: Every returned entity carries an inspectable path to observations, sources, and provenance, supporting auditability for reviewers, regulators, and risk committees.This is the practical consequence identified for the system’s faithful explanations.
  • Threats to validity: The demonstrator uses transparent proxies, fixed thresholds, equal-weighted sector baskets, announcement-date event anchors, and unadjusted closes rather than licensed adjusted feeds.These choices are documented simplifications and should be replaced before empirical market claims.
  • Threats to validity: The deterministic SHACL-gated pipeline makes figures reproducible, but the small slices mean absolute metric values should be read as demonstrator quantities, not market estimates.The stated internal-validity caveat concerns scale rather than nondeterminism.
  • Threats to validity: Full-exchange ontological fidelity remains untested: large-universe behavior is exercised only through a 64-stock Indonesia cross-section, making broader generalization future work.Execution is resolved on a standard triplestore; the remaining question is fidelity at full-exchange breadth.
  • Threats to validity: A 17-participant within-subject study found higher perceived trust and completeness with provenance bundles, although presentation order may partly explain the lift.The authors recommend a counterbalanced three-condition replication with objective time-to-verify measures.
  • Design implications: Faithful transcription varies widely and unpredictably across eight models, motivating deterministic numbers and citations with optional LLM prose containing no new facts.The proposed hybrid preserves the evidence bundle’s construction-guaranteed faithfulness while using language models only for connective text.
  • Design implications: The validated evidence bundle can serve as ground truth for measuring GraphRAG or LLM faithfulness without relying on a second judging model.Unlike reference-free evaluators, this reference is present in the validated graph and cannot itself hallucinate.

9. Limitations and future work

The main limitation is that portability has been demonstrated only across structurally similar markets after manual schema mapping. Future work therefore targets heterogeneous-market onboarding, stronger empirical feeds and study designs, and broader model evaluation.

  • Limitations: 100% apparatus reuse shows fit across three structurally similar markets, not robustness to genuinely heterogeneous reporting structures.A materially different market independently onboarded remains the decisive portability test.
  • Limitations: New markets currently require manual mapping into the common schema, so automatic ingestion of arbitrary raw reporting structures is not demonstrated.The authors explicitly avoid an unqualified portable-across-markets claim.
  • Future work: Future work should replace demonstrator comparators with licensed index and constituent feeds before making empirical market claims.The current comparators are documented simplifications rather than licensed market feeds.
  • Future work: The user study should add a counterbalanced three-condition design and objective time-to-verify measures to isolate the provenance-specific effect.The current study’s presentation order may partly account for the observed lift.
  • Future work: The faithfulness evaluation should expand to hosted frontier models and a second market’s cohort.This extension broadens the tested model and market coverage.

10. Conclusion

OntoKG-EQ combines competency-question governance, provenance-aware graph analytics, validation, inference, and automated explanation for auditable emerging-market equity querying. Across three markets, the reusable apparatus produced validated, complete, and sound explanations, while deterministic rendering guaranteed consistency with the graph.

  • 10. Conclusion: OntoKG-EQ makes analyst-oriented queries reproducible, evidence-linked, temporally explicit, structurally valid, and inspectable.Its explanations bind results to observations, sources, and provenance in the validated graph.
  • 10. Conclusion: Every ontology term is justified by one of five frozen competency questions, while metrics, SHACL validation, SPARQL queries, inference rules, and explanations form one governed method.The components collectively support typed analytical findings and evidence bundles for returned results.
  • 10. Conclusion: Graph-grounded transcription consistency is guaranteed for the deterministic renderer rather than estimated.The system is used as a provenance-grounded reference for measuring generative systems' faithfulness, not for claiming superiority over them.
  • 10. Conclusion: 100% apparatus reuse across Pakistan, Malaysia, and Indonesia was achieved with only market data and a small adapter changing.The ontology, shapes, queries, and rules were reused byte-identically across the three curated emerging-market datasets.
  • 10. Conclusion: All three markets were SHACL-conformant and answered the competency questions with complete, sound explanations.Ablations and fault injection further confirmed component use and SHACL detection of injected data errors.

11. Statements and declarations

The paper reports funding, competing-interest, ethics, availability, and authorship statements. It also documents the study's minimal-risk anonymous design and the open release of its reproducibility materials.

  • Funding: The research received no specific grant from public, commercial, or not-for-profit funding agencies.
  • Competing interests: The authors declare no competing interests relevant to the article's content.
  • Ethics approval and consent to participate: The user study was a voluntary, anonymous online questionnaire collecting no direct identifiers or sensitive data and posing minimal risk.Participants gave informed opt-in consent, and the study was found exempt from full institutional ethics review.
  • Ethics approval and consent to participate: The study's 7-point rating scales were created for this research rather than adapted from a validated or copyrighted instrument.Consequently, no permission was required.
  • Data and code availability: The complete reproducibility package, including ontology, shapes, queries, rules, data, graphs, scripts, outputs, and environment, is openly available on GitHub and Zenodo.The archive includes Indonesia acquisition scripts and the exact-date intersection builder.
  • Author contributions: The listed authors contributed across conceptualization, methodology, software, validation, analysis, data curation, writing, and visualization.

12. Declaration of generative AI and AI-assisted technologies in the manuscript preparation process

The authors used Claude during 2025–2026 to help draft and edit prose and develop selected evaluation and figure-generation scripts. They reviewed the resulting work, ran and inspected every experiment, and verified reported values against archived artifacts.

  • AI-assisted technologies: Claude was used to assist with prose drafting, editing, and selected evaluation and figure-generation scripts during 2025–2026.
  • AI-assisted technologies: The authors reviewed and edited the AI-assisted content and retained full responsibility for the published article.
  • AI-assisted technologies: The assistant did not run experiments or generate, alter, or select data or results.The authors executed every experiment, inspected outputs, and verified reported values against archived artifacts.
Loading 2609.08869v1…