Vertices and edges are the foundation of QGraph queries. All queries must contain at least one vertex. Queries with multiple vertices must form a connected graph.
To add new vertices to a query, enter vertex mode and use the mouse to position the new vertex.
In the Query Editor toolbar, click
or press
Ctrl-2 to choose the vertex tool and enter vertex
mode. The Query Editor remains in vertex mode (all clicks in the
Query Editor display area create a new vertex) until you change modes
by choosing a different tool from the toolbar.
Click in the Query Editor display area. The Query Editor creates a new vertex.
[Optional] Provide a name for the new vertex. (Alternatively, you can continue using the default name provided by the Query Editor.)
In the Query Editor toolbar, click
or press
Ctrl-1 to choose the selection tool and enter
selection mode.
Click the vertex to be re-named. The Query Editor displays the vertex’s properties in the element properties pane.
In the element properties pane, click the current (default) name for this vertex. Edit the name and press Tab or Return.
To add new edges to a query, enter edge mode and use the mouse to draw the new edge.
In the Query Editor toolbar, click
or press
Ctrl-3 to choose the edge tool and enter edge mode.
The Query Editor remains in edge mode (clicks in the
Query Editor display area create a new edge) until you change modes
by choosing a different tool from the toolbar.
Drag the mouse from one vertex to another vertex. The Query Editor creates a directed edge from the starting vertex to the ending vertex.
[Optional] Provide a name for the new edge. (Alternatively, you can continue using the default name provided by the Query Editor.)
In the Query Editor toolbar, click
or press
Ctrl-1 to choose the selection tool and enter
selection mode.
Click the edge to be re-named. The Query Editor displays the edge’s properties in the element properties pane.
In the element properties pane, click the current (default) name for this edge. Edit the name and press Tab or Return.
Edges may be directed or undirected. Directionality is an edge property and is set in the element properties pane.
To add an undirected edge:
Create a directed edge.
Click
or press Ctrl-1 to choose
the selection tool.
Click the edge to be modified
In the element properties pane, change the value of
Is Directed from true to
false.
Press Tab or Return.
To change edge direction:
Click
or press Ctrl-1 to choose
the selection tool.
Click the edge to be modified.
In the Edit menu, choose Flip Edge Direction or press Ctrl-F.
A self-link edge connects a single vertex to itself and matches links in the database that connect an object to itself.
To add a self-link (loop) edge:
Click
to choose the edge tool.
Click the target vertex without dragging. The Query Editor creates an edge that begins and ends at the target vertex (a self-link or loop edge).
Use selection mode to re-position query elements in the display and to select existing query elements for editing, such as adding or modifying conditions and annotations on that element.
In the Query Editor toolbar, click
or press
Ctrl-1 to choose the selection tool and enter
selection mode.
Click the query element you want to select. The Query Editor draws handles around the selected element.
The Query Editor remains in selection mode (clicks in the Query Editor display select query elements) until you change modes by choosing a different tool from the toolbar.
Deleting a vertex also deletes any edges linked to that vertex. Make sure that your query remains connected after deleting any elements.
Click
or press Ctrl-1 to choose
the selection tool.
Click the element to be deleted.
Press Delete.
Conditions and annotations are properties of a specific vertex or edge. Select the element to be modified and use the element properties pane to add or edit any conditions or annotations on that element.
Complex conditions must be entered using disjunctive normal form in prefix notation. See “Complex conditions in Proximity” for additional information on entering complex conditions in the Query Editor.
Click
or press Ctrl-1 to choose
the selection tool.
Click the vertex or edge that requires a condition.
In the element properties pane, click in the Value column for Condition.
Enter the new condition or edit the value of the current condition.
Press Tab or Return.
All edges adjacent to an annotated vertex must also be
annotated.
To help avoid validation
errors
due to unannotated edges,
you can elect to automatically add a [1..]
annotation to any new edge (see To change automatic annotation preferences,
below, for instructions).
Click
to choose the selection tool and select the
vertex or edge to be annotated.
In the element properties pane, click in the value column for Annotation.
Enter the annotation text.
Press Tab or Return.
The Query Editor provides the option of automatically annotating
every new edge with [1..]. Because edges
adjacent to annotated vertices must be annotated, adding this
annotation automatically can help to prevent validation errors. The
[1..] annotation is the most common edge
annotation and is typically the correct edge annotation for most
queries involving annotated vertices. Adding a
[1..] annotation to edges that are not adjacent to
annotated vertices is rarely a problem for most datasets, although
care should be taken to understand how this differs from unannotated
edges when the dataset contains instances of multiple links connecting
two objects.
In the Edit menu, choose Add [1..] To New Edges.
Selecting the Add [1..] To New Edges command toggles the automatic edge annotation behavior:
If automatic edge annotation is disabled, choosing this command turns on automatic edge annotation.
If automatic edge annotation is enabled, choosing this command turns off automatic edge annotation.