change

GitHub

用于追踪语义图随时间变化及本体版本差异的工具。支持通过时间戳获取图快照、查询节点历史溯源,以及对比和管理本体版本间的变更。

plugins/skills/change/SKILL.md semantica-agi/semantica

Trigger Scenarios

查询特定时间的知识图谱状态 对比两个本体版本的差异 追踪节点的修改历史

Install

npx skills add semantica-agi/semantica --skill change -g -y
More Options

Non-standard path

npx skills add https://github.com/semantica-agi/semantica/tree/main/plugins/skills/change -g -y

Use without installing

npx skills use semantica-agi/semantica@change

指定 Agent (Claude Code)

npx skills add semantica-agi/semantica --skill change -a claude-code -g -y

安装 repo 全部 skill

npx skills add semantica-agi/semantica --all -g -y

预览 repo 内 skill

npx skills add semantica-agi/semantica --list

SKILL.md

Frontmatter
{
    "name": "change",
    "description": "Inspect graph changes over time and ontology version diffs in Semantica. Uses ContextGraph.state_at for point-in-time graph state and change_management.VersionManager for ontology versioning."
}

/semantica:change

Track what changed. Usage: /semantica:change <task> [args]

Two distinct mechanisms cover this, and they are not interchangeable:

Question Tool
"What did the graph look like on date X?" ContextGraph.state_at()
"What changed between ontology versions?" change_management.VersionManager

graph-at <timestamp> — point-in-time graph state

import os
from semantica.context import ContextGraph

graph = ContextGraph()
graph.load_from_file(os.path.expanduser("~/.semantica/kg.json"))   # load_from_file does not expand ~

snapshot = graph.state_at("2026-06-01")      # str | int | float | datetime

Diff two moments by comparing node IDs — state_at()["nodes"] is a list of dicts (unhashable), so compare the id fields, not the dicts themselves:

before = graph.state_at("2026-06-01")
after  = graph.state_at("2026-09-01")
before_ids = {n["id"] for n in before["nodes"]}
after_ids  = {n["id"] for n in after["nodes"]}
added = after_ids - before_ids

For richer temporal work (scrubbing, evolution, temporal patterns) use /semantica:temporal, which wraps the same layer.


node-history <node_id> — who touched this node

Node-level history is provenance, not change management:

import os
from semantica.provenance import ProvenanceManager

db_path = os.path.expanduser("~/.semantica/prov.db")   # storage_path is passed to
os.makedirs(os.path.dirname(db_path), exist_ok=True)   # sqlite3.connect() unexpanded
pm = ProvenanceManager(storage_path=db_path)
history = pm.revision_history(node_id)
log     = pm.audit_log(since="2026-01-01")

versions / diff <v1> <v2> — ontology versioning

from semantica.change_management import VersionManager

vm = VersionManager()
vm.create_version("1.1.0", ontology)
vm.list_versions()
vm.get_latest_version()

delta = vm.compare_versions("1.0.0", "1.1.0")
delta = vm.diff_ontologies(base_ontology, target_ontology)
migrated = vm.migrate_ontology("1.0.0", "1.1.0", ontology)

TemporalVersionManager and OntologyVersionManager are also exported for time-scoped and ontology-specific variants.

Version History

  • fdf3fd8 Current 2026-09-22 03:20

    修复了技能示例中的多个 Bug,包括未展开用户主目录路径导致文件加载失败、对不可哈希的字典列表直接使用 set() 报错、以及修正了 API 类名和导入路径以适配 v0.7.0 版本。

  • 9094f1e 2026-07-05 09:26

Same Skill Collection

.claude/skills/semantica/SKILL.md
plugins/skills/causal/SKILL.md
plugins/skills/decision/SKILL.md
plugins/skills/deduplicate/SKILL.md
plugins/skills/explain/SKILL.md
plugins/skills/export/SKILL.md
plugins/skills/extract/SKILL.md
plugins/skills/ingest/SKILL.md
plugins/skills/ontology/SKILL.md
plugins/skills/policy/SKILL.md
plugins/skills/provenance/SKILL.md
plugins/skills/query/SKILL.md

Metadata

Files
0
Version
7918f71
Hash
e238d955
Indexed
2026-07-05 09:26

ホーム - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-09-28 18:53
浙ICP备14020137号-1