Grafo User Guide

Creating an Account & Signing In
Dashboard
Creating a new Document
Adding a Concept
Adding a Concept Attribute
Adding a Relationship
Adding a Relationship Attribute
Adding a Specialization
Sharing a Document
Commenting
Search
Document History
Export
Import
Dashboard (Redux)
Pricing

Adding a Relationship


Adding a relationship to a diagram can also be accomplished in one of two ways.

To use the Relationship tool in the toolbox, you must have two concepts already in the diagram. Once you’ve added another concept, click on the Relationship tool:

Add Relationship from Toolbox

Then mouse over to the canvas (no need to drag the relationship), and click on the first concept of the relationship (the ‘from’ concept). When you now mouse away, you will see that the relationship has been anchored to the first concept:

Relationship anchored to From Concept

Now click on the second concept, and the relationship between the two will be added:

Relationship connected to To Concept

Second Method for Adding a Relationship

The other method uses the context menu of an existing concept. This method will add the relationship as well as the concept that it is connecting to. If you start with an existing concept and select ‘Add To New Concept’ from its context menu:

Add Relationship To New Concept from Context Menu

The relationship is added with the arrow pointing from the original concept to the new concept:

Result of Add Relationship To New Concept from Context Menu

If you select ‘Add From New Concept’:

Add Relationship From New Concept from Context Menu

The relationship is added with the arrow pointing in the opposite direction: from the new concept to the original concept:

Result of Add Relationship From New Concept from Context Menu

Both context menu methods create a relationship and a concept– the only difference is the direction of the arrow.

Relationship Element

Let’s take a closer look at the Relationship element:

Relationship Element

The default label for a relationship is ‘label’. It can be renamed in the same way as a concept– simply double click on the label and rename.

The lower section of the relationship shows the number of attributes attached to this relationship– currently 0. Relationship attributes are used when modeling Property Graph schemas– click here for information on adding relationship attributes.

Detailed Relationship Information

When a relationship is added or selected in the diagram, the detailed information for that relationship pops up in the left panel:

Detailed Relationship Info

The detailed information panel for relationships contains all of the fields as for a concept, with the addition of one: Cardinality, explained below. These fields behave exactly the same as for a concept, except one: the IRI. If a new relationship is given the same label as an existing relationship, the IRI is re-used.

Also note: the number after the type of element, i.e., > CONCEPTS (2), or > RELATIONSHIPS (1) gives the number of elements that this element is attached to. Thus, for this example, we have a single relationship attached to two concepts.

Cardinality

Like attributes, relationships can also have cardinality. Suppose you had a Business concept connected to an Address concept through two relationships: ‘has address’ and ‘has shipping address’:

Relationship Cardinality

Suppose also that a Business can have multiple addresses for multiple locations (and has at least one location address)– but it can only have one shipping address for all shipments.

Cardinality for ‘has address’ would be ‘min 1’:

Relationship Cardinality for has address

And for ‘has shipping address’ it would be ‘exact 1’:

Relationship Cardinality for has shipping address

Relationship Cardinality Export

Relationship Cardinality is exported as an owl:Restriction on the appropriate Class:

Relationship Cardinality Export

Self-Referencing Relationships

A concept can have a relationship with itself. To add a self-referencing relationship, use the Relationship tool from the toolbox. Click on the concept you wish to add the relationship to, which will set it as the source. Click again on the same concept to set it as the destination:

Self-referencing Relationship