
Turning Markdown Files into a Queryable Knowledge Graph
Markdown files often contain more structure than we give them credit for. With YAML frontmatter and consistent links, a collection of Markdown files can behave like a small knowledge graph. Many people already use YAML frontmatter to store metadata: --- id : mission-klendathu type : mission commander : [[ johnny-rico ]] date : 2297-08-01 --- Once files have consistent IDs and links between them, something interesting happens: files become nodes [[links]] become relations the collection of files becomes a graph Querying Markdown One approach is to define queries directly inside Markdown files. If you can query that graph, Markdown stops being just documents — it becomes structured data . For example: !view mission where commander = [[johnny-rico]] select date, outcome sort date desc The query runs over all Markdown files and returns matching nodes. In my case, I tried building a VS Code extension to explore this idea. Live Query Results !view queries render results as tables inside the
Continue reading on Dev.to
Opens in a new tab

