Keywords from categories

Started by Aubrey, May 13, 2015, 10:13:17 AM

Previous topic - Next topic

Aubrey

I am in the process of writing keywords from categories, but I am facing some issues.
Note:
On each time I make the try I remove previously generated keywords with the delete key.

On applying the following the metadata template
{File.Categories.Direct}

Keywords are generated:
What|Nature|Minerals|Cavansite; Where|Europe|UK|London|Natural History Museum

I would like to remove "What" and "Where"

I apply the variable
{File.Categories.Direct|filter:Where}
Now I get:
Where|Europe|UK|London|Natural History Museum
(missing the second category and "Where" still appears)

I also tried
{File.Categories.Direct|Filter:Where}  (Upper case F for filter)
This is syntax of Ferdinand's message FAQ:
https://www.photools.com/community/index.php?topic=3232.msg21440#msg21440

Same result as lower case f

I also investigated:
{File.Categories.Direct|Filter:Where}
{File.Categories.Direct|Filter:What}

Same result as with {File.Categories.Direct|Filter:Where}

I have tried

{File.Categories.Direct|filter:Where;replace:Where|==}
{File.Categories.Direct|filter:What;replace:What|==}

This kind of works, but is missing the semicolon separator and therefore does not parse correctly in @keywords
Europe|UK|London|Natural History Museum
Nature|Minerals|Cavansite

Suggestions please....

Aubrey.

Mario

#1
Please double-check the documentation of the filter to understand what it does. It does not remove segments from the category path, it allows you to select parts of your category hierarchy. To remove something, use the replace function, for example. To replace Where with an empty string => remove Where.

Please note that IMatch offers the @Keywords category hierarchy which automatically maps between categories and keywords. Copying other categories to keywords will duplicate these categories in @Keywords as well. Keep that in mind. Also, make sure that you don't break your hierarchical schema when you copy categories into keywords, and what you copy is not in-line with your hierarchical keyword setup you use for keywords and @Keywords. Don't shoot yourself in the foot, producing duplicate entries for the same keyword at different levels of @Keywords.

Example: If you have WHERE|location|city|london in @Keywords, don't create a new keyword location|city|london because this creates a second entry in @Keywords, and your files will end up with two london entries most likely.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Ferdinand

[Note:  it's been quite some time since I wrote that, so my memory is a little vague.]

As Mario wrote, the filter part was just to limit the keywords to be written to that category branch.  I assume that you don't want to write all categories to keywords.

It's the "replace" part of the metadata template that removes "Where" from the category names as they are being written as keywords.

I don't recall trying to do two category branches at a time, such as "What" and "Where".  I don't know whether or not that's possible.  I did one at a time.  So first I filtered on Where and did the Where replace and then the same for What.  Maybe you can do two at a time.  You'll have to read the help and experiment.

Aubrey

Mario, Ferdinand,
Thank you for your clarification.
As I want to build hierarchical keywords I will use most of the categories.

Now that I have a better understanding of the difference between filter and replace I have written the metadata as:
{File.Categories.Direct|replace:Where|==;replace:What|==;replace:Where|==;replace:Who|==;replace:Why|==;}

This appears to be working.

Thank you,
Aubrey.