Relative Path

First of all i want to apologize for any mistakes from my part and if i am posting in the wrong section, really just started to work with KNIME.

So my question ist, to make use of relative paths ( when i want to send my workflow to someone else) both sides HAVE TO have the same folder structure to make this work ?

So when i have my workflow here:
image
my Data needs to be placed here:
image

So i need to send him the flow, the data, and make sure we have the same folder structure ? justs seems a little odd to me if thats how it works just to avoid manually changing the path.

Thanks a lot for any responces and again im sorry if im asking something really basic.

Hi @kayapinar,

Here you can find the solution to the topic Relative Path.

Best regards
Andrew

3 Likes

Hi @kayapinar ,

Making use of relative paths with the newer file nodes that support this is really as simple as creating a “data” subfolder within your workflow’s folder and putting your data files in there. Then in the nodes just choose the option that the path is relative to the workflows data area.

If you are struggling to find your workflow’s folder, I have a convenience component that may assist.

Drop this on your workflow and execute this component and it will open your workflow’s folder in Windows explorer (or equivalent). You can also configure it to create your data folder if it doesn’t exist, and open there instead.

You can then remove it from your workflow if you have no further need of it.

5 Likes

Hello @kayapinar,

and welcome to KNIME Community!

Well yes if you are sharing only workflow and data is not inside data folder within workflow directory. But you can export and then share entire workflow group which can have multiple workflows and data files. This way all relative paths will work after importing. See here for more info about importing/exporting workflows:
https://docs.knime.com/latest/analytics_platform_workbench_guide/index.html#importexport-workflows

Additionally you can use KNIME Hub for sharing and collaborating.

Give it a try and if any questions/issues feel free to ask. And no need to apologize. This is the right place to ask your questions. Even basic ones :wink:

Br,
Ivan

Thanks everyone for the feedback !

1 Like

@ipazin
thank you, i figured it work like that but can you maybe explain somethin to me, and i really tried understanding through the guides but i just dont seem to get it

So here is my question: What would be the difference when i share a workflow group like down below ? i know that the knime protocol “jumps” one level up from the place where the workflow is located and searches for datafolder ?

Data folder is inside the workflow folder:
image

Data Folder is at the same Level as the workflow folder:
image

So when im exporting a workflow group, does it whatter which relative methode i use ?

wait, is using the above method (1st picture )used when only sharing a workflow and not a group ? since it is in the workflow itsself ?

Hello @kayapinar,

No as long data is within workflow group you are exporting :wink:

Correct. You can also use relative paths and data folder within workflow directory to structure your own work. (not sharing related)

Br,
Ivan

2 Likes

@ipazin
Ok , i see. That makes it much more clearer for me now, thank you so much for taking your time to help.
If you dont mind i have one final question to this topic.
Is the advantage in using rel. paths instead of abs. paths just the fact that the path will work after sharing/importing or is there another benefit ?

Regards,
Tolga

You are welcome @kayapinar. Don’t think there are other benefits but the one you mentioned seems pretty big to me :slight_smile:
Ivan

Hello everyone.
To see what @ipazin explained in practice I made this workflow:

Enjoy!

3 Likes

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