heshamfs/materials-simulation-skills/ontology-explorer
Claude Code and agent skill by heshamfs/materials-simulation-skills
- community
Checking that the SKILL.md file is still in the repository.
Parse, navigate, and query materials science ontology structures — browse class hierarchies, inspect individual classes and their properties, look up object and data property definitions with domain/range, search for ontology terms by keyword, and parse or summarize raw OWL/XML files. Currently supports CMSO and ASMO; the broader OCDO ecosystem (CDCO, PODO, PLDO, LDO) is planned. Use when exploring what classes or properties an ontology provides, finding the right CMSO term for a crystal structure or simulation concept, understanding parent-child class relationships, or onboarding to an unfamiliar materials ontology, even if the user only says "what ontology terms describe my FCC copper simulation" or "show me the CMSO class hierarchy."
Install
npx vskill@latest install heshamfs/materials-simulation-skills/ontology-explorerSKILL.md
Ontology Explorer
Goal
Enable an agent to understand, navigate, and query the structure of materials science ontologies without loading verbose OWL/XML files directly. Provides fast access to class hierarchies, property definitions, and domain-range relationships through pre-processed JSON summaries.
Requirements
- Python 3.10+
- No external dependencies (Python standard library only)
- Internet access required only for
owl_parser.pyandontology_summarizer.pywhen fetching remote OWL files
Inputs to Gather
| Input | Description | Example | |
|---|---|---|---|
| Ontology name | Registered ontology to query | cmso | |
| Class name | A specific class to inspect | Material, UnitCell | |
| Property name | A specific property to look up | hasMaterial, hasSpaceGroupNumber | |
| Search term | Keyword to search across labels | crystal, lattice | |
| OWL source | Path or URL to an OWL/XML file (for parsing/summarizing) | https://raw.githubusercontent.com/OCDO/cmso/main/cmso.owl |
Decision Guidance
Script Outputs (JSON Fields)
| Script | Key Outputs | |
|---|---|---|
scripts/owl_parser.py | results.metadata, results.classes, results.object_properties, results.data_properties, results.class_hierarchy | |
scripts/ontology_summarizer.py | results.output_file, results.statistics | |
scripts/class_browser.py | results.class_info, results.subtree, results.properties, results.path_to_root, results.roots, results.search_results | |
scripts/property_lookup.py | results.property_info, results.class_properties, results.search_results |
Workflow
- Identify which ontology the user is working with (default: CMSO).
- Use
class_browser.py --list-rootsto see the top-level concepts. - Drill into specific classes with
class_browser.py --class <name>to see hierarchy, children, and applicable properties. - Look up individual properties with
property_lookup.py --property <name>. - If the user mentions a concept but not its ontology name, use
--searchto find matching classes or properties. - For a new or updated ontology, run
owl_parser.pyto parse the raw OWL, thenontology_summarizer.pyto generate a summary JSON.
Conversational Workflow Example
CLI Examples
Error Handling
| Error | Cause | Resolution | |
|---|---|---|---|
Ontology 'X' not in registry | Ontology name not registered | Check references/ontology_registry.json for available names | |
Class 'X' not found | Class label doesn't match any entry | Use --search to find similar names, or --list-roots to see available classes | |
Property 'X' not found | Property label doesn't match | Use --search to find similar properties | |
Cannot parse OWL source | Invalid XML or unreachable URL | Check file path or URL; ensure the file is valid OWL/XML | |
Summary file not found | Summary JSON hasn't been generated | Run ontology_summarizer.py first |
Interpretation Guidance
- Class hierarchy: root classes are the broadest concepts; leaf classes are the most specific. A class inherits all properties from its ancestors.
- Object properties: show how classes relate to each other (domain → range). A property with domain
UnitCelland rangeBasismeans a unit cell has a basis. - Data properties: show what literal values a class carries. A property with domain
ChemicalElementand rangexsd:stringmeans an element has a string-valued attribute. - Union domains: a property can apply to more than one class. When it does, the domain is shown as the classes joined with a pipe, e.g.
A | B. (The bundled CMSO/ASMO summaries currently contain no union-domain properties.) - Search relevance: 1.0 = label match, 0.5 = description match only.
Verification checklist
Before presenting any class, property, or relationship as fact, confirm and record:
- [ ] Resolved the target via
class_browser.py --class <name>(orproperty_lookup.py) and recorded the exact canonicallabelreturned inresults.class_info.label/results.property_info.name— do not quote a name the agent typed; quote the label the tool resolved (e.g.UnitCell→Unit Cell). - [ ] For every relationship chain stated, cited the actual
domainandrangefrom aproperty_lookup.py --property <name>call (recordedresults.property_info.domainand.range), rather than inferring the link from class names. - [ ] When a property's
domaincontains a pipe (A | B), reported it as a union (applies to each listed class) and confirmed the class in question matches one normalized member — did not silently assume single-class domain. - [ ] For
--searchresults, recorded each match'srelevanceand stated whether it was a label match (1.0) or description-only match (0.5); did not present a 0.5 description hit as a confirmed term match. - [ ] Identified the ontology by its registry key (
cmsoorasmo) and confirmed it exists inreferences/ontology_registry.json; did not query an unregistered ontology or conflate CMSO and ASMO terms. - [ ] When relying on a generated/refreshed summary, recorded its
metadata.source_urlandmetadata.generated_atand thestatistics(num_classes,num_object_properties,num_data_properties) so the result is traceable to a specific OWL source. - [ ] Treated absent parents, descriptions, or domain/range as missing data (not as "no such relationship"), since the parser extracts only simple
rdfs:subClassOfand declared domains/ranges and does no reasoning.
Common pitfalls & rationalizations
| Tempting shortcut | Why it's wrong / what to do | |||
|---|---|---|---|---|
"The class name UnitCell returned nothing, so the term doesn't exist." | Labels carry spaces (Unit Cell). The tools resolve exact → case-insensitive → space-normalized; if a direct guess fails, run --search and use the canonical label the tool returns, not the typed string. | |||
| "These two classes are obviously related, so I'll state the link." | Relationships exist only where an object property declares them. Verify with property_lookup.py --property <name> and quote the recorded domain → range; never infer a triple from class names alone. | |||
| "The script ran and printed results, so the answer is complete." | Run success ≠ completeness. A missing parent, description, or domain/range means the OWL lacked that annotation — the parser does no inference and ignores complex OWL restrictions. State what is absent. | |||
"--search crystal matched it, so it's the right term." | A match may be relevance 0.5 (description-only), not a label match. Check the relevance field and prefer 1.0 label matches; report 0.5 hits as "mentioned in the description," not as the canonical term. | |||
| "A property has one domain class." | Domains can be unions (`A | B). Split on | ` and check each normalized member; a property may legitimately apply to several classes. The bundled CMSO/ASMO summaries currently have none, but parsed/refreshed ones can. | |
| "Any OCDO ontology will work / CMSO and ASMO are interchangeable." | Only cmso and asmo are registered; CDCO/PODO/PLDO/LDO are planned, not available. Pick the correct registry key and don't mix terms across ontologies. | |||
"I'll point the parser at this http:// OWL URL." | owl_parser.py/ontology_summarizer.py reject non-https:// URLs by design. Use an https:// source or a local file path. |
Security
Input Validation
--ontologyis validated against registered ontology names inontology_registry.json(fixed allowlist)--classand--propertynames are validated against a safe-character pattern to prevent injection--searchterms are length-limited and used only for substring matching against pre-processed labels (never interpolated into queries or code)--sourceforowl_parser.pyaccepts file paths or URLs; URLs are validated againsthttps://scheme only
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/ontology/ontology-explorer/SKILL.md
Popularity
- Repository stars
- 40
- Repository forks
- 3
- 7-day trend score
- 19
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/heshamfs/materials-simulation-skills/ontology-explorer)