Datasets:
File size: 10,965 Bytes
028b271 2e9d96c 028b271 2e9d96c 028b271 2e9d96c 028b271 2e9d96c 028b271 2e9d96c 028b271 2e9d96c 028b271 5b0c524 028b271 5b0c524 028b271 5b0c524 028b271 2e9d96c 5b0c524 2e9d96c 5b0c524 028b271 2e9d96c 028b271 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 | ---
license: cc-by-4.0
language:
- vi
task_categories:
- question-answering
- text-retrieval
tags:
- legal
- knowledge-graph
- neo4j
- vietnamese
pretty_name: Vietnamese legal knowledge graph
size_categories:
- 10M<n<100M
configs:
- config_name: about_act
data_files:
- split: train
path: data/about_act/train-*.parquet
- config_name: about_concept
data_files:
- split: train
path: data/about_concept/train-*.parquet
- config_name: about_subject
data_files:
- split: train
path: data/about_subject/train-*.parquet
- config_name: act_chains
data_files:
- split: train
path: data/act_chains/train-*.parquet
- config_name: act_participants
data_files:
- split: train
path: data/act_participants/train-*.parquet
- config_name: acts
data_files:
- split: train
path: data/acts/train-*.parquet
- config_name: cites
data_files:
- split: train
path: data/cites/train-*.parquet
- config_name: components
data_files:
- split: train
path: data/components/train-*.parquet
- config_name: concepts
data_files:
- split: train
path: data/concepts/train-*.parquet
- config_name: conflicts
data_files:
- split: train
path: data/conflicts/train-*.parquet
- config_name: contains
data_files:
- split: train
path: data/contains/train-*.parquet
- config_name: defines
data_files:
- split: train
path: data/defines/train-*.parquet
- config_name: differs_from
data_files:
- split: train
path: data/differs_from/train-*.parquet
- config_name: documents
data_files:
- split: train
path: data/documents/train-*.parquet
- config_name: events
data_files:
- split: train
path: data/events/train-*.parquet
- config_name: has_norm
data_files:
- split: train
path: data/has_norm/train-*.parquet
- config_name: has_version
data_files:
- split: train
path: data/has_version/train-*.parquet
- config_name: instance_of
data_files:
- split: train
path: data/instance_of/train-*.parquet
- config_name: involves
data_files:
- split: train
path: data/involves/train-*.parquet
- config_name: mentions
data_files:
- split: train
path: data/mentions/train-*.parquet
- config_name: merged_concepts
data_files:
- split: train
path: data/merged_concepts/train-*.parquet
- config_name: norm_details
data_files:
- split: train
path: data/norm_details/train-*.parquet
- config_name: norm_edges
data_files:
- split: train
path: data/norm_edges/train-*.parquet
- config_name: norms
data_files:
- split: train
path: data/norms/train-*.parquet
- config_name: relations
data_files:
- split: train
path: data/relations/train-*.parquet
- config_name: subject_parents
data_files:
- split: train
path: data/subject_parents/train-*.parquet
- config_name: subjects
data_files:
- split: train
path: data/subjects/train-*.parquet
- config_name: temporal_edges
data_files:
- split: train
path: data/temporal_edges/train-*.parquet
- config_name: temporal_versions
data_files:
- split: train
path: data/temporal_versions/train-*.parquet
- config_name: term_use_edges
data_files:
- split: train
path: data/term_use_edges/train-*.parquet
- config_name: term_uses
data_files:
- split: train
path: data/term_uses/train-*.parquet
- config_name: terms
data_files:
- split: train
path: data/terms/train-*.parquet
- config_name: text_versions
data_files:
- split: train
path: data/text_versions/train-*.parquet
---
# luatdo-graph
A knowledge graph over Vietnamese law, built from about 128,000 documents by [luatdo](https://github.com/tamnd/luatdo).
This is the result of running the pipeline, published so that nobody has to run it again.
The pipeline takes days and several hundred dollars of model calls, and the output is the same for everyone.
## What is in it
| | |
| --- | --- |
| Nodes | 8,175,346 |
| Relationships | 9,119,011 |
| Node tables | 14 |
| Relationship tables | 19 |
| Node labels | 13 |
| Parquet | 623MB across 47 files |
| Neo4j archive | 550MB gzipped, about 3.4GB unpacked |
The labels present in the data are Act, Component, Condition, Document, Event, LegalConcept, Norm, Provision, Subject, TemporalVersion, Term, TermUse, TextVersion.
That is counted from the rows rather than read off the schema, which defines more labels than the extraction has so far filled.
The graph is not a shadow of the document structure.
Definitions, normative statements, temporal versions and act chains are all extracted by language models reading the text, with the provision each claim came from recorded on the claim.
## Two shapes of the same graph
The Parquet files under `data/` are the graph as tables, one directory per table, and they are what the viewer above is showing.
Node tables have an `id` and a `labels` list.
Relationship tables have a `start_id`, an `end_id` and a `type`, and the endpoints join to node `id`.
Every table is typed, so numbers are numbers and an absent value is null rather than an empty string.
`luatdo-graph-2026.08.1.tar.gz` is the same graph as a Neo4j offline import set, which is what to download if you want to run queries over it rather than read it as tables.
It is not a Neo4j database directory, so it does not depend on a Neo4j version.
## Reading the tables
```python
import pandas as pd
url = "hf://datasets/open-index/luatdo-graph/data"
docs = pd.read_parquet(f"{url}/documents/train-00000-of-00001.parquet")
```
Or with the datasets library, one config per table:
```python
from datasets import load_dataset
docs = load_dataset("open-index/luatdo-graph", "documents", split="train")
```
Or in duckdb, which will read the whole set of shards from a glob and join across tables:
```sql
select d.title, count(*) as citations
from 'data/documents/train-*.parquet' d
join 'data/cites/train-*.parquet' c on c.start_id = d.id
group by 1 order by 2 desc limit 10;
```
## Loading it into Neo4j
```sh
luatdo neo4j install
```
That downloads the archive, checks it against a pinned checksum, imports it into a local Neo4j, and waits until the database answers a query.
It works the same on Linux, macOS and Windows.
By hand, with any Neo4j 5 and a container runtime:
```sh
curl -fLO https://huggingface.co/datasets/open-index/luatdo-graph/resolve/main/luatdo-graph-2026.08.1.tar.gz
tar -xzf luatdo-graph-2026.08.1.tar.gz
docker volume create luatdo-neo4j-data
docker run --rm -v "$PWD/neo4j:/import:ro" -v luatdo-neo4j-data:/data -w /import \
neo4j:5.26 sh ./import.sh --report-file=/data/import.report
docker run -d --name luatdo-neo4j -p 7474:7474 -p 7687:7687 \
-v luatdo-neo4j-data:/data \
-e NEO4J_AUTH=neo4j/luatdo-local \
-e NEO4J_initial_dbms_default__database=luatdo \
neo4j:5.26
```
`import.sh` passes anything you give it through to `neo4j-admin`, where a repeated option takes the last value.
That is how the report is moved off the read only mount above.
The export belongs to whoever downloaded it and the image runs as its own user, so on a rootful docker host the report is the one file the import cannot write.
The database name matters.
Neo4j Community runs one user database, and the import writes into `luatdo`, so a server started without that setting comes up healthy and holds nothing.
## The tables
Nodes:
| Table | Rows | Size | Labels |
| --- | --- | --- | --- |
| `acts` | 362 | 39KB | Act |
| `components` | 4,360,083 | 51MB | Component, Provision |
| `concepts` | 43 | 3KB | LegalConcept |
| `conflicts` | 0 | 1KB | |
| `documents` | 128,097 | 8MB | Document |
| `events` | 52 | 9KB | Event |
| `merged_concepts` | 0 | 1KB | |
| `norm_details` | 631 | 30KB | Condition |
| `norms` | 849 | 89KB | Norm |
| `subjects` | 168 | 8KB | Subject |
| `temporal_versions` | 2,031 | 96KB | TemporalVersion |
| `term_uses` | 337 | 89KB | TermUse |
| `terms` | 2,315 | 43KB | Term |
| `text_versions` | 3,680,378 | 467MB | TextVersion |
Relationships:
| Table | Rows | Size |
| --- | --- | --- |
| `about_act` | 247 | 10KB |
| `about_concept` | 0 | 1KB |
| `about_subject` | 305,481 | 3MB |
| `act_chains` | 100 | 13KB |
| `act_participants` | 0 | 1KB |
| `cites` | 758,912 | 9MB |
| `contains` | 4,360,083 | 30MB |
| `defines` | 2,555 | 29KB |
| `differs_from` | 0 | 1KB |
| `has_norm` | 849 | 11KB |
| `has_version` | 3,680,378 | 59MB |
| `instance_of` | 0 | 1KB |
| `involves` | 0 | 1KB |
| `mentions` | 0 | 1KB |
| `norm_edges` | 2,579 | 24KB |
| `relations` | 0 | 1KB |
| `subject_parents` | 144 | 3KB |
| `temporal_edges` | 7,002 | 40KB |
| `term_use_edges` | 681 | 15KB |
## Versions
| Version | What changed |
| --- | --- |
| 2026.08.1 | The import scripts pass their arguments through to `neo4j-admin`, so the report can be moved off a read only mount. Later republished as Parquet as well, with the archive unchanged, so there is nothing to download again |
| 2026.08 | First publication |
## Versioning
The dataset is versioned apart from the code, as `luatdo-graph-YYYY.MM.tar.gz`.
A corpus grows when somebody runs the pipeline over more of it, and the tool changes when somebody changes the tool, and tying the two together would mean re-uploading half a gigabyte to publish a one line fix.
Each luatdo release records the dataset version it was built against.
## Provenance and limits
The source documents come from public Vietnamese legal corpora on the Hub, and the extraction on top of them is machine made.
Every extracted claim carries the provision it was read out of, so anything here can be checked against its source text, and anything here can be wrong.
Do not treat it as legal advice.
Some layers are much further along than others, and the row counts above are the honest account of which.
The document, provision, text version, citation, definition, subject, norm, temporal and act layers are populated.
The concept layer is not.
Concept mentions, concept relations, instance links, concept merges and the recorded conflicts are all empty, and the concept table itself holds a few dozen rows rather than the thousands the pipeline is capable of producing.
Those layers sit behind a human review queue that has not been worked through, so a query about concepts will return nothing rather than something wrong.
A table with no rows is published as an empty table rather than left out.
A layer that came out empty and a layer that was never exported are different things, and the file list is the only place that difference shows.
## License
CC BY 4.0.
The underlying legal texts are Vietnamese government documents.
|