Agent Skills › semantica-agi/semantica

semantica-agi/semantica

GitHub

Semantica技能提供知识图谱全栈能力,涵盖上下文分析、决策智能、可解释性、语义提取、推理、溯源、本体建模及数据导出。适用于图拓扑分析、因果推理、合规检查及多格式数据交换等场景。

13 个 Skill 1,399

安装全部 Skills

npx skills add semantica-agi/semantica --all -g -y
更多选项

预览集合内 Skills

npx skills add semantica-agi/semantica --list

集合内 Skills (13)

Semantica技能提供知识图谱全栈能力,涵盖上下文分析、决策智能、可解释性、语义提取、推理、溯源、本体建模及数据导出。适用于图拓扑分析、因果推理、合规检查及多格式数据交换等场景。
用户询问知识图谱、实体关系或语义提取 需要进行上下文图分析、图拓扑或社区检测 涉及决策智能、因果影响或结果分析 要求对图结果进行可解释性或透明度说明 需要执行演绎/归纳推理或SPARQL查询 需要追踪数据溯源、审计历史或变更 涉及本体建模、模式验证或策略执行 需要从文件/API/MCP服务器导入数据 需要去重、规范化或合并图对象 需要将图导出为JSON/RDF/CSV等格式
.claude/skills/semantica/SKILL.md
npx skills add semantica-agi/semantica --skill semantica -g -y
SKILL.md
Frontmatter
{
    "name": "semantica",
    "description": "Semantica full-stack knowledge graph skill for context graphs, decision intelligence, explainability, extraction, reasoning, visualization, ontology, provenance, policy, and export workflows."
}

Semantica

This Skill helps Claude apply Semantica knowledge graph capabilities to context graph analysis, decision intelligence, explainability, semantic extraction, graph analytics, reasoning, provenance, ontology, policy, ingestion, deduplication, and export.

When to use this Skill

  • The user asks about knowledge graphs, entities, relations, triplets, or semantic extraction.
  • A task requires context graph analysis, graph topology, centrality, communities, paths, or embeddings.
  • The request involves decision intelligence, causal influence, decision graphs, or outcome analysis.
  • The user asks for explainability, decision rationale, or transparency for graph results.
  • The request involves reasoning: deductive, abductive, SPARQL, Datalog, or Rete rules.
  • The user needs provenance, audit history, lineage tracking, or change tracing.
  • The request is about ontology modeling, schema validation, or policy enforcement.
  • Data must be ingested from files, databases, APIs, repositories, or MCP servers.
  • There is a need to deduplicate entities, normalize graph data, or merge duplicate graph objects.
  • The user wants to export graphs to JSON, RDF, Parquet, CSV, GraphML, or similar.

What this Skill contains

  • Semantic extraction guidance for NER, relation extraction, event detection, coreference resolution, and triplet generation.
  • Context graph and graph analytics workflows for topology, centrality, community detection, path finding, embeddings, and decision insights.
  • Decision intelligence support for causal reasoning, decision impact, decision graphs, and outcome analysis.
  • Explainability guidance for decision rationale, graph reasoning, rule traces, and result transparency.
  • Reasoning support for logic, hypotheses, SPARQL, Datalog, and rule-based inference.
  • Provenance and audit guidance for tracing sources, recording changes, and verifying graph lineage.
  • Ontology guidance for defining concepts, validating schemas, and modeling relationships.
  • Policy checks for compliance evaluation and graph governance.
  • Temporal analysis guidance for event timelines and graph evolution.
  • Deduplication support for duplicate detection, fuzzy matching, and graph cleanup.
  • Export workflows for sharing results in multiple structured formats.

Best prompt patterns

Use clear task descriptions, and mention the desired output format when possible.

  • "Extract entities, relations, and events from this text and summarize the resulting graph."
  • "Analyze this context graph and show the top 5 most influential nodes."
  • "Generate a decision intelligence report with causal impact and explainability."
  • "Run a provenance trace for node X and describe its history."
  • "Validate the ontology for this graph and report any schema problems."
  • "Ingest the data from this MCP server and merge it into the current graph."
  • "Export the graph to JSON and GraphML with node and edge metadata."

How Claude should use this Skill

  1. Read the YAML metadata and identify whether the request matches Semantica graph, context graph, decision intelligence, or extraction tasks.
  2. Load this Skill when the request mentions Semantica, knowledge graphs, context graphs, decision intelligence, explainability, reasoning, or provenance.
  3. Use the instructions here to choose the right workflow and then read additional files or scripts only if needed.

Authoring note

This Skill is purposely concise and focused on task selection. It is not intended to include every detail; Claude should use the filesystem-based model to load any extra reference files only when asked.

用于在Semantica知识图谱中分析因果关系,包括构建因果链、评估干预影响、追溯反事实根因及时间因果路径。
需要分析决策间的因果链条和影响范围 模拟干预措施并评估其对下游决策的影响 追溯事件的根本原因或特定时间点的因果背景
plugins/skills/causal/SKILL.md
npx skills add semantica-agi/semantica --skill causal -g -y
SKILL.md
Frontmatter
{
    "name": "causal",
    "description": "Analyze cause-and-effect relationships in the Semantica knowledge graph — causal chains, interventions, counterfactuals, and causal influence scores."
}

/semantica:causal

Analyze causal relationships and infer impacts. Usage: /semantica:causal <task> [args]

$ARGUMENTS = task + optional target entity, filter, or intervention.


chain [--subject <node>] [--depth N]

Build and inspect causal chains for a subject or category.

from semantica.context.causal_analyzer import CausalChainAnalyzer
from semantica.context import AgentContext

# Option 1: Use an existing AgentContext decision backend
chain = ctx.get_causal_chain(
    decision_id=decision_id,
    direction="upstream",
    max_depth=depth,
)

# Option 2: Use CausalChainAnalyzer directly
analyzer = CausalChainAnalyzer(graph_store=ctx.knowledge_graph)
downstream = analyzer.get_causal_chain(
    decision_id=decision_id,
    direction="downstream",
    max_depth=depth,
)

Output: chain steps, cause strength, effect reach, and summary graph.


intervene <node> <action> [--scenario <json>]

Analyze decision impact and influenced decisions (current causal API).

analyzer = CausalChainAnalyzer(graph_store=ctx.knowledge_graph)
impact_score = analyzer.get_causal_impact_score(decision_id=decision_id)
influenced = analyzer.get_influenced_decisions(
    decision_id=decision_id,
    max_depth=depth,
)

Return: impact score, influenced decisions, and downstream scope.


counterfactual <fact> [--weight N]

Trace root causes and temporal causal paths.

analyzer = CausalChainAnalyzer(graph_store=ctx.knowledge_graph)
roots = analyzer.find_root_causes(decision_id=decision_id, max_depth=depth)
historical_chain = analyzer.trace_at_time(
    event_id=decision_id,
    at_time="2026-01-01T00:00:00Z",
    direction="upstream",
    max_depth=depth,
)

Output: root decision lineage and time-bounded causal context.

用于追踪和检查 Semantica 知识图谱的变更、差异及时间更新。支持计算快照间的图差异(diff)以查看节点边的增删与属性变化,以及查询特定节点或关系的详细变更历史(history),包括版本、时间戳和作者信息。
比较两个时间点的数据差异 查看特定实体的修改记录 分析数据更新对图谱的影响
plugins/skills/change/SKILL.md
npx skills add semantica-agi/semantica --skill change -g -y
SKILL.md
Frontmatter
{
    "name": "change",
    "description": "Track and inspect graph changes, diffs, temporal updates, and the impact of new data on Semantica knowledge graphs."
}

/semantica:change

Inspect changes over time and evaluate updates. Usage: /semantica:change <task> [args]

$ARGUMENTS = task + optional node, time window, or filter.


diff [--from <ts>] [--to <ts>] [--node <id>]

Compute graph diffs between two snapshots.

from semantica.provenance.change_tracker import ChangeTracker
from semantica.context import ContextGraph

tracker = ChangeTracker()
diff = tracker.compute_diff(from_ts=from_ts, to_ts=to_ts, node_id=node_id)

Output: added/removed nodes and edges, attribute changes, and impact summary.


history <node_id> [--limit N]

Show the change history for a node or relationship.

history = tracker.get_node_history(node_id=node_id, limit=limit)

Return: revisions, timestamps, authors, and summary comments.

管理决策全生命周期,支持记录、自然语言查询、先例检索(混合/高级)、影响分析及洞察。提供结构化查询与因果链分析功能。
需要记录业务决策或AI代理决定时 查询历史决策、查找相似先例或分析决策影响时
plugins/skills/decision/SKILL.md
npx skills add semantica-agi/semantica --skill decision -g -y
SKILL.md
Frontmatter
{
    "name": "decision",
    "description": "Full decision lifecycle in Semantica — record, query, find precedents (hybrid\/advanced), analyze influence, explain, insights dashboard, list, and record exceptions. Uses AgentContext, ContextGraph, DecisionQuery, CausalChainAnalyzer, DecisionRecorder."
}

/semantica:decision

Full decision lifecycle management. Usage: /semantica:decision <sub-command> [args]


record <category> "<scenario>" "<reasoning>" <outcome> <confidence>

Record a decision with full context.

from semantica.context import AgentContext

ctx = AgentContext(decision_tracking=True)
decision_id = ctx.record_decision(
    category=category,        # "loan_approval", "deployment", "hiring"
    scenario=scenario,        # natural-language situation description
    reasoning=reasoning,      # why this decision was made
    outcome=outcome,          # "approved", "rejected", "deferred"
    confidence=float(confidence),
    entities=entities or [],
    decision_maker="ai_agent",
    valid_from=valid_from,    # optional ISO date string
    valid_until=valid_until,
)

Output: Decision <decision_id> recorded | <category> | <outcome> (conf: 0.95)


query "<question>" [--hops N] [--hybrid]

Query decisions using natural language with multi-hop graph traversal.

from semantica.context import AgentContext

ctx = AgentContext(decision_tracking=True, advanced_analytics=True)
results = ctx.query_decisions(
    query=question,
    max_hops=int(hops) if hops else 3,
    include_context=True,
    use_hybrid_search="--hybrid" in args,
)

For structured lookups use DecisionQuery:

from semantica.context.decision_query import DecisionQuery
dq = DecisionQuery(graph_store=ctx.graph_store)
# dq.find_by_category(category, limit=100)
# dq.find_by_entity(entity_id, limit=100)
# dq.find_by_time_range(start, end, limit=100)
# dq.multi_hop_reasoning(start_entity, query_context, max_hops=3)
# dq.trace_decision_path(decision_id, relationship_types)
# dq.analyze_decision_influence(decision_id, max_depth=3)

Return: | ID | Category | Scenario | Outcome | Confidence | Timestamp |


precedents "<scenario>" [--category <cat>] [--advanced] [--hops N] [--as-of <date>]

Find similar past decisions using hybrid semantic + structural + vector search.

from semantica.context import AgentContext

ctx = AgentContext(decision_tracking=True, kg_algorithms=True, vector_store_features=True)

if "--advanced" in args:
    precedents = ctx.find_precedents_advanced(
        scenario=scenario, category=category, limit=10,
        use_kg_features=True,
        similarity_weights={"semantic": 0.5, "structural": 0.3, "vector": 0.2},
    )
else:
    precedents = ctx.find_precedents(
        scenario=scenario, category=category, limit=10,
        use_hybrid_search=True,
        max_hops=int(hops) if hops else 3,
        include_context=True,
        include_superseded=False,
        as_of=as_of_date or None,   # temporal filter: only precedents that existed as_of this date
    )

Return ranked: | Rank | ID | Scenario | Outcome | Confidence | Similarity | Date |


influence <decision_id> [--depth N]

Analyze how a decision influences others across the graph.

from semantica.context import AgentContext

ctx = AgentContext(decision_tracking=True, advanced_analytics=True, kg_algorithms=True)
influence = ctx.analyze_decision_influence(decision_id, max_depth=int(depth) if depth else 3)
predictions = ctx.predict_decision_relationships(decision_id, top_k=5)

Output: Influence score + influenced decisions table + predicted new relationships.


explain <decision_id>

Full explainability trace — reasoning steps, causal antecedents, policy compliance.

from semantica.context import AgentContext, ContextGraph

ctx = AgentContext(decision_tracking=True)
explainability = ctx.trace_decision_explainability(decision_id)

graph = ContextGraph(advanced_analytics=True)
chain = graph.trace_decision_chain(decision_id, max_steps=5)
causality = graph.trace_decision_causality(decision_id, max_depth=5)

Output: Reasoning steps, causal antecedents, evidence items, policy compliance status.


insights

Comprehensive analytics across all tracked decisions.

from semantica.context import ContextGraph, AgentContext

ctx = AgentContext(decision_tracking=True, advanced_analytics=True)
graph = ContextGraph(advanced_analytics=True)

insights = graph.get_decision_insights()
summary = graph.get_decision_summary()
context_insights = ctx.get_context_insights()

Output: Total count, category breakdown, outcome distribution, avg confidence, top influential.


list [--category <cat>] [--entity <id>] [--from <date>] [--to <date>]

from semantica.context.decision_query import DecisionQuery
from semantica.context import AgentContext
from datetime import datetime

ctx = AgentContext(decision_tracking=True)
dq = DecisionQuery(graph_store=ctx.graph_store)

if category:    decisions = dq.find_by_category(category, limit=100)
elif entity:    decisions = dq.find_by_entity(entity, limit=100)
elif from_date: decisions = dq.find_by_time_range(
                    start=datetime.fromisoformat(from_date),
                    end=datetime.fromisoformat(to_date or "2099-12-31"),
                )

Return: | ID | Category | Scenario | Outcome | Confidence | Maker | Timestamp |


exception <decision_id> <policy_id> "<reason>" --approver <name>

Record a formal policy exception.

from semantica.context.decision_recorder import DecisionRecorder
from semantica.context import AgentContext

ctx = AgentContext(decision_tracking=True)
recorder = DecisionRecorder(graph_store=ctx.graph_store)

exception_id = recorder.record_exception(
    decision_id=decision_id, policy_id=policy_id,
    reason=reason, approver=approver,
    approval_method="manual_override", justification=reason,
)

from semantica.context.decision_query import DecisionQuery
dq = DecisionQuery(graph_store=ctx.graph_store)
similar = dq.find_similar_exceptions(exception_reason=reason, limit=5)

Output: Exception recorded: <exception_id> + similar past exceptions for audit context.

用于在Semantica知识图谱中检测并移除重复实体、分组及关系。通过模糊匹配、模式启发式和图相似度算法,提供重复候选项、分组结果及合并建议,支持自定义阈值和字段过滤。
需要清理知识图谱中的重复数据 发现实体或关系存在冗余时 执行图谱质量优化任务
plugins/skills/deduplicate/SKILL.md
npx skills add semantica-agi/semantica --skill deduplicate -g -y
SKILL.md
Frontmatter
{
    "name": "deduplicate",
    "description": "Detect duplicate entities, duplicate groups, and relationship duplicates in Semantica using fuzzy matching, schema heuristics, and graph similarity."
}

/semantica:deduplicate

Remove duplicates from the knowledge graph. Usage: /semantica:deduplicate <strategy> [args]

$ARGUMENTS = deduplication strategy + optional entity or threshold.


entities [--threshold <score>] [--field <name>]

Detect duplicate entities and group them by similarity.

from semantica.deduplication import DuplicateDetector

finder = DuplicateDetector()
candidates = finder.detect_duplicates(entities, threshold=threshold)
groups = finder.detect_duplicate_groups(entities, threshold=threshold)

Output: duplicate candidate list, duplicate groups, and representative merge recommendations.


relations [--similarity <score>]

Detect duplicate relationships and normalize edge representations.

from semantica.deduplication import DuplicateDetector

finder = DuplicateDetector()
relations = finder.detect_duplicates(relation_list, threshold=similarity)

Result: duplicate relation candidates, normalized relationship groups, and cleanup summary.

用于解释Semantica系统中的决策逻辑、规则推理及图分析结果。支持通过指定ID和详细程度,生成包含因果链、置信度、证据及后续建议的可读性解释报告,提升系统透明度与可追溯性。
用户询问某个决策的具体原因或依据 需要分析图中节点间的连接关系及因果链条 调试或审计推理过程中的规则触发情况
plugins/skills/explain/SKILL.md
npx skills add semantica-agi/semantica --skill explain -g -y
SKILL.md
Frontmatter
{
    "name": "explain",
    "description": "Explain Semantica reasoning, decision logic, and graph results with traceability, causal context, and human-readable rationale."
}

/semantica:explain

Produce explanations for decisions, rules, and graph analytics. Usage: /semantica:explain <target> [args]

$ARGUMENTS = explanation target + optional detail level.


decision <decision_id> [--detail <level>]

Explain why a decision was reached.

from semantica.reasoning.explanation_generator import ExplanationGenerator

# For decision explainability in Semantica contexts:
decision_trace = ctx.trace_decision_explainability(decision_id=decision_id)

# For reasoning/proof explanations:
generator = ExplanationGenerator(detail_level=detail)
explanation = generator.generate_explanation(reasoning_result)

Output: decision factors, rule traces, confidence, and suggested next steps.


graph <node_id> [--path N]

Explain graph relationships and why a node is connected.

# Use AgentContext explainability + causal tracing for graph-connected decisions
graph_explanation = ctx.trace_decision_explainability(decision_id=node_id)
upstream = ctx.get_causal_chain(decision_id=node_id, direction="upstream", max_depth=depth)
downstream = ctx.get_causal_chain(decision_id=node_id, direction="downstream", max_depth=depth)

Return: cause/effect chains, supporting evidence, and relevant metadata.

将知识图谱数据、结果及溯源信息导出为JSON、RDF、Parquet、CSV、GraphML等多种格式,支持过滤与可视化输出。
用户需要将图谱数据转换为特定文件格式 请求导出图数据用于分析或可视化
plugins/skills/export/SKILL.md
npx skills add semantica-agi/semantica --skill export -g -y
SKILL.md
Frontmatter
{
    "name": "export",
    "description": "Export Semantica graphs, results, and provenance to JSON, RDF, Parquet, CSV, GraphML, and other formats."
}

/semantica:export

Export knowledge graph data. Usage: /semantica:export <format> [args]

$ARGUMENTS = format + optional target or destination.


json [--output <path>] [--filter <query>]

Export graph data as JSON.

from semantica.export.methods import export_json

export_json(data=graph_data, file_path=output, format='json')

Output: JSON file or inline JSON payload.


rdf [--format turtle|rdfxml|jsonld|ntriples|n3] [--output <path>]

Export the graph in RDF serialization.

from semantica.export.methods import export_rdf

export_rdf(data=graph_data, file_path=output, format='turtle')

Return: RDF text or file path.


parquet [--output <path>]

Export nodes and edges to Parquet for analytics.

from semantica.export.methods import export_parquet

export_parquet(data=graph_data, file_path=output, compression='snappy')

Output: Parquet dataset ready for downstream processing.


graphml|gexf|dot [--output <path>]

Export the graph to a supported graph format.

from semantica.export import GraphExporter

exporter = GraphExporter(format='graphml', include_attributes=True)
exporter.export(graph_data, output)

Output: Graph format file suitable for visualization tools.

对文件或文本执行完整语义提取,涵盖NER、关系、事件、指代消解及三元组抽取。支持文件路径或内联文本输入,自动清理缓存并验证质量,最终输出包含警告信息的Markdown表格结果。
用户要求从文件或文本中提取实体、关系或事件 调用 /semantica:extract 命令进行语义分析
plugins/skills/extract/SKILL.md
npx skills add semantica-agi/semantica --skill extract -g -y
SKILL.md
Frontmatter
{
    "name": "extract",
    "description": "Run the full Semantica semantic extraction pipeline on a file or selected text — NER, relations, events, coreference resolution, triplets, and validation. Clears result cache before each run. Returns Markdown tables with entity\/relation\/event\/triplet results and inline validator warnings."
}

/semantica:extract

Run the full extraction pipeline. Usage: /semantica:extract [file_path | "inline text"]

$ARGUMENTS = file path, inline text in quotes, or blank (uses active editor file).


Steps

1. Resolve the source.

  • If $ARGUMENTS is a readable file path → text = open(path).read()
  • If it's quoted inline text → use directly
  • If blank → use the active editor file

2. Clear the result cache to prevent cross-invocation pollution:

from semantica.semantic_extract.cache import _result_cache
_result_cache.clear()

3. Run the full pipeline:

from semantica.semantic_extract import (
    NamedEntityRecognizer,
    RelationExtractor,
    EventDetector,
    CoreferenceResolver,
    TripletExtractor,
    ExtractionValidator,
)

# Named Entity Recognition
ner = NamedEntityRecognizer()
entities = ner.extract(text)

# Relation Extraction
rel = RelationExtractor()
relations = rel.extract(text)

# Event Detection
evt = EventDetector()
events = evt.extract(text)

# Coreference Resolution — resolve pronouns/aliases before extraction
coref = CoreferenceResolver()
resolved_text = coref.resolve(text)

# Triplet Extraction (subject–predicate–object)
triplet = TripletExtractor()
triplets = triplet.extract(resolved_text)

# Validate quality
validator = ExtractionValidator()
issues = validator.validate(entities, relations)

4. Report validator warnings above results:

⚠ ExtractionValidator: <warning message>

5. Return results as Markdown tables:

Entities (N total)

Label Type Confidence Span

Relations (M total)

Source Relation Type Target Confidence

Events (K total)

Label Type Participants Confidence

Triplets (J total)

Subject Predicate Object Confidence

6. Summary line:

Extracted: N entities, M relations, K events, J triplets — from <source>

For large files (>50KB), process in chunks and show a progress indicator. Highlight any entities appearing in the context graph already (ContextGraph.has_node(label)) with [in graph] tag.

将文件、数据库、API或流中的数据摄入到 Semantica 知识图谱,支持模式映射和实体链接。
需要从本地文件导入结构化数据 需要连接数据库并执行SQL查询导入数据
plugins/skills/ingest/SKILL.md
npx skills add semantica-agi/semantica --skill ingest -g -y
SKILL.md
Frontmatter
{
    "name": "ingest",
    "description": "Ingest data from files, databases, APIs, or streams into Semantica knowledge graphs with schema mapping and entity linking."
}

/semantica:ingest

Ingest new data into the knowledge graph. Usage: /semantica:ingest <source> [args]

$ARGUMENTS = source type + optional file path, connection string, or dataset identifier.


file <path> [--format json|csv|yaml|xml]

Ingest structured data from a local file.

from semantica.ingest import ingest_file

data = ingest_file(file_path=path, method='file', file_format=file_format)

Output: imported node/edge count and ingestion summary.


db <connection> [--query <sql>]

Ingest data from a database source.

from semantica.ingest import ingest_database

result = ingest_database(connection_string=conn, query=query)

Return: rows ingested, mapped entities, and warnings.

管理 Semantica 知识图谱的本体模式、概念、关系和对齐。支持描述本体概念详情及验证图或模式是否符合本体定义,提供错误纠正建议。
查询本体概念详细信息 验证知识图谱或Schema文件与本体的合规性
plugins/skills/ontology/SKILL.md
npx skills add semantica-agi/semantica --skill ontology -g -y
SKILL.md
Frontmatter
{
    "name": "ontology",
    "description": "Manage ontology schemas, concepts, relationships, and alignments for Semantica knowledge graphs."
}

/semantica:ontology

Manage ontology definitions and validation. Usage: /semantica:ontology <task> [args]

$ARGUMENTS = task + optional ontology item or schema file.


describe <concept>

Show ontology concept details.

from semantica.ontology import OntologyManager

manager = OntologyManager()
concept = manager.get_concept(concept_name)

Output: properties, relationships, inherited types, and examples.


validate [--schema <file>]

Validate the graph or schema against the ontology.

result = manager.validate_graph(graph=graph, schema_file=schema_file)

Return: validation status, errors, and correction suggestions.

用于在 Semantica 知识图谱上定义和执行策略、访问控制及合规规则。支持检查合规性并输出失败规则与修复建议,以及列出可用策略规则和分类信息。
需要验证知识图谱数据是否符合特定安全或业务策略 查询当前可用的合规规则列表及其严重程度
plugins/skills/policy/SKILL.md
npx skills add semantica-agi/semantica --skill policy -g -y
SKILL.md
Frontmatter
{
    "name": "policy",
    "description": "Define and enforce policies, access controls, and compliance rules over Semantica knowledge graphs."
}

/semantica:policy

Apply policy rules and checks. Usage: /semantica:policy <task> [args]

$ARGUMENTS = task + optional policy name, rule set, or target entity.


check [--rule <name>] [--target <id>]

Run policy checks against the graph.

from semantica.policy import PolicyEngine

engine = PolicyEngine()
result = engine.check(rule_name=rule_name, target=target)

Output: compliance status, failing rules, and remediation guidance.


list

List available policy rules and categories.

rules = engine.list_rules()

Return: rule name, description, severity, and category.

用于在 Semantica 图中追踪数据血缘、来源归属、审计轨迹及溯源断言。支持追溯节点事实的来源链、作者和时间戳,以及查看特定时间段或操作者的图变更审计日志。
用户询问数据来源或血缘关系 用户需要检查数据修改历史或审计记录 用户请求验证数据的可信度或作者信息
plugins/skills/provenance/SKILL.md
npx skills add semantica-agi/semantica --skill provenance -g -y
SKILL.md
Frontmatter
{
    "name": "provenance",
    "description": "Trace data lineage, source attribution, audit trails, and provenance assertions in Semantica graphs."
}

/semantica:provenance

Inspect provenance metadata. Usage: /semantica:provenance <task> [args]

$ARGUMENTS = task + optional node, edge, or time range.


trace <node_id> [--depth N]

Trace the provenance of a node or fact.

from semantica.provenance import ProvenanceTracer

tracer = ProvenanceTracer()
trace = tracer.trace_node(node_id=node_id, depth=depth)

Output: source chain, authors, timestamps, and validation status.


audit [--since <ts>] [--actor <id>]

View audit logs for graph changes.

audit_log = tracer.get_audit_log(since=since, actor=actor)

Return: change events, actor, affected objects, and action details.

通过SPARQL、Cypher及关键词搜索查询Semantica知识图谱。支持结构化图查询与实体检索,返回表格或排序结果。
用户需要执行SPARQL查询 用户需要执行Cypher查询 用户需要通过关键词搜索知识图谱中的实体
plugins/skills/query/SKILL.md
npx skills add semantica-agi/semantica --skill query -g -y
SKILL.md
Frontmatter
{
    "name": "query",
    "description": "Query the Semantica knowledge graph using SPARQL, Cypher, keyword search, and structured graph query patterns."
}

/semantica:query

Run graph queries and search. Usage: /semantica:query <mode> [args]

$ARGUMENTS = query mode + query string or filter.


sparql <query>

Execute a SPARQL query against the graph.

from semantica.query import QueryEngine

engine = QueryEngine()
results = engine.query_sparql(query)

Return: query bindings as a Markdown table.


cypher <query>

Execute a Cypher-like query.

results = engine.query_cypher(query)

Output: node/relationship results and path summaries.


search <keywords> [--filter <type>]

Search graph entities by keyword.

results = engine.search(keywords=keywords, filter_type=filter_type)

Return: ranked matches with entity types and relevance scores.

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-07-13 19:51
浙ICP备14020137号-1 $访客地图$