skills/ontology/ontology-validator/SKILL.md
Validate material sample annotations against ontology constraints — check that class names and property names exist in the ontology, verify domain and range consistency for object property relationships, assess annotation completeness (required, recommended, and optional properties), and flag unknown or misspelled terms. Use when verifying that CMSO or other ontology annotations are correct before publishing, checking whether all required properties are present for a class like Crystal Structure or Unit Cell, auditing relationship triples between instances, or catching annotation errors early in a FAIR data workflow, even if the user only says "is my annotation correct" or "what am I missing."
npx skillsauth add HeshamFS/materials-simulation-skills ontology-validatorInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Validate that material sample annotations comply with ontology constraints: correct class names, valid properties, consistent domain/range relationships, and required fields present.
cmso_summary.json and ontology_registry.json| 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"}] |
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 | 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 |
schema_checker.py to verify correctness.completeness_checker.py to see what required/recommended properties are missing.relationship_checker.py to ensure domain/range consistency.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.
# 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 | 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 |
--ontology is validated against registered ontology names in ontology_registry.json (fixed allowlist)--annotation JSON is parsed with json.loads() and validated as a dict with required class and properties keys--class names are validated against known classes in the ontology summary; unknown classes produce clear errors--provided property names are validated as comma-separated strings and matched against known properties--relationships JSON is parsed and validated as a non-empty list of dicts, each requiring subject_class, property, and object_class keysreferences/ directory: ontology_registry.json, cmso_summary.json, cmso_constraints.json (all read-only)schema_checker.py, completeness_checker.py, relationship_checker.py) with explicit argument listseval(), exec(), or dynamic code generationshell=True)json.loads() only (no pickle, no YAML with unsafe loaders)| Date | Version | Changes | |------|---------|---------| | 2026-02-25 | 1.0 | Initial release with CMSO validation support |
development
Plan verification and validation campaigns for simulation codes using manufactured solutions, canonical benchmark problems, grid/time refinement, uncertainty propagation, and pass/fail acceptance criteria. Use when an agent needs to prove a solver, model, or result is trustworthy rather than only plausible.
testing
Map computational materials tasks onto workflow engines such as atomate2, jobflow, AiiDA, pyiron, or a simple one-off script. Use when deciding how to structure a reproducible campaign, DAG, restart strategy, provenance record, storage layout, or migration path from ad hoc scripts to managed workflows.
development
Plan molecular dynamics post-processing for materials simulations, including RDF, MSD and diffusion, VACF/VDOS, coordination numbers, bond-angle distributions, stress-strain curves, equilibration detection, PBC unwrapping, and trajectory format choices. Use before writing MD analysis scripts or trusting trajectory-derived results.
development
Triage cross-code simulation failures and propose safe retry ladders for nonconvergence, NaN/Inf, exploding energies, unstable timesteps, pressure blow-up, missing potentials, bad pseudopotentials, corrupted output, and incomplete runs. Use when an agent sees a failed or suspicious materials simulation and needs a defensible first response.