tag-taxonomy

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Tag Taxonomy — Controlled Vocabulary for Wiki Tags

标签分类法——Wiki标签受控词汇表

You are enforcing consistent tagging across the wiki by normalizing tags to a controlled vocabulary.
你需要通过将标签规范化为受控词汇,在整个wiki中强制执行统一的标签规范。

Before You Start

开始之前

  1. Read
    .env
    to get
    OBSIDIAN_VAULT_PATH
  2. Read
    $OBSIDIAN_VAULT_PATH/_meta/taxonomy.md
    — this is the canonical tag list
  3. Read
    index.md
    to understand the wiki's scope
  1. 读取
    .env
    获取
    OBSIDIAN_VAULT_PATH
  2. 读取
    $OBSIDIAN_VAULT_PATH/_meta/taxonomy.md
    ——这是权威的标签列表
  3. 读取
    index.md
    了解wiki的范围

The Taxonomy File

分类法文件

The canonical tag vocabulary lives at
$OBSIDIAN_VAULT_PATH/_meta/taxonomy.md
. It defines:
  • Canonical tags — the tags that should be used
  • Aliases — common alternatives that should be mapped to the canonical form
  • Rules — max 5 tags per page, lowercase/hyphenated, prefer broad over narrow
  • Migration guide — specific renames for known inconsistencies
Always read this file before tagging. It's the source of truth.
权威标签词汇表存放在
$OBSIDIAN_VAULT_PATH/_meta/taxonomy.md
,它定义了:
  • 规范标签——应该使用的标签
  • 别名——常见的替代标签,应该映射到规范形式
  • 规则——每页最多5个标签,小写/用连字符连接,优先使用宽泛而非狭窄的标签
  • 迁移指南——针对已知不一致问题的具体重命名规则
在打标签之前请务必阅读此文件,它是唯一可信来源。

Mode 1: Tag Audit

模式1:标签审计

When the user wants to see the current state of tags:
当用户想要查看标签的当前状态时:

Step 1: Scan all pages

步骤1:扫描所有页面

Glob: $VAULT_PATH/**/*.md (excluding _archives/, .obsidian/, _meta/)
Extract: tags field from YAML frontmatter
Glob: $VAULT_PATH/**/*.md (excluding _archives/, .obsidian/, _meta/)
Extract: tags field from YAML frontmatter

Step 2: Build a tag frequency table

步骤2:构建标签频率表

For each tag found, count how many pages use it. Flag:
  • Unknown tags — not in the taxonomy's canonical list
  • Alias tags — using an alias instead of the canonical form (e.g.,
    nextjs
    instead of
    react
    )
  • Over-tagged pages — pages with more than 5 tags
  • Untagged pages — pages with no tags or empty tags field
对于找到的每个标签,统计有多少页面使用了它。标记以下问题:
  • 未知标签——不在分类法的规范列表中的标签
  • 别名标签——使用别名而非规范形式(例如
    nextjs
    而非
    react
  • 标签过多的页面——标签超过5个的页面
  • 未加标签的页面——没有标签或标签字段为空的页面

Step 3: Report

步骤3:报告

markdown
undefined
markdown
undefined

Tag Audit Report

Tag Audit Report

Summary

Summary

  • Total unique tags: 47
  • Canonical tags used: 32
  • Non-canonical tags found: 15
  • Pages over tag limit (5): 3
  • Untagged pages: 2
  • Total unique tags: 47
  • Canonical tags used: 32
  • Non-canonical tags found: 15
  • Pages over tag limit (5): 3
  • Untagged pages: 2

Non-Canonical Tags Found

Non-Canonical Tags Found

Current Tag→ CanonicalPages Affected
nextjs
react
4
next-js
react
2
robotics
ml
1
windows98
retro
3
Current Tag→ CanonicalPages Affected
nextjs
react
4
next-js
react
2
robotics
ml
1
windows98
retro
3

Unknown Tags (not in taxonomy)

Unknown Tags (not in taxonomy)

TagPagesRecommendation
flutter
1Add to taxonomy under Frameworks
kubernetes
2Add to taxonomy under DevOps
TagPagesRecommendation
flutter
1Add to taxonomy under Frameworks
kubernetes
2Add to taxonomy under DevOps

Over-Tagged Pages

Over-Tagged Pages

PageTag CountTags
entities/jane-doe.md
8ai, ml, founder, ...
undefined
PageTag CountTags
entities/jane-doe.md
8ai, ml, founder, ...
undefined

Mode 2: Tag Normalization

模式2:标签规范化

When the user wants to fix the tags:
当用户想要修复标签时:

Step 1: Run audit (above)

步骤1:运行上述审计

Step 2: Apply fixes

步骤2:应用修复

For each page with non-canonical tags:
  1. Read the page
  2. Replace alias tags with their canonical form from the taxonomy
  3. If page has > 5 tags, suggest which to drop (keep the most specific/relevant ones)
  4. Write the updated frontmatter
Example:
yaml
undefined
对于每个使用非规范标签的页面:
  1. 读取页面
  2. 将别名标签替换为分类法中对应的规范形式
  3. 如果页面标签超过5个,建议删除哪些标签(保留最具体/相关的标签)
  4. 写入更新后的frontmatter
示例:
yaml
undefined

Before

Before

tags: [nextjs, ai, ml-engineer, windows98, creative-coding, game, 8-bit, portfolio]
tags: [nextjs, ai, ml-engineer, windows98, creative-coding, game, 8-bit, portfolio]

After

After

tags: [react, ai, ml, retro, generative-art]
undefined
tags: [react, ai, ml, retro, generative-art]
undefined

Step 3: Handle unknowns

步骤3:处理未知标签

For tags that aren't in the taxonomy and aren't aliases:
  • If the tag is used on 2+ pages, suggest adding it to the taxonomy
  • If the tag is used on 1 page, suggest replacing it with the closest canonical tag
  • Ask the user before making changes to unknown tags
对于不在分类法中也不是别名的标签:
  • 如果该标签在2个及以上页面使用,建议将其添加到分类法中
  • 如果该标签仅在1个页面使用,建议用最接近的规范标签替换它
  • 修改未知标签前请先询问用户

Step 4: Update taxonomy

步骤4:更新分类法

If new canonical tags were agreed upon, append them to
_meta/taxonomy.md
in the correct section.
如果双方同意添加新的规范标签,请将其追加到
_meta/taxonomy.md
的对应部分。

Mode 3: Tagging a New Page

模式3:为新页面打标签

When you're creating a wiki page and need to choose tags:
  1. Read
    _meta/taxonomy.md
  2. Select up to 5 tags that best describe the page:
    • 1-2 domain tags (what subject area)
    • 1 type tag (what kind of thing)
    • 0-1 project tags (if project-specific)
    • 0-1 additional descriptive tags
  3. Use only canonical tags — never aliases
  4. If no existing tag fits, check if it's worth adding to the taxonomy
当你创建wiki页面需要选择标签时:
  1. 阅读
    _meta/taxonomy.md
  2. 选择最多5个最能描述页面的标签:
    • 1-2个领域标签(所属主题领域)
    • 1个类型标签(内容类型)
    • 0-1个项目标签(如果是特定项目相关的)
    • 0-1个额外的描述性标签
  3. 仅使用规范标签——不要使用别名
  4. 如果没有合适的现有标签,检查是否值得添加到分类法中

Mode 4: Adding a New Tag

模式4:添加新标签

When the user wants to add a tag to the vocabulary:
  1. Check if an existing tag already covers the concept (suggest it if so)
  2. If genuinely new, determine which section it belongs in (Domain, Type, Project)
  3. Add it to
    _meta/taxonomy.md
    with:
    • The canonical tag name
    • What it's used for
    • Any aliases to redirect
当用户想要向词汇表中添加标签时:
  1. 检查是否已有标签覆盖该概念(如果有则建议使用现有标签)
  2. 如果确实是新标签,确定它所属的类别(领域、类型、项目)
  3. 将其添加到
    _meta/taxonomy.md
    中,包含:
    • 规范标签名称
    • 用途说明
    • 任何需要重定向的别名

After Any Tag Operation

任何标签操作完成后

Append to
log.md
:
- [TIMESTAMP] TAG_AUDIT tags_normalized=N unknown_tags=M pages_modified=P
Or for normalization:
- [TIMESTAMP] TAG_NORMALIZE tags_renamed=N pages_modified=M new_tags_added=P
追加到
log.md
- [TIMESTAMP] TAG_AUDIT tags_normalized=N unknown_tags=M pages_modified=P
如果是规范化操作则使用:
- [TIMESTAMP] TAG_NORMALIZE tags_renamed=N pages_modified=M new_tags_added=P