Hierarchical Keywords: Removing "flat" items from tag... easy way?

Started by Jingo, February 20, 2020, 07:04:56 PM

Previous topic - Next topic

Jingo

Hi Mario and group... I am going through my @Keywords category and realize I have a very large mix (mess) of flat and hierarchical keywords listed.  For example: @Keywords->Hawk  along with @Keywords->Animals->Birds->Hawk and @Keywords->Animals->Birds->Raptors->Red-Tailed Hawk.

My images seem to also contain a mix of either just hierarchical (@Keywords->Animals->Bird->Hawk) and/or Hierarchical + Flag (Animals->Bird->Hawk, Animals, Bird, Hawk) or just flat (Animals, Bird, Hawk)... as mentioned, a bit of a mess.

So, I've been going through and doing some keyword panel deletes, adds, category drag/drops and category panel assigns... but, I was wondering if there was a better/easier way to get rid of all flat keywords just from the Hierarchical Keyword field and/or replace them with the correct hierarchical keywords?

Before I think about an APP to do so (or just keep manually going through them)... wanted to check here first.  The goal is to remove flat keywords and assign images to the correct hierarchical version..  I can then further refine, define and clean up the hierarchy as needed (ie: merge/change  Animals->Bird->Hawk  with Animals->Birds->Raptors->Red-Tailed Hawk).

Thanks - Andy.

Jingo

Hmm.. seems like I could possibly use the Metadata Mechanic to perform a RegEx search and replace for keywords that do not contain a "|" symbol.. that should remove the static items but won't search and add their hierarchical equiv (if it exists).. so perhaps a custom app might be more useful?

Mario

Not sure what you attempt do to...

I understand you have flat keywords in your files which do not stem from hierarchical keywords?
Or which have been created differently?

When you use the "Propagate keywords again" in the Keyword Panel (Gear button drop-down menu) IMatch copies the hierarchical keywords using your current flattening rules into the flat XMP and IPTC keywords. Is this not what you want to do?

Manually Propagating Keywords
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Jingo

Here is an example:



As you can see, I have both the correct hierarchical keyword: Animals|Bird|Rooster... but I also have some flat keywords: Animals and Bird that I would like to remove. 

The Propagate keywords will correct the images that have flat keywords in the XMP keywords records if all the keywords are hierarchical.. but not the listed keywords that are not hierarchical as in my example.  This is just left over mess from earlier keywording and software changes over the years... I've ignored it long enough and now it is time to clean house.

Bri Wit

This happens to me too. What I do is select a problem flat keyword in the Categories>@keywords view. I then select all files and drag them onto the proper leaf of hierarchical keywords. This corrects the problem. Just repeat until all the keywords that don't show the correct hierarchy show a count of 0 and then delete. I also check the thesaurus and delete any incorrect keywords there. I don't have any problem keywords at the moment to test, so maybe try one image instead of all to make sure my memory didn't miss something.

I haven't taken the time to track down the exact steps that cause this. I'm guessing at some point in the chain of apps used to process a photo, the keywords aren't written correctly when the file is saved.

Mario

Typical reasons for "unwanted" flat keywords:

Thesaurus (old or invalid entries)
Edit > Preferences > Metadata: Settings which flatten keywords and which cannot be mapped back to hierarchical keywords via the thesaurus on re-import.

These are the things I would check.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Jingo

Thx all... I'll continue to just manually adjust these files like Bri Wit suggested.. unless I feel ambitious and want to write an APP   :P


photophart

Jingo, Just so I'm sure I understand it correctly, the Keyword Stripper only acts on the items in the scope, right?
Thanx Mark

Jingo

Hi Mark - yes.. only the SELECTED keywords are stripped.  If you have 200 items in the scope but only 2 are selected, only those 2 items are stripped.  Please let me know if you run into any issues... or have any feature requests!  Please use with caution as always....  ;D