Skip to content

Data Model Editor

Vinzenz Rosenkranz edited this page Jan 24, 2019 · 13 revisions

Attributes (Form sheets) of all entity types are freely configurable to match the user's needs. The Data Model Editor (DME) is used to create and edit entity types as well as attributes. The DME is part of the Settings Menu and is accessed via the menu in the upper right corner of the UI.

Note: Before you can "use" the DME, you have to create concepts in ThesauRex or any other SKOS-tool. These concepts can then be used as labels for attribute names or attribute value choices. Without concepts you can not create attributes or entity types.

The DME is structured in three columns. First one is an attribute list, second one an entity type list and the third one the properties of the selected entity type.

Attributes

On a new installation, the left column is empty. Use the + Add Attribute button to add new attributes. In the New Attribute popup, you have to set a label using the search bar (searches for concept labels of your vocabulary) and a type. Type can be one of the following:

  • Textfield: A single-line input field for free text values.
  • Textbox: A input field for free text with multiple rows.
  • Single Choice Dropdown: A dropdown where one value can be selected.
  • Multiple Choice Dropdown: A dropdown where several values can be selected.
  • Numeric Input (Floating Point): Floating Point values (0.1, 2.42, ...)
  • Numeric Input (Integer): Integer values (1, 2, 3, ...)
  • Checkbox: A simple checkbox for yes/no or true/false values
  • Percentage: A slider with values from 0 to 100 (integers)
  • Entity: Link to another entity
  • Time Period and Epoch: Combination of inputs for time periods (200 BC to 300 AD) and a single choice dropdown for epoch selection
  • Date: A datepicker
  • Dimensions (BxHxT): Set dimension for up to 3 dimensions
  • List: A list of free text values
  • WKT (Well-Known-Binary): Input for geodata in WKT format. Additionally, it is possible to add geodata on a map using the Map button
  • Table: A combination of several columns in one attribute. The possible types for columns are a subset of all available types.
  • SQL-Query: Write a SQL-Query that is executed every time an entity is loaded. Use :entity_id in your query to refer to the ID of the entity this attribute is bound to. Result can be either a table or a single value.
  • Serial (Auto-incrementing ID): A unique name, that supports a counter, which is incremented, every time a new entity with that attribute is created.

Several datatypes support choosing values from a predefined list (dropdowns and epoch). To tell Spacialist which values should be selectable, fill out the Parent-Element with the root element of your list choices. You can also choose between a recursive list (all descendants of the parent element are selectable) or a non-recursive list (only direct descendants are selectable).

The _SQL-Query` type requires the field Content, where you have to specify your query.

The Serial type also requires the Content field. You can use whatever text you like. Add a %d somewhere in the Content to add a counter.

Example:

My_Special_Find_Type_%d would result in My_Special_Find_Type_1 for the first entity of this type and My_Special_Find_Type_328 for the 328th. To pad lower values, simply add a minimum length for the %d. For a minimum length of 5 you would use %05d instead of %d. My_Special_Find_Type_1 would then become My_Special_Find_Type_00001.

Table columns are added the same way as normal attributes. But not all types are available as table column types.

Delete Attributes

When an attribute is no longer needed, you can hover over an attribute in the left column and click on the trash icon. In the confirmation popup you can see how many entities/values are affected. If you confirm, these values get deleted.

Entity-Types

All available entity types are listed in the center column. To add new types, click on + Add Entity-Type at the bottom of the list. In the popup you need to select a label from your vocabulary, the same way as for the attributes. You also have to decide whether this type should be a Top-Level-Entity-Type. Only Top-Level-Entity-Types can be added to the first level in the tree hierarchy in the main UI. The third field is the Geometry-Type. As you can link entities to geodata, you have to restrict the type of geodata, that should be possible to link to _entity types. Choose Any if there should be no restriction.

Entity-Type Properties

To edit properties, select one of the entity types.

Change Properties

It is possible to change the Top-Level-Entity-Type property. On top of the properties column, there is a checkbox.

Beside the Top-Level property, it is also possible to restrict which entity types are allowed under this entity type in the tree hierarchy. If you click Deselect All, no type is allowed under this type, disabling the Add new Sub-Entity entry in the tree's item's context menu.

Add Attributes

Add attributes by drag and drop them from the attribute column. The list of attributes represents the layout of the form sheet.

Remove and edit options are available by hovering over the attribute.

Note: By removing an attribute from an entity type all corresponding entries (values) will also be deleted. In the confirmation popup, you can see how many values are affected.

It is also possible to change the order of attributes by drag and drop. The arrows beside the edit and remove buttons enable drag and drop.

Dependencies

It is also possible to create dependencies between two attributes so that one attribute only appears if there is a specific entry for the other attribute.

Example: Attribute State should only appear if attribute Country is USA.

  • If the entity type should have possible sub-entities, add their entity-type to “allowed sub-entities” box above the attributes.
  • The creation and editing of new attributes (create only), entity types and corresponding form sheets are possible any time.

Hint: The creation of new attributes and creation and editing of entity types and corresponding form sheets is possible at any time.