> ## Documentation Index
> Fetch the complete documentation index at: https://ladygraph.io.vn/llms.txt
> Use this file to discover all available pages before exploring further.

# Addresses, ids and fingerprints

> How ladyGraph names things, and how it finds a piece of text again without storing it.

## Addresses

An address is a validated string:

```text theme={null}
<scheme>://<scope>/<locator>#<anchor>
```

It is a string, not a class, because exchange formats require URI strings and addresses are used as keys. The validator gives every address one canonical form (Unicode NFC, percent-encoding, lower-case scheme), so an address always compares equal to itself.

| Part | Meaning |
| - | - |
| `scheme` | Which source adapter owns the address, such as `doc` or `rule`. You choose the schemes in configuration. |
| `scope` | The partition of the index. It is a hard filter on everything: concepts in one scope never point into another. |
| `locator` | The change unit, the smallest thing that is replaced as a whole. |
| `anchor` | The position inside the unit: a passage, a field or a heading path. |

A Document has the address `<document scheme>://<scope>/<unit>`. Each passage has `<scheme>://<scope>/<unit>#<anchor>`.

## Ids

| Id | Form | Derived from | Stability |
| - | - | - | - |
| Concept | `cpt_` plus 12 hex characters | A hash of the scope, the context id and the founding word (normalized for matching) | Permanent, opaque and never reused. A rebuild from the same pinned choices gives the same id. |
| Context | `ctx_` plus 12 hex characters | A hash of the scope, the parent id and the founding label | Permanent. A rename changes the label, not the id. |
| Evidence | A short key within its concept | Assigned when the evidence is created | Stable across rewrites. It is the footnote key `[^id]` in a concept body. |

A concept's *path* (`/{scope}/{context path}/{slug}`) is its id in an exported bundle. The path changes when the concept moves. The id does not.

## Three normal forms

Each form has one job.

| Form | What it does | Used for |
| - | - | - |
| `faithful` | Unicode NFC, whitespace collapsed to one space, trimmed. Keeps case, accents and punctuation. | The text that positions and fingerprints are computed in, and that a quote must match. |
| `for_matching` | Lower case, accents and diacritics removed, non-alphanumerics turned into spaces. | Comparing words, deriving ids, and matching a question to a declared word. |
| `slug` | `for_matching` with hyphens. | Paths. |

## Fingerprints

A fingerprint is a hash of a faithful span of text. `passage_fingerprint(raw)` hashes the whole faithful passage.

Fingerprints let the index find a span again after the source moves it, without storing the span. `locate(passage, fingerprint, length, hint_start=...)` returns the new start, or `None` when the words are gone. Lesson 1 shows this with a passage whose text shifts, and with a rule that is edited so the evidence goes stale.

> [card] [Data model](https://ladygraph.io.vn/concepts/data-model.md)
>
> The records that carry these ids and addresses.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.