Vietnamese Legal Ontology: Every legal answer, traced to the article that grounds it

Khac-Hoai Nam Bui, Quan Tran MinharXiv 2026 · arXiv

TL;DR

Researchers have transformed Vietnam's largest legal Q&A corpus from a collection of ambiguous text strings into a massive, verifiable knowledge graph of 11.5 million nodes. By grounding "free-text" citations in specific, dated law versions, they discovered that over a third of published legal answers now cite laws that are no longer in force.

What Problem Does This Paper Address?

Legal advice is only as reliable as the statute it rests upon. In Vietnam, the largest open legal portal pairs over 100,000 questions with answers that cite nearly 600,000 documents. However, these citations are often "free text"—phrases like "Clause 3, Article 101 of this Code" are common.

The problem? They don't specify which version of the code. Laws are frequently updated, repealed, or replaced. An answer written in 2016 might cite an article number that exists in 2024 but carries a completely different meaning. For both human readers and AI retrieval systems, this ambiguity makes it impossible to verify if a legal answer is still "correct" or which specific provision actually grounds the advice.

Methods

The authors employed the NVIDIA Auto Ontology framework, a five-stage pipeline to turn messy, flat data into a structured knowledge graph:

  1. Discover: Profiling the raw datasets to find candidate keys and join paths.
  2. Ground: Mapping citations to a formal ontology. They distinguish between a LegalWork (the abstract law) and a LegalDocument (a specific record/version).
  3. Validate: This is the "aha" step. They don't just link a citation; they verify it. Using word 5-gram containment, they check if the answer actually quotes the law's text word-for-word.
  4. Expose: Serving the graph via a Model Context Protocol (MCP) for AI agents, a CLI for analysts, and a REST API.
  5. Learn: Creating a feedback loop where failed resolutions become "proposals" for human editors to review.
Fig. 2. From strings to grounded edges, in five stages. The running example: an answer’s “Bộ luật này” (“this Code”) becomes an edge to Clause 3 of Article 101 of the 2019 Labor Code, checked against the answer’s words, served to agents, and every failure becomes a reviewable proposal.

The ontology itself (Figure 3) is highly granular, parsing legal text down to the "Point" level (the smallest subdivision of a Vietnamese law) and aligning with international standards like Akoma Ntoso and ELI.

Fig. 3. The ontology separates a law from its records, its structure from its metadata, and every claim from its evidence. Fourteen classes in three groups and twelve relations; each box gives the class in English and Vietnamese with its node count in the graph, and each arrow runs from domain to range. Chapter and Section share a box.

Datasets

The study utilized four open datasets drawn from thuvienphapluat.vn:

  • vbpl: 573,851 legal documents.
  • hdpl: 109,543 legal Q&A pairs.
  • tnpl: 17,091 legal terms and their definitions.
  • htpl: 681 legal-assistance articles.

Key Insights and Ideas

  • The Identity Crisis of Document Numbers: In Vietnam, document numbers are not unique identifiers. The authors found that over 5,500 document numbers are shared by multiple local authorities. One specific number was used by 72 different provinces for entirely different decisions.
  • Semantic Drift in Article Numbers: When a law is replaced, article numbers often stay the same but their content "moves." In the Labor Code, "Annual Leave" moved from Article 111 (2012 version) to Article 113 (2019 version). Meanwhile, Article 111 in the new code now refers to "Weekly Breaks." Without version-aware grounding, a reader would be led to the wrong rule.
  • Text Evidence Trumps Dates: While publication dates usually signal which law version was in force, the authors found 2,520 cases where the words used in the answer matched a different version of the law than the date suggested. Their system "re-versions" these citations based on textual evidence.

Key Results

The resulting graph contains 11.5 million nodes and 16 million edges.

  • Resolution Success: Of 67,868 cited provisions, 91% were successfully resolved to a specific, dated law version.
  • Context Recovery: 92% of citations that named no law at all (e.g., "this code") were recovered by analyzing the surrounding text.
  • The "Outdated" Problem: The graph revealed that 36% of resolved answers now cite a law that is no longer in force.
  • Word-for-Word Confirmation: 19,012 citations were confirmed to be verbatim quotes from the law.
Fig. 4. From 67,868 cited provisions to 19,012 confirmed by their words. Each bar is what survives a step; hatched blocks are what drops out, and why. Most citations name no law at all; 92% of those are recovered from their context before a version is chosen.

Limitations and Future Work

  • Snapshot Limitation: The graph is based on a dataset snapshot. It does not currently sync in real-time with the official government gazette.
  • Lexical vs. Semantic Validation: The "Validate" step confirms quotation, not interpretation. An answer could quote a law correctly but apply it to the wrong situation—a nuance the current system doesn't catch.
  • Parsing Gaps: Some older legal records have "parse gaps" where certain articles are missing from the digitized text, leading to unresolved citations.
  • Future Direction: The authors suggest this graph could serve as a "ground truth" layer for Retrieval-Augmented Generation (RAG) systems, ensuring that AI-generated legal advice is actually based on current, valid statutes.

Summary updated

Abstract

A legal answer is only as good as the article it rests on. Vietnam's largest open legal corpus pairs 109,543 published questions and answers with 573,851 legal documents, yet its citations are free text: "Khoan 3 Dieu 101 cua Bo luat nay" ("Clause 3, Article 101 of this Code") names neither the code nor its version. Following the five stages of NVIDIA Auto Ontology, Discover, Ground, Validate, Expose and Learn, we turn four open datasets into a knowledge graph of 11.5 M nodes and 16.0 M edges in which every node and edge carries its source record and method, with no duplicate keys, dangling edges or schema violations. Of 67,868 cited provisions, 61,487 resolve to a dated law version, 51,694 to a parsed article, clause or point, and 19,012 are confirmed word for word. The ontology then shows what flat records hide. 36% of the 78,361 answers whose citations resolve now cite a law that is no longer in force; 2,525 verified citations point to an article number that says something else in the current law; 2,520 citations were re-versioned because their words match a different version than their date suggests; and 5,575 document numbers are shared by several local authorities, one of them by 72. Every number in this paper is computed from the graph.
BibTeX
@misc{bui2026vietnamese,
  author = {Khac-Hoai Nam Bui and Quan Tran Minh},
  title = {{Vietnamese Legal Ontology: Every legal answer, traced to the article that grounds it}},
  year = {2026},
  eprint = {2611.11426},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.11426},
}
Figure