# GS1 Application Identifiers — the payload grammar

> The AI grammar row: fixed vs variable termination, GS separators, AIM symbology prologues, date and decimal AI semantics — a pinned table, not folklore.

- page: https://barcoding.dev/schemes/ai/
- machine row: https://barcoding.dev/schemes/ai.json
- scheme (dotted registry name): gs1.element-string

## Reference
- grammar: An AI is a 2–4 digit tag followed by a typed value. Fixed-length AIs run straight into the next AI; variable-length AIs terminate at GS (0x1D) or end of payload. The tag/length/type table is pinned data derived from the GS1 General Specifications.
- check: Structural — carried values bring their own rails (AI 01 carries the GTIN mod-10). Errors are typed with byte offsets.
- canonical: A typed AI map. generate emits deterministic AI ordering; resolve accepts any valid ordering.
- barcode types: GS1-128 (]C1) · GS1 DataMatrix (]d2) · GS1 QR (]Q3) · and the wider AIM prologue set (]C0 ]E0 ]I1 ]A0 ]Q1 ]L2) — the prologue names the carrier, never the identifier
- enrichment: — (grammar layer; enrichment attaches to the carried keys)
- join: The AI map is the event's raw material: 01+21 → epcList instance, 01+10 → quantityList class, 00 → parentID.

## Registry rows (engine artifacts, digest-stated)
### gs1.element-string
- grammar: `^(\](C1|e0|d2|Q3|Q1))?[\x1d]?\(?\d{2,4}\)?.+`
- check: per-key → "mod10 pass" (GS1 GenSpecs 26.0 §7.8 (AI syntax), §7.9 (check digits))
- canonical: bracketed element string, deterministic AI order: primary key, then 22, 10, 21, then ascending
- segments: one segment per AI, from the pinned AI table · primary-key check digit
- generate: gs1-128, gs1datamatrix
- hand-off: read here · resolved by id.org.ai
- digest: sha256:6e4b22877ad1c3add56c885785f5768670f9c6310f15150dc69d3aff6294dac4

## Resolution stance
barcoding.dev detects, parses, verifies, enriches and generates — the codec and the data layer. Resolution — an identifier answered with identity and its linkset of live doors — is ONE capability family-wide, served by the family's identity layer, id.org.ai; vertical estates project the same one capability (vehicles: auto.dev). This registry row is the data that resolution consumes.

## Posts
- https://barcoding.dev/blog/application-identifiers-grammar/
- https://barcoding.dev/blog/what-did-i-just-scan/
- https://barcoding.dev/blog/element-string-or-digital-link-uri/
- https://barcoding.dev/blog/the-round-trip-law/
