Extend thesaurus synonyms to universal links

Started by lbo, March 10, 2021, 04:51:34 PM

Previous topic - Next topic


The synonym entries in the thesaurus can be a great time saver. Yet they are limited to the same hierarchy branch.

This means, you can define Ort|Deutschland|München|Stachus as a synonym for Ort|Deutschland|München|Karlsplatz, but you can't have Region|Bayern as a synonym for it.

Extending the thesaurus to allow links to different branches in the hierarchy would be useful in many cases.

This way, we could have "material|asphalt" and "material|concrete" added if  "Infrastructure|Transportation|Road" is added from the thesaurus. Or Region|Ruhrgebiet if Ort|Deutschland|Essen is added.

Of course, such links shouldn't be called "synonyms" anymore, although much of the existing code and user interface could be used for them.

For a decision whether to add a specific linked keyword or not, I can imagine two approaches:

  • Add all and delete unwanted keywords in the keyword panel. That's how synonyms are handled currently.
  • Don't add linked keyword automatically but only show ("offer") them (e.g. in the existing synonyms box). Clicking on a linked keyword adds it.

A flag whether a linked keyword is added automatically or only on request would be a further improvement. For example, the Essen - Ruhrgebiet relation applies always, but the Road has asphalt or concrete surface, so usually these should not be applied both.



This sounds quite familiar to a thought I had a few years ago regarding the ability to add multiple synonyms along a tree branch when a keyword is added (ie: the keyword and its synonym as well as the branch keywords and their synonyms).



Thanks for the pointer to the earlier discussions.

Yes, it is similar. One difference is that the links can point to different branches of the thesaurus hierarchy.

An interesting point of your attempt is to link not only from the leaf entries. For the use case discussed here, this seems to be an interesting option to check also intermediate nodes.

For example, regardless whether "Infrastructure|transportation|road|highway" or "Infrastructure|transportation|road|main road"is added, the user should get a suggestion to add also the material (concrete, asphalt).

And meanwhile, I think that the "add and delete" approach (1. in my OP) is less suitable than the "suggest" approach (2. in my OP). Just as you wrote 2019 "show all ... and then let you add".

The natural way seems to be an extension to Suggestions tab in the keyword panel. The user could define links between keywords to be shown there.


One of the more complex parts of IMatch is the mapping of keywords via the the thesaurus during import and write-back.
Mapping keywords back and forth between hierarchical keywords and flat keywords using lookups in the thesaurus. This was really hard to get correct, especially with the added complexity of synonyms.

Starting to add "links" to keywords which point to arbitrary other places and levels in the thesaurus will massively increase the complexity.
Consider your links pointing here and there in relation to IMatch trying to map flat keywords into hierarchical keywords, and vice-versa.

Also, the @Keywords category hierarchy must be considered as well. Many users assign keywords from the category panel using @Keywords. Not via the Keywords panel.
@Keywords is based on the actual keywords in your files. It has no links to the thesaurus. It does not know that assigning a keyword may need to assign other, non-synonym keywords as well. And neither has @Keywords access to the thesaurus currently to perform look-ups or figuring out additional keywords to add.

And there are most likely many other things I would have to analyze and figure out. That means a lot of changes and a lot of potential for creating bugs for fringe cases.
Just speaking from the top of my head.

Very complicated. Probably several weeks of analysis and development. Testing and documentation.
And we already have this functionality in Favorites. Maybe not as 'comfortable' as bolting this onto the thesaurus, but very workable and robust.

I do this for years and I have less than 50 Splasher Favorites which do 80% of my keyword assignments. Finely colored and arranged in two Favorite groups. Keyboard shortcuts for all frequently used combinations.
Other 15% are done automatically via reverse geo-coding and metadata templates. And maybe 5% is manual assignments for "new" keywords.

To even begin analyzing this for feasibility, I would need a really substantial number of users requesting this.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook


it seems you missed that I wrote about suggestions in the keywords panel in my last posting.

No changes in category handling, no reverse mapping, no automatic adding of keywords.

Just suggestions (reminders) based on relations defined by the user.



Missed this too today
Quote from: lbo on March 10, 2021, 04:51:34 PM

This way, we could have "material|asphalt" and "material|concrete" added if  "Infrastructure|Transportation|Road" is added from the thesaurus. Or Region|Ruhrgebiet if Ort|Deutschland|Essen is added.

Important is that it automatically adds Region|Ruhrgebiet if you add Essen, but not Essen if you type Ruhrgebiet (as it would be done with synonyms)

My point is only that if you add "This keyword" from the Thesaurus, it should automatically add also "That" keyword. It is only a link to another keyword. And if that keyword does not exist anymore, do not add it.


Quote from: voronwe on March 30, 2021, 11:49:45 AM
Important is that it automatically adds Region|Ruhrgebiet if you add Essen, but not Essen if you type Ruhrgebiet (as it would be done with synonyms)

In the mean, I think that keywords shouldn't be added automatically but only suggested.

Maybe the existing "Suggestions" tab in the keyword panel is the right place.


According to https://www.photools.com/community/index.php?topic=11400.0 the automatic addition has already been added to IMatch 2021 last year.

I stand by my proposal that a suggestion would be more flexible.