JSONata

Help Contents

Introduction

IoT applications often use JSON as a protocol to deliver information.

JSONata is a lightweight language to query and transform data in a JSON formatted documents.

Fernhill SCADA uses JSONata in these areas:

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.