OWL → UML
‹ Back to the diagrammer

Scholarly basis for the translation algorithms

This tool does three distinct jobs, each grounded in established research. The references support the approaches taken; the code implements simplified variants where noted.

1. OWL/RDFS → UML mapping

OWL classes become UML classes, rdfs:subClassOf becomes generalization, an owl:ObjectProperty with a class range becomes an association, an owl:DatatypeProperty becomes an attribute, and rdfs:label supplies readable names — the correspondences formalized in the ontology-to-UML literature.

Defined classes and restrictions

Much of what an OWL ontology says is carried by anonymous class expressions, not by named superclasses. A defined class is owl:equivalentClass to an intersection (necessary and sufficient conditions); a restriction under rdfs:subClassOf states a necessary condition. Reading only named superclasses would leave defined classes with no edges at all. The diagram therefore draws:

This follows the ODM mapping of OWL class expressions onto UML constraints, simplified to what a class diagram can show: unions and complements used as superclasses have no faithful single edge and are left out.

Groups, imported vocabulary, and parallel relations

Classes are grouped by OBO-style IRI prefix (BFO_, ODP003_) or else by namespace, and each group gets a colour and an entry in the key. A group none of whose classes lives under the ontology's own namespace is treated as imported (for instance BFO), drawn in grey, and pruned to what the ontology uses: its own classes, the classes they reach through relations, and their ancestors. Relations among imported classes alone are omitted. Several relations between the same two classes are drawn as one line with stacked labels, and a restriction makes the plain domain/range association it repeats redundant. Above 40 classes, relation labels are placed after layout (Graphviz xlabel) so they do not widen the drawing.

Reasoning: asserted and inferred

With run reasoner checked (CLI: --reason), the ontology is classified and the result drawn on the same layout. A subclass relation the reasoner finds, and that the asserted subclass and definition edges do not already imply, is drawn as an orange arrow, and the class it moved is outlined in orange; Show/Hide inferred (or the i key, also in downloaded SVGs) switches between the asserted and the classified view. Only direct inferred superclasses are drawn (a transitive reduction), so classification adds as few lines as possible. Unsatisfiable classes are drawn in red; an inconsistent ontology is reported and not classified.

Source: from the picture back to the axioms

A diagram summarises; the source panel shows what it summarises. Click a class to see its IRI (linked, so a BFO term opens its published page), its definition and other annotations, and its logical axioms in three views: a Summary, Manchester syntax (the readable OWL notation used by Protégé), and the Turtle triples as they stand in the file. Click a line to see the axiom that produced it: the SubClassOf or EquivalentTo axiom behind a subclass, definition or restriction line, or the property's domain and range behind a relation line. Names in an axiom are links to their own entries; s shows or hides the panel, and Copy copies the current view.

An inferred line has no axiom of its own. Its panel lists the axioms such an inference usually rests on: the subclass's own axioms, the superclass's definition, and the property hierarchy (sub-properties, chains) connecting the properties the two mention. This is a heuristic, not a justification in the technical sense: the minimal set of axioms that entails a conclusion is found by a reasoner's explanation service, which is planned as a later addition.

The source travels with the diagram as a JSON block inside the SVG (<script type="application/json" id="o2u-source">), so a downloaded diagram shows it offline, and the CLI's --interactive option writes such a file directly. --no-source leaves it out. Each class's Turtle is its concise bounded description: its own triples, following blank nodes, plus annotated axioms and disjointness axioms that name it.

Flow view: processes as processes

The class view shows what kind of thing each class is. For an ontology of processes, the Flow view (CLI: --flow) reads the same axioms as a process: a restriction on a sequence relation ('issue PO' SubClassOf 'immediately preceded by' some 'manager approval') becomes an arrow; on a non-immediate one (preceded by) a dashed blue rule that something must come first; a restriction on realizes or has participant puts the step in that role's swimlane; and a defined subclass of a step that adds a condition and its own sequence restriction becomes a conditional rule, labelled with the condition (if for amount > 10,000). Which relations count is configurable (--flow-map, a small JSON file); the defaults are BFO 2020's precedes and preceded by and the Relation Ontology's immediate forms, and sub-properties of a mapped relation count too.

With an event log (--events: instances of the steps, linked by the immediate sequence relations) the view shows the flow as practiced: line width is the number of cases that took a path, and paths no axiom allows are drawn in orange. Cases are the connected chains of events, named by a value all their events share. Choose a case to trace its path; p switches to the design alone. With rules (--shapes, SHACL), each violation is pinned to the step its focus node instantiates. The axioms are read open-world (a missing predecessor is assumed to exist somewhere); the shapes check the log closed-world, which is what an audit needs.

Layout: Graphviz dot orders the steps left to right along the designed sequence; each lane is a horizontal band, steps of one lane that would overlap take sub-rows, and neato routes the lines on those fixed positions.

2. Layered layout (layer assignment & Graphviz dot)

Each class's rank is computed as 1 + max(parent depths) over generalization edges — textbook longest-path layering within the Sugiyama layered-drawing framework, which Graphviz dot also implements.

3. Scalable force-directed fallback (sfdp)

Above ~500 classes the renderer switches from dot to sfdp, a multilevel force-directed engine.

The code implements simplified versions of these methods (e.g. longest-path layering rather than dot's full network-simplex ranking in the built-in layout pass). The ODM and Brockmans et al. are the primary references for the core OWL→UML mapping.