last category used as keyword

Started by JoeHolzwurm, August 27, 2014, 02:07:56 PM

Previous topic - Next topic

JoeHolzwurm

In IMatch 3 I attached my photos to a lot categories which are defined in a big hierarchical tree.
With a script I wrote the last category as keyword into the corresponding IPTC field.
Example:
Category= family.grandparents.paul
keyword=paul

My script is no longer working in IMatch 5.
Is there a faster way in IMatch 5 which I did not find until now?

Mario

1. IMatch automatically copies keywords into IPTC and XMP keywords. See the IMatch help for details. Search for @Keywords. There are many features in IMatch linked with this-

2. Manually copying categories into IPTC metadata is not recommended. It not only creates extra work, but can also mess up the IPTC->XMP keyword import. Make sure you understand everything that is linked to IPTC and XMP keywords, Metadata Working Group compliance etc. before you write scripts or otherwise manually copy keywords. You are working against IMatch in this case, and this may lead to problems.

3. If you really need to manually copy categories into IPTC metadata (which I doubt, because this usually means that your setup is wrong for your workflow) you can do it with a Metadata Template.

4. Note that classic (IIM) IPTC metadata has been declared as legacy by the IPTC committee. The IPTC Core namespace in XMP should be used. You should not create legacy IPTC data for new files.

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

JoeHolzwurm

I do not want to copy keywords to the old IPTC fields anymore but I want to have the keywords in the corresponding XMP field.
The way to get the last part of my category as keyword was a good and fast solution.

I do not want to work against IMatch, I am searching for the right way in IMatch but I want to use my categories and I want to have the keywords in XMP without double work.
Attaching the photos to categories and then inserting keywords in the XMP keyword field would be double work.

Ferdinand

Can I express what Mario said slightly differently.

First, V3.5 and V5 are opposite in how they treat XMP.  In V3.6 you input IPTC and Imatch populated XMP automatically.  In V5 you input XMP and IMatch populates IPTC automatically (for those file formats that it is allowed to write IPTC to).  Perhaps you already understand this.

Second, @keywords have been designed to do exactly what you want.  What many of us have done is to migrate some of our categories to @Keywords and then remove those categories.  @Keywords appear in IMatch 5 like categories, but in fact they exist in your file.  So @Keywords is really a data-driven category on the keywords in your files, but with some special properties that other data-driven categories don't have.

Moreover, you can configure IMatch so that it only writes the last node (the leaf in the keyword branch) into the flat keywords fields (IPTC & XMP) just as you did in V3.6, while writing the hierarchical keyword (the old category) into the hierarchical keywords XMP field.  I.e. doing exactly what you want. 

And doing so without duplicated effort  and resorting to scripts.  @Keywords are a central part of V5.

And by using @Keywords you will be able to use the thesaurus, which is a REAL time saver, once you've set it up correctly.

This is explained in the help file.  Which is why you were advised to read it.

JoeHolzwurm

#4
Hello Ferdinand,

thank you for your answer. I will think about that and perhaps I have to change my workflow.
When I started with IM3 several years ago I thought a lot about a workflow and how to use which type of metadata and categories and now with IM5 everything which was good is wrong.
There is a lot of work in my category tree and the first sentence in the help file for IM5 is:
"IMatch's unique categories are one of the main concepts in IMatch. Using them will make it much easier for you to manage your image and file collection."
But you tell me that I should no longer use the categories but the hierarchical keywords.
I will think about that but please try to understand that this is hard to understand why these things change.

The help file explains a lot but not everything.


EDIT: I had a look at my @keywords and this is actually a long useless list of keywords.

Richard

Quoteplease try to understand that this is hard to understand why these things change.

If things never change then there can never be improvements.

Quote"Experience teaches, that men are often so much governed by what they are accustomed to see and practice, that the simplest and most obvious improvements ... are adopted with hesitation, reluctance, and slow gradations." --Alexander Hamilton, Report on Manufactures, 1791

Mario

QuoteI will think about that but please try to understand that this is hard to understand why these things change.

Nothing has changed. IMatch categories work like before. But with IMatch 5 you gained something: The special @Keywords category. @Keywords makes all the various schemes to somehow store/persist IMatch categories in image files (e.g. using a script to write IMatch categories to IPTC keywords) superfluous. @Keywords fuses IMatch categories and hierarchical keywords stored in your image files. @Keywords mirrors the hierarchical keywords stored in your files. If you change keywords with the Keyword Panel (or in another application) @Keywords automatically updates. When you add/remove/rename categories under @Keywords, assign images etc., these changes will be copied to the keywords stored in your files. Automatically.

Get yourself acquainted with this new concept. Then migrate the categories you want to mirror in your image files under @Keywords. IMatch will then automatically update the keywords in your files.

If you don't like all this, don't use @Keywords. If @Keywords shows only "a long useless list of keywords", you have not used hierarchical keywords in your files, you have not setup an thesaurus in IMatch to properly categorize your keywords, and this can't be helped. If you have only ever written the leaf element of your category hierarchy into your files, there is no hierarchy to extract and to re-build. Users who used one of the scripts to write IMatch categories using dot-notation can use the automatic import in IMatch, and their categories are automatically transformed in proper hierarchical @Keywords. In your case you have only used the lead level, so this cannot work.

But the database converter has migrated your existing categories and you can continue to work as before. Doing it all manually is extra work of course. If you still want to manually write your categories to IPTC or other metadata, you can do this easily with a Metadata Template. No script required. But using @Keywords will of course be much easier.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

JoeHolzwurm

Hello Mario,

thank you for your endurance. I really want to understand it and change my system but I do not know how to do that without loosing information.

You are right that I do not have hierarchical keywords in my files but I have this structure in my categories.
If I understand that correctly I have to:
- Delete all existing keywords in all image.
- Import the categories of each image into the keyword field.
IM5 automatically creates the @keyword tree from these keywords.

How should I do that? Can you please help me to find the functions /scripts?

How do I get the hierarchical categories into the thesaurus for the future work?

Ferdinand

I agree with the idea, that change can't be avoided.  I find it tiresome as well sometimes, and I hate change just for the sake of it.  But IMHO the changes in IMatch 5 were long overdue, bring it into line with other applications and enable a much higher level of interoperability, esp with Abobe applications.  It will require some effort and planning, but it's a once-off and those of us that have been through it are glad that we did, because life is so much better now.  It will be worth it.

As for how to do this, I am in the process of helping my brother through the exact same process.  If you can wait then I may write a how-to.

I did this migration myself using a script I wrote to do it.  Mario says that you don't need a script in IMatch 5, rather you use a metadata template.  That may be true for simple workflows, but I'm not so sure about more complex ones using Group and Exclude.  I'm about to ask some questions.

Stay tuned.

JoeHolzwurm

Hi Ferdinand,

it is not urgent for me and so I can wait for some help from you or someone else.

JoeHolzwurm

I still search for a possibility to copy the categories into the hierarchical keywords to change my workflow.
I started to work with metadata templates and had the idea to copy the categories with a template into the field for the hierarchical keywords but I don't find a possibility to select the categories as source.
Is there a possibility to do that?

Ferdinand

#11
Note:  From IMatch 5.2.6 this becomes a lot simpler  There's no need to write to XMP::dc\Subject in a metadata template.  If you write to the XMP::Lightroom\HierarchicalSubject field then IMatch will use your metadata preferences to fill out the flat keywords automatically.  I will try to rewrite this post as a FAQ.




I have done a little work on this, but I haven't yet done this in a full production run, so I suggest that you test this before you use it on all your files.

STANDARD CASE

If you want to write the Where category branch to keywords then you could use the following metadata template:

In XMP::Lightroom\HierarchicalSubject write {File.Categories.Direct|Filter:Where}
in XMP::dc\Subject write {File.Categories.Direct|Filter:Where;level:leaf}

This assumes that you only want the leaf node ("Montmartre" in the examples below) in flat keywords.  For IMatch to like this and not want to write all the other nodes to flat keywords after you have applied the metadata template you will need to have the following options unchecked in metadata preferences:  (i) Write hierarchical keywords (ii) Write path elements.

If you want to write some of the path elements ("France" and "Paris" in the examples below) to flat keywords then the second line in brown above becomes a lot more complex.  It may be simpler just to apply the template and let IMatch sort this out in a second round of write-backs.  In effect, use the Exclude case below.

You may also want to import the category tree into the thesaurus.  See below for how to do that, although if you don't use Group or Exclude then you could just populate the thesaurus from the data in the files. 

GROUP CASE

It is not uncommon for people who use categories like "Where" to want to mark this top node as Group.  So that if you have the category "Where|France|Paris|Montmartre" as a category then only "France|Paris|Montmartre" is written as a keyword, although the thesaurus shows "Where|France|Paris|Montmartre".  So "Where" is just an organisational convenience in the thesaurus.  It won't even show in @Keywords.  The template to do this is:

In XMP::Lightroom\HierarchicalSubject write {File.Categories.Direct|Filter:Where;replace:Where|==}
in XMP::dc\Subject write {File.Categories.Direct|Filter:Where;level:leaf}

If you do this, then before you do it you would be well advised to export this category branch using the export function, import it into the thesaurus and mark "
Where" as a Group node.  If you don't do this then IMatch won't recognise what has happen and may well want to start setting a whole series of write-backs, after you have applied the metadata template.

EXCLUDE CASE

There is also the option to mark "Where" as an Excluded node, instead of Group.  If you do this then almost certainly you're writing more than just the leaf node (e.g. "Montmartre") into flat keywords.  From my experiments it's going to be hard to give a general template to use in this case.  What I would do is first export and import the category branch into the thesarus, mark the nodes that you want excluded as Exclude, then run just this line as a metadata template:

In XMP::Lightroom\HierarchicalSubject write {File.Categories.Direct|Filter:Where}

and then let IMatch write out the matching keywords in a second round write-back.

SCRIPT APPROACH

If you've got one of the more complex cases, e.g. Exclude, and you want to avoid multiple rounds of write-backs, you can use my cats to keywords script.  Mario will say that it isn't needed, you can use metadata templates in IMatch 5, and while that's correct, it can make life slightly easier in certain instances.  But it takes some planning to use effectively.

JoeHolzwurm

#12
Hi Ferdinand,

it's such easy. I do not want to write flat keywords. I want the same hierarchy of the categories in the hierarchical keywords. With the line "{File.Categories.Direct}" everything is working as I expected. I did not find this line in the help file but now it works (tested with some photos) and I will try to change a bigger amount of files.

How could I have found the tag for the categories in the help file? Is there a list of these tags which I did not find until now?

Thanks for help.

Ferdinand

I think I found it in the help file on the Variables page.  There is section "List of File Variables" and it's in there.  There are also sections on formatting and filtering, but they don't apply to your case.

I'm not sure that you can prevent IMatch writing something to the flat keywords field.  I just rechecked and I can't find a way.  I may be wrong, and if there is a way, I'd be interested in knowing.  If I am right, then you may want to control what it writes there.  The leaf option is the simplest, and to get only that I think you need to uncheck those metadata options I mentioned above - (i) Write hierarchical keywords (ii) Write path elements.