Build your first collection
Create a thesaurus, two connected templates, and entities with documents to build a working Uwazi collection.
What you'll learn
A collection is the set of thesauri, templates, and entities that hold your content. We'll build a small one from scratch: a thesaurus, two templates linked by a relationship, and entities that carry a document. By the end of this tutorial, we'll have a working collection we can grow into a larger one.
Prerequisites
- A link to a live Uwazi instance
- An admin username and password for that instance
Creating thesauri, templates, and relationship types needs an admin account. If you don't see the Settings menu, ask your instance manager for access.
Part 1: Create a thesaurus
A thesaurus is a reusable list of options, such as a list of countries. We build it first, because a template field that offers a choice draws its options from a thesaurus that already exists.
-
Go to Settings, then select Thesauri.
The page lists the thesauri the instance already holds.
-
Select Add thesaurus in the footer.
An editor opens with an empty name field and an empty value table.
-
Type a name in the Thesauri name field, such as
Status.The name sits at the top of the table. Uwazi needs it before we save.
-
Select Add item, then type a label such as
Open.A new empty row appears, ready for the next label.
-
Add one or two more labels, such as
ClosedandUnder review.Each label fills its own row in the table.
-
Select Save.
A success message appears, and the web address updates with the new thesaurus's id.
Part 2: Create the first template
A template defines a type of entity and the fields it carries. We'll make one and give it a field that uses the thesaurus from Part 1.
-
Go to Settings, then select Templates, then Add template.
The template editor opens with an empty property table.
-
Pick a colour with the colour picker near the top.
Uwazi shows this colour as a dot on the entity's cards.
-
Type a name in the template name field, such as
Case.Uwazi needs a name, and it marks a duplicate name with an inline error.
-
Notice the three pinned rows at the top of the table: Title, Date added, and Date modified.
These common fields stay on every template. We can't remove or reorder them.
-
Select Add property in the footer.
The property panel slides in from the right.
-
Open the property type drop-down and select Select, then type a Label such as
Status.A Thesaurus selector appears below the label, because a select field needs a thesaurus.
-
Open the Thesaurus selector and pick the
Statuslist from Part 1.The selector shows your chosen list. The field now offers those options on every
Caseentity. -
Select the Use as filter checkbox.
This field will appear as a filter in the library sidebar.
-
Select Add property, then Save.
A success message appears, and the
Casetemplate joins the list.
Part 3: Connect a second template with a relationship
We'll link two templates, so an entity of one can point at an entity of the other. First we name the connection, then we build the second template around it.
-
Go to Settings, then select Relationship types, then Add relationship type.
The relationship type panel opens with a single Name field.
-
Type a name that reads in the connection's direction, such as
mentioned in, then select Save.The panel closes, and the new type joins the list.
-
Go to Settings, then Templates, then Add template. Give it a name such as
Reportand pick a colour.The editor opens, ready for properties.
-
Select Add property, open the property type drop-down, and select Relationship. Type a Label such as
Cases mentioned.Three relationship fields appear in the panel.
-
Open the Relationship type selector and pick
mentioned in.The selector shows your chosen type. This field now needs a target.
-
Open the Entities selector and pick the
Casetemplate.An Inherit property selector appears, because we picked a specific template instead of leaving Any entity.
-
Open the Inherit property selector and pick
Status.Every
Reportentity will now carry each linked case's status, which we'll read back in Part 4. -
Select Add property, then Save.
A success message appears, and the
Reporttemplate joins the list.
Part 4: Create entities and connect them
Now we add real content: one Case entity with a document, one Report entity,
and a link between them that pulls the inherited status across.
-
Go to the Library and select Create entity in the footer.
The entity form opens with a Title field and a Type drop-down.
-
Type a title such as
Case 001, then open the Type drop-down and select Case.The form grows to show the
Casefields, including theStatusfield. -
Open the Status field and pick a value, such as
Open.The field shows your choice. We'll watch this value travel to the
Reportlater. -
In the Primary Documents section, select Add PDF and choose a PDF file.
Uwazi stages the file, ready to upload when we save.
-
Select Save.
A message with Entity created appears, and
Case 001joins the library. -
Select View on the
Case 001card.The entity opens in two panes. Four tabs sit above the left pane: Document, Metadata, Relationships, and Files. Our case carries a PDF, so it opens on Document and shows the file.
-
Go back to the Library and select Create entity again. Title it
Report 001and set its Type to Report.The form shows the
Reportfields, including the Cases mentioned relationship field. -
In the Cases mentioned field, type
Case 001in the search box and select the entity from the results.The case joins the relationship field on the form.
-
Select Save, then select View on the
Report 001card.The report carries no document, so it opens on Metadata.
-
Find the Cases mentioned card in the left pane.
A caption under its title reads via mentioned in, then inherits Status. Below the caption sits a table headed Entity and Status. Its one row holds
Case 001and the status we picked,Open. Uwazi carried that value across from the case. -
Select
Case 001in the table.The connection panel slides in and shows the case's own metadata. Its footer holds Close and Open entity. Select Close to go back to the report.
What you've done
- Built a thesaurus of fixed options
- Created a template that offers those options as a field
- Named a relationship and built a second template that inherits through it
- Created two entities, attached a document, and linked them together
- Read the link and its inherited status in the entity viewer
Open Case 001, select the Metadata tab, then select Edit.
Change Status to Closed and select Save.
Reopen Report 001 and notice the Status column now reads Closed.
To show each case's first page on its library card,
add a Preview property to the Case template.
Next steps
- How to create and configure a template — every property type and setting a template can hold
- How to create and manage a thesaurus — build and organize the value lists your templates draw from
- Understanding Uwazi's building blocks — how templates, entities, and relationships fit together