How to create relationships between entities
Link an entity to other entities from its Relationships tab, or through a relationship property on the Metadata tab.
A relationship links one entity to another and carries a label, such as "Author of" or "Mentioned in". Build links by hand on the Relationships tab. Use a relationship property on the Metadata tab when your template has one.
Prerequisites
- The editor or admin role, or permission to edit this entity
- At least one relationship type in your collection
With no relationship type in your collection, Uwazi stops you at the Choose relation type step. Admins can add a type there. Everyone else reads "An admin needs to add relationship types before you can create a relationship."
Steps
Open the entity and select the Relationships tab. The tab carries a count of the relationships it lists.
Create a relationship
- Select Edit in the footer.
- Select Create relationship.
- On the Select target entity step, type a name in the Search entities... box.
- Choose the target entity from the results.
- On the Choose relation type step, pick a type.
- Select Create relationship.
Uwazi saves the link and flashes a "Relationship created" message.
To point at one passage rather than a whole entity, highlight the text in the document before you open the wizard. The wizard then adds a Select target document step and a Select text in target document step. See how to create references in a document for that path.
Create the target entity as you go
- On the Select target entity step, use Create new entity from selection.
- Type a Title.
- Pick an Entity type.
- Select Create entity.
Uwazi creates the entity, then carries on with it as your target.
Delete a relationship
Deleting a relationship removes the link for everyone, and you can't undo it. Uwazi deletes it the moment you confirm, even in edit mode.
- Point at the row you want to remove.
- Select the trash button on that row.
- In the Delete relationship dialog, select Delete.
To remove several at once:
- Select Edit in the footer.
- Select each row you want to remove, or use Select all.
- Select Delete.
- In the Delete relationships dialog, select Delete.
- Select Save to leave edit mode.
Save and Cancel only close edit mode. Neither one undoes a deletion.
Narrow the relationships in the view
You don't need edit mode for any of this.
- To search, type in the search box above the list.
It reads
Search • AND, OR, NOT, "exact", wild*, and the tips button beside it lists the syntax. - To change the layout, select one of the three view buttons beside the search box: List, Tree, or Graph.
- To reorder the list, open Display options and set Group by, Then by, Sort, or Density.
- To filter, open the filters drawer and pick values under Relation type or Target entity type.
- Select Clear all filters to start again.
Uwazi groups by Relation type and sorts by Appearance to begin with. None of these choices stick: they reset each time you open the entity.
The tab lists the links tied to the document you have open, plus the links that sit on the entity as a whole. Open another document to see its links.
Link entities through a relationship property
An administrator sets up the property first, as described in how to set up relationship properties on a template.
- Select the Metadata tab.
- Select Edit in the footer.
- Find the relationship property, labelled with the name your administrator gave it.
- Select Add entity, type in the Search entities… box, then pick an entity.
- To drop one, select the remove icon on its row.
- Select Save in the footer.
Unlike the Relationships tab, this form holds a draft. Nothing changes until you save.
Result
The linked entities appear on the entity's Relationships tab, and property links also appear in their property on the Metadata tab.
See also
- How to create references in a document — start a relationship from a passage of text you select in the document
- How to set up relationship properties on a template — set up relationship types and add relationship properties to templates so entities can link to each other
- How to create and edit an entity — create entities one at a time or in bulk, edit them, and copy property values between them in the Uwazi library