# View Structure of Nested Tags on Graph

**URL:** <https://forum.obsidian.md/t/view-structure-of-nested-tags-on-graph/11386>\
**Category:** Feature requests\
**Tags:** graph-view, ui-ux\
**Created:** [January 13, 2021, 9:14am UTC](https://forum.obsidian.md/t/view-structure-of-nested-tags-on-graph/11386 "2021-01-13T09:14:58Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![dkowalski](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/d/c89c15/32.png) [@dkowalski](https://forum.obsidian.md/u/dkowalski)\
**Post date:** [January 13, 2021, 9:14am UTC](https://forum.obsidian.md/t/view-structure-of-nested-tags-on-graph/11386/1 "2021-01-13T09:14:58Z")

</div>

### Use case or problem

Nested Tags creates a structure. Now each of element is shown as a separate tag. It’s not help to discover connections based on them.

Eg.

> #TAGROOT  
> #TAGROOT/LEVEL1a  
> #TAGROOT/LEVEL1a/SUBLEVEL1a  
> #TAGROOT/LEVEL1a/SUBLEVEL1b  
> #TAGROOT/LEVEL1a/SUBLEVEL1c  
> #TAGROOT/LEVEL1b  
> #TAGROOT/LEVEL1b/SUBLEVEL1a  
> #TAGROOT/LEVEL1b/SUBLEVEL1b  
> #TAGROOT/LEVEL1a/SUBLEVEL1c

### Proposed solution

I would like to have a view where a root of nested tag is connected with his childrens and each child with another one.

> #TAGROOT → LEVEL1a → SUBLEVEL1a  
> → SUBLEVEL1b  
> → SUBLEVEL1c  
> → LEVEL1b → SUBLEVEL1a  
> → SUBLEVEL1b  
> → SUBLEVEL1c

Additionally it would be fantastic to be able to fold/unfild each level of tags and show connection to selected level.

e.g.

I would like to see all notes connected to a root nested tag:

> #TAGROOT → connected to all notes where it is used

I would like to see all notes connected to a first level of nested tag:

> #TAGROOT → LEVEL1a  
> → LEVEL1b

### Current workaround (optional)

no

### Related feature requests (optional)

no

---

<div class="post-metadata">

**Author:** ![I-d-as](https://forum.obsidian.md/user_avatar/forum.obsidian.md/i-d-as/32/59965_2.png) [@I-d-as](https://forum.obsidian.md/u/I-d-as)\
**Post date:** [January 13, 2021, 6:01pm UTC](https://forum.obsidian.md/t/view-structure-of-nested-tags-on-graph/11386/2 "2021-01-13T18:01:17Z")

</div>

This sounds helpful but I am not sure I am understanding completely, so excuse my possible misunderstanding in this following workaround suggestion.

Could you try setting embedded search queries within a note set to a side pane?

If so, but you are requesting this for ease of use and improved interface, I understand and support that. Just thought I would mention this in case it is at all of benefit. This has me back interested in nested tags.

Thanks.

---

<div class="post-metadata">

**Author:** ![dkowalski](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/d/c89c15/32.png) [@dkowalski](https://forum.obsidian.md/u/dkowalski)\
**Post date:** [January 14, 2021, 8:00am UTC](https://forum.obsidian.md/t/view-structure-of-nested-tags-on-graph/11386/4 "2021-01-14T08:00:15Z")

</div>

> [@I-d-as](#):
>
> Could you try setting embedded search queries within a note set to a side pane?

Embedded searches are great. Whan I know to find it’s easy to use them. To discover new information or relations Graph is a better tool . I am using Embeded Search , you can see it there:

> [@(Un) Fold all nested tags](https://forum.obsidian.md/t/un-fold-all-nested-tags/10745/8):
>
> This tree grows fast because I create a productivity system. For example, one of my main nested tree: #F2F -\> a container for notes connected with my coworkers #F2F/NAME/ -\> coworker name #F2F/NAME/question -\> questions or issues to discuss with someone #F2F/NAME/eye-\> obeservation about someone #F2F/NAME/gear-\> task assigned for someone (without a date to be done) #F2F/NAME/gear/Y/21 -\> task assigned for someone, to be done during a year the 21 #F2F/NAME/gear/M/21/01 -\> ta…

According to the case described in the mentioned scenario, it is hard to find which my coworker is the best - which get the biggest number of positive feedback.

Now I’ll get a messy graph with a mix of tags: questions ❓ , negative feedback ❗, tasks ⚙, observations 👁, CR from the meetings ✅ and finally positive feedback 👍 (because each note can have any of them inside a content)

When I’ll have an option to show only:

> #F2F/(\*.)/👍/

I’ll be able to see clusters around some of them and I’ll be able to easily see and discover who is a winner.

---

<div class="post-metadata">

**Author:** ![drewt](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/d/848f3c/32.png) [@drewt](https://forum.obsidian.md/u/drewt)\
**Post date:** [January 22, 2021, 12:50am UTC](https://forum.obsidian.md/t/view-structure-of-nested-tags-on-graph/11386/8 "2021-01-22T00:50:55Z")

</div>

I think this is similar to my need. Possible an easier to consume example.

Currently, nested tags in graph are treated as a single tag. For example, there is no apparent difference between:

#Europe/Italy/Rome and #EuropeItalyRome

It would be helpful if the graph was hierarchical and branched at each sub-tag. This would allow a core tag in the graph of #Europe (with any general files on Europe connected). From there, the #Europe/Italy tag would connect to #Europe but contain files that are tagged #Europe/Italy. From #Europe/Italy the #Europe/Italy/Rome tag would be connected with its related files.

---

<div class="post-metadata">

**Author:** ![I-d-as](https://forum.obsidian.md/user_avatar/forum.obsidian.md/i-d-as/32/59965_2.png) [@I-d-as](https://forum.obsidian.md/u/I-d-as)\
**Post date:** [February 8, 2021, 7:22am UTC](https://forum.obsidian.md/t/view-structure-of-nested-tags-on-graph/11386/9 "2021-02-08T07:22:26Z")

</div>

Check out [Link Tags to Subtags in Graph](https://forum.obsidian.md/t/link-tags-to-subtags-in-graph/12506)

It is different than this feature request but does take care of this:

> [@drewt](#):
>
> Currently, nested tags in graph are treated as a single tag

Thanks.

---

<div class="post-metadata">

**Author:** ![Carabas](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/c/ce73a5/32.png) [@Carabas](https://forum.obsidian.md/u/Carabas)\
**Post date:** [February 6, 2021, 12:04pm UTC](https://forum.obsidian.md/t/view-structure-of-nested-tags-on-graph/11386/10 "2021-02-06T12:04:14Z")

</div>

Hi everyone,  
first, thank you for this amazing Application!

### Use case or problem

Subtags and Tags currently have no Connection in the Graph-View but are completly separate.

Because I don’t want a Connection between the Main-Tag and the SubTag lost, this makes me tag my Pages like this at the moment:

#books #books/fiction #books/fiction/fantasy

But this on the other hand leads to a lot of clutter in the Graph-View,

### Proposed solution

It would be nice if Sub-Tags would connect to there parents, so that there is a strong connection between Sub-Tag and parent, but Notes only need to link to their specific Sub-Tag. This would de-clutter my Graph a lot and lead to a nice Tag-Tree.

---

<div class="post-metadata">

**Author:** ![I-d-as](https://forum.obsidian.md/user_avatar/forum.obsidian.md/i-d-as/32/59965_2.png) [@I-d-as](https://forum.obsidian.md/u/I-d-as)\
**Post date:** [February 6, 2021, 1:01pm UTC](https://forum.obsidian.md/t/view-structure-of-nested-tags-on-graph/11386/11 "2021-02-06T13:01:13Z")

</div>

Good idea.

Makes sense to me. I see what you mean. But, maybe a toggle would be a good compromise.

Thanks.

---

<div class="post-metadata">

**Author:** ![Kuncy](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/k/4491bb/32.png) [@Kuncy](https://forum.obsidian.md/u/Kuncy)\
**Post date:** [February 7, 2021, 8:26am UTC](https://forum.obsidian.md/t/view-structure-of-nested-tags-on-graph/11386/12 "2021-02-07T08:26:48Z")

</div>

A Tag Tree Toggle! That is a wonderful idea!  
Even I was a little disappointed when subtags arent “sub-tags” per say, but they function as distinct tags, but with similar names.

---

<div class="post-metadata">

**Author:** ![Kuncy](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/k/4491bb/32.png) [@Kuncy](https://forum.obsidian.md/u/Kuncy)\
**Post date:** [February 10, 2021, 7:43pm UTC](https://forum.obsidian.md/t/view-structure-of-nested-tags-on-graph/11386/13 "2021-02-10T19:43:32Z")

</div>

Here’s something I’ve been thinking upon.

Once nested tags are graphically interpreted, I was wondering what would become of the relationship between the tags #America/History and #Canada/History?

I would like to hear everybody’s thoughts.

---

<div class="post-metadata">

**Author:** ![I-d-as](https://forum.obsidian.md/user_avatar/forum.obsidian.md/i-d-as/32/59965_2.png) [@I-d-as](https://forum.obsidian.md/u/I-d-as)\
**Post date:** [February 11, 2021, 3:09am UTC](https://forum.obsidian.md/t/view-structure-of-nested-tags-on-graph/11386/14 "2021-02-11T03:09:56Z")

</div>

I really like where you are going with this.

Maybe there could be a toggle switch in the Display section of graph settings to create a dotted connection between them.

Or, perhaps with either an automatic toggle or by creating a new tag called \*/History (or something legal), this new shared subtag node would be connected to all tags that had the History subtag.

I am having trouble finding it, but I had a similar feature or plugin idea using the same concept but for headings. In my idea, all notes that had a matching heading would be linked to a note with that heading name or a new note if one did not exist. Of course this would not be automatic and would have to be invoked.

Thanks.

---

<div class="post-metadata">

**Author:** ![Carabas](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/c/ce73a5/32.png) [@Carabas](https://forum.obsidian.md/u/Carabas)\
**Post date:** [February 11, 2021, 7:42am UTC](https://forum.obsidian.md/t/view-structure-of-nested-tags-on-graph/11386/15 "2021-02-11T07:42:50Z")

</div>

I think it would be more usefull if they were seperate at first, because them beeing linked would lead to a lot of overlap in a Tag-Tree and would make it hard to follow the branches from Main-Tag to Lowest-Level-Tag. But it would be nice if there was a Option to filter the Graph, to show only Notes tagged with \*/History/\* for Example.

---

<div class="post-metadata">

**Author:** ![iZeeRix](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/i/b782af/32.png) [@iZeeRix](https://forum.obsidian.md/u/iZeeRix)\
**Post date:** [March 15, 2021, 6:32pm UTC](https://forum.obsidian.md/t/view-structure-of-nested-tags-on-graph/11386/16 "2021-03-15T18:32:32Z")

</div>

+1 to that!

---

<div class="post-metadata">

**Author:** ![Ashton](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/a/9fc29f/32.png) [@Ashton](https://forum.obsidian.md/u/Ashton)\
**Post date:** [April 25, 2021, 1:20am UTC](https://forum.obsidian.md/t/view-structure-of-nested-tags-on-graph/11386/17 "2021-04-25T01:20:34Z")

</div>

Linking tags to nested tags on the graph seems super important! I want to start using a tag system, but I can’t imagine not having nested tags, and I don’t want nested tabs messing up my graph view by not being linked…

---

<div class="post-metadata">

**Author:** ![therocode](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/t/a183cd/32.png) [@therocode](https://forum.obsidian.md/u/therocode)\
**Post date:** [July 14, 2021, 1:31pm UTC](https://forum.obsidian.md/t/view-structure-of-nested-tags-on-graph/11386/18 "2021-07-14T13:31:18Z")

</div>

Just chipping in, I too would find it highly useful if nested tags connected in a meaningful way.

At the very least I think that connections should be made between direct descendants so that the tag #philosophy would connect to #philosophy/socrates and to #philosophy/democrates but the two nested tags would not connect to each other. That way you would get a tree structure which feels very natural when navigating.

---

<div class="post-metadata">

**Author:** ![D-side](https://forum.obsidian.md/user_avatar/forum.obsidian.md/d-side/32/17629_2.png) [@D-side](https://forum.obsidian.md/u/D-side)\
**Post date:** [July 27, 2021, 6:00pm UTC](https://forum.obsidian.md/t/view-structure-of-nested-tags-on-graph/11386/19 "2021-07-27T18:00:37Z")

</div>

## 🚧 A very messy workaround, but a workaround

**tl;dr: I created a note that links to the base tag and all its nested tags, pulling them together on the graph.** And hacked together an automated way to pull nested tags given a base one.

🤷‍♀️ I originally, for the laughs, created a note named after the base tag, even with the `#`, `#geo` (subtags of which I use in locations for Map View, like `#geo/beach`). Having the note, I just went ahead and mentioned every tag nested under it in that note. Manually. And once I opened the graph, it seemed to work perfectly! I put that note into its own folder and assigned it a color so that it would _blend in_ with the other tags.

🤔 E-e-e-except for one small problem. When trying to extend that practice to other tags I learned that **this was only working fine because the base tag was not in use**. So when I created a note that only had the base tag, `#geo` itself, I suddenly had _two_ dots on the graph named `#geo` — one for the tag and one for the note. That was confusing. And thanks to my color hack I couldn’t even tell them apart 😁 So I assigned this note a different color of course.

> ⚠ …and I later discovered that Obsidian on Android cannot create a file with `#` in the name. So I had to remove it from the note name anyway. It worked on Windows though.

💡 But on second thought — it actually did the job! It pulled the nested tags together! Sure, there’s one unnecessary link and the base tag got hard to spot, but the **structure** is mostly there. I just had to mention the _base_ tag in the **“pulling note”** (as I’ve gotten to call them) too, in order to not have it dangling elsewhere.

* * *

### Automation

Now, of course I had to automate this. Gathering tags by hand is tedious. I solved some of this using [Dataview](https://blacksmithgu.github.io/obsidian-dataview/) plugin. I mention the **base tag** I want to pull the subtags of, place this snippet on the page and, well, follow what it says:

````markdown
Automation snippet to maintain the list (copy&paste its results from preview window into the file):

```dataviewjs
let currentPage = dv.page(this.currentFilePath)
let pageTags = currentPage.file.etags;
let query = pageTags.join(" or ");
let queryTags = (query === "")
    ? []
    : dv.pages(query).file.etags.array();
dv.paragraph(
  [...new Set(queryTags)].join(" ")
);
```

````

- Sadly, this only really handles single-level tag nesting, because it gets all of the **descendants** of mentioned tags, not just direct children! This is JavaScript though, so it’s got to be fixable. I haven’t (yet?) gone that deep into the tags.
- It already does **not** match ancestors: if you mention a **nested** tag, it’s **not** going to return the base tag of it in the result.
- Still a bit of manual action whenever a new tag is introduced. But the snippet does make initial setup easier, and makes future tagging sprees manageable.
- It handles **multiple** base tags just fine. That goes beyond the workaround, but the snippet does not care.

Better than nothing overall. I hope this helps someone out there.

* * *

Still waiting for a native solution though. Pretty please? 🙂

---

<div class="post-metadata">

**Author:** ![Fanshu](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/f/d2c977/32.png) [@Fanshu](https://forum.obsidian.md/u/Fanshu)\
**Post date:** [July 27, 2021, 7:11pm UTC](https://forum.obsidian.md/t/view-structure-of-nested-tags-on-graph/11386/20 "2021-07-27T19:11:14Z")

</div>

I have the same idea.

---

<div class="post-metadata">

**Author:** ![Hevel](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/h/e274bd/32.png) [@Hevel](https://forum.obsidian.md/u/Hevel)\
**Post date:** [August 17, 2021, 10:16am UTC](https://forum.obsidian.md/t/view-structure-of-nested-tags-on-graph/11386/21 "2021-08-17T10:16:45Z")

</div>

Hello, any update on this ? I don’t know if I should change the way I use tags or if a solution will come out eventually.

---

<div class="post-metadata">

**Author:** ![yistc](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/y/ecd19e/32.png) [@yistc](https://forum.obsidian.md/u/yistc)\
**Post date:** [August 31, 2021, 1:10pm UTC](https://forum.obsidian.md/t/view-structure-of-nested-tags-on-graph/11386/22 "2021-08-31T13:10:29Z")

</div>

Any updates?  
A toggle that could reveal relations between nested tags and root tags would be perfect.

---

<div class="post-metadata">

**Author:** ![turiiya](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/t/ecc23a/32.png) [@turiiya](https://forum.obsidian.md/u/turiiya)\
**Post date:** [December 4, 2021, 5:17am UTC](https://forum.obsidian.md/t/view-structure-of-nested-tags-on-graph/11386/23 "2021-12-04T05:17:34Z")

</div>

I’m voting for this one!

---

<div class="post-metadata">

**Author:** ![onqun](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/o/b77776/32.png) [@onqun](https://forum.obsidian.md/u/onqun)\
**Post date:** [January 4, 2022, 11:31am UTC](https://forum.obsidian.md/t/view-structure-of-nested-tags-on-graph/11386/24 "2022-01-04T11:31:09Z")

</div>

Any updates with this feature?

[Next page](https://forum.obsidian.md/t/view-structure-of-nested-tags-on-graph/11386.md?page=2)
