Is it possible to extract the edge list of the graph?

I was doing a project on network analysis, and I want to use my own note graph as the network.

Is it possible to extract the edge list of the graph view so that I can construct the graph for my analysis?

Sure. You can do it externally (outside of Obsidian). If you’re on a Mac:

  • Open Terminal app
  • type: cd vault_directory
    (Where “vault_directory” is the root directory of your vault)
  • type: egrep -roI ‘\[\[[^]|^]+’ | sed ‘s/:\[\[/ -> /’

This is a rough solution I whipped up in 5 minutes; it does not capture external links because when I finished this, I realized that external links have a slightly different grammar. But you can capture those as well using the same method. Header and block links are captured, and will appear as duplicate edges in the output. Just add " | sort -u" to the end of that command if you don’t want the duplicates.

Edit: typo

related: Semantic Markdown (v0.3.4): Visualize and Query your Obsidian vault in Neo4j!
By default it does not extract all links/edges but regexreplace can be used on copy of the vault to put new line and some text before each link and new line after each link to make it work with current version of the tool. Then all links will be extracted to Neo4j (for network analysis).