Author Topic: Hierarchical Keywords: Lightroom vs Photo Mechanic  (Read 16730 times)

Offline davidgordon

  • Full Member
  • ***
  • Posts: 143
    • View Profile
    • davidgordon.co.uk
Hierarchical Keywords: Lightroom vs Photo Mechanic
« on: January 05, 2021, 02:55:35 AM »
Back in 2009 member Lars asked here about the "Strange bahaviour with the structured keywords" http://forums.camerabits.com/index.php?action=post;board=2.0

Its a question about how PM reads LR's XMP <lr:hierarchicalSubject> and then adds those hierarchical keywords to the keywords field even when those keywords already exist resulting in duplicates.

The thread ends with Kirk Baker suggesting

Quote
Quote from: Kirk Baker on 02-12-2009, 19:54:26
Having an option to leave hierarchical keywords out of the standard keywords field will solve your problem with Lightroom and people who need to have the hierarchy available to all existing applications will not use this new feature.

Everyone should be happy then, no?

Was that option ever implemented? I seem to have the same problem Lars complained about.

If I write hierarchical keywords using Lightroom they are written to the XMP  <dc:subject> and <lr:hierarchicalSubject>. Photo Mechanic reads both fields and I have my keywords and duplicates as well as the hierarchical structure in the keywords field.

I've found the Preference in IPTC/XMP "When updating XMP, add structured keywords to hierarchical keyword field only". But that doesn't appear to solve my problem which perhaps is to do with reading rather than writing?

Is it possible to round trip using hierarchical keywords with Lightroom and Photo Mechanic / Photo Mechanic Plus without polluting the keywords fields?

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 25020
    • View Profile
    • Camera Bits, Inc.
Re: Hierarchical Keywords: Lightroom vs Photo Mechanic
« Reply #1 on: January 06, 2021, 09:50:18 AM »
David,

Back in 2009 member Lars asked here about the "Strange bahaviour with the structured keywords" http://forums.camerabits.com/index.php?action=post;board=2.0

Its a question about how PM reads LR's XMP <lr:hierarchicalSubject> and then adds those hierarchical keywords to the keywords field even when those keywords already exist resulting in duplicates.

The thread ends with Kirk Baker suggesting

Quote
Quote from: Kirk Baker on 02-12-2009, 19:54:26
Having an option to leave hierarchical keywords out of the standard keywords field will solve your problem with Lightroom and people who need to have the hierarchy available to all existing applications will not use this new feature.

Everyone should be happy then, no?

Was that option ever implemented? I seem to have the same problem Lars complained about.

If I write hierarchical keywords using Lightroom they are written to the XMP  <dc:subject> and <lr:hierarchicalSubject>. Photo Mechanic reads both fields and I have my keywords and duplicates as well as the hierarchical structure in the keywords field.

I've found the Preference in IPTC/XMP "When updating XMP, add structured keywords to hierarchical keyword field only". But that doesn't appear to solve my problem which perhaps is to do with reading rather than writing?

Is it possible to round trip using hierarchical keywords with Lightroom and Photo Mechanic / Photo Mechanic Plus without polluting the keywords fields?

Can you post the XMP before it is polluted?  And post the XMP after it is polluted?  I'd also like to see a screen shot of your IPTC/XMP preferences.  Use the 'Attachments and other options' link when you're composing your reply to this message and there you'll be able to upload your files.

Thanks,

-Kirk
« Last Edit: January 06, 2021, 10:14:11 AM by Kirk Baker »

Offline davidgordon

  • Full Member
  • ***
  • Posts: 143
    • View Profile
    • davidgordon.co.uk
Re: Hierarchical Keywords: Lightroom vs Photo Mechanic
« Reply #2 on: January 07, 2021, 02:51:23 AM »
Can you post the XMP before it is polluted?

Here is a 'brand new' XMP file from an image ingested into Photo Mechanic without any metadata added.

<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="XMP Core 5.6.0">
 <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
  <rdf:Description rdf:about=""
    xmlns:photoshop="http://ns.adobe.com/photoshop/1.0/"
    xmlns:xmp="http://ns.adobe.com/xap/1.0/"
    xmlns:photomechanic="http://ns.camerabits.com/photomechanic/1.0/"
    xmlns:aux="http://ns.adobe.com/exif/1.0/aux/"
   photoshop:DateCreated="2021-01-07T08:56:19"
   xmp:CreateDate="2021-01-07T08:56:19"
   xmp:Rating="0"
   photomechanic:ColorClass="0"
   photomechanic:Tagged="False"
   photomechanic:Prefs="0:0:0:005960"
   photomechanic:PMVersion="PM6"
   aux:ImageNumber="5960"/>
 </rdf:RDF>
</x:xmpmeta>


And after adding some (very limited) metadata including a single keyword using PM.

x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="XMP Core 5.6.0">
 <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
  <rdf:Description rdf:about=""
    xmlns:xmpRights="http://ns.adobe.com/xap/1.0/rights/"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:photoshop="http://ns.adobe.com/photoshop/1.0/"
    xmlns:xmp="http://ns.adobe.com/xap/1.0/"
    xmlns:photomechanic="http://ns.camerabits.com/photomechanic/1.0/"
    xmlns:aux="http://ns.adobe.com/exif/1.0/aux/"
   xmpRights:Marked="True"
   photoshop:DateCreated="2021-01-07T08:56:19"
   xmp:CreateDate="2021-01-07T08:56:19"
   xmp:Rating="0"
   photomechanic:ColorClass="0"
   photomechanic:Tagged="False"
   photomechanic:Prefs="0:0:0:005960"
   photomechanic:PMVersion="PM6"
   aux:ImageNumber="5960">
   <dc:subject>
    <rdf:Bag>
     <rdf:li>Photo Mechanic</rdf:li>
    </rdf:Bag>
   </dc:subject>
   <dc:creator>
    <rdf:Seq>
     <rdf:li>David Gordon</rdf:li>
    </rdf:Seq>
   </dc:creator>
   <dc:rights>
    <rdf:Alt>
     <rdf:li xml:lang="x-default">© David Gordon</rdf:li>
    </rdf:Alt>
   </dc:rights>
  </rdf:Description>
 </rdf:RDF>
</x:xmpmeta>


After a trip to Lightroom and adding some sample hierarchical keywords (edited for brevity to remove irrelevant camera EXIF)

<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.6-c140 79.160451, 2017/05/06-01:08:21        ">
 <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
  <rdf:Description rdf:about=""
    xmlns:xmpRights="http://ns.adobe.com/xap/1.0/rights/"
    xmlns:photoshop="http://ns.adobe.com/photoshop/1.0/"
    xmlns:xmp="http://ns.adobe.com/xap/1.0/"
    xmlns:photomechanic="http://ns.camerabits.com/photomechanic/1.0/"
    xmlns:aux="http://ns.adobe.com/exif/1.0/aux/"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:tiff="http://ns.adobe.com/tiff/1.0/"
    xmlns:exif="http://ns.adobe.com/exif/1.0/"
    xmlns:exifEX="http://cipa.jp/exif/1.0/"
    xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/"
    xmlns:stEvt="http://ns.adobe.com/xap/1.0/sType/ResourceEvent#"
    xmlns:crd="http://ns.adobe.com/camera-raw-defaults/1.0/"
    xmlns:crs="http://ns.adobe.com/camera-raw-settings/1.0/"
    xmlns:lr="http://ns.adobe.com/lightroom/1.0/"
   xmpRights:Marked="True"
   photoshop:DateCreated="2021-01-07T08:56:19"
   <dc:creator>
    <rdf:Seq>
     <rdf:li>David Gordon</rdf:li>
    </rdf:Seq>
   </dc:creator>
   <dc:rights>
    <rdf:Alt>
     <rdf:li xml:lang="x-default">© David Gordon</rdf:li>
    </rdf:Alt>
   </dc:rights>
   <dc:subject>
    <rdf:Bag>
     <rdf:li>Photo Mechanic</rdf:li>
     <rdf:li>alpha</rdf:li>
     <rdf:li>another</rdf:li>
     <rdf:li>beta</rdf:li>
     <rdf:li>better</rdf:li>
     <rdf:li>charlie</rdf:li>
     <rdf:li>cloud</rdf:li>
    </rdf:Bag>
   </dc:subject>
   <xmpMM:History>
    <rdf:Seq>
     <rdf:li
      stEvt:action="saved"
      stEvt:instanceID="xmp.iid:da0b69cf-0c4f-49ef-8226-44c31dce7a98"
      stEvt:when="2021-01-07T09:18:11Z"
      stEvt:softwareAgent="Adobe Photoshop Lightroom Classic 10.1 (Macintosh)"
      stEvt:changed="/metadata"/>
    </rdf:Seq>
   </xmpMM:History>
   <lr:hierarchicalSubject>
    <rdf:Bag>
     <rdf:li>Photo Mechanic</rdf:li>
     <rdf:li>[A]|alpha</rdf:li>
     <rdf:li>[A]|another</rdf:li>
     <rdf:li>|beta</rdf:li>
     <rdf:li>|better</rdf:li>
     <rdf:li>[C]|charlie</rdf:li>
     <rdf:li>[C]|cloud</rdf:li>
    </rdf:Bag>
   </lr:hierarchicalSubject>
  </rdf:Description>
 </rdf:RDF>
</x:xmpmeta>


Lightroom has an option to show the 'containing keywords' or only those which will be exported to a derivative file. Photo Mechanic appears not to have that option and shows keywords from both the <dc:subject> and <lr:hierarchicalSubject> in the IPTC info keywords field. Lightroom and Photoshop will both 'hide' the hierarchical keywords in a file saved from Photo Mechanic, but PM itself always appears to show them.

I use the word "polluting" meaning PM is showing duplicate keywords in its IPTC keyword section. Maybe the solution is only ever keyword using PM, but that's not really practical for me. Or maybe I'm not using the keywording tools in PM because I don't understand them well enough.

Thanks




Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 25020
    • View Profile
    • Camera Bits, Inc.
Re: Hierarchical Keywords: Lightroom vs Photo Mechanic
« Reply #3 on: January 07, 2021, 08:27:41 AM »
David,

Thanks for the samples.  Photo Mechanic only has one keywords field for display.  Your metadata has both hierarchical keywords and flat keywords.  PM is showing both sets in the same field.  There is no duplication that I can see in your examples.

Is there some other step in PM that then causes the flat keywords to be written into the hierarchical keywords or for the hierarchical keywords to be written into the flat keywords?

-Kirk

Offline davidgordon

  • Full Member
  • ***
  • Posts: 143
    • View Profile
    • davidgordon.co.uk
Re: Hierarchical Keywords: Lightroom vs Photo Mechanic
« Reply #4 on: January 08, 2021, 01:23:31 AM »
Kirk

Thanks for looking.

Photo Mechanic only has one keywords field for display.

So does my question/problem boil down to: why does Photo Mechanic display the XMP <lr:hierarchicalSubject>?

When adding hierarchical keywords using Lightroom these are written into two XMP spaces, <dc:subject> and <lr:hierarchicalSubject>. The <dc:subject> contains 'flattened' keywords, the <lr:hierarchicalSubject> has the full path including keywords which are not keywords, those marked not to be written on export. For example I - and others who have posted the same issue here http://forums.camerabits.com/index.php?topic=13878.0 - use alphabetical headers to help organise my keywords by nesting them under "{A}", "{B}", "{C}" and so on.

If I add the simple keyword "Random" using either Lightroom or PM it will be written to <dc:subject> only. However if using Lightroom I add that keyword and it is 'nested' under "{R}" it will be written to <dc:subject> and _in addition_ its full path "{R} | Random" will be written to <lr:hierarchicalSubject>.

Quote
There is no duplication that I can see in your examples.

Look at the Photo Mechanic keyword field. The keywords "alpha', "another", "beta", "better", "charlie" and "cloud" each appear twice. Not to mention the duplicates "{A}", "{B}", "{C}" and the pipe characters. Lightroom (which also has only a single keyword display field) does not duplicate the keywords in the way PM does. It shows the keywords only from <dc:subject> unless specifically asked to display "Keywords and Containing Keywords" in which case it displays the hierarchy - but only showing a single entry for each keyword and containing keyword.

Quote
Is there some other step in PM that then causes the flat keywords to be written into the hierarchical keywords or for the hierarchical keywords to be written into the flat keywords?

Its not a writing issue, its a reading issue! What business does Photo Mechanic have reading <lr:hierarchicalSubject>? Lightroom has already written the keywords into <dc:subject>, that's all we need to see. As far as I understand when using PM's Structured Keywords Panel, keywords are written 'flat' into <dc:subject>. Correct me if I'm wrong but PM's structured are not hierarchical keywords. Another PM user can't see my keyword structure in the same way another Lightroom user can see its hierarchical ones.

I don't know/understand why Photo Mechanic displays the contents of <lr:hierarchicalSubject>. I think it doesn't need to read that space but if it does, give me an option _not_ to display it in the keywords field.

Many Thanks

PS I've had to substitute square for curly brackets above as seems to mess the formatting and explains why some omissions  occur in the previous post's XMP examples. <-- proving my point, theres a missing square bracket B square bracket here!

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 25020
    • View Profile
    • Camera Bits, Inc.
Re: Hierarchical Keywords: Lightroom vs Photo Mechanic
« Reply #5 on: January 08, 2021, 08:51:21 AM »
David,

The keywords are not duplicated.

"alpha" and the keyword path "[A] | alpha" are two different keywords.  There is no duplication here.

Why do we show the hierarchical keywords with the flat keywords?  Because there is only one keywords field.  How would you edit them otherwise or even see them if we didn't show them together?  Sounds like the only solution that would be satisfactory for you would be to have a separate field for hierarchical keywords.  But even then, it's garbage in/garbage out.  It would still show it as "[A] | alpha" since that's the value in the metadata.

If the '[A]' is purely for organizational purposes in Lr, one wonders why they output it in the metadata?  Why doesn't Lr just output 'alpha' to the hierarchical keywords?

As for your issue with open-bracket B close-bracket causing it to disappear and turn on bolding, that's how the forums work.  If you want your text to be left alone, you can use the 'code' formatting button (#) and you can create/paste any text and it will be left alone.

-Kirk

Offline Graham1

  • Full Member
  • ***
  • Posts: 148
    • View Profile
Re: Hierarchical Keywords: Lightroom vs Photo Mechanic
« Reply #6 on: January 08, 2021, 01:53:29 PM »
Not really sure which thread to post this on, since a couple are overlapping, but here goes.

PM's Search and Replace supports grep.  I have been playing around with this.  David seems to want only the flat keywords from Lightroom's output.  Try this:

((?<comma>\|(.*?),)|(?<endChar>\|(.*)\b)|(?<sepContent>\|(.*?)\|)|(?<sqBracket>\[(.*?)\]))

The above string is the search string.  Make sure grep is selected.  Replace by "," (i.e. a single comma, without the quotes, is the replace field).  The result should be the just flat keywords without separators.  If, as I do, you have categories in square brackets, this removes the contents of square brackets (and the brackets themselves).  I assume that if you replace (in the <sqBracket> section) \[ and \[ by \{ and \} this would work equally well for curly brackets, but I have not tested it.  This can be applied to Search and Replace across multiple images, not only one at a time.

The ?<endChar> etc. are simply annotations to help me remember what each part does and these names/sections can be altered or omitted as required.

I think this should do what David wants.  I guess the grep string could be reversed to leave only the hierarchical keywords, but I have not worked out how to do this, and do not need it, so I am afraid I cannot offer the grep string needed to achieve this.

In another related thread, there is a debate as to whether it is PM or Adobe not sticking to standards.  I think this is an impossible job for PM.  As I understand it, for .DNG files metadata should be embedded in the .DNG file, not stored in a separate .XMP file, although Capture One takes the latter approach.  But if you look at the latest Camera RAW plugin preferences, you will see that there is a user selectable option to embed metadata or store it in .XMP sidecars.  If Adobe is giving users the option to write metadata to .XMP in a non-standard conforming way, or embed it according to standards, as they think fit, what hope is there for third party software suppliers to write code that works both in accordance with standards and the possible output from Adobe programmes?

Graham

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 25020
    • View Profile
    • Camera Bits, Inc.
Re: Hierarchical Keywords: Lightroom vs Photo Mechanic
« Reply #7 on: January 08, 2021, 01:58:37 PM »
Not really sure which thread to post this on, since a couple are overlapping, but here goes.

PM's Search and Replace supports grep.  I have been playing around with this.  David seems to want only the flat keywords from Lightroom's output.  Try this:

((?<comma>\|(.*?),)|(?<endChar>\|(.*)\b)|(?<sepContent>\|(.*?)\|)|(?<sqBracket>\[(.*?)\]))

The above string is the search string.  Make sure grep is selected.  Replace by "," (i.e. a single comma, without the quotes, is the replace field).  The result should be the just flat keywords without separators.  If, as I do, you have categories in square brackets, this removes the contents of square brackets (and the brackets themselves).  I assume that if you replace (in the <sqBracket> section) \[ and \[ by \{ and \} this would work equally well for curly brackets, but I have not tested it.  This can be applied to Search and Replace across multiple images, not only one at a time.

The ?<endChar> etc. are simply annotations to help me remember what each part does and these names/sections can be altered or omitted as required.

I think this should do what David wants.  I guess the grep string could be reversed to leave only the hierarchical keywords, but I have not worked out how to do this, and do not need it, so I am afraid I cannot offer the grep string needed to achieve this.

If you do this, then the hierarchical keywords will be lost.

-Kirk

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 25020
    • View Profile
    • Camera Bits, Inc.
Re: Hierarchical Keywords: Lightroom vs Photo Mechanic
« Reply #8 on: January 08, 2021, 02:05:25 PM »
Graham,

In another related thread, there is a debate as to whether it is PM or Adobe not sticking to standards.  I think this is an impossible job for PM.  As I understand it, for .DNG files metadata should be embedded in the .DNG file, not stored in a separate .XMP file, although Capture One takes the latter approach.  But if you look at the latest Camera RAW plugin preferences, you will see that there is a user selectable option to embed metadata or store it in .XMP sidecars.  If Adobe is giving users the option to write metadata to .XMP in a non-standard conforming way, or embed it according to standards, as they think fit, what hope is there for third party software suppliers to write code that works both in accordance with standards and the possible output from Adobe programmes?

The real difficulty comes when in the same folder you have the original RAW file, the DNG produced from the RAW file, and an XMP sidecar file which needs to be associated with both image files.  Let's say you want to rename the RAW file and leave the DNG alone.  The XMP sidecar file will be renamed to match the new name of the RAW file and now the DNG loses its metadata.  Worse, let's say you want to delete the RAW file and keep the DNG.  The XMP sidecar file will be deleted with the RAW file and the DNG permanently loses its metadata with no hope of retrieval unless you have a backup.

This is a horrible trend for images that are openly documented and are expected to embed metadata (actually part of the specification!) to later expect XMP sidecar files to be associated with them.  Not only can it cause data loss as I described above, but it can cause data synchronization issues in that the embedded XMP may not match the XMP sidecar file.

Bad idea all around.

-Kirk

Offline Graham1

  • Full Member
  • ***
  • Posts: 148
    • View Profile
Re: Hierarchical Keywords: Lightroom vs Photo Mechanic
« Reply #9 on: January 08, 2021, 07:25:21 PM »
Quote
If you do this, then the hierarchical keywords will be lost.

This is the intention.  David's issue, as I understand it, is that PM reads two sources of keywords from files that have been exported from LR and displays both together.  The effect of the grep Search and Replace string is to remove the keywords read from <lr:hierarchicalSubject>, leaving only those contained in <dc:subject>.

The use of grep in this way of course eliminates one or other of the sets of keywords, rather than simply only displaying one set, but if (as I do) one needs final jpegs with only flat keywords, this seems to me to be a workable solution to apply to processed files exported from LR. 

My workflow involves simply archiving my final exported jpeg files without adding them to a catalogue in either PM or LR, so the destructive nature of losing one set or the other of the keywords is not an issue for me.  In another thread I mentioned that I could not copy a separator, but instead this pasted as a comma.  This was indeed user error on my part (apologies for wasting Kirk's time on this), caused by having a clipboard utility running in the background which converts separators to commas in copied text.  I have been using this to copy mixed hierarchical and flat keywords, pasting them back in the Metadata (IPTC) Info panel for each exported jpeg to eliminate the versions between separators, but this could only be done on an image-by-image basis.  The grep Search and Replace solution is much easier and can be applied to batches of images.

Someone who knows more about grep than I do (which is not difficult) could presumably easily negate the string to produce the opposite effect, but I have not been able to do so in a way which robustly retains only keywords read from <lr:hierarchicalSubject> by eliminating only the flat keywords in <dc:subject>.  I do not need to do this and so have not persevered in trying to get this to work, but if someone knows how to do this and could post the complementary grep string, it would be interesting to see this.  Then one could easily have two saved Search and Replace strings, the output from one of which would emulate <dc:subject> only, the other <lr:hierarchicalSubject> only. 

Graham

Offline davidgordon

  • Full Member
  • ***
  • Posts: 143
    • View Profile
    • davidgordon.co.uk
Re: Hierarchical Keywords: Lightroom vs Photo Mechanic
« Reply #10 on: January 11, 2021, 07:15:22 AM »
Kirk

What I'm looking for is an ability - an option - for Photo Mechanic not to display the contents of the XMP <lr:hierarchicalSubject> space.

As I've described and shown in screenshots, seeing the contents of two keyword spaces confuses me. And not just me, other people seem to have the same issue and are attempting to create a complex way out using grep. Carl Seibert mentions this "glitch" in a piece here https://www.carlseibert.com/keywording-in-photo-mechanic-part-2/ (scroll down to "A Lightroom glitch"). He describes it as "harmless", I disagree. It's certainly preventing me from transitioning to PM+ as my main DAM.

Frankly, I don't think Photo  Mechanic has any business reading Adobe's private <lr:hierarchicalSubject> let alone displaying the contents.

I'll try to explain...

"alpha" and the keyword path "[A] | alpha" are two different keywords.  There is no duplication here.

Okay, I accept the above example is two different keywords. In Photo Mechanic. But that's only because PM is reading two different XMP spaces and combining them.

But actually they are not two different keywords. "alpha" is a keyword and "[A] | alpha" is not. It is a hierarchical list written by Lightroom to a 'private' XMP space for use by Adobe applications.

Quote
How would you edit them otherwise or even see them if we didn't show them together?
I shouldn't be editing my Lightroom Hierarchical Keywords using Photo Mechanic. LR and PM have two different - incompatible - methods of creating and editing this type of controlled vocabulary. If I edit the individual contents of <lr:hierarchicalSubject> in PM by removing the pipe "|" for example it turns a Lightroom hierarchical list into a flat keyword and disrupts the keywords list in Lightroom.

But in any case, there's absolutely no reason to, the keywords exist in the <dc:subject> and that's where they can be edited via PM. So why do we even need to see the contents of <lr:hierarchicalSubject>? Every _keyword_ which exists in <lr:hierarchicalSubject> also exists in <dc:subject>. PM only needs to read and display <dc:subject>.

To reiterate, when I add a keyword which is part of a hierarchy using Lightroom it is written to the usual keywords space <dc:subject> for other applications to read. Additionally that word is written to a private Adobe space as a hierarchy to enable other Adobe applications to recreate that hierarchy.

Quote
If the '[A]' is purely for organizational purposes in Lr, one wonders why they output it in the metadata?
So the hierarchical keywords list travels with the image and can move between catalogues and so other Adobe applications such as Bridge can read, write and edit them. The same is true of the develop settings which are also written to the XMP. Adobe Camera Raw can use these settings but not other raw file converters such as Capture One.

Quote
Why doesn't Lr just output 'alpha' to the hierarchical keywords?
Because it uses the XMP keyword space <dc:subject> to do that.

Quote
Sounds like the only solution that would be satisfactory for you would be to have a separate field for hierarchical keywords. But even then, it's garbage in/garbage out.  It would still show it as "[A] | alpha" since that's the value in the metadata.
No, I'm suggesting an option not to view the contents of <lr:hierarchicalSubject>.  Lightroom only has a single keywords field but (as shown in the screengrabs I posted above) the option to display either only the keywords or the keywords and the hierarchy (or containing keywords as they describe them there). And, if you look again at the screenshot, Lightroom doesn't show the _exact_ value of the metadata, it strips out the pipes and doesn't duplicate the [A] etc.

Photo Mechanic can't use Lightroom's hierarchical scheme, Structured Keywords are different, Photo Mechanic doesn't need to view this XMP space, there's nothing there for PM which isn't already in the usual keywords <dc:subject>.

I'll leave it for you!

Thanks.

Offline davidgordon

  • Full Member
  • ***
  • Posts: 143
    • View Profile
    • davidgordon.co.uk
Re: Hierarchical Keywords: Lightroom vs Photo Mechanic
« Reply #11 on: January 11, 2021, 07:16:46 AM »
David's issue, as I understand it, is that PM reads two sources of keywords from files that have been exported from LR and displays both together.
No, not quite. Not with exported images. Raw files where the metadata is being written to an XMP sidecar file and subsequently read by Photo Mechanic.

Quote
The effect of the grep Search and Replace string is to remove the keywords read from <lr:hierarchicalSubject>, leaving only those contained in <dc:subject>.
I'm suggesting _not_ reading <lr:hierarchicalSubject> in the first place is the solution.

Quote
The use of grep in this way of course eliminates one or other of the sets of keywords, rather than simply only displaying one set, but if (as I do) one needs final jpegs with only flat keywords, this seems to me to be a workable solution to apply to processed files exported from LR.

Doesn't work for me as you've now deleted my LR hierarchical keyword structure!

Quote
a way which robustly retains only keywords read from <lr:hierarchicalSubject> by eliminating only the flat keywords in <dc:subject>.

I think this is a wrong thing to be doing. Hopefully explanations in my reply to Kirk make sense and you agree!

Thanks

Offline davidgordon

  • Full Member
  • ***
  • Posts: 143
    • View Profile
    • davidgordon.co.uk
Re: Hierarchical Keywords: Lightroom vs Photo Mechanic
« Reply #12 on: January 12, 2021, 09:41:36 AM »
Frankly, I don't think Photo  Mechanic has any business reading Adobe's private <lr:hierarchicalSubject> let alone displaying the contents.

So I'm wrong here. Photo Mechanic Plus is reading the hierarchical keywords and displaying them in the keyword browser list. Pretty much as Lightroom does.

Super!

But then PM+ also lists the individual keywords. Not as confusing as having then in the IPTC keywords field.

Still say an option to show / hide what become duplicates would be useful.

Offline Graham1

  • Full Member
  • ***
  • Posts: 148
    • View Profile
Re: Hierarchical Keywords: Lightroom vs Photo Mechanic
« Reply #13 on: January 13, 2021, 11:38:42 PM »
Quote
Still say an option to show / hide what become duplicates would be useful.

Yes, the separate display (and ability to copy/edit) the contents of <dc:subject> and <lr:hierarchicalSubject> would be wonderful, but I cannot see it happening because I think it would need a significant interface change, for which I would imagine there would not be sufficient demand.  I will put in a feature request, but will not hold my breath.

Graham

Offline davidgordon

  • Full Member
  • ***
  • Posts: 143
    • View Profile
    • davidgordon.co.uk
Re: Hierarchical Keywords: Lightroom vs Photo Mechanic
« Reply #14 on: January 13, 2021, 11:58:08 PM »

Yes, the separate display (and ability to copy/edit) the contents of <dc:subject> and <lr:hierarchicalSubject> would be wonderful, but I cannot see it happening because I think it would need a significant interface change

I had in mind a tick / check box in the Preferences to enable / disable viewing <lr:hierarchicalSubject> in the Keywords. So no interface change for my proposal. Your needs may vary!

Meanwhile I'm looking at ditching the whole hierarchical keywords thing: I'm not sure why I use them other than that's how Lightroom kind of makes you. I'm not sure I need them. I'm not sure why people who use them need them either.