Schema editor
This page documents some of the features of Kamala's schema editor. With this editor the users can quickly add fields and relations to a type. The editor is schema driven meaning it allows for reusing and sharing your knowledge.
Key features
- Add fields
- Reuse existing fields
- Remove fields
- Mark fields as mandatory
- Mark fields to contain multiple values
Usage
To use the schema editor, create a new topic type from the dashboard (see image) , or navigate to a pre-existing topic type.
The schema editor is available as second tab on a topic type screen, right behind 'instances'. Initially, there are no fields.
Adding fields
To add new fields to a topic type, use the green 'add' button in the top left corner of the schema editor. It will pop up a dialog to add a field. Various types of fields are available by default, like a text field, name field, checkbox field and a relation to other topics. As an example, 'phone number' is used here as a text field for topic type 'person'.
After adding some fields, the schema editor might look like this. It shows 'phone number' as text field, 'date of birth' as date field and 'employer' as relation.
The relation field shows an additional input field. The topic type to be used as values for the relation should be filled in here. The next image shows an appropriate value for the 'employment' relation: 'organization'. Existing topic types will appear as you type, or the option to create a new topic type is presented.
The next image shows the 'person' schema completely filled. 'Organization' has been included as a value for the 'employer' relation field. Additional values can be added for a single relation field.
The values are presented as links, to quickly manage schemas for other topic types. The next image shows the schema editor for 'organization', where the employment relation to person is available directly (NB: the labels of the relation field have already been edited, click the field name to open an editor that can change the labels) .
Reuse existing fields
The 'organization' schema can be filled as before. Existing fields can be reused, like the 'phone number' field, previously introduced by 'person'. As you start typing a field name, matches will show up. Simply select the existing field to reuse it.
Fields that are reused between topic types receive an additional marker to show that they are also used in other schemas.
Removing fields
The right hand side of the schema editor shows 'minus' icons to remove fields . Reused fields are only detached from the current schema. Fields that are not reused are completely removed, provided they are not used to type any values.
Marking fields as mandatory
Fields can be marked as mandatory by using the asterisk button next to a field name. Topics of this type will need to fill in a value for this field type. A phone number can be marked as mandatory, for example.
Marking fields as multi valued
Fields can be marked to contain multiple values by using the list button next to a field name.