0

When working with KNIME for testing and learning, we generally use a folder structure like

MyProject/
    MyKNIMEWorkspace/
    MyKNIMEDataFolder/

on each computer. Everyone is free to write their own workflows, don't have to share them, etc. But we want to be able to send each other workflows where we don't need to change the paths to the data folder manually, if everyone follows the given structure, i.e. always looking one level higher and find the folder MyKNIMEDataFolder and take file xyz.table.

I have played with path variables (basically fixed for each installation), with workflow variables and with flow variables (being sent around when sending the workflows), tried to connect both with the syntax from the help documentation on path variables (i.e. ${VAR}) but I cannot find the proper way to fully disconnect my workflow from my local path.

  1. Do you see anything wrong with our structure?
  2. How would you deal with the problem of sending workflows around?
ATN
  • 665
  • 8
  • 26
  • 2
    The `knime://knime.workspace/`/`knime://knime.mountpoint` (I hope I am right about the syntax for workspace/mount point relative path) and `knime://` project relative path might help when creating these kind of hierarchy. – Gábor Bakos Jun 12 '14 at 12:42
  • No such thing as knime://knime.workspace. You mean knime://knime.workflow? – simonso Aug 25 '17 at 22:33

2 Answers2

0

I think you could try to use a Java Snippet node to edit a Flow Variable before it gets to the file input node (File Reader?). The Java snippet could query the knime.workspace flow variable and use that part of the String before the part of the path that is the common file structure.

0

Actually, I hope you already resolved this by now. The way KNIME works is that you need to start everything with your knime workspace.

For KNIME client:

/home//workspace/workflow_1, /home//workspace/workflow_2, where workspace is chosen when you launch the KNIME client.

To KNIME, this workspace is your "workflow_repository" that has workflow_1 and workflow_2.

You may create directory DataFiles in parallel with workflow_1.

The knime protocol you use to refer to those files are either:

  1. knime://knime.workflow/../DataFile/filename - a URL relative to the workflow. Use exact keywork knime.workflow or
  2. knime://knime.mountpoint/DataFile/filename - a URL relative to the starting point. In knime client, the mountpoint is LOCAL. or
  3. knime://LOCAL/DataFile/filename - an absolute URL. The drawback of this scheme is you are pinned to LOCAL. If you collaborate with others, they have to change the reference from LOCAL to something else.

There is ramification on knime server. But I'll keep it from confusing you.

To top it off, this one may not help your situation. So I won't say it is related to your original problem:

knime://knime.node/../path/filename expects you to manually go into the workflow repository directory, cd into the workflow, and make a directory, say, called data. Then you can refer your data in data by knime://knime.node/../data/some_file. You can't do it from Knime Explorer/UI.

simonso
  • 595
  • 1
  • 8
  • 19