Agent Skills › semantica-agi/semantica

semantica-agi/semantica

GitHub

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

13 skills 1,382

Install All Skills

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

List skills in collection

npx skills add semantica-agi/semantica --list

Skills in Collection (13)

Semantica全栈知识图谱技能,支持上下文分析、决策智能、语义提取、推理、可解释性、本体建模、溯源及多格式导出。适用于图拓扑分析、因果推断、数据清洗与合规检查等复杂场景。
用户询问知识图谱、实体关系或语义提取 需要上下文图分析、图拓扑或中心性计算 涉及决策智能、因果影响或结果分析 要求提供决策依据或图结果的可解释性 需要进行演绎、SPARQL或规则推理 需要溯源、审计历史或变更追踪 涉及本体建模、模式验证或策略执行 需从文件、数据库或API导入数据 需要去重、标准化或合并重复节点 要求将图导出为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 知识图谱的变更、差异及时间更新。支持计算快照间差异、查看节点历史修订,评估新数据对图谱的影响,辅助进行数据溯源和影响分析。
需要对比两个时间点知识图谱的差异 查询特定节点或关系的修改历史记录
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.

管理决策全生命周期,支持记录、自然语言查询、先例检索(混合/高级)、影响分析及洞察展示。
需要记录业务决策及其背景 通过自然语言查询历史决策 查找类似场景的先例以辅助判断 分析特定决策的影响范围
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.

用于从知识图谱中检测并处理重复实体、分组及关系。支持模糊匹配与图相似度算法,提供去重策略、阈值设置及合并建议,帮助清理冗余数据并标准化关系表示。
用户要求清理知识图谱中的重复数据 需要识别相似的实体或关系组 执行图谱数据清洗与维护任务
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.

用于解释决策逻辑、规则推理及图分析结果,提供可追溯的因果上下文和人类可读的理由。支持针对特定决策ID或图节点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.

将 Semantica 知识图谱数据、结果及溯源信息导出为 JSON、RDF、Parquet、CSV、GraphML 等多种格式,支持按路径输出或内联返回,适用于数据分析、可视化及下游处理。
需要将知识图谱数据转换为特定文件格式 请求导出 GraphML 或 RDF 等标准格式
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.

执行Semantica完整语义提取流水线,支持NER、关系、事件、指代消解及三元组抽取。自动解析文件/文本源,清除缓存后运行并验证质量,最终以Markdown表格形式返回结构化结果及统计摘要。
用户需要提取文本中的实体、关系或事件 用户要求对文件或选中文本进行深度语义分析
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知识图谱中,支持模式映射和实体链接。
从本地文件导入结构化数据 从数据库查询并导入数据
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 知识图谱上定义、执行策略、访问控制和合规规则。支持检查特定目标或规则的合规状态,并列出可用规则及其详情。
用户需要验证知识图谱中的实体是否符合特定政策 用户希望查看当前可用的策略规则列表 用户请求对特定ID进行合规性检查
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图中追踪数据血缘、来源归属、审计轨迹及验证状态。支持通过节点ID追溯来源链,或按时间/操作者查看图变更的审计日志,确保数据可解释性与合规性。
查询特定数据节点的来源和演化历史 审查数据图的变更记录和操作者行为 验证数据的可信度与审计合规性
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.

Accueil - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-07-09 01:51
浙ICP备14020137号-1 $Carte des visiteurs$