---
title: What's a hierarchical tag?
url: https://photostructure.com/guide/whats-a-hierarchical-tag/
description: Find out how PhotoStructure's tags are different from most other systems
date: 2021-11-19
keywords: tags, metadata, search, asset-management, deduplication
---


All of PhotoStructure's tags are "hierarchical." This article will try to
explain how they work, and why they're useful.

## 🏷️ Flat tags

Most popular tagging systems, or
[folksonomies](https://en.wikipedia.org/wiki/Folksonomy), are "flat."

Twitter's hashtags are an example of flat tags; there's no explicit relationship
between any two hashtags.

## 🌳 Hierarchical tags

So, what if you _did_ want to group together, say, all your `#eiffeltower` and
`#louvre` tags together?

PhotoStructure supports [hierarchies](https://en.wikipedia.org/wiki/Hierarchy),
so you can tag photos with `Paris/Eiffel Tower` and `Paris/Louvre`. In fact,
PhotoStructure supports arbitrary depths, so `Where/France/Paris/Louvre` works
too (and is actually recommended).

These hierarchies are much more expressive than flat tags, as they infer
relationships between "ancestor" and "descendant" tags (looking at parents and
their progeny), and loose relationships between "sibling" tags (those that share
a common parent).

Hierarchical classification isn't a new idea, of course--[biological
taxonomies](<https://en.wikipedia.org/wiki/Taxonomy_(biology)>) have existed for
centuries, and [ontologies](https://en.wikipedia.org/wiki/Ontology) for
millennia. Computer [file systems](https://en.wikipedia.org/wiki/File_system) have
supported "folder" or "directory" hierarchies for more than 50 years.

## 📛 Photo**Structure** etymology

These hierarchical tag "structures" are what drove the name of this product:
Photo**Structure** references these hierarchical tags.

## 👨‍👧 Tag inheritance

PhotoStructure's tag hierarchies apply _implicit inheritance_.

In other words, _all path elements_ within a hierarchical tag must apply to the asset.

If an asset is tagged with `Camera/Canon/EOS 5D`, PhotoStructure also associates
it to `Camera/Canon` and `Camera`, via inheritance.

An asset tagged with `Where/France/Paris/Louvre` must have been taken in Paris,
and also taken within France.

An asset whose containing directory is `/home/alice/Photos/travels` will be tagged with `fs/home/alice/Photos/travels`.

## 🔄 But I've already spent time adding keywords to my files!?

As PhotoStructure imports your photos and videos, it extracts existing keyword
metadata from the photo or video, sidecar, or JSON takeouts. When it finds
simple keywords, it adds those keywords to the `Keywords` root tag.

As an example, if you tagged a photo with "blue" and "sky", PhotoStructure will
add `Keywords/blue` and `Keywords/sky` to that asset.

Note that PhotoStructure also supports hierarchical keywords as well as hierarchical names (given/family and family/given). [See the keywords FAQ for details.](/faq/keywords/)

## 💡 Why bother?

As a PhotoStructure user, you had to spend time reading this page to
[grok](https://en.wikipedia.org/wiki/Grok) what was going on, and
PhotoStructure's code is (substantially!) more complicated in order to
gracefully handle these hierarchies.

Hierarchical tags enables our "samples" browsing, which we hope you'll love as
much as we do.

### Browsing hierarchies via samples

Photo galleries typically use one browsing mode: a
reverse-chronologically-sorted list of photos and videos.

The human brain is remarkable at image recognition and pattern matching. We
recognize patterns effortlessly, and find repetition boring: _like seeing the
last handful of photos and videos you've taken_.

We find new patterns and images interesting, and even delightful.

PhotoStructure shows you a "taste" for descendants of the tag you're browsing,
for example, `When/2020`, and `When/2019`, and so on. Rather than a static set
of all assets that you've seen before, you can scroll though decades in just a
couple screenfulls:

{{< figure src="/img/2020/11/when-year-samples.jpg" caption="Samples of photos tagged with child tags of `When`" >}}

This "samples" interface also applies to all other tags, like file type, camera, lens, and filesystem!

## 🔢 Asset counts and deduplication {#asset-counts}

When browsing directory tags, a parent folder's asset count can be less than the
sum of its child folders' counts.

This is expected: PhotoStructure counts **unique assets**, not files.

If the same photo exists in two different subdirectories (a backup copy, an
edited version, or a RAW+JPEG pair), PhotoStructure recognizes them as the same
asset and counts it once in the parent.

For example, if `vacation-2024/` contains 100 assets and `backup/vacation-2024/`
contains 100 assets, but 10 of those are duplicates, the parent folder would
show 190 assets (not 200).

This deduplication is intentional — it gives you an accurate count of your
unique photos and videos, not how many copies exist on disk.

## See also

- [How does PhotoStructure extract keywords from my photos and videos?](/getting-started/keywords/)

