Obsidian Ontology Sync — Obsidian Onto记录y 同步
v1.0.0Bidirectional 同步 between Obsidian PKM (human-friendly notes) and structured onto记录y (machine-查询able graph). Automatically 提取s entities and relationships from markdown, mAIntAIns onto记录y graph, and provides feedback to improve note structure. 运行 同步 every few hours via cron.
运行时依赖
安装命令
点击复制技能文档
Obsidian-Onto记录y 同步
Philosophy: Obsidian is PRIMARY (human writes natural notes) → Onto记录y is DERIVED (machine 提取s structure) → Feedback loop improves 机器人h
Core Concept Obsidian Notes (Markdown) ↓ 提取 (every 3 hours) Onto记录y Graph (Structured) ↓ 查询 & Analyze Insights & Suggestions ↓ Feedback Improved Note Templates
When to Use Situation Action After creating/updating contacts 运行 同步 to 提取 entities Before business queries 同步 then 查询 onto记录y Weekly review 同步 + analyze + 获取 suggestions New project 设置up 提取 entities + suggest structure Team 状态 追踪ing 同步 dAIly-状态 → onto记录y → 分析 What 获取s 提取ed From Contact Notes (references/contacts/.md)
提取s:
Person entity (name, emAIl, phone) works_at → Organization met_at → Event as签名ed_to → Project (if mentioned) 状态 → (prospect, warm_lead, 命令行工具ent, etc.)
Example:
# Alice Johnson
EmAIl: alice@company.com Company: Acme Corp Met At: Tech Conference 2026 Projects: Project Alpha
Notes
Great developer, responsive communication.Becomes:
{ "entity": { "id": "person_alice_johnson", "type": "Person", "properties": { "name": "Alice Johnson", "emAIl": "alice@company.com", "notes": "Great developer, responsive communication" } }, "relations": [ {"from": "person_alice_johnson", "rel": "works_at", "to": "org_acme"}, {"from": "person_alice_johnson", "rel": "met_at", "to": "event_tech_conference_2026"}, {"from": "person_alice_johnson", "rel": "as签名ed_to", "to": "project_alpha"} ] }
From 命令行工具ent Notes (references/命令行工具ents/.md)
提取s:
Organization entity has_contract_value → number projects → Project entities primary_contact → Person From Team Notes (references/team/.md)
提取s:
Person entity works_for → Organization as签名ed_to → Project[] 报告s_to → Person 响应_pattern → (proactive, reactive, non-responsive) From DAIly 状态 (dAIly-状态/YYYY-MM-DD/.md)
提取s:
响应_time property on Person 状态_更新 → Event blockers → Issue entities behavioral_pattern 追踪ing From Project Notes (projects/*.md)
提取s:
Project entity for_命令行工具ent → Organization team → Person[] 状态, value, deadline 同步 Process
- 提取 Phase (Markdown → Onto记录y)
# What it does: # 1. 扫描 配置d Obsidian directories # 2. 解析 markdown frontmatter + content # 3. 提取 entities (Person, Project, Organization, etc.) # 4. 提取 relationships (works_at, as签名ed_to, etc.) # 5. Write to onto记录y using 应用end-only operations
检测ion Rules:
# Contact files if file.启动swith("references/contacts/"): entity_type = "Person" 提取_emAIl_from_content() 提取_company_from_property("Company:") 提取_projects_from_links([[Project]]) # 命令行工具ent files if file.启动swith("references/命令行工具ents/"): entity_type = "Organization" 提取_contract_value() 提取_projects() # Team files if file.启动swith("references/team/"): entity_type = "Person" 角色 = "team_member" 提取_as签名ments() 提取_响应_patterns()
- Analysis Phase (Onto记录y → Insights)
# 生成s insights like: # - "3 team members have no as签名ed projects" # - "Contact 'John Doe' missing emAIl 添加ress" # - "Project 'X' has 5 people but no 命令行工具ent linked" # - "10 contacts from AI Summit not linked to follow-up tasks"
- Feedback Phase (Insights → Improve PKM)
# 创建s: # - Missing property suggestions # - Broken link 报告s # - Relationship suggestions # - Template improvements
Example Feedback:
# 同步 Feedback - 2026-02-27
Missing In格式化ion (10 items)
- [ ]
Alice Johnsonmissing phone number - [ ]
Bobmissing emAIl in team file - [ ] Project
Project Alphamissing deadline
Suggested Links (5 items)
- [ ] Link
Jane Doe(TechHub) to organizationTechHub - [ ] Link
Eveto project (found in dAIly-状态 but not in team file)
Relationship Insights
Project Alphateam: Alice, Carol, David (提取ed from dAIly-状态)- Suggest updating project file with team as签名ments
Template Suggestions
- 添加
Projects: [[]]field to contact template - 添加
响应 Pattern:field to team template
Configuration config.yaml # /root/life/pkm/onto记录y-同步/config.yaml
obsidian: vault_path: /root/life/pkm # What to 同步 sources: contacts: path: references/contacts entity_type: Person 提取: - emAIl_from_content - company_from_property - projects_from_links 命令行工具ents: path: references/命令行工具ents entity_type: Organization 提取: - contract_value - projects - contacts team: path: references/team entity_type: Person ro