Hierarchical Keywords behavior during file copy

Started by mosdubindi1, May 26, 2025, 04:33:18 PM

Previous topic - Next topic

mosdubindi1

Hello Mario,

I've noticed a strange behavior of Hierarchical Keywords during simple file coping. Looks like it happen after IMatch update to 2025, before I havent seen it. I did a small test file for you to check. It contains 2 hierarchical keywords (count says 3, but this is separate story), which flattened into 9 XMP keywords. When I copy file into different folder, and import to IMatch without any template, it gives count 10 in hierarchical keywords (7 flattened keywords added), XMP keywords remain 9.
I use file coping for separate database and normally files should be identical in the source and target databases after coping. So far it is not big problem for me as I do further flattening for hierarchical keywords, which removes all these differences.
However if you can take a look it would be great.

Thanks in advance,
Dmitry

Mario

You copy the file how? In IMatch? Outside?
When IMatch imports a file, it maps flat keywords to hierarchical keywords. The outcome depends on the contents and format of the flat keywords (not shown), the settings you use in Edit > Preferences > Metadata (not shown) and the contents of your thesaurus (unknown). Please provide this option as a minimum.

mosdubindi1

Sorry for not providing all info. First for simplicity I did test in the same database, meaning copy of the file has been imported into different folder of the same database. Thesaurus is the same in this case. For original file 2 hierarchical keywords are used (see attached) - just 2 ticks. 

Original file keywords:

Hierarchy: 03_What|plants|asterales|asteraceae|heliopsis, 07_How|film, simulation|velvia-vivid
XMP: 03_What, plants, asterales, asteraceae, heliopsis, 07_How, film, simulation, velvia-vivid

Result of the import is different depending on Metadata tab Keyword Lookup settings:

Don't replace / Lookup are not active or Don't replace is active / Lookup is not active

Hierarchy: 03_What|plants|asterales|asteraceae|heliopsis, 07_How|film, simulation|velvia-vivid, 03_What, plants, asterales, asteraceae, 07_How, film, simulation
XMP: 03_What, plants, asterales, asteraceae, heliopsis, 07_How, film, simulation, velvia-vivid

Don't replace / Lookup are active

Hierarchy: 03_What|plants|asterales|asteraceae|heliopsis, 07_How|film, simulation|velvia-vivid, 03_What, 03_What|plants, 03_What|plantae, 03_What|plants|asterales, 03_What|plant|asterales, 03_What|plants|asterales|asteraceae, 03_What|plant|asterales|asteraceae, 07_How, 07_How|film, simulation
XMP: 03_What, plants, asterales, asteraceae, heliopsis, 07_How, film, simulation, velvia-vivid

How I copy does not matter, I try IMatch clipboard, Batch Processor, Win Explorer - the result is the same.


Mario

When you copy a file in IMatch, IMatch also copies the metadata in the database, including keywords.
If you use any other way, IMatch re-imports the metadata as it must. And when this creates new hierarchical keywords, the problem are the flat keywords. IMatch is unable to map the flat keywords into your thesaurus, thus forming new keywords.

Just look at the flat keywords you let IMatch produce and then try to find each one on the lowest level of your thesaurus. This is how flat keywords are mapped to hierarchical keywords and it it can map the flat keyword back to the full hierarchy.
IMatch looks at the leaf level of each hierarchical keyword.

When it looks for "Daytona" and it finds "Location|Beach|Daytona", it uses that to map the flat keyword into your hierarchy. It may also find "Location|Race Tracks|Daytona" and map that as well.

The default for IMatch is to write hierarchies into the flat keywords, which completely avoids this kind of issue.
When you use any other way to flatten your images, your thesaurus must be set to match.

IMatch sees these flat keywords in your configuration:

03_What
plants
asterales
asteraceae
heliopsis
07_How
film
simulation
velvia-vivid

Where should IMatch log for the flat keyword "asterales", for example?

One problem I see immediately that your hierarchical keyword contains commas:

03_What|plants|asterales|asteraceae|heliopsis, 07_How|film, simulation|velvia-vivid

and you have configured the , also as a list separator in Edit > Preferences > Metadata. This may cause issue when IMatch looks for lists in imported keywords, splitting them at the , - which makes three keywords out of one.

Using ; and , (list separators) as part of keywords is probably not a good idea, in principle. It may cause problems whenever IMatch may need to parse and split keywords, e.g. in the Keywords Panel.

mosdubindi1

Thank you Mario, I missed option of Copy-Paste file in IMatch, it works fine, however only within the same database. Also I understand keyword re-importing more clearly. I'm not sure what negative consequences it could cause, it depends on workflow, but I understand already that re-import is quite tricky point and try to avoid it whenever possible.

Don't you think to provide one more option for Keyword import, which will use different logic? For example, if keyword exists in Thesaurus hierarchy not only as a leaf, then do not create new keyword.

Mario

QuoteDon't you think to provide one more option for Keyword import, which will use different logic? For example, if keyword exists in Thesaurus hierarchy not only as a leaf, then do not create new keyword.

Feel free to add a feature request.

Your use case is pretty much worst-case, flattening keywords without hierarchies, writing each level individually. This is prone to import problems. The "protect existing keywords" option works fine for files already in the database. But when a new file comes in that has flat keywords, IMatch must import them. And when there is no match via the the thesaurus, the keyword is added "as found".

Options to ignore flat keywords without a thesaurus match, option to ignore flat keywords in IPTC and/or XMP when there are hierarchical keywords in the file, options to somehow perform different lookups in the thesaurus are all potentially things I could do. For this particular part of IMatch, to serve maybe a handful of users with this particular problem. A feature request gives other users a way to Like the request, to comment on it etc. And this tells me if a feature is useful for a large enough user group.

I generally try to make metadata handling simpler (for IMatch and users), not more complex by adding more and more features and options. Metadata handling has become so mind-bogging complicated due to all the options/switches, metadata mess produced by other software and devices, versioning with metadata propagation etc. ... - there is a complexity limit for IMatch and me.

I suggest you use the default settings for flattening keywords (writing hierarchies) to avoid all of these issues. If possible.
Avoid using common list separators like , and ; in keywords. If possible.
Use the powerful File Management features in IMatch for copying, moving, renaming and deleting files. This allows IMatch to keep the database in sync, metadata is maintained, categories are maintained etc.

mosdubindi1

Thank you again Mario, your intention to keep IMatch simple is perfectly understandable for me. I will think over the necessity of a feature request. So far my workflow is managing the issue without problem, thanks to IMatch unlimited possibilities. 

Mario

Very good. Thank you for your understanding.