ontology-explorer
정보
온톨로지-탐색기 스킬은 CMSO/ASMO와 같은 재료 과학 온톨로지를 파싱하고 쿼리하여 클래스 계층 구조를 탐색하고, 속성을 검사하며, 용어를 검색합니다. 이 스킬은 개발자가 결정 구조나 시뮬레이션 메타데이터 같은 개념에 적합한 온톨로지 용어를 찾도록 지원합니다. 온톨로지 구조를 탐색하거나, 클래스 관계를 이해하거나, 익숙하지 않은 재료 온톨로지를 습득할 때 활용하세요.
빠른 설치
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-explorerClaude Code에서 이 명령을 복사하여 붙여넣어 스킬을 설치하세요
문서
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.8+
- 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
What do you need?
├── Understand overall ontology structure
│ └── class_browser.py --ontology cmso --list-roots
├── Inspect a specific class
│ └── class_browser.py --ontology cmso --class <name>
├── Find properties for a class
│ └── property_lookup.py --ontology cmso --class <name>
├── Look up a specific property
│ └── property_lookup.py --ontology cmso --property <name>
├── Search for a concept
│ ├── class_browser.py --ontology cmso --search <term>
│ └── property_lookup.py --ontology cmso --search <term>
├── Parse a new/updated OWL file
│ └── owl_parser.py --source <path-or-url>
└── Generate/refresh a summary JSON
└── ontology_summarizer.py --source <url> --output <path>
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
User: I have an FCC copper simulation. What CMSO classes should I use to describe it?
Agent: Let me explore the CMSO ontology to find the relevant classes.
[Runs: class_browser.py --ontology cmso --search "crystal" --json]
For an FCC copper simulation, the relevant CMSO classes are:
- **Computational Sample** → **Atomic Scale Sample**: your simulation is an atomic-scale sample
- **Material** → **Crystalline Material**: copper is crystalline
- **Crystal Structure**: describes the FCC arrangement
- **Unit Cell**: the repeating FCC unit cell (a=b=c=3.615 Å, α=β=γ=90°)
- **Space Group**: FCC copper is space group 225 (Fm-3m)
- **Chemical Element**: Cu
The key relationships:
AtomicScaleSample → hasMaterial → CrystallineMaterial → hasStructure → CrystalStructure → hasUnitCell → UnitCell
Shall I look up the specific properties for any of these classes?
CLI Examples
# List root classes in CMSO
python3 skills/ontology/ontology-explorer/scripts/class_browser.py \
--ontology cmso --list-roots --json
# Inspect the Material class hierarchy
python3 skills/ontology/ontology-explorer/scripts/class_browser.py \
--ontology cmso --class Material --json
# Search for crystal-related classes
python3 skills/ontology/ontology-explorer/scripts/class_browser.py \
--ontology cmso --search crystal --json
# Find all properties for UnitCell
python3 skills/ontology/ontology-explorer/scripts/property_lookup.py \
--ontology cmso --class UnitCell --json
# Look up a specific property
python3 skills/ontology/ontology-explorer/scripts/property_lookup.py \
--ontology cmso --property "has space group" --json
# Parse a remote OWL file
python3 skills/ontology/ontology-explorer/scripts/owl_parser.py \
--source https://raw.githubusercontent.com/OCDO/cmso/main/cmso.owl --json
# Generate a summary JSON from an OWL file
python3 skills/ontology/ontology-explorer/scripts/ontology_summarizer.py \
--source https://raw.githubusercontent.com/OCDO/cmso/main/cmso.owl \
--output summary.json --json
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: some properties apply to multiple classes (e.g.,
hasVectorapplies to bothSimulationCellandUnitCell), shown asSimulationCell | UnitCell. - Search relevance: 1.0 = label match, 0.5 = description match only.
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
File Access
class_browser.pyandproperty_lookup.pyread pre-processed JSON summary files from thereferences/directory (read-only)owl_parser.pyreads a single OWL/XML file from a local path or HTTPS URL; remote fetches have a 30-second timeoutontology_summarizer.pywrites a single JSON summary file to the path specified by--output- No scripts modify or delete existing files
Tool Restrictions
- Read: Used to inspect script source, reference files, and ontology summaries
- Bash: Used to execute the four Python scripts (
owl_parser.py,ontology_summarizer.py,class_browser.py,property_lookup.py) with explicit argument lists; URL fetching is contained within the Python scripts with timeout limits
Safety Measures
- No
eval(),exec(), or dynamic code generation - All subprocess calls use explicit argument lists (no
shell=True) - OWL/XML parsing uses Python's
xml.etree.ElementTreewhich does not resolve external entities by default, mitigating XXE attacks - Remote URL fetching is limited to HTTPS with a 30-second timeout to prevent abuse
- Search results are capped in count to prevent output flooding
Limitations
- Only supports OWL/XML format (not Turtle, JSON-LD, or N-Triples)
- Does not support OWL reasoning or inference (e.g., does not compute transitive closures)
- Class hierarchy extraction handles simple
rdfs:subClassOfonly (not complex OWL restrictions) - Descriptions may be missing for classes that lack
rdfs:comment,skos:definition, or IAO annotations - URL fetching requires internet access and may time out (30-second limit)
References
- OWL/RDF Primer — brief introduction to OWL concepts
- CMSO Guide — narrative guide to the CMSO ontology
- Ontology Registry — registered ontologies and their metadata
- CMSO Summary — pre-processed CMSO structure
- CMSO Documentation — official CMSO docs
- CMSO Repository — source OWL file and development
Version History
| Date | Version | Changes |
|---|---|---|
| 2026-02-25 | 1.0 | Initial release with CMSO support |
GitHub 저장소
연관 스킬
release-standards
문서 처리이 스킬은 소프트웨어 릴리스에 대한 시맨틱 버저닝(semver) 가이드라인과 변경 로그 형식 표준을 제공합니다. 릴리스를 준비할 때 버전 번호(메이저/마이너/패치)를 올바르게 증가시키고 변경 로그 항목을 구성하려면 이 스킬을 사용하세요. 사전 릴리스 식별자 규칙과 개발자를 위한 명확한 예시가 포함되어 있습니다.
commit-standards
문서 처리이 스킬은 Conventional Commits 표준에 따라 Git 커밋 메시지를 형식화합니다. 커밋 작성이나 리뷰 시 일관성을 보장하기 위해 템플릿과 유형 정의(예: `feat`, `fix`, `refactor`)를 제공합니다. 커밋 과정에서 이를 사용하여 명확하고 구조화된 커밋 기록을 생성할 수 있습니다.
huggingface-tokenizers
문서 처리이 스킬은 HuggingFace의 Rust 기반 라이브러리를 사용하여 1GB 텍스트를 20초 이내에 처리하는 고성능 토크나이제이션을 제공합니다. BPE, WordPiece, Unigram 알고리즘을 지원하며 사용자 정의 토크나이저 학습과 정렬 추적 기능을 포함합니다. 프로덕션 수준의 고속 토크나이제이션이 필요하거나 transformers 생태계와 통합된 맞춤형 토크나이저를 구축할 때 사용하세요.
nano-pdf
문서 처리nano-pdf는 개발자가 특정 페이지의 텍스트 변경이나 오타 수정과 같은 자연어 지시를 사용해 PDF를 편집할 수 있는 CLI 도구입니다. 터미널에서 직접 빠르고 프로그래밍 방식으로 PDF를 수정하는 데 이상적입니다. 페이지 번호 매기기가 버전마다 다를 수 있으므로 출력 결과는 항상 확인하세요.
