Graph
The Graph tab draws the whole project as an interactive graph. You can rearrange it, navigate from it to your source, and act on concepts and files through right-click menus.
What you see
| Shape | Meaning |
|---|---|
| Box with a header and rows | A concept. Each row is a field (has …) with its type and cardinality. |
| Rounded box | A property declared on its own whose domain or range is in another file, outside the project, a union, or missing. |
| Small square | A union type such as (Cat or Dog), used as a range or a field type. |
| Frame around boxes | A file: every node declared in one .dlf is grouped in the frame, labelled with the file name. |
| Line | Meaning |
|---|---|
| Thick, arrow | sub: the concept is a subclass of the one it points to. |
| Thin, arrow | has: a field pointing to its type. |
| Dashed, arrow | The range of a property. |
| Dotted | A member of a union. |
A concept or property box shows its label (the label / pref_label of its #@ glossary: block) in your preferred language, or its name when it has none. When the labels exist in several languages, a language picker appears at the top right: pick one to relabel the boxes, or Default to go back to your preferred language. Your choice is remembered, and Pangloss uses the same one. Field rows and arrows keep their names.
Nodes that do not belong to the open file are faded, so the file you are working on stands out. Hover a node to read its description. Hover a property (an arrow, a field row inside a box, or a property node) to read its # comment. A field or arrow without its own comment shows the comment of the top-level property of the same name, marked [inherited]. With neither, you see its signature, Domain -> Range, with cardinalities.
Moving around
| To | Do |
|---|---|
| Pan | Drag the background. |
| Zoom | Scroll (towards the pointer), or Zoom in / Zoom out in the magnifying-glass menu at the top right. The menu stays open, so you can click them several times. |
| Zoom into an area | Ctrl+drag (⌘+drag on a Mac) a rectangle. A plain Ctrl+click zooms in one step. |
| Zoom out | Ctrl+Shift+drag a rectangle. A plain Ctrl+Shift+click zooms out one step. |
| Move a node | Drag it. |
| Move a whole file | Drag its frame. |
| Tidy by hierarchy | Arrange by hierarchy, in the magnifying-glass menu at the top right, lays out each file’s concepts top-down, with every parent above its sub-concepts, then places the files so that a file whose concepts extend another file’s sits below it. |
| Start over | Reset layout, in the magnifying-glass menu at the top right, puts every node back where Agrafe first placed it. |
Arrange by hierarchy only follows the parent / sub-concept links. Concepts with no such link, property nodes and union nodes are set together in a block next to the trees. The result is saved like a layout you made by hand (on the public page or as a viewer it stays on your screen only), and you can move boxes afterwards. Reset layout still returns to Agrafe’s first placement.
The layout, zoom included, is saved with the project when its owner or an editor moves it: you find it as you left it, and so do the people you share the project with. A viewer’s moves last until the page is reloaded.
Going to the source
Hover a node: a ⌖ target appears at the right of its header. Click it to open the file at the declaration.
From the editor, right-click a name and choose Reveal in graph: the Graph tab opens, centres on the node and highlights it.
Right-click a node
| Item | Action |
|---|---|
| ⌖ Go to… | Opens the file at the declaration. Only for nodes that come from your source. |
| 🔗 Get references | Lists every place in the project where the name is used, with the line of source. Click one to go there. |
| 🕸 Show neighbors | Lists every node directly linked to this one (parents, children, field types, ranges…). Click one to go to its declaration. |
| 🆔 Copy id | Copies the node id, for example animals:Dog. |
| 📋 Copy label | Copies the displayed name, for example Dog. |
| ◎ Center in view | Pans so the node is in the middle, keeping the zoom. |
| ✏ Edit… | Opens the declaration’s source (header and body) in a box. Change it and Save (Ctrl+Enter). An edit that does not parse is refused and the box stays open. |
| 🔤 Rename | Turns the name on the node into a text box. Enter renames, Escape or clicking elsewhere cancels. Renames the concept or property and every reference to it, in every file of the project. Files that do not parse are left as they are, and named in a message. |
| ➕ New sub-concept… | Creates a concept with this one as its parent, in the same file. Concepts only. Typing the name of an existing concept offers Link instead: it adds sub <this concept> to that concept, in whatever file declares it. It is refused when that concept is already a sub-concept of this one, or when linking would make a cycle. |
| ↗ Add property… | Adds a has name: type line inside the concept (cardinality optional: one string). If the concept has no body yet, it gets one. Concepts only. |
| ➕ New sub-property… | Creates a standalone property with a sub line pointing at this one. Properties only. |
| 🗑 Delete… | Removes the declaration, with its body and the # comment just above it. The box says how many references elsewhere will stop resolving. |
A property declared in the same file as its domain and range is drawn like a has of its domain: property owns: Owner -> Dog is an owns arrow from Owner to Dog, and property age: Dog -> int is an age: int row in the Dog box. It keeps a rounded box of its own when its domain or range is in another file, or when the domain already has a has of the same name.
Right-click a property arrow
A has line draws an arrow from the concept to the property’s type. Right-click the arrow or its label for the same menu, acting on that has line: Go to… opens it, Copy id gives animals:owner, Edit… shows the line with its axioms, Rename puts a text box on the label and renames the property everywhere it is used, New sub-property… proposes the arrow’s concept and type as domain and range, Delete… removes the line, and Center in view centres on the arrow.
An arrow or field row drawn from a property declaration has the same menu, acting on that declaration: Go to… opens it, and Edit…, Rename and Delete… change the property itself.
Right-click a file frame
| Item | Action |
|---|---|
| ✏ Rename file… | Opens a box with the file name (the folder is kept). Enter renames, Escape cancels. |
| 🗑 Delete file… | Asks for confirmation, then deletes the file. This cannot be undone. |
| ➕ Add concept… | Creates a concept (name, optional parent) at the end of the file. |
| ↗ Add property… | Creates a standalone property name: Domain -> Range at the end of the file, outside any concept. |
The round + button at the top left of the graph opens a menu with Concept and Property, which do the same in the open file.
Drag to connect two concepts
Point at a concept: a small blue handle shows on its right edge (on a touch screen, tap the concept first). Drag the handle onto another concept, or back onto the same one for a property that points to itself. The concept under the pointer is outlined and the arrow snaps to it. Release, type the property name in the box that opens, and press Enter: a property name: Source -> Target line is added at the end of the source concept’s file.
Release on empty space instead to get a choice: New concept here + property asks for a concept name and a property name, creates the concept at that spot, then the property pointing to it. Cancel drops the gesture.
Escape cancels at any time, during the drag or in the name box. Dragging the box itself still moves it. Concepts outside the project (dashed boxes) have no handle.
Edit a property’s domain or range
Click (or tap) the domain end or the range end of a property arrow, or any small operator square of its type expression (an (A or B) group, a nested group, a not), to open a box with that whole type as it is written in the source. Type a new type expression: names are suggested as you type (Tab takes the first one), and the and, or, not buttons insert the keyword at the cursor; ( ) wraps the selection in parentheses. Press Enter or Apply to rewrite the type in the .dlf file; anything else on the line (cardinality, comments) stays. An expression that does not parse, such as (A or B) and C without the outer parentheses, is refused with the reason shown in the box, which stays open. A has line’s range can be edited this way; its domain is the concept it sits in. A type spread over several lines (a with block) is edited in the editor.
Build a composite class
To give a property a type such as (Dog or Cat) without typing it, build it on the canvas first.
- Select classes. Shift+click a concept, or a small square standing for a type expression, to add it to the selection or take it out. Shift+drag on empty space draws a rectangle that adds every box it touches. On a touch screen, long-press a concept to add it (long-press a selected one to get its menu). Selected boxes get a thick outline. A click on empty space, or Escape, clears the selection.
- Combine. The Combine: buttons under the + button create a draft: and or or with two or more classes selected, not with exactly one. The draft is a dashed square above its classes, linked to them like the other type squares; point at it to read the whole expression. The new draft is selected, so it can be combined again: select it with another class and press or to nest it, as in
(Pet and (Dog or Cat)). Combining the same classes the same way again selects the existing draft. - Use it. A draft has the drag handle of a concept: drag from it, or onto it, to create a property with the draft as its domain or range. The box that edits a domain or range lists the drafts too; a click inserts one at the cursor. Only then is the expression written to the source (
(A and B),(A or B),not A, nested groups in parentheses), in the file of the draft’s first class. The dashed draft then becomes a regular square. - Discard. Discard removes the selected drafts, and the drafts built on them.
A Dolfin file has no place for a class expression nobody uses, so a draft that no property uses stays in your browser only: it disappears when the page reloads, and nobody else sees it. Renaming or deleting one of its classes in the source discards it. Drafts are not offered on a public project, nor to project members who can only view.
Every change is written to the .dlf source, then the graph redraws. People with the file open see the change in their editor right away, and it appears in the file’s history like any other save.
If you have the file open in the editor, Ctrl+Z (⌘+Z on a Mac) there undoes your graph changes, one step per change, like your typing. A drag that creates a concept and a property is two changes, so two steps. Changes made by other people never land on your undo list.
The editing items and buttons are not offered on a public project.
Right-click the Graph tab
When other people have the project open, right-click the Graph tab title to choose what you see of them:
| Item | Action |
|---|---|
| Show / Hide others’ viewports | A labelled frame for the area each person is looking at. |
| Show / Hide others’ mouse | A dot with their name where their pointer is. |
Nodes someone else drags move on your screen too. See Collaboration.
When the graph is empty or dimmed
- Compiling the graph…: the graph is being compiled (on opening the project, and after each save until it lands).
- Graph renders here after save: the project’s file list could not be loaded (reload the page).
- No concepts to draw yet. Write a
conceptand save.: the project has no files, no Dolfin source, or compiles but declares no concept. - The graph needs source that parses.: nothing has compiled yet; the Problems panel says why.
- A dimmed graph under Showing the last valid graph… is the last version that compiled.