ontology-validator
정보
온톨로지 검증 스킬은 재료 샘플 주석의 온톨로지 준수 여부를 확인하며, 용어 존재 여부, 도메인/범위 일관성, 필수 속성의 완전성을 검증합니다. CMSO와 같은 온톨로지에 대한 주석을 게시 전에 감사하여 FAIR 데이터 표준을 보장하는 데 사용됩니다. 개발자는 워크플로우 초기 단계에서 클래스 및 속성 정의의 오류를 발견하기 위해 이 스킬을 활용해야 합니다.
빠른 설치
Claude Code
추천npx skills add HeshamFS/materials-simulation-skills -a claude-code/plugin add https://github.com/HeshamFS/materials-simulation-skillsgit clone https://github.com/HeshamFS/materials-simulation-skills.git ~/.claude/skills/ontology-validatorClaude Code에서 이 명령을 복사하여 붙여넣어 스킬을 설치하세요
문서
Ontology Validator
Goal
Validate that material sample annotations comply with ontology constraints: correct class names, valid properties, consistent domain/range relationships, and required fields present.
Requirements
- Python 3.8+
- No external dependencies (Python standard library only)
- Requires ontology-explorer's
cmso_summary.jsonandontology_registry.json
Inputs to Gather
| Input | Description | Example |
|---|---|---|
| Annotation | JSON dict or list of annotation dicts | {"class":"UnitCell","properties":{"has Bravais lattice":"cF"}} |
| Class name | Class to check completeness for | Crystal Structure |
| Provided properties | Comma-separated property names | "has unit cell,has space group" |
| Relationships | JSON array of subject-property-object triples | [{"subject_class":"Material","property":"has structure","object_class":"Crystal Structure"}] |
Decision Guidance
What do you need to validate?
├── An annotation (classes and properties are correct)
│ └── schema_checker.py --ontology cmso --annotation '<json>'
├── Completeness of a class annotation
│ └── completeness_checker.py --ontology cmso --class <name> --provided <props>
└── Object property relationships
└── relationship_checker.py --ontology cmso --relationships '<json>'
Script Outputs (JSON Fields)
| Script | Key Outputs |
|---|---|
scripts/schema_checker.py | results.valid, results.errors, results.warnings, results.class_valid, results.properties_valid |
scripts/completeness_checker.py | results.completeness_score, results.required_missing, results.recommended_missing, results.optional_missing, results.unrecognized |
scripts/relationship_checker.py | results.valid, results.results, results.errors |
Workflow
- After mapping a sample with ontology-mapper, pass the annotations to
schema_checker.pyto verify correctness. - For a specific class, use
completeness_checker.pyto see what required/recommended properties are missing. - When building relationships between instances, use
relationship_checker.pyto ensure domain/range consistency.
Conversational Workflow Example
User: I annotated my sample as CrystalStructure with properties hasUnitCell and hasBasis.
Is this correct and complete?
Agent: Let me validate your annotation and check completeness.
[Runs: completeness_checker.py --ontology cmso --class "Crystal Structure" --provided "has unit cell,has basis" --json]
Your annotation is partially complete:
- has unit cell: provided (required)
- has basis: not a direct property of Crystal Structure (it belongs to Unit Cell)
- **Missing required**: has space group
The "has basis" property belongs to the Unit Cell class, not Crystal Structure.
You should add "has space group" to Crystal Structure and move "has basis"
to the Unit Cell annotation.
CLI Examples
# Validate an annotation
python3 skills/ontology/ontology-validator/scripts/schema_checker.py \
--ontology cmso \
--annotation '{"class":"Unit Cell","properties":{"has Bravais lattice":"cF"}}' \
--json
# Check completeness
python3 skills/ontology/ontology-validator/scripts/completeness_checker.py \
--ontology cmso \
--class "Crystal Structure" \
--provided "has unit cell,has space group" \
--json
# Validate relationships
python3 skills/ontology/ontology-validator/scripts/relationship_checker.py \
--ontology cmso \
--relationships '[{"subject_class":"Computational Sample","property":"has material","object_class":"Material"}]' \
--json
Error Handling
| Error | Cause | Resolution |
|---|---|---|
Class 'X' not found | Invalid class name | Use ontology-explorer to find correct name |
Property 'X' not found | Invalid property name | Use property_lookup.py to search |
Annotation must be a dict | Wrong input format | Provide valid JSON dict |
Relationships must be a non-empty list | Wrong input format | Provide JSON array of relationship dicts |
Interpretation Guidance
- Errors indicate definite problems (unknown class/property, range mismatch)
- Warnings indicate potential issues (domain mismatch — may be intentional for subclasses)
- Completeness score: 0.0-1.0 ratio of provided vs. total tracked properties
- required_missing: must fix for valid annotation
- recommended_missing: should fix for quality
- unrecognized: may indicate typos or properties from a different ontology
Security
Input Validation
--ontologyis validated against registered ontology names inontology_registry.json(fixed allowlist)--annotationJSON is parsed withjson.loads()and validated as a dict with requiredclassandpropertieskeys--classnames are validated against known classes in the ontology summary; unknown classes produce clear errors--providedproperty names are validated as comma-separated strings and matched against known properties--relationshipsJSON is parsed and validated as a non-empty list of dicts, each requiringsubject_class,property, andobject_classkeys
File Access
- Scripts read pre-processed JSON files from the
references/directory:ontology_registry.json,cmso_summary.json,cmso_constraints.json(all read-only) - No scripts write to the filesystem; all output goes to stdout
- No network access is required
Tool Restrictions
- Read: Used to inspect script source, reference files, and ontology constraint data
- Bash: Used to execute the three Python validation scripts (
schema_checker.py,completeness_checker.py,relationship_checker.py) with explicit argument lists
Safety Measures
- No
eval(),exec(), or dynamic code generation - All subprocess calls use explicit argument lists (no
shell=True) - JSON input parsing uses
json.loads()only (no pickle, no YAML with unsafe loaders) - Validation logic operates on pre-loaded in-memory data structures; no dynamic file discovery or traversal
Limitations
- Constraints file is manually curated, not derived from OWL axioms
- Does not validate data types (e.g., whether a value is actually a float vs string)
- Does not validate cardinality (e.g., exactly one space group per structure)
- Subclass checking uses simple parent traversal, not full OWL reasoning
References
- Validation Rules — what is validated and why
- CMSO Constraints — required/recommended properties per class
- CMSO Guide — CMSO ontology overview
Version History
| Date | Version | Changes |
|---|---|---|
| 2026-02-25 | 1.0 | Initial release with CMSO validation support |
GitHub 저장소
연관 스킬
executing-plans
디자인executing-plans 스킬은 검토 체크포인트가 포함된 통제된 배치로 실행할 완전한 구현 계획이 있을 때 사용합니다. 이 스킬은 계획을 불러와 비판적으로 검토한 후, 소규모 배치(기본값 3개 작업)로 작업을 실행하면서 각 배치 사이에 진행 상황을 아키텍트 검토를 위해 보고합니다. 이를 통해 내재된 품질 관리 체크포인트를 갖춘 체계적인 구현이 보장됩니다.
requesting-code-review
디자인이 스킬은 코드 변경 사항을 요구 사항에 따라 분석하기 위해 코드 리뷰어 하위 에이전트를 호출합니다. 작업 완료 후, 주요 기능 구현 후, 또는 메인 브랜치에 병합하기 전에 사용해야 합니다. 이 리뷰는 현재 구현체와 원래 계획을 비교하여 문제를 조기에 발견하는 데 도움이 됩니다.
connect-mcp-server
디자인이 스킬은 개발자들이 HTTP, stdio 또는 SSE 전송 방식을 통해 MCP 서버를 Claude Code에 연결하는 포괄적인 가이드를 제공합니다. GitHub, Notion 및 사용자 정의 API와 같은 외부 서비스를 통합하기 위한 설치, 구성, 인증 및 보안을 다룹니다. MCP 통합 설정, 외부 도구 구성 또는 Claude의 모델 컨텍스트 프로토콜 작업 시 활용하세요.
web-cli-teleport
디자인이 스킬은 작업 분석을 기반으로 개발자가 Claude Code 웹 인터페이스와 CLI 인터페이스 중 선택할 수 있도록 돕고, 두 환경 간 원활한 세션 텔레포트를 가능하게 합니다. 웹, CLI 또는 모바일 환경 전환 시 세션 상태와 컨텍스트를 관리하여 워크플로를 최적화합니다. 다양한 단계에서 서로 다른 도구가 필요한 복잡한 프로젝트에 사용하세요.
