JSONata

Help Contents

JSONata Introduction

Internet of Things (IoT) applications often use Java Script Object Notation (JSON) as a protocol to deliver information.

JSONata is a lightweight language to query and transform data extracted from JSON documents.

JSONata is used in Fernhill SCADA by the MQTT Driver to select values from JSON formatted topic values.

JSONata Expression Syntax

A JSONata expression is a sequence of literals, selectors and operators which produces a single result.

The syntax is defined as:

jsonata-expr ::=
  unary-expr { operator unary-expr }

unary-expr ::=
  [ '-' ] primary

primary ::=
  'null' | 'true' | 'false' |
  integer-literal |
  string-literal |
  json-selector |
  $function(...) |
  ( jsonata-expr )

JSONata Types

JSONata expressions supports these types:

TypeDescription
Nullnull value
Booleantrue of false
NumberNumeric value
StringVariable length string
ObjectJSON Object
ArrayJSON Array

Further Information

JSONata Selectors

To learn how to select values from a JSON document.

JSONata Operators

To learn how to combine values into a single value.

MQTT Driver

To learn how the Message Queuing Telemetry Transport (MQTT) driver uses JSONata to transform JSON payloads.

Glossary

For the meaning of terms used in Fernhill SCADA.