CLI Import: Specifiy Project to Place Dataset

Currently I’m able to specifiy a dataset name when I upload an image using the -T option (for example, bin/omero import image.png -T Dataset:name:new_dataset). If the dataset doesn’t currently exist, it will be created.
However, the new dataset is created in the root directory and not associated with an existing project.
What I would like to do is specify a project to look for the dataset in, and if it doesn’t exist in the project, create a new dataset in the project. Is this already possible or would this be a new feature?

Thanks,
Philip

Hi @pmann. It’s not currently possible with a single command, no, though what you point out has certainly been requested before. Do you have a suggestion on what the command would look like?

In case it helps until then, a project can be placed into a dataset like this:

$ PROJECT=$(bin/omero -q obj new Project name=example)
$ DATASET=$(bin/omero -q obj new Dataset name=example)
$ bin/omero -q obj new ProjectDatasetLink parent=$PROJECT child=$DATASET
ProjectDatasetLink:451
$ touch /tmp/a.fake
$ bin/omero import -T $DATASET /tmp/a.fake

To check for an existing Dataset would require a few more lines.
~J.

1 Like

I think something like:
bin/omero import -T Dataset:name:dataset_name -P Project:name:project_name
or maybe
bin/omero import -TP Project:name:project_name Dataset:name:dataset_name
or perhaps
bin/omero import -T Project:name:project_name/Dataset:name:dataset_name
The last one might have a different separator from slash if that’s too common.

1 Like

Not yet ready for release, but open for feedback:

~Josh

1 Like

Hey Josh, I see that the PR has been merged :grinning:
Do you know approximately when the feature will be available in a release?

Hi @pmann,

timely enough we just released OMERO 5.5.1 which includes this new feature. Can you give it a try and let us know if this meets your requirements?

Best,
Sebastien