OpenClaw-Medical-Skills ontology-validator
install
source · Clone the upstream repo
git clone https://github.com/FreedomIntelligence/OpenClaw-Medical-Skills
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/FreedomIntelligence/OpenClaw-Medical-Skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/ontology-validator" ~/.claude/skills/freedomintelligence-openclaw-medical-skills-ontology-validator && rm -rf "$T"
OpenClaw · Install into ~/.openclaw/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/FreedomIntelligence/OpenClaw-Medical-Skills "$T" && mkdir -p ~/.openclaw/skills && cp -r "$T/skills/ontology-validator" ~/.openclaw/skills/freedomintelligence-openclaw-medical-skills-ontology-validator && rm -rf "$T"
manifest:
skills/ontology-validator/SKILL.mdsource content
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
andcmso_summary.jsonontology_registry.json
Inputs to Gather
| Input | Description | Example |
|---|---|---|
| Annotation | JSON dict or list of annotation dicts | |
| Class name | Class to check completeness for | |
| Provided properties | Comma-separated property names | |
| Relationships | JSON array of subject-property-object triples | |
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 |
|---|---|
| , , , , |
| , , , , |
| , , |
Workflow
- After mapping a sample with ontology-mapper, pass the annotations to
to verify correctness.schema_checker.py - For a specific class, use
to see what required/recommended properties are missing.completeness_checker.py - When building relationships between instances, use
to ensure domain/range consistency.relationship_checker.py
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 |
|---|---|---|
| Invalid class name | Use ontology-explorer to find correct name |
| Invalid property name | Use property_lookup.py to search |
| Wrong input format | Provide valid JSON dict |
| 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
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 |