# Data model and citation scheme

`data/bnss.json` is produced by `python -m bnss.parse` from the reconciled page
blocks (`ocr/textlayer/page-NNN.txt`) and schedules (`ocr/schedules.json`). It
is the only input of the site build.

## Top level

```jsonc
{
  "meta": {
    "title": "The Bharatiya Nagarik Suraksha Sanhita, 2023",
    "short": "BNSS",
    "act": "Act No. 46 of 2023",
    "assented": "2023-12-25",
    "in_force": "2024-07-01",
    "commencement": {
      "notification": "S.O. 848(E), dated 23 February 2024",
      "date": "2024-07-01",
      "not_in_force": []
    },
    "text_as_of": "As enacted (Gazette of 25 December 2023); later amendments, if any, are not incorporated.",
    "source": {
      "file": "docs/BNSS_2023_Act_46_of_2023_Gazette_English.pdf",
      "sha256": "5e60e2afe30d0fe7eca4f8126301146b76c86a444e690581f81eb564843517fe",
      "gazette": "The Gazette of India, Extraordinary, Part II—Section 1, No. 54, New Delhi, 25 December 2023 (CG-DL-E-25122023-250884)",
      "url": "https://prsindia.org/files/bills_acts/bills_parliament/2023/The%20Bharatiya%20Nagarik%20Suraksha%20Sanhita,%202023.pdf",
      "pages": 249
    },
    "generated": "…ISO timestamp…"
  },
  "preamble": {
    "title": "THE BHARATIYA NAGARIK SURAKSHA SANHITA, 2023",
    "act_no": "NO. 46 OF 2023",
    "date": "[25th December, 2023.]",
    "long_title": "An Act to consolidate and amend the law relating to Criminal Procedure.",
    "enacting_formula": "BE it enacted by Parliament in the Seventy-fourth Year of the Republic of India as follows:—",
    "page": 1
  },
  "chapters": [Chapter, …],             // 39 chapters (I to XXXIX), in order
  "sections": {"1": Section, …, "531": Section},
  "order": ["1", "2", …, "531"],        // reading order of section numbers
  "schedules": [ScheduleI, ScheduleII], // First Schedule (Classification of Offences) & Second Schedule (58 Forms)
  "signature": "DIWAKAR SINGH, Joint Secretary & Legislative Counsel to the Govt. of India."
}
```

## Citation scheme

Indian statutes cite as *section → sub-section (1) → clause (a) → sub-clause
(i)*; compact form `section 35(1)(b)`. Ids follow that compact form, so the id
**is** the citation:

| Provision | id | cite |
|---|---|---|
| Section 173 | `173` | `Section 173` |
| Sub-section (1) of section 173 | `173(1)` | `Section 173(1)` |
| Clause (b) of sub-section (1) of section 35 | `35(1)(b)` | `Section 35(1)(b)` |
| Sub-clause (i) of clause (a) of sub-section (1) of section 215 | `215(1)(a)(i)` | `Section 215(1)(a)(i)` |
| Explanation to section 35(1)(b) | `35(1)(b)-expl` | `Explanation to Section 35(1)(b)` |
| First proviso to section 173(1) | `173(1)-proviso-1` | `First proviso to Section 173(1)` |
| Illustration (a) to section 245 | `245-illus-a` | `Illustration (a) to Section 245` |

## URLs

| Path | Content |
|---|---|
| `/` | Act title, preamble, full table of contents (chapter → group → section + schedules) |
| `/chapter-XII/` | Chapter: groups, sections with full text |
| `/section-173/` | One section; paragraph anchors `#p-173(1)` |
| `/schedule-I/` | The First Schedule — Classification of Offences (Part I: BNS offences; Part II: other laws) |
| `/schedule-II/` | The Second Schedule — Forms (Form No. 1 to Form No. 58, anchored at `#form-N`) |
| `/search/?q=…` | Full-text + citation search; a pure citation (`173(1)`, `s. 35(1)(b)`, `BNSS 482`) redirects to the provision |
| `/full/` | Whole Act on one page (print / find-in-page) |
| `/about/` | Source, method, verification, citation guide |
| `/stats/` | Sourced figures and reported changes, from `data/stats.json` |
| `/download/bnss.json`, `/download/stats.json`, `/download/DATA_MODEL.md` | The full data behind the site (byte-identical to `data/`), CORS-enabled |
| `/source/bnss-2023-gazette.pdf` | The source Gazette (`#page=N` deep links) |
