Setting up JSON metadata for an input file - 6.5

Talend Open Studio for MDM User Guide

Talend Open Studio for MDM
Data Governance
Data Quality and Preparation
Design and Development
Talend Studio

This section describes how to define a file connection and upload a JSON schema for an input file. To define an output JSON file connection and schema, see Setting up JSON metadata for an output file.

Defining the general properties

  1. In the wizard, fill in the general information in the relevant fields to identify the JSON file metadata, including Name, Purpose and Description.



    In this step, it is advisable to enter information that will help you distinguish between your input and output connections, which will be defined in the next step.



  3. If needed, click the Select button next to the Path field to select a folder under the File Json node to hold your newly created file connection.

  4. Click Next to select the type of metadata.

Setting the type of metadata and loading the input file

  1. In the dialog box, select Input Json and click Next to proceed to the next step of the wizard to load the input file.

  2. From the Read By list box, select the type of query to read the source JSON file.

    • JsonPath: read the JSON data based on a JsonPath query.

      This is the default and recommended query type to read JSON data in order to gain performance and to avoid problems that you may encounter when reading JSON data based on an XPath query.

    • Xpath: read the JSON data based on an XPath query.

  3. Click Browse... and browse your directory to the JSON file to be uploaded. Alternatively, enter the full path to the file or the URL that links to the JSON file.

    In this example, the input JSON file has the following content:

    {"movieCollection": [
            "type": "Action Movie",
            "name": "Brave Heart",
            "details": {
                "release": "1995",
                "rating": "5",
                "starring": "Mel Gibson"
            "type": "Action Movie",
            "name": "Edge of Darkness",
            "details": {
                "release": "2010",
                "rating": "5",
                "starring": "Mel Gibson"

    The Schema Viewer area displays a preview of the JSON structure. You can expand and visualize every level of the file's JSON tree structure.

  4. Enter the Encoding type in the corresponding field if the system does not detect it automatically.

  5. In the Limit field, enter the number of levels in the JSON hierarchical depth to which you want to limit the JsonPath or XPath query, 0 for no limits.

    Setting this parameter to a value less than 5 can help prevent the wizard from hanging in case of a large JSON file.

  6. Click Next to define the schema parameters.

Defining the schema

In this step you will set the schema parameters.

The schema definition window is composed of four views:



Source Schema

Tree view of the JSON file.

Target Schema

Extraction and iteration information.



File Viewer

Preview of the JSON file's data.




      An orange arrow links the node to the corresponding expression.


    The Path loop expression definition is mandatory.






    • Add or delete a column using the [+] and [x] buttons.

    • Change the order of the columns using the and buttons.



  7. Click Next to finalize the schema.

Finalizing the schema






    Below are the commonly used Talend data types:






Now you can drag and drop the file connection or the schema of it from the Repository tree view onto the design workspace as a new tFileInputJSON or tExtractJSONFields component or onto an existing component to reuse the metadata. For further information about how to use the centralized metadata in a Job, see How to use centralized metadata in a Job and How to set a repository schema in a Job.

To modify an existing file connection, right-click it from the Repository tree view, and select Edit JSON to open the file metadata setup wizard.

