Using Hierarchical Keywords
(Android)


Hierarchical keywords provide a finer control over selection of the keywords that describe your photos.

In particular, hierarchical keywords provide a way to disambiguate keywords that may have multiple meanings. Examples:
- Does the keyword "orange" signify a fruit or a color?
- Does the keyword "spring" signify a season or a body of water?
- Does the keyword "Fred" signify your uncle Fred or your cousin Fred?

Hierarchical keywords are defined in an outline format that makes it clear which meaning you intend to assign to your photos.

_Fruit
__Apple
__Orange

_Color
__Red
__Orange

Keyword Lists and checkbox entry mode make it easy to define and set hierarchical keywords. (Android 6+ is required for Keyword Lists and checkbox entry mode.)
 
Hierarchical keywords use a format employed by several other photo metadata programs. But this is not an official standard. For maximum portability of your photos you should always create a "flattened" version of your hierarchical keywords. FastPhotoTagger makes this easy.

Here are the steps for using hierarchical keywords, keyword lists, and checkbox mode

    o Enter hierarchical and flattened keywords into Program Settings
    o Create keyword list files
    o Enter keyword list files into Program Settings
    o Use checkbox entry mode to enter keywords


Enter Hierarchical Keyword Metadata Into Program Settings

First, enter your metadata choices, including hierarchical keywords and flattened keywords in App / Program Settings / All Settings / Metadata Tags / Metadata.





Open the App / Program Settings / All Settings / Metadata Tags / Hierarchical Keywords panel. Short press on an empty line.





FastPhotoTagger allows you to use any list-type metadata field as a hierarchical keyword field. For maximum usability of your photos with other metadata programs, you should use "XMP:XMP-LR:HierarchicalSubject" as your hierarchical keyword field. Select your choice in the "Hierarchical" drop down menu.

Choose a metadata field to contain the flattened version of your hierarchical keywords. "MWG:Keywords" is recommended. This is an ExifTool composite tag that will actually write to other tags based on MWG Guidelines. (If you use MWG:Keywords do not also use its derivative fields IPTC:Keywords and XMP-dc:Subject in your metadata list.) Select your choice in the "Flat List" drop down menu.

Press "OK" and close the Program Settings panels.


Format of Hierarchical Keywords

Hierarchical keywords use the bar ("|") character as an internal delimiter. So if you choose "Fruit Orange" as your hierarchical keyword, the text "Fruit|Orange" will be written as metadata to the hierarchical keyword field. Both keywords, "Fruit" and "Orange" will be written to the flattened keyword field.

Here is a more complicated example. If you choose "USA Massachusetts Cities Boston" as your hierarchical keyword, all partial keywords from left to right will be written as hierarchical keywords:

Hierarchical: USA; USA|Massachusetts; USA|Massachusetts|Cities; USA|Massachusetts|Cities|Boston;

(Checkbox entry mode provides control over exactly which hierarchical keywords are written.)

These keywords will be written to the flattened field:

Flattened: USA; Massachusetts; Cities; Boston


Create Keyword List Files (Android 6+)

A keyword list file is a text format file that defines a set of keywords and their hierarchical relationships, if any. You may create keyword list files using FastPhotoTagger's text editor, or you may create them using any Android text editor, word processor, or spreadsheet program, or you may import keyword files from the Internet or a PC.

Imported keyword files will most likely use the TAB character to indent levels. Since it is generally pretty hard to type a TAB character on Android, you should use the SPACE character to indent keyword levels.

Here is a simple keyword list file. There are no hierarchical relationships between the keywords.

apple
banana
cherry
grape
mango
orange


Here are the same keywords; this time they are identified as fruit in a hierarchical relationship. The fruit names are indented one space under the title "fruit". (Spaces are shown here as "_" for clarity.) We refer to "fruit" as the parent keyword of "apple".

fruit
_apple
_banana
_cherry
_grape
_mango
_orange


Keyword hierarchies can extend to any number of levels.

fruit
_apple
__cortland
__delicious
___golden
___red


Synonyms

Now suppose whenever you write "apple" as a keyword, you also want to write the apple's scientific name as a keyword. This can be done using the "Synonym" feature of keyword lists. Synonyms are surrounded by { and } which are not actually part of the synonym. Synonyms immediately follow their parent keyword at the next indentation level. There can be any number of synonyms, one per line..

fruit
_apple
__{Malus pumila}
__cortland
__delicious
___golden
___red



Now whenever you write "fruit|apple|cortland" you will also write "fruit|Malus pumila|cortland".

Categories

If you have a very long list of keywords. You can organize the list into large groups called "Categories". Categories are primarily used for organizational purposes are not usually written as keywords. Category names are surrounded by [ and ] which are not actually part of the category names.

[Stuff To Eat]
_fruit
__apple
___{Malus pumila}
___cortland
___delicious
____golden
____red



Enter Keyword List Files Into Program Settings (Android 6+)

To specify the keyword list files that you will use with FastPhotoTagger, open App / Program Settings / All Settings / Keywords. Short press on an empty line and then select a file. Each keyword list file may be marked as Active or Inactive using the checkbox.






Checkbox Entry Mode (Android 6+)

To use your keyword lists, you must switch from text entry mode to checkbox entry mode. These input fields support checkbox entry mode:
o Metadata Panel
o Fast Tagger
o Abbreviations expansion fields
o Search Metadata panel

Long press on an entry field to bring up the Edit menu. Select the "Keywords" item.  (Alternatively, you may long press on the metadata name.)

The keywords checkbox panel will open and display all the keywords in your active keyword list files.





If you want to write [Category] names as part of metadata check the "Include Parent [Categories]" box.
If you want to write Parent Keywords as part of metadata check the "Include Parent Keywords" box.
If you want to write Synonyms as part of metadata check the "Include {Synonyms}" box.

Then you can navigate the list of keywords, expanding and contracting the hierarchy, and checking appropriate keyword boxes.

Use the search field to find keywords that may be deep in the hierarchy and not visible. You may search for categories, keywords, and synonyms. Matches are highlighted and the tree containing the latest match is expanded. The search starts at the latest match and wraps around the tree. Search is case insensitive.

Use the + field to add keywords that are not in your keyword files. These typed keywords will be appended to the list of checked keywords. Be sure to end each keyword with a comma or semi-colon delimiter.

Here is a view when tagging from the Metadata panel:






When using the Fast Tagger, you can enlarge the image to see more detail and use the keywords checkbox panel as an overlay:





In the example above, checking "geyser" automatically checks "nature" because the "Include Parent Keywords" box is checked and "nature" is the parent keyword of "geyser".

When finished, press "OK".


When you change a hierarchical keyword field the flattened version of the keywords is copied to the flattened keyword field.







Searching For Hierarchical Keywords

When searching a hierarchical keyword field, use the bar character to specify the levels of keyword, e.g., "nature|geyser". You can also long press to use checkbox entry mode. The selected hierarchical keyword will be copied to the search term.

You can search as many or as few levels of the hierarchy as you need. Using the earlier example, if your hierarchical keyword is "USA|Massachusetts|Cities|Boston;", you can search for "USA;" or "USA|Massachusetts;" or "USA|Massachusetts|Cities;" or "USA|Massachusetts|Cities|Boston;".





(If you invoke checkbox entry mode on a non-hierarchical keyword, check all the keywords you wish to search for.)


Searching a Hierarchy Without Hierarchical Keywords


If you have tagged only with flat keywords, you can still get some of the benefits of hierarchical keywords.

Put your existing keywords into a hierarchy. Suppose you've tagged with apple, orange, baseball, football. Create a hierarchy using these keywords, such as

fruit
_apple
_orange
games
_baseball
_football

(Spaces are shown here as "_" for clarity.)

Put this into a keyword list file. Enter it into Program Settings as described above. Be sure the Active box is checked.

Now, when you search, display the keyword dialog and select a parent keyword, e.g., fruit. Surround the keyword with brackets, e.g., [fruit].





This search will find images tagged with apple or orange or fruit. You may also prepend the item with + or -. +[fruit], -[fruit].

(The search is actually for any keywords that contain the hierarchical keywords as whole words. For example, the above search will also find "orange juice.")