Links: Body vs Frontmatter

LinkCache[] — wikilinks and markdown links in the note body. Does NOT include frontmatter links.

FrontmatterLinkCache[][[wikilinks]] inside YAML frontmatter property values1. Each entry has a key field identifying which frontmatter property contained the link.

The Dataview PR that added frontmatter link support explicitly documents: “These links are not added to the .links property in CachedMetadata. Instead they are added as a new and separate property called .frontmatterLinks.”2

Record<string, Record<string, number>> — the fully resolved link graph. Includes both body AND frontmatter links. The count includes all occurrences regardless of source.

Evidence

From the obsidian-tasks plugin test vault345:

// link_in_yaml.md — has ONLY a frontmatter link
// frontmatterLinks: [{ link: "yaml_tags_is_empty", key: "test-link" }]
// links: (not present)
// resolvedLinks: { "Test Data/yaml_tags_is_empty.md": 1 } ← INCLUDED
 
// link_in_file_body.md — has ONLY a body link
// links: [{ link: "yaml_tags_is_empty" }]
// frontmatterLinks: (not present)
// resolvedLinks: { "Test Data/yaml_tags_is_empty.md": 1 } ← INCLUDED

Both appear in resolvedLinks, but they’re in different CachedMetadata properties.

Since resolvedLinks doesn’t distinguish sources, we determine provenance by:

  1. For each source in resolvedLinks, resolve its CachedMetadata.frontmatterLinks to destination paths
  2. Count how many frontmatter links point to each destination
  3. Compare against the total count in resolvedLinks:

If related: "[[target]]" and see-also: "[[target]]" both exist in the same file, resolvedLinks reports count: 2 and fmCount: 2. Since totalCount === fmCount, the link is correctly classified as frontmatter-only.

Footnotes

  1. obsidian-tasks test data — resolvedLinks.json