Open sbesson opened 4 years ago
This issue has been mentioned on Image.sc Forum. There might be relevant details there:
Thanks @sbesson , I didn't catch your original issue.
Just my two cents, based on what I see users doing:
a dataset is found and a project is found but they are not linked
If the dataset is orphaned, it makes sense to link them, but the safest option (in terms of difficulty of cleaning up a mistake) is to create a new dataset in the project. If the dataset is in another project, I would definitely not create a new link.
a dataset of the given name is found but no project is found
I would create a new project and a new dataset. Again, because it would be easier to clean up a mistake (it's easier to merge two datasets that are the same than to pick individual images out of a dataset in which they do not belong)
no dataset of the given name is found and no project is found
Create both and link.
neither a dataset nor a project is found
Isn't this the same as the previous point?
Additionally to what @mellertd suggests, possibly an additional arsenal of possibilities such as specified in the "For example" section of https://docs.openmicroscopy.org/omero/5.6.1/users/cli/import-target.html#importing-to-a-dataset-or-screen could be added. These possibilities would give the user a chance to inequivocally force the behaviour, using small syntactic means such as addition of + or somesuch, to decide whether or not a new object is created or not.
Support for project targets was introduced in OMERO 5.6.1 via https://github.com/ome/omero-blitz/pull/61. The implementation was documented in https://github.com/ome/ome-documentation/pull/2053, queries first projects then datasets matching the target names independently, resolves them using the standard target discriminators https://docs.openmicroscopy.org/omero/5.6.1/users/cli/import-target.html and links the dataset to the project.
As reported in https://github.com/ome/omero-blitz/pull/61#issuecomment-519587145 and https://forum.image.sc/t/bulk-import-bug/38143, this implementation challenges some user expectations especially when a dataset with the target name exists but is not linked to a project with the target name. Under some circumstances depending on object creation order/target discriminators, this might lead to the "incorrect" dataset (as per the user's expectation) being linked to the project and used for importing the data.
To be able to handle these scenario, we need to define more precisely the expected outcome for the import. A few initial questions:
if so, what should be the behavior if no linked project/dataset was found. We might want minimally to consider the following cases: