Skip to content

Obsidian wikilinks prefixed with the scan folder name are dropped (no references edge) #4559

Open

Description

@CryptoRMac4

Version: graphifyy 0.9.48, graphify update . --force on an Obsidian vault folder.

Problem: _vault_lookup in graphify/extractors/markdown.py resolves [[Note]] and [[wiki/Note]], but a vault-root style link that starts with the scan folder's own name, such as [[Corp/wiki/Delta|alias]] or [[Corp/wiki/Fox]] (scan root is Corp/), never becomes a references edge. Obsidian vaults whose scan root is a sub-folder of the vault commonly link this way, because Obsidian shows the vault-relative path. The path suffix Corp/wiki/Fox.md never matches the root-relative index entry wiki/Fox.md, so the edge is dropped silently.

Repro:

Corp/Alpha.md      [[Bravo]] [[wiki/Charlie]] [[Corp/wiki/Delta|alias]] [[Corp/wiki/Fox]]
Corp/Bravo.md
Corp/wiki/{Charlie,Delta,Fox}.md
cd Corp && graphify update . --force

Expected: 4 references edges from Alpha. Actual: 2 (Bravo, Charlie).

On a real vault folder this meant about 119 references edges against about 10,000 contains edges; after the fix the same folder produced about 1,500.

Suggested fix: in _vault_lookup, when no candidate matches and the first path segment equals the scan root's folder name, retry with that segment stripped:

if not matches and len(parts) > 1 and parts[0] == _nfc(Path(root).name):
    suffix2 = "/".join(parts[1:])
    matches = [c for c in candidates if c[1] == suffix2 or c[1].endswith("/" + suffix2)]

Activity

  1. github-actions commented on Oct 18, 2026

    @github-actions

    Thanks for opening this issue, @CryptoRMac4. A maintainer will take a look soon.

    If you would like to discuss it in real time, come say hi on our Discord server. For longer-form questions and ideas there is also GitHub Discussions.

    To help us triage, please make sure the report includes what you expected, what actually happened, and the steps (and a small sample) to reproduce it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions