ArticleslgStudy

computer science

JData

JData is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand JData rather than just read about it. In short: JData is a light-weight data annotation and exchange open-standard designed to represent general-purpose and scientific data structures using human-readable (text-based) JSON and (binary) UBJSON formats. JData specification specifically aims at simplifying exchange of hierarchical and complex data between programming languages, such as MATLAB, Python, JavaScript etc.

Key takeaways

  • JData belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect JData to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of JData from memory before moving on to harder problems.

Reference excerpt

JData is a light-weight data annotation and exchange open-standard designed to represent general-purpose and scientific data structures using human-readable (text-based) JSON and (binary) UBJSON formats. JData specification specifically aims at simplifying exchange of hierarchical and complex data between programming languages, such as MATLAB, Python, JavaScript etc. It defines a comprehensive list of JSON-compatible "name":value constructs to store a wide range of data structures, including scalars, N-dimensional arrays, sparse/complex-valued arrays, maps, tables, hashes, linked lists, trees and graphs, and support optional data grouping and metadata for each data element. The generated data files are compatible with JSON/UBJSON specifications and can be readily processed by most existing parsers. JData-defined annotation keywords also permit storage of strongly-typed binary data streams in JSON, data compression, linking and referencing.

History The initial development of the JData annotation scheme started in 2011 as part of the development of the JSONLab Toolbox - a widely used open-source MATLAB/GNU Octave JSON reader/writer. The majority of the annotated N-D array constructs, such as _ArrayType_, _ArraySize_, and _ArrayData_, had been implemented in the early releases of JSONLab. In 2015, the first draft of the JData Specification was developed in the Iso2Mesh Wiki; since 2019, the subsequent development of the specification has been migrated to Github.

Releases

JData Version 0.5 The v0.5 version of the JData specification is the first complete draft and public request-for-comment (RFC) of the specification, made available on May 15, 2019. This preview version of the specification supports a majority of the data structures related to scientific data and research, including N-D arrays, sparse and complex-valued arrays, binary data interface, data-record-level compression, hashes, tables, trees, linked lists and graphs. It also describes the general approach for data linking and referencing. The reference implementation of this specification version is released as JSONLab v1.8.

JData Version 1 Draft 1 The Draft 1 of the JData specification Version 1 was released on June 4, 2019. The major changes in this release include The reference implementation of this specification version is released as JSONLab v1.9.

JData Version 1 Draft 2 The Draft 2 of the JData specification Version 1 was released on July 25, 2019. The major changes in this release include The reference implementation of this specification version is released as JSONLab v2.0.

JData annotation examples

Numerical scalars Numerical values are directly supported by either JSON or UBJSON specifications. A numerical value is typically unchanged when converting to the JData annotation. When storing as files, they are directly stored in the JSON/UBJSON numerical value forms. For example

Special constants and strings There are a few special constants, namely "NaN", "Infinity" and "-Infinity", they are encoded as special string keywords when stored in the JSON/text-JData formats, but stay unchanged when stored in the binary JData format

Structures and hashes Hierarchical structures are often needed when representing metadata or simple lists with named-members. Because "structure" data-type can be directly mapped to the "object" construct in JSON and UBJSON, therefore, they do not need to be converted when using the JData annotation.

2D array in the array format Simple 1-dimensional vectors are supported in both JSON and UBJSON using the "array" construct. For example

2-D arrays in the annotated format In JData specification, we introduced a light-weight data annotation approach to allow one to specify additional information, such as data type, data size and compression, in the stored data record. This is achieved using a "structure-like" data container (a structure is supported in almost all programming language) with JData-specified human-readable subfield keywords. This construct is also easily serialized using many of the existing JSON/UBJSON libraries. For example, the above 2-D array can be alternatively stored using the annotated format to allow fine-grained data storage

3-D and higher dimensional array One can use either the direct-format or annotated-format for storing higher dimensional arrays, as natively supported by both JSON/UBJSON, but the benefit of using the annotated format for text-based JData, and the packed-array optimized format for binary-JData becomes more advantageous due to faster processing speed.

Array data with compression JData annotations supports data compression to save space. Several additional keywords are needed, including _ArrayZipType - the compression method used, _ArrayZipSize_ - the dimension vector of the "preprocessed" data stored in the _ArrayData_ construct before compression, and _ArrayZipData_ - the compressed data byte-stream. For example,

Complex-number and complex-valued arrays

A complex-valued data record must be stored using the "annotated array format". This is achieved via the presence of _ArrayIsComplex_ keyword and the serialization of the complex values in the _ArrayData_ constructs in the order of [[serialized real-part values], [serialized imag-part values]]

Sparse arrays

Complex-valued sparse arrays

Tables see JData Specification

Trees see JData Specification

Graphs see JData Specification

Software ecosystem Text-based JData files are plain JSON files and can be readily parsed by most existing JSON parsers. The JSON files that contains JData annotation tags is recommended to have a suffix of .jdt, although it can also be saved as .json. A few slight differences exist between a .jdt and a .json file, including

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with JData

Start with the simplest possible case. Write down what JData claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to JData before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about JData ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of JData

In research
JData appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses JData in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
JData is common in secondary-school and first-year university syllabi. It links to neighbouring topics Computer file formats, Cross-platform software, Data exchange formats, so understanding it makes those chapters shorter.
In everyday life
Look for JData outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study JData in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what JData means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain JData out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is JData in simple terms?

JData is a light-weight data annotation and exchange open-standard designed to represent general-purpose and scientific data structures using human-readable (text-based) JSON and (binary) UBJSON formats. JData specification specifically aims at simplifying exchange of hierarchical and complex data…

Why does JData matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study JData?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on JData.

Tags

  • Computer file formats
  • Cross-platform software
  • Data exchange formats
  • Data serialization formats
  • JSON
  • Markup languages

Keep exploring