validate
它能做什么
这项技能检查 Semantica 中流程、抽取数据、图谱结构和本体的质量。适合想在问题影响结果之前就将其找出的人。
适用场景
- ✓当你想在运行数据流程之前检查其设置的时候。
- ✓当你想确认抽取出的实体和关系质量良好的时候。
- ✓当你需要一份图谱或本体的错误和警告清单的时候。
技能链接
https://github.com/semantica-agi/semantica/blob/main/plugins/skills/validate/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请帮我检查数据流程的设置是否有错误,并告诉我哪些步骤缺少依赖?”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会针对你选择的目标运行相应的验证器,例如流程、单个步骤、图谱或本体。它会返回错误和警告清单,以及步骤之间缺失的任何依赖。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
/semantica:validate
Validate pipeline and graph quality. Usage: /semantica:validate <target> [options]
$ARGUMENTS = target type + optional config or path.
pipeline [--config '<json>']
Validate a full pipeline builder configuration.
from semantica.pipeline.pipeline_builder import PipelineBuilder
from semantica.pipeline.pipeline_validator import PipelineValidator
builder = PipelineBuilder()
if config_json:
import json
builder.build_pipeline(json.loads(config_json))
# PipelineBuilder has its own quick validate
quick = builder.validate_pipeline() # returns Dict
# PipelineValidator gives full ValidationResult(valid, errors, warnings)
# Does NOT raise — always returns a result object
validator = PipelineValidator()
result = validator.validate(builder)
# Also check inter-step dependencies
deps = validator.check_dependencies(builder)
Output:
Pipeline Validation: VALID ✓ | INVALID ✗
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Steps: N registered
Valid: M steps
Errors (K):
✗ [step_name] <error message>
Warnings (J):
⚠ [step_name] <warning message>
Dependencies:
✓ All dependencies resolved
✗ Step "<name>" depends on missing step "<dep>"
Result: <valid> — K errors, J warnings
step <step_name> [--type <type>] [--constraints '<json>']
Validate a single pipeline step.
from semantica.pipeline.pipeline_builder import PipelineBuilder
from semantica.pipeline.pipeline_validator import PipelineValidator
import json
builder = PipelineBuilder()
step = builder.get_step(step_name)
validator = PipelineValidator()
result = validator.validate_step(
step=step,
**json.loads(constraints_json) if constraints_json else {},
)
Output: same checklist format but scoped to a single step.
dependencies
Check all inter-step dependency resolution for the active pipeline.
from semantica.pipeline.pipeline_builder import PipelineBuilder
from semantica.pipeline.pipeline_validator import PipelineValidator
builder = PipelineBuilder()
validator = PipelineValidator()
deps = validator.check_dependencies(builder)
Output:
Dependency Graph:
| Step | Depends On | Status |
| step_A | — | ✓ |
| step_B | step_A | ✓ |
| step_C | step_X | ✗ MISSING |
Cycles detected: YES / NO
Missing steps: [list]
extraction <file_path>
Validate extraction quality for a file — entity confidence, relation density, coverage.
from semantica.semantic_extract.extraction_validator import ExtractionValidator
from semantica.semantic_extract import (
NamedEntityRecognizer,
RelationExtractor,
)
from semantica.semantic_extract.cache import extraction_cache
extraction_cache.clear() # prevent cross-invocation cache pollution
text = open(file_path).read()
ner = NamedEntityRecognizer()
rel = RelationExtractor()
entities = ner.extract(text)
relations = rel.extract(text)
validator = ExtractionValidator()
issues = validator.validate(entities, relations)
Output:
Extraction Validation: <file_path>
Entities: N extracted
Relations: M extracted
Avg confidence: 0.83
Errors (K):
✗ <issue>
Warnings (J):
⚠ <warning>
Quality score: X/100
graph
Check schema conformance, referential integrity, and structural health.
from semantica.kg.graph_validator import GraphValidator
from semantica.context import ContextGraph
graph = ContextGraph()
validator = GraphValidator(graph)
result = validator.validate()
Output:
Graph Validation:
Nodes: N | Edges: M
Node types: K valid, J unknown
Referential integrity:
✗ Dangling edge: <source> → <missing target>
Schema conformance:
✗ Node "<id>" missing required property "<prop>"
Result: N errors, M warnings
ontology
Validate ontology consistency and evaluate competency questions.
from semantica.ontology import OntologyValidator
validator = OntologyValidator()
result = validator.validate()
cq_results = validator.evaluate_competency_questions()
Output:
Ontology Validation:
Classes: N
Properties: M
Consistent: YES ✓ | NO ✗
Competency questions:
✓ "Can we find all instances of X?" — answered
✗ "Is Y a subclass of Z?" — failed: <reason>
Result: N consistency errors, M CQ failures
performance
Validate pipeline performance characteristics — bottlenecks, parallelism, and resource use.
from semantica.pipeline.pipeline_builder import Pipeli
常见问题
验证会停止运行吗?
不会。验证器会返回列出问题的结果,而不会中止运行。
可以验证哪些内容?
流程、单个步骤、依赖关系、抽取质量、图谱、本体和性能。
结果有摘要吗?
有。每项检查都会以有效或无效的结论结束,并给出错误和警告的数量。
详情
作者的原始描述
Validate Semantica pipelines, extraction quality, graph schemas, and ontology consistency. Returns structured error/warning checklists. Uses PipelineValidator, PipelineBuilder.validate_pipeline(), GraphValidator, and OntologyValidator. Sub-commands: pipeline, step, dependencies, extraction, graph, ontology, performance.
repo: semantica-agi/semantica
热度
- GitHub 星标
- 14k
- 排名
- #11157
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …