This is an environment to design ontologies.
  • Python 66.3%
  • Rust 33.7%
Find a file
Daniel Hernandez 76c2912481 Initial commit: ontocraft — generate Gaphor UML diagrams from OWL ontologies
Rust (oxigraph + PyO3) parses Turtle and extracts OWL classes, object
properties, datatype properties, and subclass hierarchies. Python computes
Graphviz layout and generates Gaphor XML with auto-positioned diagram items.
2026-03-02 08:49:08 +01:00
python/ontocraft Initial commit: ontocraft — generate Gaphor UML diagrams from OWL ontologies 2026-03-02 08:49:08 +01:00
src Initial commit: ontocraft — generate Gaphor UML diagrams from OWL ontologies 2026-03-02 08:49:08 +01:00
tests Initial commit: ontocraft — generate Gaphor UML diagrams from OWL ontologies 2026-03-02 08:49:08 +01:00
.gitignore Initial commit: ontocraft — generate Gaphor UML diagrams from OWL ontologies 2026-03-02 08:49:08 +01:00
Cargo.toml Initial commit: ontocraft — generate Gaphor UML diagrams from OWL ontologies 2026-03-02 08:49:08 +01:00
contributors.ttl Initial commit: ontocraft — generate Gaphor UML diagrams from OWL ontologies 2026-03-02 08:49:08 +01:00
LICENSE Initial commit: ontocraft — generate Gaphor UML diagrams from OWL ontologies 2026-03-02 08:49:08 +01:00
pyproject.toml Initial commit: ontocraft — generate Gaphor UML diagrams from OWL ontologies 2026-03-02 08:49:08 +01:00
README.md Initial commit: ontocraft — generate Gaphor UML diagrams from OWL ontologies 2026-03-02 08:49:08 +01:00

ontocraft

Generate Gaphor UML diagrams from OWL/RDF ontologies (Turtle format).

ontocraft parses OWL ontology files, extracts the class hierarchy, object properties, and datatype properties, computes a Graphviz layout, and writes a .gaphor file you can open and edit in Gaphor.

Architecture

  • Rust (via oxigraph): parses Turtle, runs SPARQL queries to extract ontological structure
  • Python (via PyO3 + Maturin): computes layout with PyGraphviz, generates Gaphor XML

Installation

Requires Rust toolchain, Python 3.9+, and the Graphviz development libraries.

# Install system dependency (Debian/Ubuntu)
sudo apt install libgraphviz-dev

# Build and install in a virtual environment
python3 -m venv .venv
source .venv/bin/activate
pip install maturin pygraphviz
maturin develop

Usage

ontocraft ontology.ttl -o diagram.gaphor

If -o is omitted, the output file defaults to <input>.gaphor.

Supported OWL constructs

  • owl:Class with rdfs:label
  • rdfs:subClassOf hierarchies
  • owl:ObjectProperty with rdfs:domain / rdfs:range
  • owl:DatatypeProperty with rdfs:domain / rdfs:range

Running tests

pip install pytest
python -m pytest tests/ -v

License

MIT