<s>
JData	B-Protocol
is	O
a	O
light-weight	O
data	O
annotation	O
and	O
exchange	O
open-standard	O
designed	O
to	O
represent	O
general-purpose	O
and	O
scientific	O
data	O
structures	O
using	O
human-readable	O
(	O
text-based	O
)	O
JSON	B-General_Concept
and	O
(	O
binary	O
)	O
UBJSON	B-Protocol
formats	O
.	O
</s>
<s>
JData	B-Protocol
specification	O
specifically	O
aims	O
at	O
simplifying	O
exchange	O
of	O
hierarchical	O
and	O
complex	O
data	O
between	O
programming	O
languages	O
,	O
such	O
as	O
MATLAB	B-Language
,	O
Python	B-Language
,	O
JavaScript	B-Language
etc	O
.	O
</s>
<s>
It	O
defines	O
a	O
comprehensive	O
list	O
of	O
JSON-compatible	O
"	O
name	O
"	O
:value	O
constructs	O
to	O
store	O
a	O
wide	O
range	O
of	O
data	O
structures	O
,	O
including	O
scalars	O
,	O
N-dimensional	O
arrays	O
,	O
sparse/complex	O
-valued	O
arrays	O
,	O
maps	O
,	O
tables	O
,	O
hashes	O
,	O
linked	O
lists	O
,	O
trees	O
and	O
graphs	O
,	O
and	O
support	O
optional	O
data	O
grouping	O
and	O
metadata	O
for	O
each	O
data	O
element	O
.	O
</s>
<s>
The	O
generated	O
data	O
files	O
are	O
compatible	O
with	O
JSON/UBJSON	O
specifications	O
and	O
can	O
be	O
readily	O
processed	O
by	O
most	O
existing	O
parsers	O
.	O
</s>
<s>
JData-defined	O
annotation	O
keywords	O
also	O
permit	O
storage	O
of	O
strongly-typed	O
binary	O
data	O
streams	O
in	O
JSON	B-General_Concept
,	O
data	O
compression	O
,	O
linking	O
and	O
referencing	O
.	O
</s>
<s>
The	O
initial	O
development	O
of	O
the	O
JData	B-Protocol
annotation	O
scheme	O
started	O
in	O
2011	O
as	O
part	O
of	O
the	O
development	O
of	O
the	O
JSONLab	O
Toolbox	O
-	O
a	O
widely	O
used	O
open-source	O
MATLAB/GNU	O
Octave	O
JSON	B-General_Concept
reader/writer	O
.	O
</s>
<s>
In	O
2015	O
,	O
the	O
first	O
draft	O
of	O
the	O
JData	B-Protocol
Specification	O
was	O
developed	O
in	O
the	O
Iso2Mesh	O
Wiki	O
;	O
since	O
2019	O
,	O
the	O
subsequent	O
development	O
of	O
the	O
specification	O
has	O
been	O
migrated	O
to	O
.	O
</s>
<s>
The	O
v0.5	O
version	O
of	O
the	O
JData	B-Protocol
specification	O
is	O
the	O
first	O
complete	O
draft	O
and	O
public	O
request-for-comment	O
(	O
RFC	O
)	O
of	O
the	O
specification	O
,	O
made	O
available	O
on	O
May	O
15	O
,	O
2019	O
.	O
</s>
<s>
The	O
Draft	O
1	O
of	O
the	O
JData	B-Protocol
specification	O
Version	O
1	O
was	O
released	O
on	O
June	O
4	O
,	O
2019	O
.	O
</s>
<s>
The	O
major	O
changes	O
in	O
this	O
release	O
include	O
1	O
)	O
the	O
serialization	O
order	O
of	O
N-D	O
array	O
elements	O
changes	O
from	O
column-major	O
to	O
row-major	O
,	O
2	O
)	O
_ArrayData_	O
construct	O
for	O
complex	O
N-D	O
array	O
changes	O
from	O
a	O
1-D	O
vector	O
to	O
a	O
two-row	O
matrix	O
,	O
3	O
)	O
support	O
non-string	O
valued	O
keys	O
in	O
the	O
hash	O
data	O
JSON	B-General_Concept
representation	O
,	O
and	O
4	O
)	O
add	O
a	O
new	O
_ByteStream_	O
object	O
to	O
serialize	O
generic	O
binary	O
data	O
or	O
binary	O
large	O
object	O
(	O
BLOB	O
)	O
.	O
</s>
<s>
The	O
Draft	O
2	O
of	O
the	O
JData	B-Protocol
specification	O
Version	O
1	O
was	O
released	O
on	O
July	O
25	O
,	O
2019	O
.	O
</s>
<s>
Numerical	O
values	O
are	O
directly	O
supported	O
by	O
either	O
JSON	B-General_Concept
or	O
UBJSON	B-Protocol
specifications	O
.	O
</s>
<s>
A	O
numerical	O
value	O
is	O
typically	O
unchanged	O
when	O
converting	O
to	O
the	O
JData	B-Protocol
annotation	O
.	O
</s>
<s>
When	O
storing	O
as	O
files	O
,	O
they	O
are	O
directly	O
stored	O
in	O
the	O
JSON/UBJSON	O
numerical	O
value	O
forms	O
.	O
</s>
<s>
Because	O
"	O
structure	O
"	O
data-type	O
can	O
be	O
directly	O
mapped	O
to	O
the	O
"	O
object	O
"	O
construct	O
in	O
JSON	B-General_Concept
and	O
UBJSON	B-Protocol
,	O
therefore	O
,	O
they	O
do	O
not	O
need	O
to	O
be	O
converted	O
when	O
using	O
the	O
JData	B-Protocol
annotation	O
.	O
</s>
<s>
Simple	O
1-dimensional	O
vectors	O
are	O
supported	O
in	O
both	O
JSON	B-General_Concept
and	O
UBJSON	B-Protocol
using	O
the	O
"	O
array	O
"	O
construct	O
.	O
</s>
<s>
 [  }  ] 	O
to	O
simplify	O
this	O
further	O
,	O
in	O
the	O
JData	B-Protocol
Specification	O
,	O
</s>
<s>
In	O
JData	B-Protocol
specification	O
,	O
we	O
introduced	O
a	O
light-weight	O
data	O
annotation	O
approach	O
to	O
allow	O
one	O
to	O
specify	O
additional	O
information	O
,	O
such	O
as	O
data	O
type	O
,	O
data	O
size	O
and	O
compression	O
,	O
in	O
the	O
stored	O
data	O
record	O
.	O
</s>
<s>
This	O
is	O
achieved	O
using	O
a	O
"	O
structure-like	O
"	O
data	O
container	O
(	O
a	O
structure	O
is	O
supported	O
in	O
almost	O
all	O
programming	O
language	O
)	O
with	O
JData-specified	O
human-readable	O
subfield	O
keywords	O
.	O
</s>
<s>
This	O
construct	O
is	O
also	O
easily	O
serialized	O
using	O
many	O
of	O
the	O
existing	O
JSON/UBJSON	O
libraries	O
.	O
</s>
<s>
One	O
can	O
use	O
either	O
the	O
direct-format	O
or	O
annotated-format	O
for	O
storing	O
higher	O
dimensional	O
arrays	O
,	O
as	O
natively	O
supported	O
by	O
both	O
JSON/UBJSON	O
,	O
but	O
the	O
benefit	O
of	O
using	O
the	O
annotated	O
format	O
for	O
text-based	O
JData	B-Protocol
,	O
and	O
the	O
packed-array	O
optimized	O
format	O
for	O
binary-JData	O
becomes	O
more	O
advantageous	O
due	O
to	O
faster	O
processing	O
speed	O
.	O
</s>
<s>
JData	B-Protocol
annotations	O
supports	O
data	O
compression	O
to	O
save	O
space	O
.	O
</s>
<s>
Native	O
data	O
text-JData/JSON	O
form	O
binary-JData	O
(	O
BJData/UBJSON	O
)	O
a	O
=	O
sparse(5,4 )	O
;	O
</s>
<s>
Native	O
data	O
text-JData/JSON	O
form	O
binary-JData	O
(	O
BJData/UBJSON	O
)	O
a	O
=	O
sparse(5,4 )	O
;	O
</s>
<s>
Text-based	O
JData	B-Protocol
files	O
are	O
plain	O
JSON	B-General_Concept
files	O
and	O
can	O
be	O
readily	O
parsed	O
by	O
most	O
existing	O
JSON	B-General_Concept
parsers	O
.	O
</s>
<s>
The	O
JSON	B-General_Concept
files	O
that	O
contains	O
JData	B-Protocol
annotation	O
tags	O
is	O
recommended	O
to	O
have	O
a	O
suffix	O
of	O
.jdt	O
,	O
although	O
it	O
can	O
also	O
be	O
saved	O
as	O
.json	B-General_Concept
.	O
</s>
<s>
JData	B-Protocol
.jdt	O
strings	O
accepts	O
new-lines	O
inside	O
a	O
string	O
while	O
JSON	B-General_Concept
specification	O
requires	O
new-line	O
characters	O
to	O
be	O
encoded	O
as	O
"	O
\n	O
 "	O
;	O
most	O
JSON	B-General_Concept
parsers	O
can	O
process	O
new-lines	O
in	O
the	O
string	O
via	O
the	O
"	O
relaxed	O
"	O
parsing	O
mode	O
.	O
</s>
<s>
The	O
binary	O
interface	O
of	O
the	O
JData	B-Protocol
specification	O
is	O
defined	O
via	O
the	O
Binary	O
JData	B-Protocol
(	O
BJData	O
)	O
specification	O
-	O
a	O
format	O
largely	O
derived	O
from	O
the	O
UBJSON	B-Protocol
Specification	O
Draft	O
12	O
.	O
</s>
<s>
The	O
BJData	O
format	O
contains	O
three	O
extended	O
features	O
compared	O
to	O
UBJSON	B-Protocol
:	O
1	O
)	O
BJData	O
introduces	O
4	O
new	O
data	O
markers	O
( [	O
u ]	O
for	O
"	O
uint16	O
"	O
,	O
 [ m ] 	O
for	O
"	O
uint32	O
"	O
,	O
 [ M ] 	O
for	O
"	O
uint64	O
"	O
,	O
and	O
 [ h ] 	O
for	O
"	O
float16	O
"	O
)	O
that	O
were	O
not	O
supported	O
in	O
UBJSON	B-Protocol
,	O
2	O
)	O
BJData	O
introduces	O
an	O
optimized	O
typed	O
N-D	O
array	O
container	O
,	O
and	O
3	O
)	O
BJData	O
stops	O
mapping	O
NaN/Infinity	O
to	O
null	O
( [	O
Z ]	O
)	O
,	O
instead	O
,	O
it	O
uses	O
their	O
respective	O
IEEE754	O
representations	O
.	O
</s>
<s>
Lightweight	O
Python	B-Language
JData	B-Protocol
encoder/decoder	O
,	O
pyjdata	O
,	O
is	O
available	O
on	O
PyPI	B-Language
,	O
Debian/Ubuntu	O
and	O
GitHub	B-Application
.	O
</s>
<s>
It	O
can	O
convert	O
a	O
wide	O
range	O
of	O
complex	O
data	O
structures	O
,	O
including	O
dict	O
,	O
array	O
,	O
numpy	O
ndarray	O
,	O
into	O
JData	B-Protocol
representations	O
and	O
export	O
the	O
data	O
as	O
JSON	B-General_Concept
or	O
UBJSON	B-Protocol
files	O
.	O
</s>
<s>
The	O
BJData	O
Python	B-Language
module	O
,	O
pybj	O
,	O
enabling	O
reading/writing	O
BJData/UBJSON	O
files	O
,	O
is	O
also	O
available	O
on	O
PyPI	B-Language
,	O
Debian/Ubuntu	O
and	O
GitHub	B-Application
.	O
</s>
<s>
For	O
MATLAB	B-Language
and	O
GNU	B-Language
Octave	I-Language
,	O
JSONLab	O
v2.0	O
is	O
the	O
reference	O
implementation	O
for	O
the	O
latest	O
JData	B-Protocol
specification	O
,	O
and	O
is	O
available	O
on	O
Debian/Ubuntu	O
,	O
Fedora	O
,	O
and	O
GitHub	B-Application
.	O
</s>
<s>
The	O
JSONLab	O
toolbox	O
is	O
also	O
distributed	O
via	O
MATLAB	B-Language
File	O
Exchange	O
,	O
and	O
is	O
among	O
the	O
most	O
popular	O
downloads	O
packages	O
,	O
and	O
named	O
in	O
Popular	O
File	O
2018	O
.	O
</s>
<s>
For	O
JavaScript	B-Language
,	O
a	O
JData	B-Protocol
encoder/decoder	O
named	O
jsdata	O
has	O
been	O
developed	O
to	O
process	O
JData	B-Protocol
encoded	O
files	O
in	O
web	O
pages	O
.	O
</s>
<s>
Compact	O
functions	O
for	O
encoding/decoding	O
JSON	B-General_Concept
files	O
containing	O
JData-annotations	O
have	O
also	O
been	O
implemented	O
in	O
C/C	O
++	O
as	O
part	O
of	O
the	O
Monte	O
Carlo	O
eXtreme	O
photon	O
transport	O
simulator	O
.	O
</s>
