Converting yaml data into dangling links that show up in suggested

Hello! Sorry in advance if this is a stupid question, I have limited coding knowledge.
TLDR: I’m trying to print some frontmatter values as real links in the note body that show up as suggested links when typing [[.

If I use dataview, I can get the frontmatter listed like links, but they will not show up as suggested links when typing [[ in a new note. I understand why since it’s just a query, but now I’m wondering if there is a way I can do it without dataview. Hopefully this makes sense.

For context, I’m using the Linked Data Vocabularies plugin that uses the Library of Congress subject headings and also supplies narrow and broad topics related. The plugin auto-inserts the yaml data from a json. I’m hoping to list the narrow topics in each note as a non-existent/dangling link so that it shows up in the suggested links by typing [[ to easily link to a topic and keep everything automatically connected.

Example:
My Psychology note has yaml for “narrower” topics, imported by the linked vocabulary plugin

narrower:

  • Evolutionary Psychology
  • Positive Psychology
  • Behavioral Psychology

I used dataview like this:

LIST link(file.frontmatter.narrower)
WHERE file.path = this.file.path

This creates a list of links for the narrow property, but they don’t show up as suggested ones like other non-existent notes when linking in Obsidian. I thought of having a giant list of headings from the Library of Congress each listed with brackets in one single note, but it made Obsidian too sluggish. I’ve also thought of ways to automatically update the yaml items to have brackets, but realized those don’t come up for suggested either. Have looked into some Templater options too that take from the frontmatter but couldn’t figure it out. The plugin that inserts the broader and narrower items pulls from a JSON, so maybe that could directly be edited to already have link format, but I’d have no idea where to start for that.

Is this possible in any easy way? Thanks for reading!

1 Like

Would inline metadata work?

narrower:: [[Evolutionary Psychology]], [[Positive Psychology]], [[Behavioral Psychology]]

```dataview 
LIST narrower
WHERE file.path = this.file.path
```

Yes! One problem is that the Linked Data Vocabularies plugin only plugs data into frontmatter though. I did find a workaround by using the plugin Various Complements and adding all of the Library of Congress subject headings as a custom dictionary, which will show up like suggestions once I type them. Was also advised to try suggester() from the Templater plugin to do the same sort of thing as I’m doing with Various Complements. We shall see!

2 Likes

Ah, I understand more clearly now. I don’t have a solution but hopefully someone else (like holroy, perhaps) will. :crossed_fingers:

The general concept is that dataview is dynamic, and not static. This means that the links will not be in the Obsidian cache.

However, if you apply a template then it can insert those links into your document and make them static. And then you’ve got some options available, like you could use Templater and look through your frontmatter and display it as links.

Or you could do a markdown query variant of dataview from inside the template, and output that result.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.