Thesaurus hierarchy update via txt file

Started by mosdubindi1, April 02, 2024, 11:59:07 AM

Previous topic - Next topic

mosdubindi1

Hello Mario,

I'm facing problem with updating Thesaurus hierarchy via txt file import. I'm not sure what is the reason as sometimes update is working, sometimes not. I did various tests and cannot understand why in one cases hierarchy has been updated and not updated in another. For sure it does not depend on number of levels of hierarchy.

For example I've updated standard IMatch hierarchy first time on 3rd level (seagull) and it works. Then I was trying to update next level (silver) and it does not work.

IMatch log file in debug mode is attached.

Best regards,
Dmitry

Mario

This feature is not really designed to do cumulative updates. It is designed to fill your thesaurus initially and once, e.g. from a Lightroom export or a commercial/free controlled vocabulary. From the screen shot it seems you merge the data and that can have many pitfalls. Spelling, case, missing levels or skipped levels and whatnot.

Before I can do anything I would need

a) your current thesaurus in IMatch standard format
b) the text file you are trying to import.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

mosdubindi1

Thank you Mario, you are right, I'm trying to use import for adding keywords to the existing hierarchy in mass. For me it could be very helpful feature.

Attached pls. find thesaurus of the test database, which I'm using to play with the import and the uploading file.

Mario

QuoteI'm trying to use import for adding keywords to the existing hierarchy in mass.
Why. Usually you do one import to setup your thesaurus and then manage all new keywords and changes in the Thesaurus Manager.

I will look at your import file when there is time.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

mosdubindi1

For me to update Thesaurus via file is faster than manually in the Thesaurus Manager. It is difficult to set up full Thesaurus from the beginning and until Thesaurus reaches good level of completeness, there is always need for mass update.

PandDLong


I have had the same experience over time.  My use of the thesaurus changes as I use it more and as I add more files into iMatch.

What I do when I want to update the thesaurus using a file is:

1. I export the current Thesaurus from iMatch to a txt file
2. I edit that file to add, remove, change
3. I import the updated Txt file to replace the one in iMatch

I have done this a few times without issue.

Michael

Mario

Note that changes done via this detour don't support the Thesaurus applying changes done to it to the database.
Do you know that the Thesaurus Manager supports drag & drop, copy/cut/paste, that it has commands to add multiple sub-elements in one go etc? 
I have never considered anything other than the Thesaurus Manager to manage my thesaurus.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

rolandgifford

Quote from: PandDLong on April 02, 2024, 08:02:27 PM2. I edit that file to add, remove, change
3. I import the updated Txt file to replace the one in iMatch


2a Delete the 'tree' from the Thesaurus that I am replacing

rolandgifford

Quote from: Mario on April 02, 2024, 08:31:09 PMI have never considered anything other than the Thesaurus Manager to manage my thesaurus.

I make significant changes to one 'tree' of my Thesaurus (IOC bird taxonomy) twice a year and use the text import method for that.

I use the Thesaurus manager for everything else

PandDLong

Quote from: Mario on April 02, 2024, 08:31:09 PMNote that changes done via this detour don't support the Thesaurus applying changes done to it to the database.
Do you know that the Thesaurus Manager supports drag & drop, copy/cut/paste, that it has commands to add multiple sub-elements in one go etc?
I have never considered anything other than the Thesaurus Manager to manage my thesaurus.

Yes, your recent updates have made using the Thesaurus Manager more compelling to use.    I did make some recent changes (moving a sub-tree and a rename in the hierarchy - not a leaf) and I used the Thesaurus to do those changes.  It didn't affect a significant number of files, but it was useful to have the database updated automatically.


One of the other reasons I have used the export/import in the past was to be able to visually see the whole taxonomy my thesaurus was supporting through using a print-out and mapping out changes.  Perhaps I won't need to do another mass update... just an occasional export.

Michael

Mario

This issue has been resolved for the next release.
The problem was caused by a combination of factors.

Your thesaurus has two entries for "Seagull" on the same level but under different parents:
+ 02_Who|animal|bird|seagull
+ Animals & Pets|Birds|Seagull

when dealing with already existing thesaurus elements during import, IMatch made the mistake to use a "too broad" method to search for an existing element when inserting an imported element resolved into "duplicate name".
This caused the import routine to find the wrong Seagull and insert Silver below that one instead of the correct one.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

mosdubindi1

Hello Mario,

Thank you very much.

BR,
Dmitry