JPath / JSON Processing
Data Query from JSON Data Packages
JSON is a JavaScript-based standard used for transmission of structured data via the internet. JSON is often used as value or parameter input or output. JSON is a valuable exchange format between Web client and backend services.
JPath is designed for server responses containing JSON. JPath and works on the same principle as XPath function, and allows easy access to data contained in JSON data packages, thus enabling the OPC Router to extract and provide the desired information whenever and whereever needed.
That’s how easy it is.
Connecting Systems
Transfer Objects
The transfer object of the JSON Plug-in facilitates easy access to incoming JSON strings.
JPath Query
The query requires a JSON string as data entry field. In the transfer ojbect, a JPath query is created and formulated, and is structured as items and parameters.
The items of the data fields are made available as output, for subsequent objects.
Trigger
The JSON plug-in does not come with its own trigger functions. Instead it uses the standard trigger functions of the OPC Router.
Browsing
The JSON plug-in directly addresses JSON items.
JSON Server Plug-in Application Examples
Production and process data packaged in JSON
The JSON format is the common formatting for data in the environment of NoSQL, Cloud, MQTT, Web etc.. The JSON documents can map complex structures and are readable as normal text due to the encoding in UTF-8 (or UTF-16/-32).
If production or process data are to be read from controllers via OPC UA and transferred as JSON to a target system, they are converted using the JSON Write transfer object of the OPC router. The nested JSON document structure is defined in the JSON Write transfer object. The individual fields of the document can then be written to with OPC UA data in the OPC Router connection. The JSON document filled with production and process data is transferred to the target system as a complete document (e.g. MongoDB, InfluxDB, MQTT, REST).

Extract data from JSON documents for OPC and SQL
In addition to sending JSON structured data from the industry 4.0 environment to the NoSQL and Cloud environments, JSON also provides data for the production of these systems via JSON document. The received JSON documents must then be evaluated and broken down into data fields and structures that can be processed by the production systems involved. The JSON Read transfer object of the OPC router reads the JSON document structure for this purpose and provides the available data fields and structures intuitively for selection. Individual data fields are selected for transfer to controllers and devices via OPC UA. For the transfer to SQL based databases (SQL Server, ORACLE, MySQL) whole sub-structures and arrays can be selected and transferred directly to the database. A practical example can be found in our tutorial article on transferring weather data from the online portal OpenWeatherMap to a SQL database.
JSON schema for REST communication
JSON-based protocols are increasingly being used in modern production environments, for example for REST APIs, MQTT messages, or unified namespace architectures. Configuring such data structures is often complex, as each interface uses its own formats and fields.
By integrating JSON schemas into OPC Router, these structures can be standardized and processed automatically. OPC Router imports OpenAPI schemas for REST interfaces and AsyncAPI schemas for MQTT or edge platforms and automatically generates the required inputs and outputs from them. This eliminates the need for manual replication of payload structures, which significantly simplifies project configuration and reduces sources of error.
Companies can also define and centrally manage their own JSON schemas. This creates a uniform data model that is used by all systems and ensures versioning, consistency, and traceability.
The standardized use of JSON schemas thus ensures clear interfaces, clean data flows, and high data quality. This is an important basis for efficient integration, scalability, and automated data processing in industrial communication.

