No history yet

Metadata Foundations

Data About Data

Every note you write in Obsidian contains information. That's the data. But what if you could add information about that information? This is the core idea of metadata—it's data about your data.

Think of a library book. The book itself is the data. The little card in the back or the entry in the catalog—with the author, publication date, and genre—is the metadata. It helps you understand and organize the book without having to read it first.

In Obsidian, we can create these digital index cards for our notes. This practice transforms your collection of notes from a simple pile of text into a structured, searchable database. The Dataview plugin is the tool that reads these index cards, but first, we need to learn how to write them.

Using YAML Frontmatter

The most common way to add metadata in Obsidian is with YAML frontmatters. This is a special block of text that must be at the very top of your note, enclosed by triple dashes (---). Anything you put inside this block is treated as metadata by Obsidian and plugins like Dataview.

Metadata is organized into key-value pairs. A "key" is like a label, and a "value" is the information for that label. You write them with a colon and a space in between.

Key: Value

For example, if you were writing a book summary, your metadata might look like this:

---
author: "J.R.R. Tolkien"
title: "The Hobbit"
rating: 5
finished: true
date_read: 2023-08-15
tags:
  - fantasy
  - adventure
  - classic
---

# My Notes on The Hobbit

This book was an incredible journey...

Understanding Data Types

The "value" in a key-value pair can be different types of data. Getting the type right is important for when you want to sort or filter your notes later. Here are the most common ones:

Data TypeDescriptionExample
TextA sequence of characters. Wrap in quotes if it contains special characters.status: "In Progress"
NumberA whole number or a decimal. No quotes needed.pages: 310
DateA specific date, formatted as YYYY-MM-DD.created: 2024-10-26
BooleanA simple true or false value.published: false
ListA collection of items, indented with dashes or in brackets.tags: [books, fiction]

Using these types correctly allows Dataview to do powerful things, like finding all notes where published is true or sorting book notes by rating.

Inline Metadata

Sometimes, metadata belongs right in the middle of a sentence. For this, you can use inline fields. The syntax is two colons, with no spaces, between the key and the value.

Key:: Value

This is great for tracking data that feels more natural as part of your writing. For example, instead of putting a completion date in the frontmatter, you could write it directly in your notes.

  • Project A started on StartDate:: 2023-01-10.
  • I finally completed the main objective on CompletionDate:: 2023-05-21.

Dataview will find StartDate and CompletionDate just as if they were in the frontmatter. This keeps your data in context, making your notes more readable and your data entry more seamless.

Now you have the foundational skills to add structured data to any note in your vault. By using YAML frontmatter and inline fields, you're no longer just writing notes; you're building a personal knowledge database.

Quiz Questions 1/5

What is the primary purpose of adding metadata to your Obsidian notes?

Quiz Questions 2/5

Where must YAML frontmatter be placed in an Obsidian note and how is it enclosed?