Dike

Cite

Parse and resolve an Arabic legal citation string.

POST /v1/cite

Normalizes the citation (NFKC, Arabic-Indic digit folding, alef/hamza folding), parses it, then resolves it to a document in the corpus. Supported patterns: legislation (القانون رقم N لسنة Y), PM/ministerial decrees (قرار رئيس مجلس الوزراء رقم N لسنة Y, قرار وزاري), cassation rulings (الطعن رقم N لسنة Y ق), and fatawa (فتوى رقم N لسنة Y).

The citation travels in the JSON body, not a URL path segment — consistent with /v1/search and /v1/reason, and it avoids percent-encoding Arabic text into a path, which is unreadable in tooling, logs, and docs.

Request

{ "citation": "القانون رقم 131 لسنة 1948" }

Response

{
  "parsed": {
    "doc_type": "legislation",
    "number": "131",
    "year": 1948,
    "canonical_id": "eg-leg-1948-131"
  },
  "document": {
    "canonical_id": "eg-leg-1948-131",
    "doc_type": "legislation",
    "jurisdiction": "EG",
    "title": "القانون المدني",
    "official_number": "131",
    "year_gregorian": 1948,
    "status": "in_force",
    "issuing_body": "البرلمان المصري"
  }
}

document is only present when the citation resolves to a known document. A citation that parses but doesn't resolve (a real-looking but unindexed law number) returns 404 citation_not_found; a string that doesn't match any supported pattern at all returns 422 citation_unparseable, with the normalized form Dike attempted in detail.

flowchart TD
    A[Raw citation string] --> B["Normalize<br/>NFKC, digit folding, alef/hamza folding"]
    B --> C{Matches a<br/>known pattern?}
    C -->|no| D["422 citation_unparseable<br/>(normalized form in detail)"]
    C -->|yes| E[parsed returned]
    E --> F{Resolves to a<br/>document?}
    F -->|no| G["404 citation_not_found<br/>(parsed still returned)"]
    F -->|yes| H["200<br/>parsed + document"]

Errors

  • 401 unauthorized
  • 404 citation_not_found — parsed, but nothing resolved
  • 422 citation_unparseable — didn't match any supported pattern
  • 422 validation_error — malformed request body