Ontology Diagram Panel

The Ontology Diagram panel is used to create and visualize UML-style class diagrams where nodes represent OWL classes and edges represent either subclass relationships or object property relationships between those classes.

Unlike the Simple Diagram Panel, every element in an Ontology Diagram has a backing presence in the RDF graph: creating a node opens a dialog to create a new class, and drawing an edge between two nodes creates either an rdfs:subClassOf triple or a SHACL property shape, depending on the selected edge type.

Canvas Controls

The pointer tools along the left edge decide what a click or drag on the canvas does:

  • Hand: Drag anywhere on the canvas, including on a node, to move around the diagram. Clicking a node or edge still selects it, but nothing can be moved or edited. Diagrams open with this tool for users who can only view them.

  • Select: Select, move and connect nodes, and edit their labels. Diagrams open with this tool for users who can edit them.

  • Add nodes: While this tool is on, each click on an empty area of the canvas adds a node there. Existing nodes and edges are left alone. Click Add nodes again, or press Esc, to go back to Select. This tool is only offered to users who can edit the diagram.

In the bottom-right corner:

  • Zoom out and Zoom in change the zoom level, which is shown between them. The zoom level ranges from 45% to 250%. The mouse wheel zooms as well.

  • Overview shows a miniature of the whole diagram above the zoom controls. Drag the frame in the miniature to move around the diagram. Click Overview again to hide it.

With any tool, hold Space or Ctrl (Cmd on Mac) and drag to move around the diagram.

Navigation & Selection

  • Add Node: Turn on Add nodes and click an empty area of the canvas to open the Create Class dialog. Closing the dialog without creating a class adds nothing, and Add nodes stays on.

  • Drag Node from tree: Drag an existing class from the resource tree onto the canvas to add it as a node. Any subclass, superclass, or property relationship to classes that are already shown in the diagram is connected automatically.

  • Pan View: Use the Hand tool, or hold Space or Ctrl (Cmd on Mac) and drag the canvas

  • Zoom: Use the mouse wheel or the zoom controls in the bottom-right corner

  • Bulk Selection: With the Select tool, click and drag on an empty area to use the Marquee tool to select multiple items

Node & Edge Manipulation

These use the Select tool.

  • Move Node: Click and drag the center of a node

  • Create Edge: Drag from the border of a node (blue highlight). The Edge type selector overlaid on the canvas determines what kind of relationship is created:

    • Subclass of adds an rdfs:subClassOf relationship, shown with a hollow triangle arrow. A duplicate subclass edge between the same pair of nodes is rejected with a notification.

    • Relationship opens the Create Object Property dialog, which is used to select or create the SHACL property shape (and, optionally, its inverse) that backs the relationship.

    • To cancel edge creation while dragging, Right-click.

  • Delete: Select an item and press Backspace or Delete

Labels & Styling

  • Edit Node Labels: Double-click a node or an existing node label to modify the class’s rdfs:label

  • Edit Relationship Label: Double-click the label on a relationship edge to rename the underlying property shape. Subclass edges do not carry an editable label. A relationship label longer than about 30 characters is shortened to one line, ending in an ellipsis. Hover over it to see the full text.

  • Cardinality: Relationship edges, as well as attributes listed in a class node’s body, display the SHACL sh:minCount/sh:maxCount of the corresponding property shape as a read-only [min..max] label.

  • Color Styling: Select one or more nodes to reveal the Context Menu. Its color button opens the color dialog. The selected nodes take on the color as you pick it, with an outline in a darker shade of the same color.

Keyboard Shortcut Summary

Action

Input

New Node

Add nodes, then click the canvas

Stop Adding Nodes

Esc, or click Add nodes again

New Edge

Drag Node Border

Pan Canvas

Hand + Drag, or Space / Ctrl + Drag

Zoom

Mouse Wheel

Edit Node Label

Double-Click

Delete Selection

Del / Backspace

The diagrams themselves are represented as assets in RDF using a dedicated diagrams ontology. Nodes become instances of diagrams:Node and edges become instances of diagrams:Edge. Nodes store the x/y position and width/height information in an extensible data model.

Nodes are linked to the class that they represent using the property diagrams:asset. Subclass edges represent the rdfs:subClassOf triple directly, while relationship edges are linked to the SHACL property shape that defines the object property, including its sh:path, sh:class, sh:minCount and sh:maxCount.

The RDF-based representation also means that Data Foundation features like importers, exporters, SPARQL query and ADS scripting can be applied on them. For example, diagrams can be generated programmatically from other data.

A consequence of the representation is also that edit permissions are required to modify the diagram, even to move or resize nodes.

Toolbar Features

  • Refresh diagram forces a manual refresh of the visualization from the underlying RDF representation. This is usually not necessary because the diagram should update itself after any edit, regardless of where they originated from.

  • Fit diagram in view zooms and pans so that the whole diagram is visible.

  • Focus diagram globally selects the asset that represents the diagram itself. This can be used, for example, to edit the label of the diagram, or add descriptive comments.

  • Auto layout rearranges all classes using a hierarchical, bottom-to-top layout that follows the direction of subclass relationships, then saves the resulting node positions back to the diagram.

  • Remove or delete opens a menu with:

    • Remove selected nodes from diagram (keep classes) removes the selected nodes from the diagram visualization only. The backing classes and their RDF data remain untouched. Any selected edges are also removed from the diagram, while the subclass relationships and property shapes they show are kept. Only available when at least one node is selected. Pressing Del or Backspace does the same, and also works on selected edges alone.

    • Delete selected items and their backing assets asks for confirmation, then permanently deletes the selected nodes and edges along with the classes, subclass relationships and property shapes they represent from the underlying ontology. Only available when at least one node or edge is selected.

  • Export diagram can be used to save the diagram as an image.

  • Select a diagram shows the available diagrams, allowing users to switch between them. This includes diagrams that are stored in the current asset collection, but also any included asset collection. Diagrams that are stored in included collections are always read-only.

  • Create ontology diagram can be used to create a new, empty diagram.

  • Delete diagram opens a confirmation dialog to permanently delete the selected diagram. Choose Delete diagram to remove only the diagram’s visual layout while preserving the underlying classes and property shapes, or Delete diagram and data to also permanently delete backing resources owned by this collection. Unowned resources are skipped.

See Also

Further Reading on TQ Data Foundation