Reader Nodes: Using relative paths to import data

Hi everyone,

I’m struggling to import data using relative paths:

The KNIME workflow file (knwf) lies in a folder called “02 Workflow”. The inpurt data (an excel file) lies in a folder called “01 Data”. Both folders are on the same level.

/Downloads/Use Case/01 Data
/Downloads/Use Case/02 Workflow

I want to use relative file paths so that when I share the folder with the data and workflow with a colleague they won’t have to adjust the file paths.

My KNIME workspace is located here: C:\Users\USERNAME\knime-workspace

Can anyone help me with the correct configuration?

Best,
Henan

Hello @Henan
You will have to create your folder structure within the ‘Current workflow data area’… this is by adding a ‘data’ folder into your workflow folder structure.

i.e. You have a workflow saved as ‘KNIME_test’ (see picture). You can manually add an empty ‘data’ folder from your file explorer, and reproduce your folder structure within it. Then you can use ‘Browse button’ with ‘Relative to’ - ‘Current workflow data area’ node configuration.

BR

4 Likes

Thanks for your help, @gonhaddock !

So relative paths only work when the workflow is saved in the KNIME Workspace and when the data files lie in the workflow folder within the KNIME Workspace?

Right now, I exported the workflow as knwf-file. I thought that I could just share this knwf-file with my colleagues…

Best,
Henan

2 Likes

That’s right @Henan
You can test your own created .knwf and save it with a new name…

Your colleagues will be able to execute the workflow even opening it from a .knwf file. The data is embedded in the workflow.

Once they save the workflow in their own knime-workspace; all the data folder structure and files are copied in their saved workflow.

BR

2 Likes

Thanks a lot, @gonhaddock ! Will try that approach.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.