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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- fr
|
| 4 |
+
license: cc-by-4.0
|
| 5 |
+
size_categories:
|
| 6 |
+
- 10K-100K
|
| 7 |
+
tags:
|
| 8 |
+
- legal
|
| 9 |
+
- african-nlp
|
| 10 |
+
- ohada
|
| 11 |
+
- knowledge-graph
|
| 12 |
+
- graph-ml
|
| 13 |
+
- court-decisions
|
| 14 |
+
- francophone-africa
|
| 15 |
+
- citation-network
|
| 16 |
+
- heterogeneous-graph
|
| 17 |
+
- low-resource
|
| 18 |
+
pretty_name: OHADA CCJA Legal Knowledge Graph
|
| 19 |
+
---
|
| 20 |
+
|
| 21 |
+
# OHADA-CCJA Legal Knowledge Graph
|
| 22 |
+
|
| 23 |
+
## Dataset Description
|
| 24 |
+
|
| 25 |
+
A heterogeneous knowledge graph extracted from 4,059 court decisions of the **Cour Commune de Justice et d'Arbitrage (CCJA)**, the supranational court of the Organisation pour l'Harmonisation en Afrique du Droit des Affaires (OHADA). The graph captures the relational structure of pan-African business law jurisprudence across 17 member states, spanning 1997–2023.
|
| 26 |
+
|
| 27 |
+
This is the **graph companion** to the tabular [OHADA-CCJA Court Decisions Corpus](https://huggingface.co/datasets/Maathis-com/ohada-ccja-corpus). The tabular dataset provides the raw text and metadata; this dataset provides the extracted relational structure for graph ML research.
|
| 28 |
+
|
| 29 |
+
### Why a Graph?
|
| 30 |
+
|
| 31 |
+
Legal reasoning is inherently relational. Courts cite prior decisions, apply specific legal articles, and resolve disputes between named parties under particular branches of law. These relationships are invisible in a flat tabular format but become first-class features in a graph. This dataset makes them explicit, enabling research at the intersection of legal NLP and graph machine learning — a combination that has received almost no attention for African legal systems.
|
| 32 |
+
|
| 33 |
+
## Graph Schema
|
| 34 |
+
|
| 35 |
+
The graph contains **11,131 nodes** across 6 types and **33,408 edges** across 6 relation types.
|
| 36 |
+
|
| 37 |
+
### Node Types
|
| 38 |
+
|
| 39 |
+
| Node Type | Count | Description |
|
| 40 |
+
|-----------|-------|-------------|
|
| 41 |
+
| Case | 4,059 | CCJA court decisions, with metadata (year, legal domain, source) |
|
| 42 |
+
| Legal Domain | 16 | Branches of OHADA law (e.g., enforcement, commercial companies, arbitration) |
|
| 43 |
+
| OHADA Member State | 17 | Countries in the OHADA zone (Benin through Togo) |
|
| 44 |
+
| Acte Uniforme | 9 | OHADA Uniform Acts — the harmonized legal instruments |
|
| 45 |
+
| Article | 669 | Individual legal articles cited in decisions |
|
| 46 |
+
| Party | 6,361 | Litigants (companies, individuals, institutions) |
|
| 47 |
+
|
| 48 |
+
### Edge Types
|
| 49 |
+
|
| 50 |
+
| Relation | Source | Target | Count | Description |
|
| 51 |
+
|----------|--------|--------|-------|-------------|
|
| 52 |
+
| cites | Case | Case | 796 | Inter-case citation (precedent references) |
|
| 53 |
+
| classified_as | Case | Legal Domain | 4,049 | Legal domain classification |
|
| 54 |
+
| originates_from | Case | Member State | 4,318 | Geographic origin of the dispute |
|
| 55 |
+
| references | Case | Acte Uniforme | 1,577 | Which Uniform Act the decision applies |
|
| 56 |
+
| cites_article | Case | Article | 15,668 | Specific legal articles cited |
|
| 57 |
+
| involves | Case | Party | 7,000 | Plaintiff (3,526) and defendant (3,474) relationships |
|
| 58 |
+
|
| 59 |
+
### Graph Statistics
|
| 60 |
+
|
| 61 |
+
| Metric | Value |
|
| 62 |
+
|--------|-------|
|
| 63 |
+
| Total nodes | 11,131 |
|
| 64 |
+
| Total edges | 33,408 |
|
| 65 |
+
| Average degree (Case nodes) | ~8.2 |
|
| 66 |
+
| Case-cites-Case resolved to known cases | 151 (19%) |
|
| 67 |
+
| Case-cites-Case unresolved (external citations) | 645 |
|
| 68 |
+
| Unique citing cases | 604 |
|
| 69 |
+
| Most cited article | Article 13 (1,363 citations) |
|
| 70 |
+
| Most connected country | Côte d'Ivoire (1,437 cases) |
|
| 71 |
+
| Most referenced Acte Uniforme | AUPSRVE (984 cases) |
|
| 72 |
+
|
| 73 |
+
### Geographic Distribution
|
| 74 |
+
|
| 75 |
+
| Country | Cases | | Country | Cases |
|
| 76 |
+
|---------|-------|-|---------|-------|
|
| 77 |
+
| Côte d'Ivoire | 1,437 | | Mali | 121 |
|
| 78 |
+
| Cameroun | 839 | | Guinée | 83 |
|
| 79 |
+
| Sénégal | 494 | | Congo-Brazzaville | 76 |
|
| 80 |
+
| Burkina Faso | 442 | | Congo-RDC | 65 |
|
| 81 |
+
| Niger | 187 | | Centrafrique | 47 |
|
| 82 |
+
| Togo | 166 | | Tchad | 37 |
|
| 83 |
+
| Gabon | 154 | | Guinée Equatoriale | 6 |
|
| 84 |
+
| Bénin | 154 | | Guinée-Bissau | 5 |
|
| 85 |
+
| | | | Comores | 5 |
|
| 86 |
+
|
| 87 |
+
### Acte Uniforme Distribution
|
| 88 |
+
|
| 89 |
+
| Code | Full Name | Cases |
|
| 90 |
+
|------|-----------|-------|
|
| 91 |
+
| AUPSRVE | Procédures simplifiées de recouvrement et voies d'exécution | 984 |
|
| 92 |
+
| AUSCGIE | Droit des sociétés commerciales et GIE | 169 |
|
| 93 |
+
| AUDCG | Droit commercial général | 162 |
|
| 94 |
+
| AUPC | Procédures collectives | 103 |
|
| 95 |
+
| AUS | Organisation des sûretés | 92 |
|
| 96 |
+
| AUA | Droit de l'arbitrage | 63 |
|
| 97 |
+
| AUCTMR | Contrats de transport de marchandises par route | 2 |
|
| 98 |
+
| AUSCOOP | Droit des sociétés coopératives | 2 |
|
| 99 |
+
|
| 100 |
+
## Supported ML Tasks
|
| 101 |
+
|
| 102 |
+
| Task | Type | Description |
|
| 103 |
+
|------|------|-------------|
|
| 104 |
+
| Legal citation prediction | Link prediction | Given a new case, predict which prior CCJA decisions it will cite |
|
| 105 |
+
| Legal domain classification | Node classification | Classify cases using graph topology, text features, or both |
|
| 106 |
+
| Knowledge graph completion | KGC | Predict missing articles cited, legal domains, or party roles |
|
| 107 |
+
| Temporal jurisprudence analysis | Temporal graph | Track how citation patterns and legal domains evolve over 25 years |
|
| 108 |
+
| Community detection | Clustering | Discover clusters of related jurisprudence |
|
| 109 |
+
| Graph-based legal retrieval | GNN retrieval | Retrieve relevant precedents using graph structure |
|
| 110 |
+
| Multi-relational reasoning | Heterogeneous GNN | Joint reasoning over cases, articles, parties, and countries |
|
| 111 |
+
|
| 112 |
+
## Dataset Structure
|
| 113 |
+
|
| 114 |
+
### File Layout
|
| 115 |
+
|
| 116 |
+
```
|
| 117 |
+
ohada_graph/
|
| 118 |
+
├── nodes/
|
| 119 |
+
│ ├── cases.csv # 4,059 case nodes with metadata
|
| 120 |
+
│ ├── legal_domains.csv # 16 legal domain nodes
|
| 121 |
+
│ ├── member_states.csv # 17 OHADA member state nodes
|
| 122 |
+
│ ├── actes_uniformes.csv # 9 Acte Uniforme nodes
|
| 123 |
+
│ ├── articles.csv # 669 legal article nodes
|
| 124 |
+
│ └── parties.csv # 6,361 party nodes
|
| 125 |
+
├── edges/
|
| 126 |
+
│ ├── case_cites_case.csv # 796 inter-case citations
|
| 127 |
+
│ ├── case_classified_as_domain.csv # 4,049 domain classifications
|
| 128 |
+
│ ├── case_originates_from_state.csv # 4,318 geographic edges
|
| 129 |
+
│ ├── case_references_acte.csv # 1,577 Acte Uniforme references
|
| 130 |
+
│ ├── case_cites_article.csv # 15,668 article citations
|
| 131 |
+
│ └── case_involves_party.csv # 7,000 party involvement edges
|
| 132 |
+
├── load_pyg.py # PyTorch Geometric HeteroData loader
|
| 133 |
+
└── import_neo4j.cypher # Neo4j Cypher import script
|
| 134 |
+
```
|
| 135 |
+
|
| 136 |
+
### Node Schemas
|
| 137 |
+
|
| 138 |
+
**cases.csv**: `case_id, case_number, date, year, legal_domain, jurisdiction, source, text_length`
|
| 139 |
+
|
| 140 |
+
**legal_domains.csv**: `domain_id, name, case_count`
|
| 141 |
+
|
| 142 |
+
**member_states.csv**: `state_id, name`
|
| 143 |
+
|
| 144 |
+
**actes_uniformes.csv**: `acte_id, full_name, domain`
|
| 145 |
+
|
| 146 |
+
**articles.csv**: `article_number, article_id`
|
| 147 |
+
|
| 148 |
+
**parties.csv**: `party_id, name`
|
| 149 |
+
|
| 150 |
+
### Edge Schemas
|
| 151 |
+
|
| 152 |
+
**case_cites_case.csv**: `source_case_id, source_case_number, cited_case_number, cited_case_id`
|
| 153 |
+
(Note: `cited_case_id` is null for citations to decisions outside this corpus)
|
| 154 |
+
|
| 155 |
+
**case_classified_as_domain.csv**: `case_id, domain_id, domain_name`
|
| 156 |
+
|
| 157 |
+
**case_originates_from_state.csv**: `case_id, state_id, state_name`
|
| 158 |
+
|
| 159 |
+
**case_references_acte.csv**: `case_id, acte_id`
|
| 160 |
+
|
| 161 |
+
**case_cites_article.csv**: `case_id, article_number`
|
| 162 |
+
|
| 163 |
+
**case_involves_party.csv**: `case_id, party_name, role` (role: plaintiff or defendant)
|
| 164 |
+
|
| 165 |
+
## Usage
|
| 166 |
+
|
| 167 |
+
### Loading with PyTorch Geometric
|
| 168 |
+
|
| 169 |
+
```python
|
| 170 |
+
# Download the repo, then:
|
| 171 |
+
from load_pyg import load_ohada_graph
|
| 172 |
+
|
| 173 |
+
data = load_ohada_graph('.')
|
| 174 |
+
print(data)
|
| 175 |
+
# HeteroData(
|
| 176 |
+
# case={ num_nodes=4059, x=[4059, 1] },
|
| 177 |
+
# domain={ num_nodes=16 },
|
| 178 |
+
# state={ num_nodes=17 },
|
| 179 |
+
# acte={ num_nodes=9 },
|
| 180 |
+
# article={ num_nodes=669 },
|
| 181 |
+
# party={ num_nodes=6361 },
|
| 182 |
+
# (case, cites, case)={ edge_index=[2, ...] },
|
| 183 |
+
# (case, classified_as, domain)={ edge_index=[2, 4049] },
|
| 184 |
+
# ...
|
| 185 |
+
# )
|
| 186 |
+
```
|
| 187 |
+
|
| 188 |
+
### Loading with NetworkX
|
| 189 |
+
|
| 190 |
+
```python
|
| 191 |
+
import pandas as pd
|
| 192 |
+
import networkx as nx
|
| 193 |
+
|
| 194 |
+
G = nx.MultiDiGraph()
|
| 195 |
+
|
| 196 |
+
# Add case nodes
|
| 197 |
+
cases = pd.read_csv('nodes/cases.csv')
|
| 198 |
+
for _, row in cases.iterrows():
|
| 199 |
+
G.add_node(row['case_id'], type='case', year=row['year'], domain=row['legal_domain'])
|
| 200 |
+
|
| 201 |
+
# Add citation edges
|
| 202 |
+
cites = pd.read_csv('edges/case_cites_case.csv')
|
| 203 |
+
for _, row in cites.dropna(subset=['cited_case_id']).iterrows():
|
| 204 |
+
G.add_edge(row['source_case_id'], row['cited_case_id'], relation='cites')
|
| 205 |
+
|
| 206 |
+
print(f"Nodes: {G.number_of_nodes()}, Edges: {G.number_of_edges()}")
|
| 207 |
+
```
|
| 208 |
+
|
| 209 |
+
### Loading into Neo4j
|
| 210 |
+
|
| 211 |
+
Import the graph using the provided Cypher script. Copy node/edge CSVs to your Neo4j `import/` directory, then run:
|
| 212 |
+
|
| 213 |
+
```bash
|
| 214 |
+
cat import_neo4j.cypher | cypher-shell -u neo4j -p your_password
|
| 215 |
+
```
|
| 216 |
+
|
| 217 |
+
### Combining with the Tabular Dataset
|
| 218 |
+
|
| 219 |
+
For text+graph multimodal models, load both datasets:
|
| 220 |
+
|
| 221 |
+
```python
|
| 222 |
+
from datasets import load_dataset
|
| 223 |
+
from load_pyg import load_ohada_graph
|
| 224 |
+
|
| 225 |
+
# Text features
|
| 226 |
+
text_data = load_dataset('Maathis-com/ohada-ccja-corpus')
|
| 227 |
+
|
| 228 |
+
# Graph structure
|
| 229 |
+
graph_data = load_ohada_graph('.')
|
| 230 |
+
|
| 231 |
+
# Join on case_id to combine text embeddings with graph topology
|
| 232 |
+
```
|
| 233 |
+
|
| 234 |
+
## Dataset Creation
|
| 235 |
+
|
| 236 |
+
### Extraction Pipeline
|
| 237 |
+
|
| 238 |
+
The graph was extracted from the [OHADA-CCJA Court Decisions Corpus](https://huggingface.co/datasets/Maathis-com/ohada-ccja-corpus) using regex-based extraction:
|
| 239 |
+
|
| 240 |
+
1. **Case citations**: Pattern matching on "Arrêt n° XXX/YYYY" references in full text, with self-citation filtering and deduplication
|
| 241 |
+
2. **Country/state**: Keyword matching on OHADA member state names and major city names (e.g., Abidjan → Côte d'Ivoire, Douala → Cameroun), with word-boundary disambiguation (e.g., "Niger" not matching "Nigeria")
|
| 242 |
+
3. **Acte Uniforme**: Regex matching on the 9 standardized OHADA Uniform Act names with accent-tolerant patterns
|
| 243 |
+
4. **Article citations**: Pattern matching on "Article(s) NNN" references, filtered to article numbers under 1,000, deduplicated per case
|
| 244 |
+
5. **Parties**: Direct extraction from structured `plaintiff` and `defendant` fields
|
| 245 |
+
6. **Legal domain**: Direct mapping from the `legal_domain` field
|
| 246 |
+
|
| 247 |
+
### Limitations
|
| 248 |
+
|
| 249 |
+
- **Citation resolution**: Only 19% of inter-case citations could be resolved to cases within this corpus. The remaining 81% reference decisions not included in the dataset (older decisions, lower court rulings, or decisions from national courts). These unresolved edges are preserved with the cited case number for potential future linking.
|
| 250 |
+
- **Party deduplication**: Party names are extracted as-is. The same entity may appear under slightly different names (e.g., "BICICI" vs "Banque Internationale pour le Commerce et l'Industrie de la Côte d'Ivoire"). Entity resolution is left as a downstream task.
|
| 251 |
+
- **Article disambiguation**: Article numbers are extracted without always resolving which specific Acte Uniforme they belong to. Article 13 of the OHADA Treaty and Article 13 of an Acte Uniforme are currently treated as the same node.
|
| 252 |
+
- **Country attribution**: A case mentioning "Abidjan" is tagged as Côte d'Ivoire, but some cases involve parties from multiple countries. The graph captures all mentioned countries, not just the primary jurisdiction.
|
| 253 |
+
|
| 254 |
+
### Ethical Considerations
|
| 255 |
+
|
| 256 |
+
Same as the [tabular dataset](https://huggingface.co/datasets/Maathis-com/ohada-ccja-corpus): all data comes from public court records. Party names are as published in official decisions. See the tabular dataset card for full ethical discussion.
|
| 257 |
+
|
| 258 |
+
### License
|
| 259 |
+
|
| 260 |
+
CC-BY-4.0
|
| 261 |
+
|
| 262 |
+
## Suggested Baselines
|
| 263 |
+
|
| 264 |
+
- **Node classification** (legal domain): GCN, GAT, or GraphSAGE on the heterogeneous graph, with or without text features
|
| 265 |
+
- **Link prediction** (citation): TransE, DistMult, or R-GCN on the case-cites-case subgraph
|
| 266 |
+
- **Text+Graph**: CamemBERT or multilingual BERT embeddings as node features, combined with GNN message passing
|
| 267 |
+
- **Temporal**: Temporal graph networks (TGN) on the citation network, using decision dates as timestamps
|
| 268 |
+
|
| 269 |
+
## Citation
|
| 270 |
+
|
| 271 |
+
```bibtex
|
| 272 |
+
@dataset{ohada_ccja_graph_2026,
|
| 273 |
+
title={OHADA-CCJA Legal Knowledge Graph: A Heterogeneous Graph Dataset for African Legal AI},
|
| 274 |
+
author={Foutse Yuehgoh},
|
| 275 |
+
year={2026},
|
| 276 |
+
url={https://huggingface.co/datasets/Maathis-com/ohada-ccja-graph},
|
| 277 |
+
note={Presented at Deep Learning Indaba 2026, Nigeria}
|
| 278 |
+
}
|
| 279 |
+
```
|
| 280 |
+
|
| 281 |
+
## Related Datasets
|
| 282 |
+
|
| 283 |
+
- [OHADA-CCJA Court Decisions Corpus](https://huggingface.co/datasets/Maathis-com/ohada-ccja-corpus) — the tabular source dataset with full text, dispute summaries, reasoning, and rulings
|
| 284 |
+
|
| 285 |
+
## Contact
|
| 286 |
+
|
| 287 |
+
For questions, please open an issue on the [HuggingFace repository](https://huggingface.co/datasets/Maathis-com/ohada-ccja-graph/discussions).
|
graph_preview.png
ADDED
|
Git LFS Details
|