Efficiently deleting a Hierarchical Keyword Branch

Started by Erik, December 13, 2017, 01:17:16 AM

Previous topic - Next topic

Erik

Database is currently 45,000 files (not much compared to some people but not small either).

Back in the IMatch 3 days, I had category tree called "Where" that ended up in keywords on the upgrade to IM 5. That "Where" tree was manually filled (qualitative and grouped place name and location).  During the switch to IM5, I wanted to automate things more and started filling the locations automatically from lat and long. I then created a metadata preset to write the XMP location data to a "Location" keyword tree automatically (wanted location info in keywords for web sharing).

Now here is my "problem". 

I have about 25,000 files that have the following two types of keywords (along with other keywords):

Location|Country|State or Province|City|Location
Where|Country|State or Province|City|Location

When files have these two, the leafs are not necessarily equal due to the subjective nature of how I filled "Where".

Question: Is there an easy way to delete the "Where" keyword from each file considering the rest of the hierarchical keyword will vary for each file? 

I regret I didn't do this a while ago. If I still had IMatch 5, I would write a script to iterate through the files and remove the "Where" keyword for each file.  Perhaps not the best way, but what I know.  I can't wrap my head around the new apps and scripting in IMatch 2017, so I would like to avoid it unless it is my only option. 

I know I could do it brute force by manually cycling through all the Where sub-categories in @keywords and deleting the keyword. I don't think believe deleting a "category" under @keywords works although the helpfile doesn't say it won't work. I think I would essentially have to delete the keywords one at a time.

I'm not entirely sure if there would be a way of doing it through the ExifTool command-line / panel.  I used that a lot previously to clean up some old metadata issues I had, but I don't think I ever got that specific with it, and I am not sure I could.

Am I missing something obvious?  Or is an app / script the only real obvious option.  I guess one option would be to go back to IMatch 5 and write a script there to do it. 

This is all a one time operation as well, which might make the going back to IMatch 5 not a horrible option.

Thanks.




Erik

Apparently deleting the category under @keywords does work. I tested it out on a small tree. That's a relief.

This will be a lifesaver.  I won't fear a cleanup of my hierarchy and thesaurus much anymore.  I need a good reorg.

Mario

IMatch applies changes done to @Keywords to the actual keywords in your files. This is one of the things that makes the @Keywords category hierarchy so special and useful. I recommend you read the documentation of @Keywords to see how it can support your keyword cleanup task.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Erik

Quote from: Mario on December 13, 2017, 09:08:32 AM
IMatch applies changes done to @Keywords to the actual keywords in your files. This is one of the things that makes the @Keywords category hierarchy so special and useful. I recommend you read the documentation of @Keywords to see how it can support your keyword cleanup task.

I did read it, multiple times.  I'm not sure it says that one could delete a category from @keywords (nor what would happen if one did).  If it did, I missed it multiple times.  Admittedly, I don't think it said not to do it either.  This led me to search the forum, and I was led back to a lot of discussions about the limitations to @keywords that were based on the early releases of IM5.  I also recalled (without searching to confirm), a lot of improvements made to @keywords, so I gave deleting a keyword a shot, and of course it worked.  My memory may be fuzzy too.  Most of my memories are around not moving keywords around using the @keywords tree, which I know was addressed later on. 

Anyway, the help file is not terribly clear.  And maybe my lack of clarity was self induced because of the weird (in a good way) hybrid form the @keywords categories take between normal categories and data driven categories.  I think of them as data driven categories with all the same limitations, even when I know they aren't as limited.