Dike

Citation resolution workflow

Turn a bare citation string found in text into a linked, verified source.

A common pattern: you have a document (a contract, a brief, a news article) that references a law by name, and you want to turn that reference into a verified link.

1. Extract the candidate string

Pull the raw citation text as it appears — don't pre-normalize it. /v1/cite handles NFKC normalization, Arabic-Indic digit folding, and alef/hamza folding itself:

"...بموجب القانون رقم ١٣١ لسنة ١٩٤٨..."

2. Resolve it

curl https://api.dike.it.com/v1/cite \
  -H "Authorization: Bearer $DIKE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"citation": "القانون رقم ١٣١ لسنة ١٩٤٨"}'

3. Branch on the result

  • 200 with document present — link directly to the resolved canonical_id.
  • 404 citation_not_found — the citation parsed cleanly (you'll still get parsed) but nothing in the corpus matches; the law may be out of current coverage rather than genuinely nonexistent — see /coverage.
  • 422 citation_unparseable — the string didn't match any supported pattern. Check detail for the normalized form Dike attempted; a citation with an unsupported shape (e.g. a non-Egyptian format) fails here, not at resolution.

4. Batch carefully

There's no batch /v1/cite endpoint — resolving many citations means one call per string. Rate limits apply per key (Rate limits & errors), so a document with dozens of citations should be resolved with some concurrency control, not fired all at once.