New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix #10703: download pre-FS original metadata in FS #1717
Conversation
if (rsp.fileAnnotationId != null) { | ||
final IQuery iQuery = helper.getServiceFactory().getQueryService(); | ||
final FileAnnotation fileAnnotation = iQuery.get(FileAnnotation.class, rsp.fileAnnotationId.getValue()); | ||
final String filePath = pixelsService.getFilesPath(fileAnnotation.getFile().getId()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this not looking under /OMERO/Pixels
rather than /OMERO/Files
/?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's getPixelsPath
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course! Cheers.
Using
I get the following differences in keys:
and
which looks as if the parsing of |
It isn't. The Apache Commons library I tried didn't seem to quite fit the INI-like format that we use, and your testing reveals that going too simple doesn't either. Is there a spec somewhere of our version of it so I know what to handle how? (I am thinking that '=' within '()' might not be the only problem, for instance perhaps we do something with quoting or escaping or other kinds of bracket or brace too?) Or, avoiding parenthesis balancing, perhaps it is always okay to split only at the last '=', ignoring any earlier -- we could give that a try? |
@mtbc, have you tried the |
It probably might, thank you, I shall give it a try. |
Hmm, it looks to delegate to |
agree that Download and downgrade (currently in insight) should be done in B-F but not in that PR. |
I can certainly see adding unit testing for Once this PR is agreed to work, if deemed desirable for Bio-Formats I could try to introduce |
@mtbc : sounds like a plan. |
omero.cmd.fs.OriginalMetadataRequestTest.testMetadataParsing which presumably someday gets moved with other Blitz tests to OmeroJava
In general - the metadata files are present, but with minor (major?) differences. It's hard for me to judge the implications, so maybe someone with more metadata-fu could have a look? /cc @pwalczysko The unit test runs fine. If the issues mentioned by me are to be handled in a different PR, this is OK to merge. |
How do the downloaded files differ from the I'd guess that the MIME type issue is unrelated to this PR but very likely worth at least ticketing. I wonder if the Leica issue is some Bio-Formats change or something. I'll cc @rleigh-dundee as he may have some familiarity with all this too. |
@mtbc The differences were either related to the |
Thank you, I will investigate tomorrow. |
So, the files I'll look at are,
|
FYI: I found a bug in download of pre-FS original files while reviewing another PR: #1738. Don't know if that's something related to this? |
I am comparing the |
|
which got parsed as just the first line and the other lines were ignored. I think I'd probably argue here that this was the right thing to do, unless we really should be appending following (even blank) lines onto values without any explicit quoting or line continuation hint at all? I don't know if anyone watching this PR has a strong opinion on this or if it's worth an RFE ticket. |
|
So, at this point I think I'm still happy with this PR as at least being a substantial improvement unless that awful many-line GIven that @bpindelski mentions an issue with private String commentDelimiter = "#"; String line = in.readLine();
if (line == null) break;
no++;
// strip comments
if (commentDelimiter != null) {
int comment = line.indexOf(commentDelimiter);
if (comment >= 0) line = line.substring(0, comment);
} which, given the nature of our actual input data, may well be worth a ticket. |
@will-moore: I think, probably unrelated, but thank you! |
It should be noted that the same images imported in 4.4 and upgraded, and imported in 5.0, may not have identical metadata due to various other code differences, especially in Bio-Formats. |
Filed http://trac.openmicroscopy.org.uk/ome/ticket/11684 and http://trac.openmicroscopy.org.uk/ome/ticket/11685 about the INI format issues. @bpindelski please could you file one about how to reproduce the MIME type issue you discovered? This PR at least, I think, is a significant improvement over the current state of affairs (wherein one couldn't download any metadata in OMERO 5 for images imported prior to upgrade from OMERO 4). |
@mtbc Ticket for MIME type difference opened: https://trac.openmicroscopy.org.uk/ome/ticket/11688 I also agree that this PR improves the state of the original metadata aspect. I don't have anything against merging, and massaging out the subtler bugs later on. |
Thanks, guys! |
fix #10703: download pre-FS original metadata in FS
Fixes http://trac.openmicroscopy.org.uk/ome/ticket/10703. To test,
ome/data_repo/test_images_metadata/
sql/psql/OMERO5.0DEV__6/OMERO4.4__0.sql
OriginalMetadataRequestTest.testMetadataParsing()
passes.(Lines may be re-ordered but ought still be under the correct sections.)
I first tried using
org.apache.commons.configuration.HierarchicalINIConfiguration
to parse the file but, for our kind of INI-format, it turned out to be more trouble than it was worth.--no-rebase as 5.0-specific