Clean up the Subject Tag Mess

Started by Kugelblitz, July 12, 2020, 08:55:21 PM

Previous topic - Next topic

Kugelblitz

Hello,
this is a follow up Post to the https://exiftool.org/forum/index.php?topic=11404.0 Post.

My large Photo library / Tags are still messy.
Looks a bit like this.
---- XMP-MP ----
RegionPersonDisplayName         :
---- XMP-microsoft ----
LastKeywordXMP                  : Sightseeing <|> AUS <|> Australia <|> Beach <|> Sydney <|> Food <|> Mr. Firstname Lastname <|> Mrs. Firstname Lastname <|> New South Wales <|> Holiday
---- XMP-acdsee ----
Categories                      : Sightseeing, AUS, Australia, Beach, Sydney, Food, Mr. Firstname Lastname, Mrs. Firstname Lastname, New South Wales, Holiday
---- XMP-dc ----
Subject                         : Sightseeing <|> AUS <|> Australia <|> Beach <|> Sydney <|> Food <|> Mr. Firstname Lastname <|> Mrs. Firstname Lastname <|> New South Wales <|> Holiday
---- XMP-digiKam ----
TagsList                        : Sightseeing, AUS, Australia, Beach, Sydney, Food, Mr. Firstname Lastname, Mrs. Firstname Lastname, New South Wales, Holiday
---- XMP-lr ----
HierarchicalSubject             : Sightseeing, AUS, Australia, Beach, Sydney, Food, Mr. Firstname Lastname, Mrs. Firstname Lastname, New South Wales, Holiday
---- XMP-mediapro ----
CatalogSets                     : Sightseeing, AUS, Australia, Beach, Sydney, Food, Mr. Firstname Lastname, Mrs. Firstname Lastname, New South Wales, Holiday
---- IPTC ----
Keywords                        : Sightseeing <|> AUS <|> Australia <|> Beach <|> Sydney <|> Food <|> Mr. Firstname Lastname <|> Mrs. Firstname Lastname <|> New South Wales <|> Holiday
CatalogSets                     : Sightseeing, AUS, Australia, Beach, Sydney, Food, Mr. Firstname Lastname, Mrs. Firstname Lastname, New South Wales, Holiday
-- press ENTER --


I can separate the Tags now, but I have a lot of duplicates.
And the People Names (changed them to Mr. Firstname Lastname, Mrs. Firstname Lastname) from the Facetags and Location Tags like Country, State, City are also in the Subject Tags. 

So here is how I would like to tidy up the mess.

:D 1st Step - WORKS - separate all Tags like in the previous Post.
exiftool -Sep ", " -@ separate-tags-by-comma.args -overwrite_original -forcewrite=exif -r -m -P -k -v -NoDubs -iptc:all FILENAME

separate-tags-by-comma.args
-XMP:Subject<${XMP:Subject;s/\;/\,/g}
-XMP-digiKam:TagsList<${XMP-digiKam:TagsList;s/\;/\,/g}
-XMP:LastKeywordXMP<${XMP:LastKeywordXMP;s/\;/\,/g}
-XMP:LastKeywordIPTC<${XMP:LastKeywordIPTC;s/\;/\,/g}
-XMP-lr:HierarchicalSubject<${XMP-lr:HierarchicalSubject;s/\;/\,/g}
-IPTC:Keywords<${IPTC:Keywords;s/\;/\,/g}
-IPTC:CatalogSets<${IPTC:CatalogSets;s/\;/\,/g}
-IFDO:XPKeywords<${IFD0:XPKeywords;s/\s+,\s+|,\s+|\s+,/,/g;}
-XMP-mediapro:CatalogSets<${XMP-mediapro:CatalogSets;s/\;/\,/g}
-XMP-acdsee:Categories<${XMP-acdsee:Categories;s/\;/\,/g}
-RegionName<${RegionName;s/\;/\,/g}
-RegionPersonDisplayName<${RegionPersonDisplayName;s/\;/\,/g}




:-\ 2nd Step - NOT SURE HOW TO DO THIS
- move all Subject Tags into XMP:Subject
- clear all duplicates
- clear or remove the "old" Tags (XMP-digiKam, LastKeywordIPTC, XMP:LastKeywordXMP, IPTC:Keywords, LastKeywordIPTC, XMP-lr:HierarchicalSubject, XMP-mediapro:CatalogSets, IPTC:CatalogSets
- clear or remove IFDO:XPKeywords and XMP-acdsee too.

exiftool -addtagsfromfile -@ move-keywords-to-xmp-subject.args -overwrite_original -forcewrite=exif -r -m -P -k -v -NoDubs xmp:codedcharacterset=utf8 FILENAME

move-keywords-to-xmp-subject.args
-XMP:Subject<${XMP:Subject;NoDups}
-XMP:Subject<${XMP-digiKam:TagsList;NoDups}
-XMP:Subject<${LastKeywordIPTC;NoDups}
-XMP:Subject<${XMP:LastKeywordXMP;NoDups}
-XMP:Subject<${IPTC:Keywords;NoDups}
-XMP:Subject<${LastKeywordIPTC;NoDups}
-XMP:Subject<${XMP-lr:HierarchicalSubject;NoDups}
-XMP:Subject<${XMP-mediapro:CatalogSets;NoDups}
-XMP:Subject<${IPTC:CatalogSets;NoDups}
-XMP:Subject<${XMP:Subject;NoDups}
-XMP-acdsee:Categories=
-IFDO:XPKeywords=




??? 3rd Step - mostly WORKS most of the time - Remove Facetags from XMP:Subject

exiftool.exe -addtagsfromfile @ -@ remove-facetags-from-keywords.args -common_args -r -overwrite_original -forcewrite=exif -m -P -L -v2 -iptc:codedcharacterset=utf8 -charset DOSlatin1 FILENAME

w-remove-facetags-from-keywords.args

-XMP:Subject-<XMP-mwg-rs:RegionName
-XMP:Subject-<XMP-MP:RegionName
-XMP:Subject-<XMP-MP:RegionPersonDisplayName




:D 4th Step - WORKS - Remove Location Tags from XMP:Subject
- remove the Location Tags from XMP:Subject
exiftool -addtagsfromfile @ -@ w-remove-geonames-from-keywords.args -common_args -r -overwrite_original -forcewrite=exif -m -P -L -v2 -iptc:codedcharacterset=utf8 -charset DOSlatin1 FILENAME

remove-geonames-from-keywords.args
-XMP:Subject-<XMP:CountryCode
-XMP:Subject-<XMP:Country
-XMP:Subject-<XMP:City
-XMP:Subject-<XMP:Location
-XMP:Subject-<Country-PrimaryLocationCode
-XMP:Subject-<Country-PrimaryLocationName
-XMP:Subject-<Province-State
-XMP:Subject-<City
-XMP:Subject-<Sub-location



BONUS


:D 5th Step - WORKS - Re-Add the Facetags
Re-Add the Facetags maybe in a Hierarchical Structure under a Main Tag "_People" like _People/Name
exiftool -Sep "##" -addtagsfromfile @ -@ add-facetags-to-hierachical-subject.args -overwrite_original -forcewrite=exif -r -m -P -k -v -NoDubs -iptc:all -iptc:codedcharacterset=utf8 -charset DOSlatin1 FILENAME
add-facetags-to-hierachical-subject.args
-hierarchicalSubject<${regionpersondisplayname;s/(^|##)/$1_People\|/g}



:-\ 6th Step - DOES NOT WORK
Re-Add the Location tags in a Hierarchical Structure under a Main Tag "_Places" like _Places/Australia/New South Wales/Sydney/Newtown
exiftool -Sep "##" -@ add-location-to-hierachical-subject.args -overwrite_original -forcewrite=exif -r -m -P -k -v -NoDubs -iptc:all FILENAME

add-location-to-hierachical-subject.args
-hierarchicalSubject<${IPTC:Country-PrimaryLocationName;s/(^|##)/$1_Places\|/IPTC:Country-PrimaryLocationName\|/IPTC:Province-State\|/IPTC:City\|/IPTC:Sub-location\|/g}


:) I guess that is a long and laborious way - but I do not know it better - yet

Thank you for your time reading all this and replying.
Thank you for your patience and support.


Kugelblitz

Allright - I figured out most of it. Just struggling on Step 6 - Re-Add the Location tags in a Hierarchical Structure under a Main Tag "_Places" like _Places/Australia/New South Wales/Sydney/Newtown.
Would be good if the Steps 1 to 6 also could be combined in a single process that I can run on all Files.
And also to get a list of files where it failed. I tried "-efile error.txt" but that did not create an error.txt file.


For Documentation - her are the Steps 1 to 5.


:D Pre-Step - WORKS - Fix Errors
I noticed some of the Files are not processed cause of an error. This is an attempt to fix most of them.
exiftool -all= -tagsfromfile @ -all:all -unsafe -icc_profile -overwrite_original -forcewrite=exif -k -P -r FILENAME

:D 1st Step - WORKS -  Separate Tags
I noticed some of the Files are not processed cause of an error. This is an attempt to fix most of them.
exiftool -Sep ", " -@ 01-separate-tags-by-comma.args -common_args -overwrite_original_in_place -k -P -r -fast FILENAME

01-separate-tags-by-comma.args
-XMP-lr:HierarchicalSubject<${XMP-lr:HierarchicalSubject;s/\s+,\s+|,\s+|\s+,/, /g;}
-XMP-dc:Subject<${XMP-dc:Subject;s/\s+,\s+|,\s+|\s+,/, /g;}
-IPTC:Keywords<${IPTC:Keywords;s/\s+,\s+|,\s+|\s+,/, /g;}
-XMP:LastKeywordXMP<${XMP:LastKeywordXMP;s/\s+,\s+|,\s+|\s+,/, /g;}
-XMP-digiKam:TagsList<${XMP-digiKam:TagsList;s/\s+,\s+|,\s+|\s+,/, /g;}
-XMP:LastKeywordIPTC<${XMP:LastKeywordIPTC;s/\s+,\s+|,\s+|\s+,/, /g;}
-IPTC:CatalogSets<${IPTC:CatalogSets;s/\s+,\s+|,\s+|\s+,/, /g;}
-IFDO:XPKeywords<${IFD0:XPKeywords;s/\s+,\s+|,\s+|\s+,/, /g;}
-XMP-mediapro:CatalogSets<${XMP-mediapro:CatalogSets;s/\s+,\s+|,\s+|\s+,/, /g;}
-XMP-acdsee:Categories<${XMP-acdsee:Categories;s/\s+,\s+|,\s+|\s+,/, /g;}
-XMP-mwg-rs:RegionName<${XMP-mwg-rs:RegionName;s/\s+,\s+|,\s+|\s+,/, /g;}
-XMP-MP:RegionPersonDisplayName<${XMP-MP:RegionPersonDisplayName;s/\s+,\s+|,\s+|\s+,/, /g;}


:D 2nd Step Part 1  - WORKS - merge all keywords to XMP-dc:Subject and copy that then to XMP-digiKam:TagsList
exiftool -sep "##" -addtagsfromfile @ -@ 02-move-keywords-to-xmp-subject.args -overwrite_original -forcewrite=exif -r -P -k -v -NoDubs FILENAME

02-move-keywords-to-xmp-subject.args
-XMP-dc:Subject+<${XMP-digiKam:TagsList;NoDups}
-XMP-dc:Subject+<${LastKeywordIPTC;NoDups}
-XMP-dc:Subject+<${LastKeywordXMP;NoDups}
-XMP-dc:Subject+<${IPTC:Keywords;NoDups}
-XMP-dc:Subject+<${LastKeywordIPTC;NoDups}
-XMP-dc:Subject+<${XMP-lr:HierarchicalSubject;NoDups}
-XMP-dc:Subject+<${XMP-mediapro:CatalogSets;NoDups}
-XMP-dc:Subject+<${IPTC:CatalogSets;NoDups}
-XMP-digiKam:TagsList+<${XMP-dc:Subject;NoDups}


2nd Step Part 2  - WORKS -  remove duplicate keywords and keep XMP Subject

exiftool -addtagsfromfile @ -@ 02-remove-not-needed-keywords-except-xmp-subject.args -overwrite_original -forcewrite=exif -r -P -k -v -NoDubs FILENAME

02-remove-not-needed-keywords-except-xmp-subject.args
-XMP-microsoft:LastKeywordIPTC=
-XMP-microsoft:LastKeywordXMP=
-XMP-lr:HierarchicalSubject=
-IPTC:Keywords=
-IPTC:CatalogSets=
-XMP-mediapro:CatalogSets=
-IFD0:XPKeywords=
-XMP-acdsee:Categories=


:D 3rd Step - WORKS - remove facetags from Keywords
exiftool.exe -Sep "##" -addtagsfromfile @ -@ 03-remove-facetags-from-keywords.args -overwrite_original -forcewrite=exif -P -k -v -L -NoDubs -charset DOSlatin1 FILENAME


03-remove-facetags-from-keywords.args
-XMP:Subject-<XMP-mwg-rs:RegionName
-XMP-digiKam:TagsList-<XMP-mwg-rs:RegionName
-XMP:LastKeywordXMP-<XMP-mwg-rs:RegionName
-XMP:LastKeywordIPTC-<XMP-mwg-rs:RegionName
-XMP-lr:HierarchicalSubject-<XMP-mwg-rs:RegionName
-IPTC:Keywords-<XMP-mwg-rs:RegionName
-IPTC:CatalogSets-<XMP-mwg-rs:RegionName
-IFDO:XPKeywords-<XMP-mwg-rs:RegionName
-XMP-mediapro:CatalogSets-<XMP-mwg-rs:RegionName
-XMP-acdsee:Categories-<XMP-mwg-rs:RegionName
-XMP:Subject-<XMP-MP:RegionName
-XMP-digiKam:TagsList-<XMP-MP:RegionName
-XMP:LastKeywordXMP-<XMP-MP:RegionName
-XMP:LastKeywordIPTC-<XMP-MP:RegionName
-XMP-lr:HierarchicalSubject-<XMP-MP:RegionName
-IPTC:Keywords-<XMP-MP:RegionName
-IPTC:CatalogSets-<XMP-MP:RegionName
-IFDO:XPKeywords-<XMP-MP:RegionName
-XMP-mediapro:CatalogSets-<XMP-MP:RegionName
-XMP-acdsee:Categories-<XMP-MP:RegionName
-XMP:Subject-<XMP-MP:RegionPersonDisplayName
-XMP-digiKam:TagsList-<XMP-MP:RegionPersonDisplayName
-XMP:LastKeywordXMP-<XMP-MP:RegionPersonDisplayName
-XMP:LastKeywordIPTC-<XMP-MP:RegionPersonDisplayName
-XMP-lr:HierarchicalSubject-<XMP-MP:RegionPersonDisplayName
-IPTC:Keywords-<XMP-MP:RegionPersonDisplayName
-IPTC:CatalogSets-<XMP-MP:RegionPersonDisplayName
-IFDO:XPKeywords-<XMP-MP:RegionPersonDisplayName
-XMP-mediapro:CatalogSets-<XMP-MP:RegionPersonDisplayName
-XMP-acdsee:Categories-<XMP-MP:RegionPersonDisplayName


:D 4th Step - WORKS - Remove Locationnames (Country, State, City, Location) added by Geosetter from Keywords.
exiftool -addtagsfromfile @ -@ 04-remove-geotag-country-state-city-from-subject.args -common_args -r -overwrite_original -forcewrite=exif -P -L -iptc:codedcharacterset=utf8 -charset DOSlatin1 FILENAME

04-remove-geotag-country-state-city-from-subject.args
-IPTC:Keywords-<XMP:CountryCode
-IPTC:Keywords-<XMP:Country
-IPTC:Keywords-<XMP:City
-IPTC:Keywords-<XMP:Location
-IPTC:Keywords-<Country-PrimaryLocationCode
-IPTC:Keywords-<Country-PrimaryLocationName
-IPTC:Keywords-<Province-State
-IPTC:Keywords-<City
-IPTC:Keywords-<Sub-location
-Keywords-<XMP:CountryCode
-Keywords-<XMP:Country
-Keywords-<XMP:City
-Keywords-<XMP:Location
-Keywords-<Country-PrimaryLocationCode
-Keywords-<Country-PrimaryLocationName
-Keywords-<Province-State
-Keywords-<City
-Keywords-<Sub-location
-XMP:Subject-<XMP:CountryCode
-XMP:Subject-<XMP:Country
-XMP:Subject-<XMP:City
-XMP:Subject-<XMP:Location
-XMP:Subject-<Country-PrimaryLocationCode
-XMP:Subject-<Country-PrimaryLocationName
-XMP:Subject-<Province-State
-XMP:Subject-<City
-XMP:Subject-<Sub-location
-XMP:LastKeywordXMP-<XMP:CountryCode
-XMP:LastKeywordXMP-<XMP:Country
-XMP:LastKeywordXMP-<XMP:City
-XMP:LastKeywordXMP-<XMP:Location
-XMP:LastKeywordXMP-<Country-PrimaryLocationCode
-XMP:LastKeywordXMP-<Country-PrimaryLocationName
-XMP:LastKeywordXMP-<Province-State
-XMP:LastKeywordXMP-<City
-XMP:LastKeywordXMP-<Sub-location
-KeywordIPTC:Keywords-<XMP:CountryCode
-KeywordIPTC:Keywords-<XMP:Country
-KeywordIPTC:Keywords-<XMP:City
-KeywordIPTC:Keywords-<XMP:Location
-KeywordIPTC:Keywords-<Country-PrimaryLocationCode
-KeywordIPTC:Keywords-<Country-PrimaryLocationName
-KeywordIPTC:Keywords-<Province-State
-KeywordIPTC:Keywords-<City
-KeywordIPTC:Keywords-<Sub-location
-IFDO:XPKeywords-<XMP:CountryCode
-IFDO:XPKeywords-<XMP:Country
-IFDO:XPKeywords-<XMP:City
-IFDO:XPKeywords-<XMP:Location
-IFDO:XPKeywords-<Country-PrimaryLocationCode
-IFDO:XPKeywords-<Country-PrimaryLocationName
-IFDO:XPKeywords-<Province-State
-IFDO:XPKeywords-<City
-IFDO:XPKeywords-<Sub-location
-XMP-digiKam:TagsList-<XMP:CountryCode
-XMP-digiKam:TagsList-<XMP:Country
-XMP-digiKam:TagsList-<XMP:City
-XMP-digiKam:TagsList-<XMP:Location
-XMP-digiKam:TagsList-<Country-PrimaryLocationCode
-XMP-digiKam:TagsList-<Country-PrimaryLocationName
-XMP-digiKam:TagsList-<Province-State
-XMP-digiKam:TagsList-<City
-XMP-digiKam:TagsList-<Sub-location
-XMP-lr:HierarchicalSubject-<XMP:CountryCode
-XMP-lr:HierarchicalSubject-<XMP:Country
-XMP-lr:HierarchicalSubject-<XMP:City
-XMP-lr:HierarchicalSubject-<XMP:Location
-XMP-lr:HierarchicalSubject-<Country-PrimaryLocationCode
-XMP-lr:HierarchicalSubject-<Country-PrimaryLocationName
-XMP-lr:HierarchicalSubject-<Province-State
-XMP-lr:HierarchicalSubject-<City
-XMP-lr:HierarchicalSubject-<Sub-location
-IPTC:CatalogSets-<XMP:CountryCode
-IPTC:CatalogSets-<XMP:Country
-IPTC:CatalogSets-<XMP:City
-IPTC:CatalogSets-<XMP:Location
-IPTC:CatalogSets-<Country-PrimaryLocationCode
-IPTC:CatalogSets-<Country-PrimaryLocationName
-IPTC:CatalogSets-<Province-State
-IPTC:CatalogSets-<City
-IPTC:CatalogSets-<Sub-location
-XMP-mediapro:CatalogSets-<XMP:CountryCode
-XMP-mediapro:CatalogSets-<XMP:Country
-XMP-mediapro:CatalogSets-<XMP:City
-XMP-mediapro:CatalogSets-<XMP:Location
-XMP-mediapro:CatalogSets-<Country-PrimaryLocationCode
-XMP-mediapro:CatalogSets-<Country-PrimaryLocationName
-XMP-mediapro:CatalogSets-<Province-State
-XMP-mediapro:CatalogSets-<City
-XMP-mediapro:CatalogSets-<Sub-location


:D 5th Step - WORKS - Add facetags to Keywords but in a Hirachy under "Persons"
exiftool -Sep "##" -addtagsfromfile @ -@ 05-add-facetags-to-hierachical-subject.args -overwrite_original -forcewrite=exif -P -k -v -NoDubs -iptc:all -iptc:codedcharacterset=utf8 -charset DOSlatin1 FILENAME

05-add-facetags-to-hierachical-subject.args
-if
defined $XMP-MP:regionpersondisplayname
-hierarchicalSubject+<${XMP-MP:regionpersondisplayname;s/(^|##)/$1Persons\|/g;NoDups}
-execute
-if
defined $XMP-mwg-rs:RegionName
-hierarchicalSubject+<${XMP-mwg-rs:RegionName;s/(^|##)/$1Persons\|/g;NoDups}


Thank you for your time reading all this and replying.
Thank you for your patience and support.

Kugelblitz

 :D 6th Step - WORKS - Re-Add the Location tags in a Hierarchical Structure under a Main Tag "_Places"

exiftool -Sep "##" -addtagsfromfile @ -@ 06-re-add-location-tags-in-hierarchical-structure.args -overwrite_original -forcewrite=exif -P -k -v -NoDubs -iptc:all -iptc:codedcharacterset=utf8 -charset DOSlatin1 FILENAME

06-re-add-location-tags-in-hierarchical-structure.args
-if
defined $IPTC:Country-PrimaryLocationName
-XMP-lr:HierarchicalSubject<_Places|$IPTC:Country-PrimaryLocationName|$IPTC:Province-State|$IPTC:City|$IPTC:Sub-location


:D 7th Step - WORKS - Set Date to Taken Date
exiftool -config oldest_datetime_config -charset filename=utf8  "-FileModifyDate<OldestDateTime" "-FileCreateDate<OldestDateTime" "-DateTimeOriginal<OldestDateTime" "-CreateDate<OldestDateTime" "-ModifyDate<OldestDateTime" -k -r -overwrite_original FILENAME

oldest_datetime_config
%Image::ExifTool::UserDefined = (
    'Image::ExifTool::Composite' => {
        # Select oldest date from a number of date tags
        OldestDateTime => {
            Desire => {
                0 => 'FileModifyDate',
                1 => 'MDItemFSContentChangeDate',
                2 => 'FileCreateDate',
                3 => 'MDItemFSCreationDate',
                4 => 'ModifyDate',
                5 => 'CreateDate',
                6 => 'DateTimeCreated',
                7 => 'DateTimeOriginal',
                8 => 'XMP:DateCreated',
                9 => 'XMP:DateAcquired',
            },
            ValueConv => q{
                my $oldest = undef;
                for my $date (@val) {
                    next if not defined $date or $date lt '1970:01:02';
                    $date =~ s/[+-]\d{2}:\d{2}$//; # Strip TimeZone
                    return $date if $date =~ / 12:00:00$/;
                    if ($date && (!$oldest || $date lt $oldest)) {
                        $oldest = $date;
                    }
                }
                return $oldest;
            },
        },
    },
);

1;



So now whats left is to get all this in one big process that can run on all files.

Kugelblitz

Quote from: Kugelblitz on July 19, 2020, 09:31:52 AM
:D 6th Step - WORKS - Re-Add the Location tags in a Hierarchical Structure under a Main Tag "_Places"

exiftool -Sep "##" -addtagsfromfile @ -@ 06-re-add-location-tags-in-hierarchical-structure.args -overwrite_original -forcewrite=exif -P -k -v -NoDubs -iptc:all -iptc:codedcharacterset=utf8 -charset DOSlatin1 FILENAME

06-re-add-location-tags-in-hierarchical-structure.args
-if
defined $IPTC:Country-PrimaryLocationName
-execute
-XMP-lr:HierarchicalSubject<_Places|$IPTC:Country-PrimaryLocationName|$IPTC:Province-State|$IPTC:City|$IPTC:Sub-location


It works but it overwrites existing tags.

To add the Location names in a hierarchical structure under"_Orte" (German for locations) and keep existing tags use this.

06-re-add-location-tags-in-hierarchical-structure.args
-if
defined $IPTC:Country-PrimaryLocationName
-execute
-XMP-digiKam:TagsList+<_Orte/$IPTC:Country-PrimaryLocationName/$IPTC:Province-State/$IPTC:City/$IPTC:Sub-location
-XMP-microsoft:LastKeywordXMP+<_Orte/$IPTC:Country-PrimaryLocationName/$IPTC:Province-State/$IPTC:City/$IPTC:Sub-location
-XMP-lr:HierarchicalSubject+<_Orte|$IPTC:Country-PrimaryLocationName|$IPTC:Province-State|$IPTC:City|$IPTC:Sub-location
-XMP-mediapro:CatalogSets+<_Orte|$IPTC:Country-PrimaryLocationName|$IPTC:Province-State|$IPTC:City|$IPTC:Sub-location

Phil Harvey

To add to an existing tag, you just add it to the list.  eg)

-XMP-digiKam:TagsList<$XMP-digiKam:TagsList/_Orte/$IPTC:Country-PrimaryLocationName/$IPTC:Province-State/$IPTC:City/$IPTC:Sub-location

But if the tag may or may not already exist, you need to keep the existing entry and just add this.  eg)

-XMP-digiKam:TagsList<_Orte/$IPTC:Country-PrimaryLocationName/$IPTC:Province-State/$IPTC:City/$IPTC:Sub-location
-XMP-digiKam:TagsList<$XMP-digiKam:TagsList/_Orte/$IPTC:Country-PrimaryLocationName/$IPTC:Province-State/$IPTC:City/$IPTC:Sub-location


- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Kugelblitz