A client has an image bank with many pictures. They have categorised those pictures in a hierarchy. Now they want to move the pictures to a new image bank and I am asked to put this hierarchy into the EXIF or XMP data inside the pictures. Technically, using exiftool, that is all very easy, but I cannot seem to find any conventions of which field to use and how. So who knows how to store this kind of hierarchical data in EXIF?
So after a little digging and with the help of Murat's hint I found the following field in some pictures. This basically is the way that Adobe Lightroom stores the information and it could be used as a defacto standard in your project. We already went for a similar solution with our own field name and no use of rdf, but just to close this question here is the Lightroom solution as exported by exiftool:
<XMP-lr:HierarchicalSubject> <rdf:Bag> <rdf:li>general|mission|ISAF</rdf:li> <rdf:li>Army|vehicle|Fennek</rdf:li> <rdf:li>Army|personnel|troops</rdf:li> <rdf:li>general|mission</rdf:li> <rdf:li>Army</rdf:li> </rdf:Bag> </XMP-lr:HierarchicalSubject>
Well you can find a list of XMP field names used by common photo software on this page.
For example, digiKam uses the
TagsList field name in XMP metadata to store its tag hierarchy. So when I mark an image with the "Brighton" sub-tag which is nested under the "East-Sussex" sub-tag, nested under the "UK" sub-tag, nested under the "located" top-level tag, and also the "Friends" sub-tag nested under the "populated" top-level tag, digiKam adds this to the TagsList field:
This format does forbid that individual tag values contain spaces or forward-slashes, but I believe tags should be compact and unique tokens with a defined meaning, not verbose free text, so this constraint should not be a problem.
To be honest it shouldn't matter how you choose to store the information so long as it works for you at the time and so long as you document your decisions so that future users can migrate the metadata to a new format in future if the need arises.
I'd say it's more important that you pick a format and then stick to it consistently. Consistent data can be translated and migrated automatically from one format to another. Inconsistent data is garbage which requires hours of human intervention every time it has to be processed. (And I should know: I usually seem to be the one who ends up having to process it.)
You can suggest to your client to use a Digital Asset Management to manage his image bank. The most modern DAM solutions can automatically save tag hierarchy to XMP.
EXIF is mainly used for storing technical camera and image shooting info.
Another standard is IPTC but it is obsoleted and has significant limitations to length of the fields.
Hiearchical info is supported by XMP/MWG specification, but I know very few programs that are supported it well.
The most popular approach is to store hierarchical data inside your XMP (MWG) is by separating each level with the "|" separator. This symbols is used by a lot of DAM solution (unofficially), including our Daminion, Lightroom, IdImager, MS Photogallery, iView/MediaPro, etc...
So don't re-invent a wheel and consider a good DAM solution!
Taxonomy? Exiftool has supported writing Darwin Core as XMP for a while now.
Resource Space is a free software DAM which uses exiftool as it's metadata backend. You can customize it to support Darwin Core.