当前位置: 首页 > Skill >

Obsidian Ontology Sync

Obsidian Ontology Sync

2026.11.23 浏览:633
获取Skill文件查看使用说明
作者:顾知许可证:
本文目录展开

Obsidian-Ontology Sync

Philosophy: Obsidian is PRIMARY (human writes natural notes) → Ontology is DERIVED (machine extracts structure) → Feedback loop improves both

Core Concept

Obsidian Notes (Markdown)
    ↓ Extract (every 3 hours)
Ontology Graph (Structured)
    ↓ Query & Analyze
Insights & Suggestions
    ↓ Feedback
Improved Note Templates

When to Use

Situation Action
After creating/updating contacts Run sync to extract entities
Before business queries Sync then query ontology
Weekly review Sync + analyze + get suggestions
New project setup Extract entities + suggest structure
Team status tracking Sync daily-status → ontology → analytics

What Gets Extracted

From Contact Notes (references/contacts/*.md)

Extracts:

  • Person entity (name, email, phone)
  • works_at → Organization
  • met_at → Event
  • assigned_to → Project (if mentioned)
  • status → (prospect, warm_lead, client, 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": "assigned_to", "to": "project_alpha"}
  ]
}

From Client Notes (references/clients/*.md)

Extracts:

  • Organization entity
  • has_contract_value → number
  • projects → Project entities
  • primary_contact → Person

From Team Notes (references/team/*.md)

Extracts:

  • Person entity
  • works_for → Organization
  • assigned_to → Project[]
  • reports_to → Person
  • response_pattern → (proactive, reactive, non-responsive)

From Daily Status (daily-status/YYYY-MM-DD/*.md)

Extracts:

  • response_time property on Person
  • status_update → Event
  • blockers → Issue entities
  • behavioral_pattern tracking

From Project Notes (projects/*.md)

Extracts:

  • Project entity
  • for_client → Organization
  • team → Person[]
  • status, value, deadline

Sync Process

1. Extract Phase (Markdown → Ontology)

# Run extraction
python3 skills/obsidian-ontology-sync/scripts/sync.py extract

# What it does:
# 1. Scan configured Obsidian directories
# 2. Parse markdown frontmatter + content
# 3. Extract entities (Person, Project, Organization, etc.)
# 4. Extract relationships (works_at, assigned_to, etc.)
# 5. Write to ontology using append-only operations

Detection Rules:

# Contact files
if file.startswith("references/contacts/"):
    entity_type = "Person"
    extract_email_from_content()
    extract_company_from_property("Company:")
    extract_projects_from_links([[Project]])
    
# Client files
if file.startswith("references/clients/"):
    entity_type = "Organization"
    extract_contract_value()
    extract_projects()
    
# Team files
if file.startswith("references/team/"):
    entity_type = "Person"
    role = "team_member"
    extract_assignments()
    extract_response_patterns()

2. Analysis Phase (Ontology → Insights)

# Run analytics
python3 skills/obsidian-ontology-sync/scripts/sync.py analyze

# Generates insights like:
# - "3 team members have no assigned projects"
# - "Contact 'John Doe' missing email address"
# - "Project 'X' has 5 people but no client linked"
# - "10 contacts from AI Summit not linked to follow-up tasks"

3. Feedback Phase (Insights → Improve PKM)

# Get suggestions
python3 skills/obsidian-ontology-sync/scripts/sync.py feedback

# Creates:
# - Missing property suggestions
# - Broken link reports
# - Relationship suggestions
# - Template improvements

Example Feedback:

# Sync Feedback - 2026-02-27

## Missing Information (10 items)
- [ ] `Alice Johnson` missing phone number
- [ ] `Bob` missing email in team file
- [ ] Project `Project Alpha` missing deadline

## Suggested Links (5 items)
- [ ] Link `Jane Doe` (TechHub) to organization `TechHub`
- [ ] Link `Eve` to project (found in daily-status but not in team file)

## Relationship Insights
- `Project Alpha` team: Alice, Carol, David (extracted from daily-status)
- Suggest updating project file with team assignments

## Template Suggestions
- Add `Projects: [[]]` field to contact template
- Add `Response Pattern:` field to team template

Configuration

config.yaml

# /root/life/pkm/ontology-sync/config.yaml

obsidian:
  vault_path: /root/life/pkm
  
  # What to sync
  sources:
    contacts:
      path: references/contacts
      entity_type: Person
      extract:
        - email_from_content
        - company_from_property
        - projects_from_links
    
    clients:
      path: references/clients
      entity_type: Organization
      extract:
        - contract_value
        - projects
        - contacts
    
    team:
      path: references/team
      entity_type: Person
      role: team_member
      extract:
        - assignments
        - response_patterns
        - reports_to
    
    daily_status:
      path: daily-status
      extract:
        - response_times
        - behavioral_patterns
        - blockers

ontology:
  storage_path: /root/life/pkm/memory/ontology
  format: jsonl  # or sqlite for scale
  
  # Entity types to track
  entities:
    - Person
    - Organization
    - Project
    - Event
    - Task
  
  # Relationships to extract
  relationships:
    - works_at
    - assigned_to
    - met_at
    - for_client
    - reports_to
    - has_task
    - blocks

feedback:
  output_path: /root/life/pkm/ontology-sync/feedback
  generate_reports: true
  suggest_templates: true
  highlight_missing: true

schedule:
  # Run via cron every 3 hours
  sync_interval: "0 */3 * * *"
  analyze_daily: "0 9 * * *"  # 9 AM daily
  feedback_weekly: "0 10 * * MON"  # Monday 10 AM

Scheduled Sync (Cron Integration)

Setup Automatic Sync

# Add to OpenClaw cron
python3 skills/obsidian-ontology-sync/scripts/setup-cron.py

# Or manually via cron tool
cron add 
  --schedule "0 */3 * * *" 
  --task "python3 skills/obsidian-ontology-sync/scripts/sync.py extract" 
  --label "Obsidian → Ontology Sync"

Cron Jobs Created:

  1. Every 3 hours: Extract entities from Obsidian → Update ontology
  2. Daily 9 AM: Run analytics and generate insights
  3. Weekly Monday 10 AM: Generate feedback report + template suggestions

Queries (Using Ontology)

Once synced, you can query:

# All team members on high-value projects
python3 skills/ontology/scripts/ontology.py query 
  --type Person 
  --where '{"role":"team_member"}' 
  --related assigned_to 
  --filter '{"type":"Project","value__gt":400000}'

# Contacts from specific event not yet followed up
python3 skills/ontology/scripts/ontology.py query 
  --type Person 
  --where '{"met_at":"event_tech_conference_2026"}' 
  --missing has_task

# Team response patterns
python3 skills/ontology/scripts/ontology.py query 
  --type Person 
  --where '{"role":"team_member"}' 
  --aggregate response_pattern

# Projects by client
python3 skills/ontology/scripts/ontology.py query 
  --type Project 
  --group-by for_client 
  --count

Feedback Loop Examples

Example 1: Missing Email Detection

Ontology finds: Person entity with no email property

Feedback generated:

## Missing Contact Information

The following team members are missing email addresses:

- [ ] Bob (`references/team/Bob.md`)
- [ ] Lucky (`references/team/Lucky.md`)

**Suggestion:** Add email field to team member template:
```markdown
**Email:** 
```

Example 2: Broken Project Links

Ontology finds: Person assigned_to Project that doesn't exist

Feedback generated:

## Broken Project References

Found references to projects that don't have dedicated files:

- [ ] "Project Epsilon" mentioned in team files but no `projects/Project Epsilon.md`
- [ ] "Project Delta Tata DT" assigned but no project file

**Suggestion:** Create project files with template

Example 3: Relationship Discovery

Ontology finds: Multiple people working at same company

Feedback generated:

## Suggested Company Grouping

Found 3 contacts at "TechHub":
- Jane Doe
- [2 others from daily-status mentions]

**Suggestion:** Create `references/clients/TechHub.md` and link contacts

Integration with Daily Workflow

Morning Routine (9 AM)

# Cron runs analysis
# Generates daily-insights.md with:
- Response rate from yesterday's status requests
- Projects needing attention (blockers mentioned)
- Contacts to follow up (met > 3 days ago, no task)

Weekly Review (Monday 10 AM)

# Cron generates weekly feedback
# Creates suggestions for:
- Missing information to fill in
- Broken links to fix
- New templates to adopt
- Relationship insights

On-Demand Queries

# Before a meeting
"Show me all interactions with Client X"

# Resource planning
"Which team members are on <3 projects?"

# Sales pipeline
"Contacts met at conferences in last 30 days without follow-up"

Benefits

✅ For You

  1. Zero Extra Work: Just keep writing normal Obsidian notes
  2. Automatic Structure: Ontology extracted automatically
  3. Powerful Queries: Find patterns across all your data
  4. Quality Improvement: Feedback loop catches missing info
  5. No Double Entry: Single source of truth (Obsidian)

✅ For Team Management

  • Track who's on which project (auto-extracted)
  • Monitor response patterns (from daily-status)
  • Identify unbalanced workloads
  • Find blockers across projects

✅ For Sales/BD

  • Track contact network (who you met, where, when)
  • Follow-up reminders (contacted >7 days ago)
  • Relationship mapping (who knows who)
  • Pipeline insights (prospects → warm → clients)

✅ For Finance

  • Project valuations (extracted from client notes)
  • Team cost allocation (people → projects → revenue)
  • Revenue forecasting (active projects × value)

File Structure After Sync

/root/life/pkm/
├── references/
│   ├── contacts/          # Source notes (you write these)
│   ├── clients/           # Source notes
│   └── team/              # Source notes
├── daily-status/          # Source notes
├── projects/              # Source notes
│
├── memory/ontology/       # Generated ontology
│   ├── graph.jsonl        # Entity/relation storage
│   └── schema.yaml        # Type definitions
│
└── ontology-sync/         # Sync outputs
    ├── config.yaml        # Your config
    ├── feedback/
    │   ├── daily-insights.md
    │   ├── weekly-feedback.md
    │   └── suggestions.md
    └── logs/
        └── sync-YYYY-MM-DD.log

Advanced: Bidirectional Sync

Future capability:

Update Obsidian notes FROM ontology insights:

# Automatically add missing fields
python3 skills/obsidian-ontology-sync/scripts/sync.py apply-feedback

# What it does:
# - Adds missing email field to contact notes
# - Creates suggested project files
# - Links related entities
# - Updates frontmatter

Safety: Always creates backup before modifying files.

Comparison with Alternatives

Approach Pros Cons
Manual ontology Full control Too much work, falls behind
Obsidian only Simple No structured queries
Ontology only Powerful queries Not human-friendly
This skill Best of both Initial setup needed

Getting Started

1. Install Dependencies

# Already have ontology skill installed
clawhub install obsidian  # If not already installed

2. Create Config

python3 skills/obsidian-ontology-sync/scripts/init.py

# Creates:
# - config.yaml with your vault path
# - ontology directory structure
# - cron jobs

3. Run First Sync

# Manual first sync to test
python3 skills/obsidian-ontology-sync/scripts/sync.py extract --dry-run

# See what would be extracted
# Review, then run for real:
python3 skills/obsidian-ontology-sync/scripts/sync.py extract

4. Enable Automatic Sync

python3 skills/obsidian-ontology-sync/scripts/setup-cron.py

# Confirms cron jobs:
# ✓ Sync every 3 hours
# ✓ Daily analysis at 9 AM
# ✓ Weekly feedback Monday 10 AM

5. Query Your Data

# Try some queries
python3 skills/obsidian-ontology-sync/scripts/query.py "team members on high value projects"

Troubleshooting

Extraction Issues

# Dry run to see what would be extracted
python3 skills/obsidian-ontology-sync/scripts/sync.py extract --dry-run --verbose

# Check specific file
python3 skills/obsidian-ontology-sync/scripts/debug.py 
  --file references/contacts/Alice.md

Query Not Finding Data

# Check what's in ontology
python3 skills/ontology/scripts/ontology.py query --type Person

# Verify sync ran
cat /root/life/pkm/ontology-sync/logs/sync-latest.log

Feedback Not Generated

# Manually run analysis
python3 skills/obsidian-ontology-sync/scripts/sync.py analyze
python3 skills/obsidian-ontology-sync/scripts/sync.py feedback

Version History

  • 1.0.0 (2026-02-27) - Initial version with extraction, analysis, feedback loop

Author: Built for team management, contact tracking, and business intelligence at scale License: MIT Tags: obsidian, ontology, knowledge-graph, pkm, automation, sync

推荐文章

更多
PHP时间戳与日期字符串相互转换方法详解

本文介绍PHP中时间数值(Unix时间戳)与日期字符串之间的相互转换方法。通过strtotime和date函数,实现将当前时间、指定日期转换为时间戳,以及将时间戳格式化为可读的日期时间字符串,并提供相关在线计算工具推荐。

2025.11.30 1,034
PHP日期转时间戳时区偏差怎么解决

在 PHP 中将日期字符串转换为时间戳时,若未显式指定时区,默认使用脚本配置的 date.timezone 或系统时区。当服务器时区与业务逻辑预期(如 UTC )不一致时,会产生偏差。解决核心是确保输入字符串携带明确时区信息,或在转换前统一设置时区上下文。

2026.10.24 1,031
PHP跨域配置:怎么安全地允许指定域名而非使用通配符

在 PHP 中安全地允许指定域名跨域,核心是解析请求头中的 Origin ,验证其是否在白名单内,然后动态设置 Access-Control-Allow-Origin 响应头。不要使用通配符 * ,也不要硬编码单一域名。

2025.03.29 1,018
JavaScript中利用replace结合正则实现replaceAll效果

JavaScript原生仅支持replace()进行单次或全局替换,缺乏类似Java的replaceAll()便捷方法。本文总结四种在JS中实现全量替换的方案:使用带g标志的正则、带gm标志的正则、扩展String原型以及split后join。通过对比代码示例,展示各方法的实现细节与适用场景,帮助开发者根据需求选择最优解。

2025.04.29 1,017
OpenAI的Jalapeno芯片未落地,教你分辨300兆瓦算力消息

OpenAI计划在SB Energy租赁的数据中心部署约300兆瓦自研Jalapeno推理芯片,但目前双方仍处于洽谈阶段,交易细节与上线时间表均未公布。本文带你按报道原文核实项目所处阶段,厘清芯片发布、电力功率与实际推理算力的边界,并将融资意向与签约、开工、投运节点分开追踪,避免误将规划容量计入现有算力。

2026.12.02 1,013
PHP实现基础文件上传:HTML表单与$_FILES处理流程

在 HTML 表单中设置 enctype="multipart/form-data" ,并在 PHP 后端通过 $_FILES 数组接收文件,调用 move_uploaded_file() 将临时文件移动到目标目录即可完成上传。

2026.09.07 1,013
Skill 文件
  • SKILL.md
    • Obsidian-Ontology Sync
    • Core Concept
    • When to Use
    • What Gets Extracted
      • From Contact Notes (references/contacts/*.md)
      • From Client Notes (references/clients/*.md)
      • From Team Notes (references/team/*.md)
      • From Daily Status (daily-status/YYYY-MM-DD/*.md)
      • From Project Notes (projects/*.md)
    • Sync Process
      • 1. Extract Phase (Markdown → Ontology)
      • 2. Analysis Phase (Ontology → Insights)
      • 3. Feedback Phase (Insights → Improve PKM)
    • Configuration
      • config.yaml
    • Scheduled Sync (Cron Integration)
      • Setup Automatic Sync
    • Queries (Using Ontology)
    • Feedback Loop Examples
      • Example 1: Missing Email Detection
      • Example 2: Broken Project Links
      • Example 3: Relationship Discovery
    • Integration with Daily Workflow
      • Morning Routine (9 AM)
      • Weekly Review (Monday 10 AM)
      • On-Demand Queries
    • Benefits
      • ✅ For You
      • ✅ For Team Management
      • ✅ For Sales/BD
      • ✅ For Finance
    • File Structure After Sync
    • Advanced: Bidirectional Sync
    • Comparison with Alternatives
    • Getting Started
      • 1. Install Dependencies
      • 2. Create Config
      • 3. Run First Sync
      • 4. Enable Automatic Sync
      • 5. Query Your Data
    • Troubleshooting
      • Extraction Issues
      • Query Not Finding Data
      • Feedback Not Generated
    • Version History

相关 Skill

更多
Obsidian Search Obsidian Search 使用 AI 向量嵌入在 Obsidian 笔记中进行语义搜索,按含义查找笔记、发现关联、按标签/日期/文件夹筛选,并获取完整内容
Article Fetcher(文章抓取+Notion/Obsidian知识库存档) Article Fetcher(文章抓取+Notion/Obsidian知识库存档) 抓取微信公众号、小红书、豆瓣、知乎文章,自动上传OSS图片,LLM智能提取关键词,一键存档至Obsidian本地库(可选Notion)
Obsidian Bases Obsidian Bases 创建和编辑 Obsidian Bases(.base 文件),包含视图、过滤器、公式和摘要。用于处理 .base 文件并创建类似数据库的视图。
Obsidian工具箱(专业版) Obsidian工具箱(专业版) AI Agent的企业级Obsidian综合管理工具箱。批量操作、高级模板、插件深度集成、Canvas管理,复杂知识库一网打尽。
Obsidian Folder Sync Obsidian Folder Sync 将任意文件夹(支持任何 AI agent workspace)同步到 Obsidian Vault。 **触发场景**: - 用户说「同步到Obsidian」「备份到Obsidian」「Obsidian同步」「folder sync」 - 需要将任意文件夹(skills、memory、项目文档等)备份到 Obsi...