obsidian-bases
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chineseobsidian-bases: Obsidian's Database Layer
obsidian-bases: Obsidian的数据库层
Obsidian Bases (launched 2025) turns vault notes into queryable, dynamic views. Tables, cards, lists, maps. Defined in files. No plugin required; it is a core Obsidian feature.
.baseSubstrate preference (v1.7+): This skill is a self-contained fallback. Prefer as the authoritative substrate — its skill is the canonical reference for Bases YAML, formulas, and view definitions. If you see an skill available without the namespace, that is kepano's version: use it. The reference below is provided so the plugin remains functional when kepano's marketplace is not installed. Install: . Official Bases docs: https://help.obsidian.md/bases/syntax
kepano/obsidian-skillsobsidian-basesobsidian-basesclaude-obsidian:claude plugin marketplace add kepano/obsidian-skillsObsidian Bases(2025年推出)可将库笔记转换为可查询的动态视图,支持表格、卡片、列表、地图等形式。通过文件定义,无需安装插件,是Obsidian的核心功能。
.baseSubstrate偏好(v1.7+):本技能是一个独立的备用方案。**优先使用**作为权威基础库——其技能是Bases YAML、公式和视图定义的标准参考。如果您看到不带命名空间的技能,那就是kepano的版本,请使用它。提供以下参考是为了当kepano的市场插件未安装时,本插件仍能正常运行。安装方式:。官方Bases文档:https://help.obsidian.md/bases/syntax
kepano/obsidian-skillsobsidian-basesclaude-obsidian:obsidian-basesclaude plugin marketplace add kepano/obsidian-skillsFile Format
文件格式
.basefiltersformulaspropertiessummariesviewsyaml
undefined.basefiltersformulaspropertiessummariesviewsyaml
undefinedGlobal filters: apply to ALL views
Global filters: apply to ALL views
filters:
and:
- file.hasTag("wiki")
- 'status != "archived"'
filters:
and:
- file.hasTag("wiki")
- 'status != "archived"'
Computed properties
Computed properties
formulas:
age_days: '(now() - file.ctime).days.round(0)'
status_icon: 'if(status == "mature", "✅", "🔄")'
formulas:
age_days: '(now() - file.ctime).days.round(0)'
status_icon: 'if(status == "mature", "✅", "🔄")'
Display name overrides for properties panel
Display name overrides for properties panel
properties:
status:
displayName: "Status"
formula.age_days:
displayName: "Age (days)"
properties:
status:
displayName: "Status"
formula.age_days:
displayName: "Age (days)"
One or more views
One or more views
views:
- type: table
name: "All Pages"
order:
- file.name
- type
- status
- updated
- formula.age_days
---views:
- type: table
name: "All Pages"
order:
- file.name
- type
- status
- updated
- formula.age_days
---Filters
Filters(筛选器)
Filters select which notes appear. Applied globally or per-view.
yaml
undefinedFilters用于选择要显示的笔记,可全局应用或按视图应用。
yaml
undefinedSingle string filter
Single string filter
filters: 'status == "current"'
filters: 'status == "current"'
AND: all must be true
AND: all must be true
filters:
and:
- 'status != "archived"'
- file.hasTag("wiki")
filters:
and:
- 'status != "archived"'
- file.hasTag("wiki")
OR: any can be true
OR: any can be true
filters:
or:
- file.hasTag("concept")
- file.hasTag("entity")
filters:
or:
- file.hasTag("concept")
- file.hasTag("entity")
NOT: exclude matches
NOT: exclude matches
filters:
not:
- file.inFolder("wiki/meta")
filters:
not:
- file.inFolder("wiki/meta")
Nested
Nested
filters:
and:
- file.inFolder("wiki/")
- or:
- 'type == "concept"'
- 'type == "entity"'
undefinedfilters:
and:
- file.inFolder("wiki/")
- or:
- 'type == "concept"'
- 'type == "entity"'
undefinedFilter operators
Filter运算符
==!=><>=<===!=><>=<=Useful filter functions
实用Filter函数
| Function | Example |
|---|---|
| Notes with tag |
| Notes in folder |
| Notes linking to Note |
| 函数 | 示例 |
|---|---|
| 带有标签 |
| 指定文件夹中的笔记 |
| 链接到Note的笔记 |
Properties
Properties(属性)
Three types:
- Note properties: from frontmatter: ,
status,typeupdated - File properties: metadata: ,
file.name,file.mtime,file.size,file.ctime,file.tagsfile.folder - Formula properties: computed:
formula.age_days
分为三种类型:
- 笔记属性:来自前置元数据:、
status、typeupdated - 文件属性:元数据:、
file.name、file.mtime、file.size、file.ctime、file.tagsfile.folder - 公式属性:计算得出:
formula.age_days
Formulas
Formulas(公式)
Defined in . Referenced as in and .
formulas:formula.nameorder:properties:yaml
formulas:
# Days since created
age_days: '(now() - file.ctime).days.round(0)'
# Days until a date property
days_until: 'if(due_date, (date(due_date) - today()).days, "")'
# Conditional label
status_icon: 'if(status == "mature", "✅", if(status == "developing", "🔄", "🌱"))'
# Word count estimate
word_est: '(file.size / 5).round(0)'Key rule: Subtracting two dates returns a . Not a number. Always access first:
Duration.daysyaml
undefined在中定义,在和中通过引用。
formulas:order:properties:formula.nameyaml
formulas:
# Days since created
age_days: '(now() - file.ctime).days.round(0)'
# Days until a date property
days_until: 'if(due_date, (date(due_date) - today()).days, "")'
# Conditional label
status_icon: 'if(status == "mature", "✅", if(status == "developing", "🔄", "🌱"))'
# Word count estimate
word_est: '(file.size / 5).round(0)'关键规则:两个日期相减会返回类型,而非数字。必须先访问属性:
Duration.daysyaml
undefinedCORRECT
CORRECT
age: '(now() - file.ctime).days'
age: '(now() - file.ctime).days'
WRONG: crashes
WRONG: crashes
age: '(now() - file.ctime).round(0)'
**Always guard nullable properties with `if()`**:
```yamlage: '(now() - file.ctime).round(0)'
**始终用`if()`处理可空属性**:
```yamlCORRECT
CORRECT
days_left: 'if(due_date, (date(due_date) - today()).days, "")'
---days_left: 'if(due_date, (date(due_date) - today()).days, "")'
---View Types
视图类型
Table
表格(Table)
yaml
views:
- type: table
name: "Wiki Index"
limit: 100
order:
- file.name
- type
- status
- updated
groupBy:
property: type
direction: ASCyaml
views:
- type: table
name: "Wiki Index"
limit: 100
order:
- file.name
- type
- status
- updated
groupBy:
property: type
direction: ASCCards
卡片(Cards)
yaml
views:
- type: cards
name: "Gallery"
order:
- file.name
- tags
- statusyaml
views:
- type: cards
name: "Gallery"
order:
- file.name
- tags
- statusList
列表(List)
yaml
views:
- type: list
name: "Quick List"
order:
- file.name
- statusyaml
views:
- type: list
name: "Quick List"
order:
- file.name
- statusWiki Vault Templates
Wiki库模板
Wiki content dashboard (all non-meta pages)
Wiki内容仪表盘(所有非元数据页面)
yaml
filters:
and:
- file.inFolder("wiki/")
- not:
- file.inFolder("wiki/meta")
formulas:
age: '(now() - file.ctime).days.round(0)'
properties:
formula.age:
displayName: "Age (days)"
views:
- type: table
name: "All Wiki Pages"
order:
- file.name
- type
- status
- updated
- formula.age
groupBy:
property: type
direction: ASCyaml
filters:
and:
- file.inFolder("wiki/")
- not:
- file.inFolder("wiki/meta")
formulas:
age: '(now() - file.ctime).days.round(0)'
properties:
formula.age:
displayName: "Age (days)"
views:
- type: table
name: "All Wiki Pages"
order:
- file.name
- type
- status
- updated
- formula.age
groupBy:
property: type
direction: ASCEntity index (people, orgs, repos)
实体索引(人物、组织、仓库)
yaml
filters:
and:
- file.inFolder("wiki/entities/")
- 'file.ext == "md"'
views:
- type: table
name: "Entities"
order:
- file.name
- entity_type
- status
- updated
groupBy:
property: entity_type
direction: ASCyaml
filters:
and:
- file.inFolder("wiki/entities/")
- 'file.ext == "md"'
views:
- type: table
name: "Entities"
order:
- file.name
- entity_type
- status
- updated
groupBy:
property: entity_type
direction: ASCRecent ingests
近期导入内容
yaml
filters:
and:
- file.inFolder("wiki/sources/")
views:
- type: table
name: "Sources"
order:
- file.name
- source_type
- created
- status
groupBy:
property: source_type
direction: ASCyaml
filters:
and:
- file.inFolder("wiki/sources/")
views:
- type: table
name: "Sources"
order:
- file.name
- source_type
- created
- status
groupBy:
property: source_type
direction: ASCEmbedding in Notes
在笔记中嵌入
markdown
![[MyBase.base]]
![[MyBase.base#View Name]]markdown
![[MyBase.base]]
![[MyBase.base#View Name]]Where to Save
保存位置
Store files in for vault dashboards:
.basewiki/meta/- : main content view
wiki/meta/dashboard.base - : entity tracker
wiki/meta/entities.base - : ingestion log
wiki/meta/sources.base
将文件存储在目录下用于库仪表盘:
.basewiki/meta/- :主内容视图
wiki/meta/dashboard.base - :实体追踪器
wiki/meta/entities.base - :导入日志
wiki/meta/sources.base
YAML Quoting Rules
YAML引用规则
- Formulas with double quotes → wrap in single quotes:
'if(done, "Yes", "No")' - Strings with colons or special chars → wrap in double quotes:
"Status: Active" - Unquoted strings with break YAML parsing
:
- 包含双引号的公式→用单引号包裹:
'if(done, "Yes", "No")' - 包含冒号或特殊字符的字符串→用双引号包裹:
"Status: Active" - 未加引号且包含的字符串会破坏YAML解析
:
What Not to Do
注意事项
- Do not use or
from:: those are Dataview syntax, not Obsidian Baseswhere: - Do not use at the root level: sorting is per-view via
sort:andorder:groupBy: - Do not put files outside the vault: they only render inside Obsidian
.base - Do not reference in
formula.Xwithout definingorder:inXformulas:
- 不要使用或
from::这些是Dataview语法,而非Obsidian Bases语法where: - 不要在根级别使用:排序需通过视图内的
sort:和order:实现groupBy: - 不要将文件存储在库外:它们仅能在Obsidian内渲染
.base - 不要在中引用未在
order:中定义的formulas:formula.X
How to think (10-principle mapping)
思考原则(10-principle mapping)
When working on this skill, apply the 10-principle loop. See for the canonical framework.
skills/think/SKILL.md| # | Principle | Application here |
|---|---|---|
| 1 | OBSERVE (ext) | The |
| 2 | OBSERVE (int) | Am I documenting yesterday's spec or today's? Bases evolves fast post-GA. |
| 3 | LISTEN | The user's specific Bases use-case (dashboard, filter chain, computed property). |
| 4 | THINK | Which filter operators, formula syntax, view types apply? Validate against the current spec. |
| 5 | CONNECT (lat) | How do Bases relate to Dataview queries? Properties? Canvas overlays? Map the deltas. |
| 6 | CONNECT (sys) | Obsidian Bases is post-1.10 GA; substrate-defer to kepano/obsidian-skills when present. |
| 7 | FEEL | Examples that actually parse and render. Pseudo-syntax wastes the user. |
| 8 | ACCEPT | Bases spec evolves; some features in this doc may have changed. Keep the version note current. |
| 9 | CREATE | Schema docs + worked examples that render in the user's actual Obsidian version. |
| 10 | GROW | As Bases features ship, refresh the reference. Track upstream releases. |
使用本技能时,请遵循10原则循环。标准框架请参考。
skills/think/SKILL.md| 序号 | 原则 | 应用场景 |
|---|---|---|
| 1 | OBSERVE (ext) | 用户正在编写的 |
| 2 | OBSERVE (int) | 我记录的是昨天的规范还是今天的?Bases在正式发布后迭代很快。 |
| 3 | LISTEN | 用户的具体Bases使用场景(仪表盘、筛选链、计算属性)。 |
| 4 | THINK | 哪些Filter运算符、公式语法、视图类型适用?对照当前规范验证。 |
| 5 | CONNECT (lat) | Bases与Dataview查询、属性、Canvas叠加层有何关联?梳理差异。 |
| 6 | CONNECT (sys) | Obsidian Bases是1.10版本后正式发布的;当存在kepano/obsidian-skills时,优先使用其作为基础库。 |
| 7 | FEEL | 提供能实际解析和渲染的示例,伪语法对用户毫无用处。 |
| 8 | ACCEPT | Bases规范不断演进;本文档中的部分功能可能已变更。请保持版本说明的时效性。 |
| 9 | CREATE | 提供能在用户实际Obsidian版本中渲染的架构文档和实用示例。 |
| 10 | GROW | 随着Bases功能发布,更新参考文档,追踪上游版本。 |