Dike logoDocs

Every legal document indexed in Dike is identified by a unique, deterministic Canonical ID. Canonical IDs serve as the universal join key across every endpoint in the platform (/v1/search, /v1/reason, /v1/cite, /v1/document/{id}, and /v1/graph/traverse).

[jurisdiction]-[doc_type]-[year]-[official_number]

Canonical ID Syntax Specification

Rendering diagram...

Components

  1. jurisdiction (2 characters, lowercase ISO code):
    • eg: Arab Republic of Egypt
    • sa: Kingdom of Saudi Arabia
    • ae: United Arab Emirates
  2. doc_type (abbreviated document category):
    • leg: Primary Legislation / Statutes / Laws (قانون / نظام)
    • dec: Ministerial, Prime Ministerial, or Royal Decrees (قرار / أمر ملكي / مرسوم)
    • reg: Executive Regulations / Implementing Bylaws (لائحة تنفيذية)
    • cass: Court of Cassation / Supreme Court Judgements (أحكام محكمة النقض / المحكمة العليا)
    • fat: Official Fatawa / State Council Opinions (فتاوى مجلس الدولة / دار الإفتاء)
    • circ: Regulatory Circulars & Directives (تعاميم)
  3. year (4 digits, Gregorian calendar):
    • For Saudi documents enacted by Hijri calendar, the year is normalized to Gregorian with the Hijri year preserved in metadata.
  4. official_number (alphanumeric identifier):
    • The promulgated statute, decree, or case number (e.g. 131, 45-m, 1234-q).

Canonical ID Examples

Canonical IDJurisdictionTypeTitle (Arabic)Description
eg-leg-1948-131Egypt (EG)Legislationالقانون المدني المصري رقم 131 لسنة 1948Egyptian Civil Code
eg-leg-1999-17Egypt (EG)Legislationقانون التجارة رقم 17 لسنة 1999Egyptian Commercial Code
eg-cass-civ-1995-1234Egypt (EG)Case Lawطعن نقض مدني رقم 1234 لسنة 65 قEgyptian Civil Cassation Ruling
sa-leg-2023-191Saudi Arabia (SA)Legislationنظام المعاملات المدنية (مرسوم م/191 لسنة 1444هـ)Saudi Civil Transactions Law
sa-dec-2022-105Saudi Arabia (SA)Decreeقرار مجلس الوزراء رقم 105Saudi Cabinet Decision
ae-leg-2021-33UAE (AE)Legislationمرسوم بقانون اتحادي رقم 33 لسنة 2021 بشأن تنظيم علاقات العملUAE Federal Labour Law Decree

Canonical ID Lifecycle Across Endpoints

Rendering diagram...

Normalization & Parsing Guarantees

When calling POST /v1/cite, Dike parses raw citations into Canonical IDs deterministically:

  1. Unicode NFKC Normalization: Strips decorative tatweel (ـ), normalizes whitespace and diacritics.
  2. Arabic-Indic Digit Folding: Automatically converts Eastern Arabic digits (١، ٢، ٣) to standard digits (1, 2, 3).
  3. Alef & Hamza Unification: Resolves variants (أ, إ, آ, ا) to ensure robust pattern matching against statutory gazettes.
  4. Validation: Returns 404 citation_not_found if the parsed law number has no corresponding entry in the corpus.

Stable Identifier Guarantee

Once assigned, a canonical_id is permanent and will never change across API versions, ensuring your database references and cache keys remain durable.

On this page