JDogo
Open playground

Format guide

A JDogo document is a JSON value written so the structure of a table appears once, in a header, and rows hold only values. This page covers everything a reader needs. The normative texts are spec/SPEC_2.0.md and the 2.1 addendum the JDogo specification.

Three guarantees

Document kinds

The first characters decide what follows.

Starts withKindHolds
@name,…TableA list of objects, one row per line
@=Single objectOne object, its values on the next line
@{}Keyed mapAn object of objects; each row starts with its key
@[]MatrixA list of lists of scalars
@:Record linesSparse objects, written by the AI prompt builders
anything elseInline valueOne value written inline
@id,name,city            -> [{"id":1,"name":"Ana","city":"Paris"},
1,Ana,Paris                   {"id":2,"name":"Bo","city":"Oslo"}]
2,Bo,Oslo

@=name,tags              -> {"name":"Ana","tags":["a","b"]}
Ana,[a,b]

@{}age,city              -> {"u1":{"age":31,"city":"Paris"},"u2":{"age":28,"city":"Oslo"}}
u1,31,Paris
u2,28,Oslo

@[]                      -> [[1,2],[3,4]]
1,2
3,4

Header forms

Each header field is a name, optionally followed by one form that says how its cells are written. Writers pick a form only when it fits every row exactly.

FormExampleMeaning
nonecityAny value, written inline
+id+Whole numbers stored as the step from the row above
^prefixsku^SKU-Strings sharing a prefix; the cell holds the rest
$suffixemail$@acme.ioStrings sharing a suffix; the cell holds the start
^prefix+id^ORD-+Prefix, then a whole number stored as a step
=valuestatus=openSame value in every row, no cell
@a;b;…city@Paris;OsloA dictionary; the cell holds the entry's index
{…}user{id,name}A nested object whose fields are cells of this row
?{…}user?{id,name}A nested object that may be missing or null
[]{…}items[]{sku,qty}A list of objects: [a,1;b,2]

A real example, six orders:

@id+,sku^SKU-+,status=open,city,qty,note
5001,8100,Cairo,3,~
1,7,Lima,12,fragile
1,7,Oslo,5,""
1,7,Cairo,5,fragile
1,7,Lima,40,"rush, cold chain"
1,7,Cairo,7,~

Watch it build

The same six orders, one idea at a time. Every step is a valid JDogo document that decodes to the same orders.

    Cells

    CellMeans
    emptyThe field is absent from this row's object
    ~null
    ^Same value as this column in the row above
    true falseBooleans
    42 -0.5 1e21Numbers
    "…"A string, as a JSON string literal
    […]An inline list
    {k:v,…}An inline object
    other textA string, read up to , ] } ; or the line end

    Every cell after the first keeps its comma, even when empty, so a row cut short is an error rather than silent data loss.

    When strings are quoted

    A string is written in quotes when it:

    Quoted strings use JSON escapes only. Decoders reject anything else.

    Whitespace

    As in JSON, whitespace between values means nothing: spaces around , : [ ] { }, around table cells and header names, and line breaks inside brackets are ignored. So {"a": [1, 2]}, indented JSON and a hand-written @id, name header all read as expected. Whitespace inside unquoted text, and anything in quotes, is kept; that is why strings with leading or trailing spaces are always quoted.

    Rules readers enforce

    How it's kept honest

    The normative rules are in the JDogo specification, and each one cites the shared test that checks it. 203 reference encodings from the Java codec must decode identically in every SDK. A cross-language fuzzer encodes random values in each SDK and decodes them in all three. Another fuzzer feeds every decoder broken and hostile text.