Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

BaSyx / Documentation / Components / DataBridge / Features / Data Transformation / JSONata

JSONata

The JSONata transformer can be integrated with DataBridge. The Jsonata component allows you to process JSON messages using the JSONata specification. This can be ideal when doing JSON to JSON transformation and other transformations from JSON.

Configuration

To configure JSONata transformer in DataBridge you need to provide the unique id, the relative path to the file containing JSONata expressions, input type and the output type.

Sample Configuration

[
	{
		"uniqueId": "jsonataA",
		"queryPath": "jsonataA.jsonata",
		"inputType": "JsonString",
		"outputType": "JsonString"
	}
]

Disclaimer: Please use only the relative path (queryPath) of the file containing JSONata expressions.

Below is an example expression that can be put in the jsonataA.jsonata file.

Sample JSONata expression

$sum(Account.Order.Product.(Price * Quantity))

To learn more about JSONata expressions please refer JSONata Org

Similarly, you can configure multiple JSONata transformers inside the configuration file.

Naming Convention

The name of the JSONata configuration file should be jsonatatransformer.json.

Working Example

The integration example with MQTT as a data source, JSONata as a transformer, and AAS as a data sink is available on GitHub DataBridge Example.

Back to the top