Block metadata - extension of block-id syntax

Proposed solution: yaml enclosed in curly braces after caret symbol.
E.g. ^{id: block-id, date created: 2020-11-06, authors: [he, me], inspired by: "Obsidian://vault/myvault/an%20idea"}

{#block-id, key = value, key = value}
In some existing formats (e.g. markua), metadata is located one line before multiline block (html div tag) or immediately after an “inline block”{#span-id} or after a # header {#heading-id} (extended markdown).

Initial caret symbol would indicate that it applies to the same scope as current Obsidian block-id syntax, not as in other formats.

It could extend to more lines with simple YAML notation and e.g. be optionally folded by default in editor.

If the YAML can be unambiguously recognized from “key = value” format, then both formats can be accepted or maybe even mixed, or extended to allow things like inclusion of unquoted wikilinks within yaml or “{#block-id}” which is syntactic sugar for “{id = block-id}” in some existing formats. So we could have e.g.

^{#block-id 
	title: flexible format for block metadata
	date created: 2020-11-06
	authors: [ '[[he]]', me ]
	inspired by: '[[an idea]]'
	SRS: {last rep: 2020-10-13, mark: easy, next rep: 2021-08-06} 
	}

Future use cases

  • conversion between block-metadata and YAML-front-matter when refactoring notes from blocks to separate files and back
  • filtering blocks in search
  • displaying values in columns alongside text, like e.g. in “Notion” software or in Windows-File-Explorer.
  • tracking of provenance
  • conversion to graph database and analysis e.g. in Neo4j with Cypher

Keywords:

  • attributes, database, graph, metadata, properties

Related feature requests:

9 Likes

This is so cool. Obsidian has power of metadata and Obsidian will rule structural and unstructural–whole-- data.

1 Like

Is there any thought for allowing arbitrary block boundaries? I’m think of being able to assign a single block-id to an arbitrary amount of content, including different elements (e.g., headers, paragraphs, lists, etc.).