Exporting Data to a Json File

The Export to Json task exports datasets or other Rulex structures to a series of JSON files.


Prerequisites

Additional tabs

The following additional tabs are provided:


Procedure

  1. Drag and drop the Export to Json task onto the stage.

  2. Connect a task, which contains the data you want to export, to the new task.

  3. Double click the Export to Json task.

  4. Configure the task options as described in the table below in the Options and File Format tabs.

  5. Save and compute the task.

Export to Json File options

Parameter Name

PO

Description

Data to be exported

reflist

Select what type data you want to export from the list of options.

Possible options are:

  • Association rules (produced by Hierarchical Basket Analysis and Similar Items Detector tasks)

  • Auto regressive models (produced by Auto Regressive task)

  • Clusters (produced by Label Clustering, Projection Clustering and Standard Clustering tasks)

  • Cluster Labels (produced by Label Clustering and Projection Clustering tasks)

  • Datasets (all import, data preparation and data pre-processing tasks)

  • Discretization cutoffs (produced by Discretize task)

  • Frequent itemsets (produced by Frequent Itemsets Mining task)

  • Frequent sequences (produced by Sequence Analysis task)

  • Results (produced by all data analysis tasks)

  • Rules (produced by LLM tasks (Classification, Regression & One-Class), along with Decision Tree and Regression Tree tasks)

  • Models (produced by Logistic, Linear, Neural Networks (Classification and Regression) and SVM (Classification and Regression).

  • PCA eigenvectors (produced by the Principal Component Analysis task)

  • Relevances (produced by classification and regression tasks).

Mode

mode

Select how you want to save the file, either by storing it in a location you will then specify, by sending the file as an e-mail or both ways.

If you select to send the file by e-mail, you  must then specify the e-mail address in the Recipients for export via email edit box.

Export URI

uri

Select whether the file will be saved locally (Local File System) or remotely (Http Remote APISharePoint, HDFS, AWS S3, FTP, Azure Storage).

From version 4.7 of Rulex, API responses from HTTP calls can be redirected to external sources, such as SharePoint and S3. The response path corresponds to the filename, with the complete path for local file systems, and the remote directory for external sources.

Note: if you chose to save the file remotely you must also configure the Remote Connection parameters in the Remote Connections tab.

Directory

dirname

Enter or browse to the directory where the file will be saved.

If you are exporting to an Azure Storage repository you can either:

  • select just the container where you want to save the file as the Directory, and then specify the metadata file name of the blob in the File basename parameter. 
    In this case a blob with the same name as the file will be automatically created for the file.

  • select the container, and manually add the name of the blob, where you want to save the file as the Directory, and then specify the metadata file name of the blob in the File basename parameter. 
    In this case the file will be saved in the specified blob and container.

File basename

basename

Enter a name for the file that will be exported.

Add current date and time as prefix

timestampprefix

If selected, the date and timestamp will be added to the start of the file basename as a prefix.

Add current date and time as suffix

timestampsuffix

If selected, the date and timestamp will be added to the end of the file basename as a suffix.

Append data if already exists


If selected, data will be appended to the specified basename if the file already exists, otherwise the original data will be overwritten.

Recipients for export via email (use comma as separator)

recipients

Specify the email addresses where the exported file will be sent, separated by commas.

This option will only be valid if you have selected Send via email or Both in the Mode option.

File Format options



File format

fileformat

Select the format in which you want to export the file: flat, nested or according to the group column.

If you select the group option, you must have selected the Group Column option when importing the Json file, in order to create a column which identifies the group of each tag.

If you did not select this option in import, Rulex will not be able to identify which group each tag belongs to, and consequently a single group will be created in export.

Key for types


Specify the attribute which defines the data type.

Remove missing values

removemiss

If selected, missing records are removed from the exported file.


Specific use case: exporting an HTTP response to SharePoint

When exporting an HTTP response to SharePoint, you do not need to only specify the HTTP Server connection parameters, but also the SharePoint connection parameters.

This means that, when following the procedure, you need to insert information on the connection for both the HTTP Server and SharePoint.

You will find all the operations to perform in the procedure below:

  1. In the Export to Json File task, in the Options tab, select HTTP Remote API in the Export URI text box.

  2. In the Remote Connections tab, configure the HTTP API as follows:

    1. Choose the Authentication type and fill the connection information required.

    2. In the Response URI drop down menu, select SharePoint.

    3. In the Response file path, write the SharePoint path where you want the file to be saved.

  3. In the Remote Connections tab, configure the SharePoint connection info required.

  4. Save and compute the task.