---
name: obsidian-bases
component: obsidian
description: >-
  Obsidian bases and dataview query patterns for structured vault queries.
  Covers file-based query patterns, frontmatter filtering, and built-in
  table views. Advanced dataview/REST API features are deferred.
type: utility
trigger-patterns:
  - vault queries
  - data aggregation
  - structured search
category: tooling
tags:
  - obsidian
  - bases
  - dataview
  - queries
---

# Obsidian Bases

Patterns for querying and aggregating structured data from vault notes.

## Obsidian Bases (Built-in)

Bases is Obsidian's built-in feature for creating table views of notes. It works without plugins.

### Creating a Base

1. Create a new note with the base view type
2. Configure columns from frontmatter fields
3. Set filters and sort order

Bases query frontmatter properties across notes in a folder or the entire vault.

### Frontmatter Properties for Bases

Design your notes with queryable frontmatter:

```yaml
---
title: Auth Implementation Summary
phase: 04
plan: 01
status: complete
tags:
  - gmd
  - implementation
completed: 2026-04-10
duration: 4min
tasks_completed: 2
---
```

Properties Bases can filter on:
- `tags` -- multi-value filtering
- `status` -- single-value matching
- `phase` / `plan` -- numeric range filtering
- Any custom property defined in frontmatter

## Dataview Queries (Plugin)

When the Dataview plugin is available, use code-block queries for richer aggregation.

> [!note]
> Dataview is a community plugin. Check availability before relying on it.
> File-based approaches (Bases, manual frontmatter) always work.

### TABLE Queries

```dataview
TABLE phase, status, duration
FROM "GMD/Projects/GetMagicDone/Phases"
WHERE status = "complete"
SORT phase ASC
```

### LIST Queries

```dataview
LIST
FROM #decision AND #phase-04
SORT file.ctime DESC
```

### TASK Queries

```dataview
TASK
FROM "GMD/Projects/GetMagicDone"
WHERE !completed
```

### Inline Queries

```markdown
Total phases: `= length(filter(this.file.tasks, (t) => t.completed))`
```

## File-Based Query Patterns

For programmatic access without Dataview, query vault files directly:

```javascript
const fs = require('fs');
const path = require('path');

function queryNotes(vaultDir, filter) {
  const results = [];
  const files = fs.readdirSync(vaultDir, { recursive: true });
  for (const file of files) {
    if (!file.endsWith('.md')) continue;
    const content = fs.readFileSync(path.join(vaultDir, file), 'utf8');
    const fm = parseFrontmatter(content);
    if (filter(fm)) results.push({ file, frontmatter: fm });
  }
  return results;
}

// Example: find all complete phase summaries
const summaries = queryNotes(vaultRoot, (fm) =>
  fm.status === 'complete' && fm.tags?.includes('gmd')
);
```

## Tagging Strategy for Queries

Consistent tagging enables effective queries:

| Tag | Purpose |
|-----|---------|
| `#gmd` | All GMD-related notes |
| `#phase-XX` | Phase-specific notes |
| `#decision` | Decision records |
| `#research` | Research findings |
| `#summary` | Plan summaries |
| `#blocker` | Known blockers |

## When to Use This Skill

- Building dashboard or index notes that aggregate project data
- Querying vault notes by frontmatter properties
- Creating filtered views of phases, decisions, or research
- Any structured data retrieval from vault content
