OK. After much cogitation, here are my ramblings.
The first thing that strikes me as wrong is the mixing of the keyword “manager”, with which we can add, remove and arrange keywords from the “dictionary”, with the panel for assigning, deleting, etc of keywords for a selected image.
This is nothing short of confusing for a lot of users and can/does lead to all sorts of problems.
Let’s start with @freixas first hierarchy A | B | C.
In my software (which is compatible with most other software, I manage my hierarchies in a separate manager dialog so, for that hierarchy, what I get is…
Choosing that hierarchy in the main image window looks like this…
… and, once the selection has been accepted, like this…
This represents the contents of the dc:subject
tag.
There is no explicit display of the hierarchy but it is recorded internally for writing to the lr:hierarchicalSubject
tag.
The resulting XMP (either in an image file or an XMP sidecar, looks like this…
<dc:subject>
<rdf:Bag>
<rdf:li>A</rdf:li>
<rdf:li>B</rdf:li>
<rdf:li>C</rdf:li>
</rdf:Bag>
</dc:subject>
…
<lr:hierarchicalSubject>
<rdf:Bag>
<rdf:li>A</rdf:li>
<rdf:li>A|B</rdf:li>
<rdf:li>A|B|C</rdf:li>
</rdf:Bag>
</lr:hierarchicalSubject>
Opening this image in PL7 shows me this (three images to show the hierarchy that appears when I hover the mouse over…
The resulting DOP file contains…
Keywords = {
{
"A",
"B",
"C",
},
{
"A",
},
{
"A",
"B",
},
},
However, the search field brings up a very restricted and somewhat confusing option set…
Now, to follow your example in my software, I drag C onto the leaf of D | E
and get…
At which point, I see that my software does something odd because the algorithm for parsing the entered hierarchies creates a second hierarchy that ends in C which for some reason I have now got to discover, only retrieves the latter D | E | C
when writing to the XMP…
<dc:subject>
<rdf:Bag>
<rdf:li>A</rdf:li>
<rdf:li>B</rdf:li>
<rdf:li>C</rdf:li>
<rdf:li>D</rdf:li>
<rdf:li>E</rdf:li>
</rdf:Bag>
</dc:subject>
…
<lr:hierarchicalSubject>
<rdf:Bag>
<rdf:li>D</rdf:li>
<rdf:li>D|E</rdf:li>
<rdf:li>D|E|C</rdf:li>
</rdf:Bag>
</lr:hierarchicalSubject>
So, if nothing else, you have helped my find a possible bug in my software that nobody else has yet found
And this is part of the problem with designing “foolproof” keyword handling code.
In this case, should dragging have moved the dragged object, or copied it? Because, by moving it, the C
no longer belongs to A | B | C
but only to D | E | C
- or does it?
If I create the following hierarchies in PL7 without dragging…
… then I get exactly the XMP I would expect…
<lr:hierarchicalSubject>
<rdf:Bag>
<rdf:li>A</rdf:li>
<rdf:li>A|B</rdf:li>
<rdf:li>A|B|C</rdf:li>
<rdf:li>D</rdf:li>
<rdf:li>D|E</rdf:li>
<rdf:li>D|E|C</rdf:li>
</rdf:Bag>
</lr:hierarchicalSubject>
… and the DOP looks like this…
Keywords = {
{
"D",
},
{
"D",
"E",
},
{
"D",
"E",
"C",
},
{
"A",
"B",
"C",
},
{
"A",
},
{
"A",
"B",
},
},
So, without drag drop, PL7 seems to be doing the right thing.
As you can see, the DOP file you got resembles the XMP that my code produces but, I have a sneaking suspicion that both mine and DxO’s may be wrong and this does, indeed need looking at more deeply.
Finally, I get a sneaking feeling that using the same keyword at the same level, in more than one hierarchy, could be the cause of the problem, but this is going to require a bit more digging.