hierarchical keywords in synonyms not appearing.

Started by Aubrey, April 11, 2018, 09:05:39 AM

Previous topic - Next topic

Aubrey

I cannot get the correct hierarchical keyword structure saved for synonyms.

I select an image and the associated keyword (input.jpg) All is fine.

When I write back the metadata the synonym has had the hierarchy stripped off the keyword. (result.jpg)
You can see that the Latin name for the brown pelican has lost its hierarchy.

In the Thesaurus Manager the default is selected (thesaurus.jpg):
Exclude in flat keywords: No
Group Level: No
Use sub-elements: No

What am I doing wrong?

Thanks,
Aubrey.

Mario

Which settings do you use under Edit > Preferences > Metadata for flattening your keywords?

Synonyms are not a concept that is part of XMP or IPTC. Synonyms only exist in your thesaurus. Once you assign them, they become regular keywords. And are written as such.
After writing the keywords, IMatch re-imports the metadata, mapping flat keywords back into the database, applying whatever rules you use.

First check:

When you write back a file, make sure the Output Panel is open. In the ExifTool tab you can see which data IMatch is writing, including each keyword. This tells you if all keywords are written as you think they are. When the keywords are written correctly but some keywords vanish during re-import, it's your mapping settings (flat to hierarchical) which cause the issue. Or mismatched keywords already in your file...

Second check:

Look at the keywords in your image using the ExifTool Command Processor and the "All Keywords" preset. Your keywords need to be in-synch between all standards, depending on your thesaurus settings and the mapping you make IMatch perform during write-back and read. Yes, this is complicated but the default settings in IMatch usually work just out fo the box, provided that the metadata in your images is OK and valid.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Aubrey

Thank you for your fast response. I have now checked items you suggested.
Quote from: Mario on April 11, 2018, 09:18:10 AM
Synonyms are not a concept that is part of XMP or IPTC. Synonyms only exist in your thesaurus. Once you assign them, they become regular keywords. And are written as such.
Makes sense.

Quote from: Mario on April 11, 2018, 09:18:10 AM
Which settings do you use under Edit > Preferences > Metadata for flattening your keywords?

Keyword export:
Ticked: Write hierarchical keywords

Keyword Lookup:
Ticked: Lookup keywords via thesaurus
Ticked: Also assign synonyms

Quote from: Mario on April 11, 2018, 09:18:10 AM
Second check:

Look at the keywords in your image using the ExifTool Command Processor and the "All Keywords" preset. Your keywords need to be in-synch between all standards, depending on your thesaurus settings and the mapping you make IMatch perform during write-back and read. Yes, this is complicated but the default settings in IMatch usually work just out fo the box, provided that the metadata in your images is OK and valid.

I have applied ECP command "Delete all metadata", so not to have any interference from existing IPTC or XMP data.
I deleted all keywords, and checked nothing was there from ECP

When I check the output after ticking the keyword, the only items written back to the xmp are hierarchical:
--Exif:rating
-@
C:\Program Files\photools.com\imatch6\arg_files\iptc2xmp.args
-@
C:\Program Files\photools.com\imatch6\arg_files\gps2xmp.args
-sep

-XMP-lr:HierarchicalSubject=
-XMP-dc:Subject=
-XMP-lr:HierarchicalSubject=~What|Nature|Birds|[PELECANIFORMES]|[Pelicans]|Brown Pelican
-XMP-lr:HierarchicalSubject=~What|Nature|Birds|[PELECANIFORMES]|[Pelicans]|Pelecanus occidentalis
-XMP-dc:Subject=~What|Nature|Birds|[PELECANIFORMES]|[Pelicans]|Brown Pelican
-XMP-dc:Subject=~What|Nature|Birds|[PELECANIFORMES]|[Pelicans]|Pelecanus occidentalis
-XMP:CreatorTool=photools.com IMatch 17.14.0.2 (Windows)

-xmp:InstanceID=xmp.iid:01fb1683-0814-429a-af45-183683927acc

-XMP:MetadataDate=now


However, the pencil appears for another write back, on this write back the hierarchical synonym keyword is replaced by the flat keyword (i.e., the Latin name).

A solution:
In metadata panel, I set "Keyword Import" to
Ticked: Don't replace existing hierarchical keywords

Now the synonym is saved as hierarchical; there is no request for a second write back (i.e., yellow pencil)

This was not what I was expecting. It means I have to delete the standard hierarchical keyword, click again on the item on the keyword panel. If I don't delete the standard hierarchical keyword then of course it will appear twice, as I have selected "not to replace existing hierarchical keywords"

Aubrey.


Mario

The typical cause (at least in all cases I know of) or the write-back pen reappearing after a write-back is a problem with synchronizing keywords. When IMatch re-imports keywords after thew write-back it maps the flat keywords found via your thesaurus to hierarchical keywords, applying the keyword import settings etc. When this produces "new" keywords or maybe some other change in hierarchical keywords, the file is set back to pending write-back.

it id easy to shot yourself in your own foot by fiddling too much with the keyword mapping, thesaurus, group and exclusion levels etc. Very hard to diagnose remotely. Best you take notes about under which conditions which keywords in your setup disappear or who up in other parts of your hierarchy, then trace the source of the problem back from there.

Your output looks OK to me. IMatch writes two hierarchical keywords:

What|Nature|Birds|[PELECANIFORMES]|[Pelicans]|Brown Pelican
What|Nature|Birds|[PELECANIFORMES]|[Pelicans]|Pelecanus occidentalis

and two flat keywords, also with the full hierarchy, as per your settings:

What|Nature|Birds|[PELECANIFORMES]|[Pelicans]|Brown Pelican
What|Nature|Birds|[PELECANIFORMES]|[Pelicans]|Pelecanus occidentalis

You are using [] in your keywords (unusual) why is that?
This may cause issues with other applications which use [] to determine groups or exclusions...
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Aubrey

Quote from: Mario on April 11, 2018, 12:16:25 PM
The typical cause (at least in all cases I know of) or the write-back pen reappearing after a write-back is a problem with synchronizing keywords.
Yes, I agree, usually clearing IPTC and LR hierarchical keywords solves write back issues

Quote from: Mario on April 11, 2018, 12:16:25 PM

it is easy to shot yourself in your own foot by fiddling too much with the keyword mapping, thesaurus, group and exclusion levels etc. Very hard to diagnose remotely. Best you take notes about under which conditions which keywords in your setup disappear or who up in other parts of your hierarchy, then trace the source of the problem back from there.

Agreed, hence I try to stay with defaults, especially given all the headaches with metadata.

Quote from: Mario on April 11, 2018, 12:16:25 PM
You are using [] in your keywords (unusual) why is that?
This may cause issues with other applications which use [] to determine groups or exclusions...

These have come from bird 2.0, a controlled vocabulary (free-controlled-vocabularies-imatch points to this)
I think that the idea is that these would be "Group Level" keywords.

I don't think that this is an issue as I set up a test:
~where|Europe (standard)
~where|tempeurope (synonym)

and the keywords stored were: ~where|Europe;tempeurope

so there was the same issue, synonym hierarchy did not show up.

I'm reasonably happy working with:
Ticked: Don't replace existing hierarchical keywords

Thank you for your contribution.
Aubrey.

Mario

[ and ] are used by import files from Lr. They indicate group levels. The thesaurus import in IMatch detects these and makes the keywords group levels. And then removes the [] from the keyword.
Since your keywords still contain [] there seems to be a problem with your data...?
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Aubrey

#6
I've tested a couple of files. As usual you are correct! The issue seems to disappear when I remove  [ ].

I'm going to export, edit and re-import the thesaurus.

I'll update on the result.

Nope, I was mistaken, removing the [] does not help.

When:
Ticked: Don't replace existing hierarchical keywords

All is OK.

If I remove the tick after writing back and crtl-shift F5 everything is still OK.

I think there is some gremlin in my database, I'll get the keywords cleaned up and then see if the issue is still present when new files are added. I'm now using DxO rather than LR, this may help my situation.


Thanks,
Aubrey.

Mario

I will look into this the next time I have an open slot.
Use the settings as you have now because this seems to work.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Aubrey

Well I think it must be something in my setup rather than the software. There must be many users using synonyms for birds, animals plants etc. in their databases (perhaps not necessarily photo databases).

Before you spend time I need to create a new database and do some further tests.

I'd rather you worked on IMatch 2018!

Aubrey.

Mario

This mapping in both directions, with or without synonyms, the many options which control how keywords are mapping on export and import + the thesaurus settings create dozens of potential code paths. There  is always a chance that something is not covered or fails due to some obscure combination of parameters. I will check this as soon as I find some time. Currently deep into other things.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook