Obsidian format parser: aliases, wikilinks, and tags extraction
まだ誰も着手していません。
評価
調査の方向性
Start by reading terraphim_automata/src/markdown_directives.rs and the MarkdownDirectives definition in terraphim_types, then inspect haystack configuration in terraphim_config. Use real Obsidian vault fixtures and add tests for frontmatter aliases and tags, wikilinks, inline tags, mixed syntax, and format routing. Done means all listed patterns merge into the shared struct and the obsidian configuration is accepted.
索引モデルが issue の本文から書いたものです。
説明
Summary
Extend parse_markdown_directives_content() in terraphim_automata/src/markdown_directives.rs to parse Obsidian-native patterns alongside the existing Logseq synonyms:: syntax.
Current Parser
The parser handles 4 directives:
synonyms::-> synonyms (Logseq property syntax)type:::-> document typeroute::-> LLM routing configpriority::-> priority score
New Patterns to Parse
1. YAML Frontmatter
---
aliases: [context management, semantic scope]
tags: [engineering, knowledge-graph]
---
aliases:-> treated as synonyms (same semantics assynonyms::)tags:-> stored as concept categories (new field inMarkdownDirectives)- Supports both YAML list syntax (
[a, b]) and multi-line (- a\n- b)
2. Wikilinks
Related to [[knowledge graph]] and [[ontology]] concepts.
- Extract all
[[target]]and[[target|display text]]patterns - Store as related concepts (new
Vec<String>field inMarkdownDirectives) - These become edges in the rolegraph, not synonyms
3. Inline Tags
This concept is important for #engineering and #search.
- Extract
#tagpatterns (excluding headings## heading) - Store as categories alongside YAML frontmatter tags
- Deduplicate with YAML tags
Parser Mode Configuration
Add a format field to haystack config:
[[roles.engineer.haystacks]]
location = "~/.config/terraphim/kg"
format = "terraphim" # synonyms:: + type::: + route:: + priority:: (default)
[[roles.engineer.haystacks]]
location = "~/synced/pages"
format = "logseq" # synonyms:: only
[[roles.engineer.haystacks]]
location = "~/synced/ObsidianVault"
format = "obsidian" # aliases: + [[wikilinks]] + #tags + synonyms::
All formats output the same MarkdownDirectives struct. The obsidian format is a superset that also accepts synonyms:: (for Dataview users).
Extended Struct
pub struct MarkdownDirectives {
pub doc_type: DocumentType,
pub synonyms: Vec<String>, // existing
pub route: Option<RouteDirective>, // existing
pub priority: Option<u8>, // existing
pub categories: Vec<String>, // NEW: from tags:/\#tag
pub related_concepts: Vec<String>, // NEW: from [[wikilinks]]
}
Test Plan
- Fixture: real Obsidian vault files with YAML frontmatter, wikilinks, and tags
- Test: aliases parsed as synonyms alongside existing synonyms:: support
- Test: wikilinks extracted as related concepts
- Test: tags extracted from both YAML frontmatter and inline #tags, deduplicated
- Test: mixed format (file has both synonyms:: and aliases:) merges correctly
- Test: obsidian format config flag routes to extended parser
Affected Crates
terraphim_automata(primary -- extend markdown_directives.rs)terraphim_types(add categories + related_concepts to MarkdownDirectives)terraphim_config(add format field to haystack config)
Estimated Effort
~4 hours
Part of
Epic #603
- 主要言語
- Rust
- スター
- 62
- フォーク
- 5
- 平均マージ
- 2時間 27分
- マージ済み PR(30日)
- 1
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
terraphim/terraphim-ai のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
terraphim/terraphim-ai#885 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
terraphim/terraphim-ai#871 ·
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
terraphim/terraphim-ai#810 · コメント 2 件 ·
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
terraphim/terraphim-ai#729 ·
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
terraphim/terraphim-ai#728 ·
terraphim/terraphim-ai の issue をすべて見る
似ている issue
-
bug github_actions
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
registrystack/registry-stack#1393 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
longbridge/gpui-kit#3223 ·
-
bug engine
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
rocky-data/rocky#2181 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
oasisprotocol/oasis-sdk#2523 ·
-
[indexer] [QA] Add a focused test for the new NonRetryableError / assertSocketAlive() behavior. オープンbot:ai-assisted component:indexer QA-roadmap status:untriaged
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
midnightntwrk/midnight-indexer#1557 ·