Keyword behavior

Started by rienvanham, April 26, 2025, 07:56:59 PM

Previous topic - Next topic

rienvanham

Hello Mario,

I have a small problem and I can't figure out what I'm doing wrong / what's happening:

1: I have a photo with 8 hierarchical and 17 flat keywords (see attachment 1);
2: I edit the photo with Photoshop;
3: iMatch re-inports the photo and 8 hierarchical and 8 flat keywords are present (see attachment 2);

It seems that all parent-tags (from the hierarchical keywords) are gone.

Thanks on forehand,

Rien


Mario

Check the image with Metadata Analyst.
Look at the actual keywords in the image with the ExifTool Command Processor.
These are the first steps.

Did you write back in IMatch before opening the file in Ps.?
Do you have any metadata protection enabled?
What are your settings on Edit menu > Preferences > Metadata?

rienvanham

Hi Mario,

It is oké now. In Metadata the setting "Write path elements" was unchecked. Don't know why this happened.

Thanks for your suggestions and have a nice sunday!

Rien.

Mario

Be extra careful when you flatten keywords and also read/write metadata with several applications.
Different applications have different levels of support for keywords. It's easy to mess up keywords when applications only work with IPTC:keywords or XMP-dc:Subject...

When IMatch imports flat keywords, it uses your thesaurus to figure out the corresponding hierarchical keyword. If the thesaurus does not match, a keyword like "beach" will end up on the top-level, instead of, for example, WHERE|location|beach.

rienvanham

Thanks for your tips Mario!

rienvanham

Hi Mario,

I'm trying to correct all issues for the keyword issue and playing around with data-driven categories.

I made an instance with the next variable:

{File.MD.XMP::Lightroom\hierarchicalSubject\HierarchicalSubject\0|count|equals{File.MD.XMP::dc\subject\Subject\0|count,YES,NO,true}

but that don't give an expected result.

Can you please help me?

Thanks in advance!
Rien.

Mario

Your syntax is all wrong. There can only be one | per variable, and equals does not even exist. 
Did you ask an AI?

As per IMatch variables help, count is used as follows:

count:Boolean

{File.MD.XMP::dc\subject\Subject\0|count:true}
----
{File.MD.hierarchicalkeywords|count:true}
----

You want to compare the number of hierarchical keywords with the number of flat keywords in XMP-dc:Subject, right?
For comparting numbers, we use numcomp:

numcomp:Op,Value,TV,FV,Mode

numcomp:eq,a,b,YES,NO

{File.MD.hierarchicalkeywords|numcomp:eq,
{File.MD.hierarchicalkeywords|count:true},{File.MD.XMP::dc\subject\Subject\0|count:true},YES,NO}

We compare the two counts with eq (equal) and this gives us YES or NO, depending on whether they are equal or not.

rienvanham

Hi Mario,

It is just the laziness of me. Tried it for an hour or so and then thought: Mario will give me the right answer. And yes, in no time I got the right solution.

Thanks again Mario for this excellent service you always give.


rienvanham

#8
Hi Mario,

Unfortunately your solution doesn't work right. I only got "YES" for all photo's. If I use the line in Vartoy I got:

Photo with 11 hierarchical keywords and 11 flat keywords: YES (see attachment)
Photo with 6 hierarchical keywords and 17 flat keywords: YES (where it should say: NO, see attachment)

Thanks in advance,
Rien.

Mario

#9
I did not test it since I don't have images with that problem.
What have you tried to fix this so far? What does count:true return for images with this problem?

The error is quite obvious.

{File.MD.hierarchicalkeywords|count:true;numcomp:eq,
{File.MD.XMP::dc\subject\Subject\0|count:true},YES,NO}

rienvanham

Hi Mario,

I looked in the manual and got a bit confused:
it states: numcomp:Op,Value,TV,FV,Mode

and looked at an example:
{File.Rating|numcomp:eq,1,true,false}

which seems to be 4 parts; where part 3 and 4 return the results.

If I look at your solution:
 {File.MD.hierarchicalkeywords|numcomp:eq,
{File.MD.hierarchicalkeywords|count:true},{File.MD.XMP::dc\subject\Subject\0|count:true},YES,NO} 

I count 5 parts.

So I tried a lot of combinations without succes.

I tried {File.MD.hierarchicalkeywords|count:true|numcomp:eq, .....
(I thought that we have to compare the count) but, as you state, only one | is allowed.

I also tried:
{File.MD.XMP::dc\subject\Subject\0|numcomp:eq,{File.MD.hierarchicalkeywords|count:true},{File.MD.XMP::dc\subject\Subject\0|count:true},YES,NO}
and
other combinations, without succes.



Mario

Did you try my solution from above?

rienvanham

Yes and it works!! Thank you very much Mario!

Stenis

Quote from: Mario on April 27, 2025, 10:59:34 AMBe extra careful when you flatten keywords and also read/write metadata with several applications.
Different applications have different levels of support for keywords. It's easy to mess up keywords when applications only work with IPTC:keywords or XMP-dc:Subject...

When IMatch imports flat keywords, it uses your thesaurus to figure out the corresponding hierarchical keyword. If the thesaurus does not match, a keyword like "beach" will end up on the top-level, instead of, for example, WHERE|location|beach.


My experience is the total opposit. To finally abandon the use of hierarchies among the keywords might have been one of my best decissions ever. After that automatic synch of keyword data between all my applications has been a non-issue. Today it works seamlessly between Photolab, PhotoMechanic, Capture One and XnView and even with iMatch. Before it didn't even work with just two of them.

As a former user of DXO Photolab and PhotoMechanic I realized using hierarchies was a really bad idea with those applications and that was on top of the terrible job to maintain those structures manually in the keyword lists.

The parallell use of the IPTC Keyword tag the Dublin Core Subject and later also Adobes proprietary tag is just made to fuck up interchanges. To keep it simple is a good rule and hierarchies are not one of them.

With that said iMatch is the only example of application that I know about where maintenance of hierarchies really works and is automated when using them with AI in Autotagger but as soon as you start to integrate with other applications absolutely anything can happen when data gets forked here and then and you will find yourself without any control at all.

Mario

This problem is somewhat remedied if you consider the DAM as the final stage in your process and also set/finalize metadata in it. There is usually no need to fiddle with metadata in other applications once a file is in the archived stage and done.

Adding/changing metadata in multiple applications is often a well of problems. PM does only legacy IPTC. Many only update metadata that co-exists in EXIF, GPS, legacy IPTC and XMP in all available metadata formats. Which causes the data to drift and get out of sync. Some silently strip legacy IPTC, damage EXIF maker notes when updating images and many, many other horrors.

Using hierarchical keywords is optional.
Doing it all in "flat" works, if you have a very tightly controlled and small keyword vocabulary.

But when you end up with a list of 500 or 1,000 or more keywords, all on one level and without any kind of organization, things can become ugly. Many IMatch users work with large taxonomies, where hierarchies are essential, because the number of keywords is so huge. Many other applications for hierarchical keywords, both in professional and amateur scenarios.

There is a reason Adobe introduced hierarchical keywords in their end-user and corporate DAM products.
The IPTC also came up with a keyword hierarchy, but it is so complex and convoluted that it never gained traction. Sigh.

If you, as so many users, add and edit metadata only in IMatch, you avoid all problems caused by editing metadata in multiple applications with often sketchy support for metadata standards. The metadata produced by IMatch is the richest and most standard-compliant ExifTool and I can come up with.

Keeping things simple, like using only flat keywords, is of course always a good advice. When it works for your workflow.

Pro Tip: when you edit metadata in so multiple applications, make a copy of the file after writing back in IMatch and then compare the IMatch version with the image containing metadata modified by other software using IMatch's Metadata Compare & Sync tool.

Users often get nasty surprises when they see which metadata has been stripped or de-synchronized mangled by their other software.

Stenis

Bidirectional updates is a very bad idea. I have never done that because the tools in for example converters for metadata maintenance are so poor that it is a pain. First PM and now iMatch have been my only metadata "sources". The other applications are just metadata "consumers". For example XnView has qualities that most other applications don´t have since it gives a very good overview of both EXIF, IPTC and XMP.

Both PM and iMatch integrated with for exemple Photolab gives certain scaling qualities RAW-converters do not have in general. They also makes future migrations easier than with Photolab which lacks basic tolls for that. Since Photolab works directly towards the folders and files in the filesystem without import or ingestion functions it gets really slow with big subdirectories say 1000 files and in cases like that it is much more effective to select smaller batches from iMatch or PM to make it more efficient.

If I had started today I could have chosen hierarchies as well because now iMatch has solved the keyword maintenance in a totally diffrent way than PM can. There is only one thing I haven´t figure out that bothers me a bit and that is a "search and Replace"-function I gat used to with PM.

There is also a totally different thing in organizations that have stardardized on a "controlled hierachic vocabulry" like they for example do in many Cultural Heritage organisations and museums. I have seen that myself in museums. Then these questions are not an issue really.

Mario


Quote"search and Replace"-function I gat used to with PM.
Maybe try the The Metadata Mechanic?
It can search and replace, among other things.

Also note the advanced features of the Metadata Panel which can add/replace/remove tag data in any number of selected files.

Stenis

OK thanks I´ll try that :-)

I suspected there were ways but could not figure it out myself.

Mario

Quote from: Stenis on May 06, 2025, 02:20:47 PMOK thanks I´ll try that :-)

I suspected there were ways but could not figure it out myself.
That's what this community is for. Or the AI of your choice. I just tried, for fun, Microsoft Copilot.
Here is my question and Copilot's answer. I find this quite impressive :)

Image1.jpg

Stenis

Thanks! This might be the best and most rewarding community to visit that I have ever experienced. Coming from the really hopeless DXO Forums it is almost a cultural shock. There people have to help themselves because DXO almost never interact themselves in their forums. I think DXO is the real loser there and causes themselves a lot of unnecessary bad will. How efficient is not a community that both has a great vendor expertise and a lot of knowledgeable users in symbiosis with the support?

I have used Coopilot a lot too and like it. It has been most helpful for simpler tasks but a user dialog takes us far further normally.

I was first stupid enough to activate the map-functions at Googles AI studio and got completely puzzled by Googles all 30+ Map-related API:s that I just doesn´t really need I found out by later reading your very useful help texts. Instead of 30+ I just needed four :-)

When activating a lot of API:s I really didn´t need they also signed me up for their Cloud Storage that I definitely NOT want either. Then I couldn´t find out myself how to get rid of that Cloud Storage but I got some help from OpenAI :-)

There is so much un educational debris at Google that it is really hard to handle, I think. In that respect I think OpenAI is much better.