Main Menu

Don't understand this

Started by Germ, February 18, 2025, 04:57:19 PM

Previous topic - Next topic

Germ

Hi all,

In the thesaurus I keep my various keywords.

I ran into the following situation:

In the thesaurus i have:
Parent 1
       SubParent 1
              Keyword 1

and

Parent 2
       SubParent 2
              Keyword 2

I had a bit of a problem when Keyword 1 = Keyword 2 (for instance (butterflies|native|other and flowers|tropical|other)
When I I assign one of the 2 to a file in the Keywords panel all seems to go ok. The right key is added (exmple: butterflies|native|other). When writing the metadata to the files however (Shift-alt-s) both mentioned keys ( butterflies|native|other and flowers|tropical|other) end uyp in the keywords of my image. Unintentionally (from my point of view anyway) flowers|tropical|other is is added. Did I go wrong here is this a small glitch in the program?

Kind regards from Holland
Germ Wind


Mario

If you have the same keyword at the bottom level in your Thesaurus, you must take special care for if and how you flatten keywords in metadata.

When you make IMatch write only the bottom keywords ("other"), or each element in the keyword hierarchy as a separate keyword ("butterflies", "native", "other") and you enable the options to use the thesaurus to map keywords when files are imported (or re-imported after write-back) (see: Metadata), the thesaurus will map the keyword "other" to any matching branch in your hierarchy, because it cannot know otherwise. Check your settings in the Edit > Preferences > Metadata dialog accordingly.

Germ

Thanks for your speedy and thourough answer. I checked.
I set up an example with different keywords than described above.
When flattening the keywords are written as a full path delimited bij a |
The keyword parts if the xmp show:

<rdf:Description rdf:about=''
  <dc:subject>
  <rdf:Bag>
    <rdf:li>Onderwerp: Overige|Kasteel de Haar</rdf:li>
    <rdf:li>Onderwerp: Fauna|Vogels|IJsvogel</rdf:li>
  </rdf:Bag>
  </dc:subject>
</rdf:Description>

<rdf:Description rdf:about=''
  xmlns:lr='http://ns.adobe.com/lightroom/1.0/'>
  <lr:hierarchicalSubject>
  <rdf:Bag>
    <rdf:li>Onderwerp: Overige|Kasteel de Haar</rdf:li>
    <rdf:li>Onderwerp: Fauna|Vogels|IJsvogel</rdf:li>
  </rdf:Bag>
  </lr:hierarchicalSubject>
</rdf:Description>

When I check preferences \ metadata \ Don't replace existing hierachical keywords and write this selected file the keyword parts if the xmp show:

<rdf:Description rdf:about=''
  <dc:subject>
  <rdf:Bag>
    <rdf:li>Plaats|Haarzuilens|Kasteel de Haar</rdf:li>
    <rdf:li>Onderwerp: Fauna|Vogels|IJsvogel</rdf:li>
  </rdf:Bag>
  </dc:subject>
</rdf:Description>

<rdf:Description rdf:about=''
  xmlns:lr='http://ns.adobe.com/lightroom/1.0/'>
  <lr:hierarchicalSubject>
  <rdf:Bag>
    <rdf:li>Plaats|Haarzuilens|Kasteel de Haar</rdf:li>
    <rdf:li>Onderwerp: Fauna|Vogels|IJsvogel</rdf:li>
  </rdf:Bag>
  </lr:hierarchicalSubject>
</rdf:Description>

So pretty much the same.

When I uncheck preferences \ metadata \ Don't replace existing hierachical keywords and write this selected file the keyword parts if the xmp show:

<rdf:Description rdf:about=''
  <dc:subject>
  <rdf:Bag>
    <rdf:li>Onderwerp: Overige|Kasteel de Haar</rdf:li>
    <rdf:li>Plaats|Haarzuilens|Kasteel de Haar</rdf:li>
    <rdf:li>Onderwerp: Fauna|Vogels|IJsvogel</rdf:li>
  </rdf:Bag>
  </dc:subject>
</rdf:Description>

<rdf:Description rdf:about=''
  xmlns:lr='http://ns.adobe.com/lightroom/1.0/'>
  <lr:hierarchicalSubject>
  <rdf:Bag>
    <rdf:li>Onderwerp: Overige|Kasteel de Haar</rdf:li>
    <rdf:li>Plaats|Haarzuilens|Kasteel de Haar</rdf:li>
    <rdf:li>Onderwerp: Fauna|Vogels|IJsvogel</rdf:li>
  </rdf:Bag>
  </lr:hierarchicalSubject>
</rdf:Description>

So in this case Onderwerp: Overige|Kasteel de Haar was added as a keyword.
I checked that the .ORF file itself did not contain any keywords.
I'm still puzzled. Because the full path of the keyword was specified and yet there seems to have been added a keyword based on the leaf value only. The answer is clearly to check Don't replace existing hierachical but i do not understand the behaviour when it is not checked.
Can you help please?

Kind regards from Holland
Germ

hluxem

I think you need to uncheck the Keyword lookup in the metadata preferences. See attached screenshot.

Mario

QuoteWhen I check preferences \ metadata \ Don't replace existing hierachical keywords
This setting is only used when IMatch imports keywords. It is on by default and protects keywords already in the database when IMatch re-imports an image for some reason. It does not affect the keywords IMatch writes or flattens out.
Show us a screen shot of the Edit > Preferences > Metadata dialog.

Germ

Hi Mario,

Here is the requested screenshot.

And before you ask: both items "Kasteel de Haar" are not sysnyms (i checked)

Kind regards from Holland
Germ

Germ

Hi hluxem,

Thanks for your suggestion. However, remembering experiences in the past, I am careful with changing the default settings as they could lead to effects where I did not expect them. I keep your suggestion in the back of my head in case all else fails.

Kind regards from Holland
Germ

Mario

The settings look good.
Can you please export your thesaurus (via the Thesaurus Manager) and attach it. Also attach an image that causes this issue I can see if I can reproduce it here with your thesaurus and the image (both may be the reason for the issue you are experiencing).

Germ

How do I attach the thesaurus export in a post please? The forum site accepts only image formats.

Kind regards from Holland
Germ

Jingo

You can zip up the file(s) and the forum will accept it as well. 

Germ

#10
Hi Mario, Jingo,

Here are the requested files.
If you write back the file with "Don't replace existing hierachical keywords" checked no keywords are added.
If you write back the file with "Don't replace existing hierachical keywords" unchecked a keywords is added.

You are very helpful Jingo. Worked like a charm.

Kind regards from Holland
Germ

Mario

"Don't replace existing hierachical keywords" works on imported keywords, it does not affect which keywords are written.
Did you look at the actual keywords in the image with the ExifTool Command Processor (Use the "List Metadata" preset)?

My guess is that the extra keyword is created when IMatch re-imports the file, since the "Don't replace" option is off and IMatch re-improts the keywords from the image and performs thesaurus lookups again.

These are the keywords in your image as posted:

[IPTC]          Keywords                        : Onderwerp: Fauna|Vogels|IJsvogel, Plaats|Haarzuilens|Kasteel de Haar
[XMP-dc]        Subject                         : Onderwerp: Fauna|Vogels|IJsvogel, Plaats|Haarzuilens|Kasteel de Haar
[XMP-lr]        Hierarchical Subject            : Onderwerp: Fauna|Vogels|IJsvogel, Plaats|Haarzuilens|Kasteel de Haar

2 keywords, and in sync.

When I import the file into a database with your thesaurus, IMatch imports the two keywords in the file:

Onderwerp: Fauna|Vogels|IJsvogel
Plaats|Haarzuilens|Kasteel de Haar

Correct. Now, with the "Don't replace..." option active, I do a Shift+Ctrl+F5 > Reload Metadata. And now I have 3 keywords:

Onderwerp: Fauna|Vogels|IJsvogel
Onderwerp: Overige|Kasteel de Haar
Plaats|Haarzuilens|Kasteel de Haar

Which looks like IMatch, in this situation, uses the lowest level for the lookup and found a new keyword matching the "Kasteel de Haar" section. The initial import gets it right, but later imports (manually triggered or following a write-back) find the wrong keyword because the leaf levels match.

I will move that to bug reports, because this seems to be a bug.

Germ

Thank you Mario.
As always: great support

Kind regards from Holland
Germ