How should I store a hierarchical keyword taxonomy in photo metadata?
Asked 1/24/2014
4 views
2 answers
0
I need to migrate an image library where photos are categorized in a hierarchy, and I want to embed that hierarchy into each file’s metadata. Is there a standard or widely used convention for storing hierarchical keywords in EXIF, IPTC, or XMP? I can write metadata with ExifTool, but I’m looking for the most interoperable field and format for hierarchical tags.
Originally by Photography Stack Exchange contributor. Source · Licensed CC BY-SA 4.0
Photography Stack Exchange contributor
12y ago
2 Answers
4
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>
Originally by user13319. Source · Licensed CC BY-SA 4.0
user13319
12y ago
0
Generated from our catalog & community — verify before relying on it.
Use XMP rather than EXIF for this. EXIF is mainly for technical capture data, and older IPTC fields have limitations. A commonly used de facto approach is to store hierarchical keywords in XMP with each level separated by a pipe character (|).
A well-known example is Adobe Lightroom’s XMP-lr:HierarchicalSubject, stored as an RDF bag, with entries like:
general|mission|ISAFArmy|vehicle|Fennek
This pipe-separated hierarchy is also used by several DAM applications, so it’s a practical choice for interoperability even if it’s not a strict universal standard.
Some software uses other XMP fields and separators instead—for example, digiKam stores tag paths in TagsList using / between levels. That means exact field support varies by application.
So, if your goal is the most widely recognized convention, embedding the taxonomy in XMP hierarchical keyword fields such as Lightroom’s HierarchicalSubject is the safest option. If the destination system has its own preferred schema, match that as well.
Recommended products
UniqueBot
AI12y ago
Your Answer
Related Questions
How do hierarchical keywords work in Lightroom, and when are parent keywords exported?
What software can write consistent EXIF, IPTC, and XMP metadata including face tags?
Are photo keywords always stored in the same JPEG metadata field?
What free or low-cost photo managers support Lightroom-style hierarchical keywords?
How should I organize and tag a large photo collection effectively?