# moomoogrange/law-go-kr-obsidian architecture

> Architecture diagram of the GitHub repository moomoogrange/law-go-kr-obsidian, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-06-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/moomoogrange/law-go-kr-obsidian
- Repository: https://github.com/moomoogrange/law-go-kr-obsidian

## Overview

1. **Repository role**
   - This is not an application codebase; it is a **content knowledge base** that repackages 대한민국 법령 from `law.go.kr` into an **Obsidian vault**.
   - The architecture is centered on **Markdown documents, YAML frontmatter, and Wikilinks** so the corpus can be navigated as a graph.

2. **Top-level information architecture**
   - The repository has four main content zones:
     - `00-인덱스/`: entry points and curated maps of content
     - `01-소관부처/`: ministry-based indexes
     - `02-법령구분/`: legal-form indexes such as 법률, 대통령령, 부령, 규칙
     - `법령/`: the full legal corpus, organized by law name
   - These layers separate **navigation metadata** from the **canonical legal text**.

3. **Core corpus layout**
   - Each law is a folder under `법령/{법령명}/`.
   - Inside each folder, files are split by hierarchy or version, typically:
     - `법률.md`
     - `시행령.md`
     - `시행규칙.md`
     - occasionally ministry-specific or legacy variants like `시행규칙(농림축산식품부령).md`
   - This folder/file structure encodes the **legal hierarchy** directly in the path.

4. **Document model**
   - Each document uses YAML frontmatter to capture structured metadata such as:
     - title, law identifiers, legal type, supervising ministry, promulgation and effective dates, status, and source URL
   - The body then holds the readable legal text and embeds links to related laws.
   - This makes each file simultaneously a **human-readable document** and a **machine-queryable node**.

5. **Graph layer**
   - Wikilinks like `[[법령/초지법/법률]]` turn cross-references into explicit edges.
   - The repo therefore behaves like a **legal knowledge graph** rather than a flat document archive.
   - The graph is used for:
     - inter-law citations
     - subordinate law navigation
     - ministry-based grouping
     - historical/legal version comparison

6. **Indexing subsystem**
   - `00-인덱스/` is the main discovery layer.
   - The dashboard and MOC-style files act as **central routing nodes** into the corpus.
   - These indexes are likely what a reader or an LLM uses first to jump from high-level questions into the detailed law folders.

7. **Administrative classification subsystem**
   - `01-소관부처/` groups laws by supervising authority, reflecting Korea’s administrative structure.
   - `02-법령구분/` groups by the form of enactment, which is crucial because the same law can have multiple layers and historical issuances.
   - These two subsystems provide orthogonal views over the same corpus: **who owns it** and **what kind of legal instrument it is**.

8. **Historical and version boundary**
   - The tree includes both current and legacy names for ministries and legal instruments, such as older ministry names and historical forms like 조선총독부법령, 군정법령, or renamed ministerial decrees.
   - That means the repository is intentionally **historical**, not just current-state legal text.
   - Architecture-wise, this is important because consumers must filter by `상태` or date rather than assume all files are contemporaneous.

9. **Data flow from source to vault**
   - The README states the source is `law.go.kr`, and the repository represents a downstream **transformation pipeline output**.
   - The source system is HTML- and document-centric; this repo converts that into a markdown-native structure designed for navigation, search, and graph traversal.
   - The actual crawler/transformer is not included, so the repo is the **materialized knowledge base**, not the ingestion code.

10. **Consumer-facing usage modes**
   - There are two intended consumers:
     - **Humans in Obsidian**, using graph view and backlinks
     - **LLMs / RAG systems**, which can use grep-like retrieval, wikilink following, and frontmatter parsing
   - The storage format deliberately avoids requiring a separate database, vector store, or application layer for basic use.

11. **Scale and coverage**
   - The README describes the corpus as roughly:
     - 3,037 law folders
     - 6,884 Markdown files
     - 222,279 cross-reference links
     - 75 ministries
     - 70 legal categories
   - This scale implies the repository is structured as a **large static knowledge graph**, not a hand-curated notes collection.

12. **Important boundary conditions**
   - The repo excludes the regeneration scripts and only ships the final vault content.
   - It also does not include case law, many subordinate administrative notices, or post-cutoff updates after `2026-04-01`.
   - So the architectural boundary is: **law corpus only, as-of a snapshot date, optimized for retrieval and reasoning**.

13. **What an architecture diagram should show**
   - Source: `law.go.kr`
   - Transformation boundary: external, not present in repo
   - Materialized store: Markdown Obsidian vault
   - Index layer: dashboards and MOCs
   - Classification layer: ministry/type indexes
   - Corpus layer: per-law folders and hierarchical legal documents
   - Relationship edges: wikilinks across files
   - Consumers: Obsidian users and LLM/RAG tooling

Main entry points: [`법령/초지법`](https://github.com/moomoogrange/law-go-kr-obsidian/tree/main/법령/초지법) (법령명 폴더), [`00-인덱스/📊 대시보드.md`](https://github.com/moomoogrange/law-go-kr-obsidian/blob/HEAD/00-%EC%9D%B8%EB%8D%B1%EC%8A%A4/%F0%9F%93%8A%20%EB%8C%80%EC%8B%9C%EB%B3%B4%EB%93%9C.md) (대시보드), [`법령/초지법/법률.md`](https://github.com/moomoogrange/law-go-kr-obsidian/blob/main/법령/초지법/법률.md) (법률 문서), [`법령/초지법/시행령.md`](https://github.com/moomoogrange/law-go-kr-obsidian/blob/main/법령/초지법/시행령.md) (시행령)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_source["Source & pipeline"]
  node_lawgo[("law.go.kr<br/>external source")]
  node_transform["Vault build<br/>ingestion transform"]
end

subgraph group_navigation["Navigation layer"]
  node_dashboard["대시보드<br/>MOC dashboard<br/>[📊 대시보드.md]"]
  node_lawindex["법령구분 인덱스<br/>legal-form index"]
  node_ministryindex["소관부처 인덱스<br/>ministry index"]
  node_relationmoc["관계법령 MOC<br/>topic map<br/>[초지법 관계법령 인덱스.md]"]
end

subgraph group_corpus["Legal corpus"]
  node_lawfolder["법령 폴더<br/>law namespace"]
  node_lawname["법령명 폴더<br/>law collection"]
  node_lawdoc["법률 문서<br/>primary statute<br/>[법률.md]"]
  node_decree["시행령<br/>subordinate decree<br/>[시행령.md]"]
  node_rule["시행규칙<br/>subordinate rule<br/>[시행규칙.md]"]
  node_specialrule["특례 규칙<br/>variant rule<br/>[시행규칙(행정안전부령).md]"]
  node_frontmatter["Frontmatter<br/>structured metadata"]
end

subgraph group_relationships["Graph links"]
  node_vaultlinks(("Wikilinks<br/>cross-reference graph"))
end

subgraph group_consumers["Consumers"]
  node_obsidian(("Obsidian users<br/>human consumer"))
  node_rag(("LLM / RAG<br/>tooling consumer"))
end

node_lawgo -->|"source text"| node_transform
node_transform -->|"materialize"| node_lawfolder
node_lawfolder -->|"organize"| node_lawname
node_lawname -->|"contains"| node_lawdoc
node_lawname -->|"contains"| node_decree
node_lawname -->|"contains"| node_rule
node_lawname -->|"contains"| node_specialrule
node_lawdoc -->|"metadata"| node_frontmatter
node_decree -->|"metadata"| node_frontmatter
node_rule -->|"metadata"| node_frontmatter
node_specialrule -->|"metadata"| node_frontmatter
node_frontmatter -->|"enables"| node_vaultlinks
node_lawdoc -->|"references"| node_vaultlinks
node_decree -->|"references"| node_vaultlinks
node_rule -->|"references"| node_vaultlinks
node_vaultlinks -->|"supports"| node_relationmoc
node_vaultlinks -->|"feeds"| node_dashboard
node_dashboard -->|"routes to"| node_ministryindex
node_dashboard -->|"routes to"| node_lawindex
node_dashboard -->|"routes to"| node_relationmoc
node_obsidian -->|"starts here"| node_dashboard
node_obsidian -->|"follows"| node_vaultlinks
node_rag -->|"parses"| node_frontmatter
node_rag -->|"retrieves"| node_vaultlinks
node_rag -->|"reads"| node_lawdoc

click node_dashboard "https://github.com/moomoogrange/law-go-kr-obsidian/blob/main/00-인덱스/📊 대시보드.md"
click node_lawindex "https://github.com/moomoogrange/law-go-kr-obsidian/blob/main/00-인덱스/📋 법령구분 인덱스.md"
click node_ministryindex "https://github.com/moomoogrange/law-go-kr-obsidian/blob/main/00-인덱스/🏛️ 소관부처 인덱스.md"
click node_relationmoc "https://github.com/moomoogrange/law-go-kr-obsidian/blob/main/00-인덱스/초지법 관계법령 인덱스.md"
click node_lawfolder "https://github.com/moomoogrange/law-go-kr-obsidian/tree/main/법령"
click node_lawname "https://github.com/moomoogrange/law-go-kr-obsidian/tree/main/법령/초지법"
click node_lawdoc "https://github.com/moomoogrange/law-go-kr-obsidian/blob/main/법령/초지법/법률.md"
click node_decree "https://github.com/moomoogrange/law-go-kr-obsidian/blob/main/법령/초지법/시행령.md"
click node_rule "https://github.com/moomoogrange/law-go-kr-obsidian/blob/main/법령/초지법/시행규칙.md"
click node_specialrule "https://github.com/moomoogrange/law-go-kr-obsidian/blob/main/법령/119구조ㆍ구급에관한법률/시행규칙(행정안전부령).md"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_lawgo,node_transform toneBlue
class node_dashboard,node_lawindex,node_ministryindex,node_relationmoc toneAmber
class node_lawfolder,node_lawname,node_lawdoc,node_decree,node_rule,node_specialrule,node_frontmatter toneMint
class node_vaultlinks toneRose
class node_obsidian,node_rag toneIndigo
```

## Components

### Source & pipeline

External source and transformation boundary not included in the repo.

- **law.go.kr**: external source · Upstream source of Korean legal text and metadata.
- **Vault build**: ingestion transform · External conversion step from source documents into Markdown vault content.

### Navigation layer

Curated entry points and orthogonal indexes for discovery.

- [대시보드](https://github.com/moomoogrange/law-go-kr-obsidian/blob/HEAD/00-%EC%9D%B8%EB%8D%B1%EC%8A%A4/%F0%9F%93%8A%20%EB%8C%80%EC%8B%9C%EB%B3%B4%EB%93%9C.md): MOC dashboard · Main landing page for broad exploration of the vault. · `00-인덱스/📊 대시보드.md`
- [법령구분 인덱스](https://github.com/moomoogrange/law-go-kr-obsidian/blob/HEAD/00-%EC%9D%B8%EB%8D%B1%EC%8A%A4/%F0%9F%93%8B%20%EB%B2%95%EB%A0%B9%EA%B5%AC%EB%B6%84%20%EC%9D%B8%EB%8D%B1%EC%8A%A4.md): legal-form index · Entry point for browsing by enactment form such as 법률, 대통령령, 부령. · `00-인덱스/📋 법령구분 인덱스.md`
- [소관부처 인덱스](https://github.com/moomoogrange/law-go-kr-obsidian/blob/HEAD/00-%EC%9D%B8%EB%8D%B1%EC%8A%A4/%F0%9F%8F%9B%EF%B8%8F%20%EC%86%8C%EA%B4%80%EB%B6%80%EC%B2%98%20%EC%9D%B8%EB%8D%B1%EC%8A%A4.md): ministry index · Entry point for browsing laws by supervising authority. · `00-인덱스/🏛️ 소관부처 인덱스.md`
- [관계법령 MOC](https://github.com/moomoogrange/law-go-kr-obsidian/blob/HEAD/00-%EC%9D%B8%EB%8D%B1%EC%8A%A4/%EC%B4%88%EC%A7%80%EB%B2%95%20%EA%B4%80%EA%B3%84%EB%B2%95%EB%A0%B9%20%EC%9D%B8%EB%8D%B1%EC%8A%A4.md): topic map · Curated map focused on one law and its related statutes. · `00-인덱스/초지법 관계법령 인덱스.md`

### Legal corpus

Per-law folders and document hierarchy that hold the canonical text snapshot.

- [법령 폴더](https://github.com/moomoogrange/law-go-kr-obsidian/tree/main/법령): law namespace · Top-level corpus namespace containing one folder per law. · `법령`
- [법령명 폴더](https://github.com/moomoogrange/law-go-kr-obsidian/tree/main/법령/초지법): law collection · One folder per law name, grouping versions and subordinate instruments. · `법령/초지법`
- [법률 문서](https://github.com/moomoogrange/law-go-kr-obsidian/blob/main/법령/초지법/법률.md): primary statute · Canonical law text for the base act. · `법령/초지법/법률.md`
- [시행령](https://github.com/moomoogrange/law-go-kr-obsidian/blob/main/법령/초지법/시행령.md): subordinate decree · Presidential decree or equivalent implementation layer for a law. · `법령/초지법/시행령.md`
- [시행규칙](https://github.com/moomoogrange/law-go-kr-obsidian/blob/main/법령/초지법/시행규칙.md): subordinate rule · Ministerial or court rule that implements the law. · `법령/초지법/시행규칙.md`
- [특례 규칙](https://github.com/moomoogrange/law-go-kr-obsidian/blob/main/법령/119구조ㆍ구급에관한법률/시행규칙(행정안전부령).md): variant rule · Legacy or ministry-specific variants of subordinate rules. · `법령/119구조ㆍ구급에관한법률/시행규칙(행정안전부령).md`
- **Frontmatter**: structured metadata · YAML metadata layer for identifiers, ministry, dates, status, and source URL.

### Graph links

Wikilink-based cross references between legal documents.

- **Wikilinks**: cross-reference graph · Markdown links that materialize citations and legal relationships as edges.

### Consumers

Primary ways the vault is used by people and tooling.

- **Obsidian users**: human consumer · Readers navigating laws through search, backlinks, and graph view.
- **LLM / RAG**: tooling consumer · Retrieval and reasoning systems using frontmatter, links, and text chunks.

## Connections

- law.go.kr → Vault build: source text · Upstream legal content is converted into vault-ready Markdown.
- Vault build → 법령 폴더: materialize · The build output becomes the repository’s law corpus.
- 법령 폴더 → 법령명 폴더: organize · Each law is stored in its own folder.
- 법령명 폴더 → 법률 문서: contains · A law folder contains the base statute document.
- 법령명 폴더 → 시행령: contains · A law folder may contain an implementation decree.
- 법령명 폴더 → 시행규칙: contains · A law folder may contain implementation rules.
- 법령명 폴더 → 특례 규칙: contains · Some laws include ministry-specific or historical variants.
- 법률 문서 → Frontmatter: metadata · Structured metadata is embedded at the top of each document.
- 시행령 → Frontmatter: metadata · Subordinate instruments also carry structured metadata.
- 시행규칙 → Frontmatter: metadata · Rules expose queryable metadata in frontmatter.
- 특례 규칙 → Frontmatter: metadata · Variant rules retain the same machine-readable metadata model.
- Frontmatter → Wikilinks: enables · Metadata and links together support graph navigation and retrieval.
- 법률 문서 → Wikilinks: references · Legal text links to related laws and subordinate instruments.
- 시행령 → Wikilinks: references · Implementation layers cross-link to statutes and related rules.
- 시행규칙 → Wikilinks: references · Rules create explicit edges to related legal documents.
- Wikilinks → 관계법령 MOC: supports · Cross-links make topic maps and relationship indexes useful.
- Wikilinks → 대시보드: feeds · Graph-connected documents surface through dashboards and index pages.
- 대시보드 → 소관부처 인덱스: routes to · The dashboard links into ministry-based browsing.
- 대시보드 → 법령구분 인덱스: routes to · The dashboard links into legal-form browsing.
- 대시보드 → 관계법령 MOC: routes to · The dashboard points to curated relationship maps.
- Obsidian users → 대시보드: starts here · Human readers typically begin from curated entry pages.
- Obsidian users → Wikilinks: follows · Readers traverse wikilinks and backlinks to explore the corpus.
- LLM / RAG → Frontmatter: parses · Tooling extracts identifiers, dates, ministry, and status.
- LLM / RAG → Wikilinks: retrieves · Tooling follows links to expand context across laws.
- LLM / RAG → 법률 문서: reads · RAG systems consume the canonical legal text from Markdown.
