provenance

GitHub

追踪数据血缘、来源归属及审计轨迹,支持W3C PROV-O导出。提供溯源查询、源分析、审计日志、格式导出、失效标记及完整性检查功能,用于构建可信赖的数据治理体系。

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

Trigger Scenarios

需要追溯数据实体来源或完整血缘路径时 生成合规性审计日志或W3C标准格式报告时

Install

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

Non-standard path

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

Use without installing

npx skills use semantica-agi/semantica@provenance

指定 Agent (Claude Code)

npx skills add semantica-agi/semantica --skill provenance -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": "provenance",
    "description": "Trace data lineage, source attribution, audit trails, and W3C PROV-O export in Semantica graphs. Uses ProvenanceManager."
}

/semantica:provenance

Lineage and audit trails. Usage: /semantica:provenance <task> [args]


lineage <entity_id> [--depth N]

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)   # SQLite, or omit for in-memory
chain = pm.lineage(entity_id, depth=3)
full  = pm.get_lineage(entity_id)          # complete ancestry
down  = pm.get_descendants(entity_id)      # what this entity influenced

sources <entity_id>

srcs = pm.get_all_sources(entity_id)       # every source that contributed
prov = pm.get_provenance(entity_id)        # the raw PROV entry
hist = pm.revision_history(entity_id)

audit [--since <iso-date>] [--format table|json]

log = pm.audit_log(since="2026-01-01", format="table")
between = pm.query_recorded_between(start, end)
stats = pm.get_statistics()

export [--format turtle|json-ld|xml]

W3C PROV-O export — this is the regulator-facing artifact.

rdf = pm.export_prov(format="turtle", base_uri="https://example.org/prov/")

invalidate <entity_id> <agent_id> [--reason ...]

Mark an entity superseded without deleting history.

pm.invalidate(entity_id, agent_id, reason="source retracted")

check [--strict]

report = pm.check(strict=False)   # integrity check over the provenance store

Version History

  • fdf3fd8 Current 2026-09-22 03:21

    重构API以适配v0.7.0版本,将ProvenanceTracer替换为ProvenanceManager,修复存储路径解析及依赖类导入错误。

  • 9094f1e 2026-07-05 09:26

Same Skill Collection

.claude/skills/semantica/SKILL.md
plugins/skills/causal/SKILL.md
plugins/skills/change/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/query/SKILL.md

Metadata

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

Home - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-09-27 22:00
浙ICP备14020137号-1