User Guide

Prev Next

The KNIME Data Functions allows you to set up a bi-directional data exchange between Spotfire and KNIME.

How to create a KNIME workflow for Data Functions

Here is an example of a compatible KNIME workflow:

Knime_Workflow_Sample_Sample

There are multiple possible types of input parameters that a KNIME Workflow might expect:

  • <Value> Input: includes string, datetime, integer, double. No special needs for this kind of input.
  • <Column> Input: includes json, credentials input, list inbox input. No special needs for this kind of input, data will be read as a column by KNIME.
  • File Upload Input: Spotfire Data Functions will only upload SBDF file. So you will need an SBDF Reader node after the upload node:

Knime_Workflow_Sample_input

Note that it is recommended to encapsulate the input nodes in a component to ensure exposition through REST API.

For outputs, KNIME Data Functions will understand the following kind of outputs:

  • File output: only SBDF can be read, so before using a File Download output node, use a SBDF Writer to create the SBDF
  • Others: includes text and json output. Will be treated by the data function as a new table and pushed to it.

Knime_Workflow_Sample_output

How to Register a KNIME Data Function

Once a compatible workflow is available on the KNIME server, to use it you have to register the KNIME Workflow as a Spotfire Data Function.

To do that, launch Spotfire analyst and go to Tools > Discngine KNIME data functions Administration

Knime_Workflow_Register_01

In the current window, you have three tabs that describe the content of the Spotfire library from the DefaultRootPath defined in the Spotfire preferences:

  • The Table View displays the content of the folder using a simple data grid (where you can see the Spotfire library path and the corresponding workflow path in the KNIME server folders)
  • The Spotfire Library View shows the same information but using the Spotfire library tree structure
  • The KNIME View shows the same information but using the KNIME Server tree structure

Knime_Workflow_Register_02

To register a new data function, you must login to the KNIME Server using the login button:

Knime_Workflow_Register_03

Then click on "Register New". The new window opening show you the KNIME library structure with each workflow available. Select the one you want and click on select or double-click:

Knime_Workflow_Register_04

It opens a window to save the new Spotfire data function filled with information from the workflow (Name, Description, Tags, Output parameters, Input Parameters).

Knime_Workflow_Register_05

It allows you to modify before save:

  • The name of the future data function
  • The tags (must be comma-separated)
  • The description
  • The folder where the data function will be saved (click on the "Select" button beside the Library Path):

Knime_Workflow_Register_06

  • If you have selected a wrong workflow, you can select the right one by clicking on "Select" button beside the Workflow Path

Knime_Workflow_Register_07

All other fields are read only and are here for you to check every input and output are available.

Note: Input and output names are generated by KNIME itself.

When all changes are ok, you can "Save" the data function.

NB: If a data function with the same name in the same Spotfire library location already exists, a warning will be shown to you before saving to ensure you want to overwrite the existing one.

Knime_Workflow_Register_08

When the data function is saved, you will have this message:

Knime_Workflow_Register_09

The new data function is now available for usage and can be accessed through the library:

Knime_Workflow_Register_09

How to use KNIME Data Functions

To add a data function to a Spotfire document, click the + Files and Data button on the quick access panel, then Browse the Library to the folder where you saved your data function.

Note that given on their input types, some data functions might not be visible. For example, data functions requiring a table as input will not be visible from a blank document.

Knime_Workflow_Register_09

When loading a data function, a window will pop up and prompt you to enter the values for the different parameters used in the data function.

The input handlers will depend on the input type.

Pro tip: using Document property or Data table property combined with Text Areas is a great way to add interactivity to your Spotfire document.

Set Data Function Parameters

Once all the parameters have been set, click OK to load the data function.

Execute Data Function

Note

If you are not yet authenticated on the KNIME Server, a prompt window will pop up and ask you to enter your credentials.
Authenticate against KNIME Server

Upon completion, depending on the output parameters of your workflow, you will have a list of data tables to add to your document.

For example with the demo workflow "Load Maybridge Data":

Load Data from DF

That's it! As a next step, try using a document property to control the workflow parameter, and a Text Area to control the document property. Doing so you can some interactivity to the Spotfire document.