RABX - is there an explanation of this encoding format ?

18 views
Skip to first unread message

john simpson

unread,
Aug 2, 2023, 9:19:07 AM8/2/23
to FixMyStreet
I am trying to understand this encoding format.
I cannot find anything on google.
From using the 'dbeaver' app to see the field data, I'm struggle to make any sense of it at all.

In the table called 'problem' the field 'extra' in is populated when we add more questions when someone selects a certain category.

I am guessing has at least 4 data type identifiers:
A=alphanumeric
T=text

L= logical / boolean
 
????
E=Error code

After that, it just seem to say for example T7, then follow by 7 text characters. 

Has anyone have any insight to this system ?

Thanks, John.

john simpson

unread,
Aug 3, 2023, 9:43:29 AM8/3/23
to FixMyStreet, john simpson
I think I have worked out most of the RABX formatting. Here is the 'extra' field in the 'poblem' table after I created and answered more questions for that category.

Could someone help me with explaining the first line ?
I presume '_fields' is just the RABX field name. But L1:5 ? What does the 'L'  + '5' mean  ?
It was '5' when I had more questions.

I have broken the long string what I think are the data chunks:

A1:2,T7:_fields,L1:5,

A1:3,T11:description,T11:Pole height,T4:name,T6:height,T5:value,T5:short,
A1:3,T11:description,T13:type of cable,T4:name,T5:cable,T5:value,T5:boxed,
A1:3,T11:description,T20:What zone is it in ?,T4:name,T4:zone,T5:value,T8:expanded
A1:3,T11:description,T9:direction,T4:name,T9:direction,T5:value,T3:NNE,
T14:contributed_by,I2:10,











Matthew Somerville

unread,
Aug 3, 2023, 10:00:46 AM8/3/23
to FixMyStreet
Hi,

The codebase switched from using RABX to JSON finally earlier this year: https://github.com/mysociety/fixmystreet/pull/3220 (just after the v5 release as it was such a big change, but we're running it in live for months now so should work fine.) But from a user point of view, that shouldn't really matter, because it shouldn't be a system you ever have to interpret or use directly. You should be interfacing with any columns like that via code, not directly in the database.

The codebase has various functions (generally held in the Extra role) for talking to the extra columns of reports in the database. For example, if you have a report row fetched into $p, then $p->get_extra_fields will return all the answers to the extra questions during report creation. I don't want to say a little knowledge is a dangerous thing, but I would strongly encourage you to interact with the data via the written interfaces, trying to manually construct or edit machine-encoded data can cause corruption and bugs if any mistake is made at all.

(To answer your questions, but I really don't think it's a good thing to do, A is a key-value dictionary (Associative array), and L means a list, so L5 means a list of 5 items. RABX is a length-encoded buffer format for storing arbitrary data. The "long string" you quote is not valid RABX, you must have edited it, as it only has 4 entries in the list.)

ATB,
Matthew

john simpson

unread,
Sep 24, 2023, 1:59:38 AM9/24/23
to FixMyStreet, matthew
Thanks Matthew,
We installed the latest FMS release and ran the upgrade script. However, I suspect we are still on the RABX format.
Do you know when the JSON version will the released as the standard public download ?
Thanks.
Reply all
Reply to author
Forward
0 new messages