Data Entities and Maps

<< Click to Display Table of Contents >>

Navigation:  Defining Entity Types > Data Entities >

Data Entities and Maps

Previous pageReturn to chapter overviewNext page

To create a data entity, you'll first need the data source file itself, which must be loaded into Ventity:

 

Loading Data

Expand the Time Series Data and Data Sources tabs. Right-click on Data Sources and select "Add Data Files."

 

  datafile01datafile02

 

Locate and load in the relevant data file. Once it's been loaded, it will appear under your Data Sources tab. From here, the next step is to create a data map:

 

Creating a Data Map

 

A data map connects the data in source files to data entities in the model.

If the model does not yet include any data entity types, we need to create the data entity types and the maps that link them to the source files.

If the data entity types already exist, we need just to create the map to link them to the source files.

 

If you have not yet created a data entity type for these data:

 

Right-click on a data source, and select Create Mapping to Model Fields. This will pull up the mappings dialog screen.

 

datamap01

 

The system creates a new map, which you will edit through the Data Mapping Control.

 

datamap02

 

The name of the map (“Mapping Name”) and the name of the source file appear in the upper right. You can change the map name if you like, and there's room next to the file name to add a description of the source file.

 

Next, click the "Detect Source Entity Types” button:

 

 

datafile03

 

 

This will instruct Ventity to read your data source file and determine which variables are present for which entities. You will see the information appear in the dialog, with information from the source file on the left and corresponding Data Entity information on the right:

 

datamap03

 

 

In this example, Ventity has detected that the source file contains information for "strain" entity types, including an attribute "strainid" which is taken to be a key, and a variable called "Infected Data".

 

datamap04

 

The next step is to set interpolation types for each data variable. These determine what the model will do at time points before, after, or in between the times when data are provided. The available types are:

 

Raw: If no data are in the source file for a particular time, the model will not use any value.

Straight: If no data are in the source file for a particular time, the model will use a linear interpolation between the closest two points.

Hold backward: The model will use the most recent value from the data source.

Look forward: The model will look ahead to the next provided value in the data source.

 

Setting Interpolation Types

 

datamap05

 

From the menu in the "Interpolation Type" column, select one or more interpolation types. Each type you select will appear in the data entity as a separate variable, named as a combination of the source variable and the interpolation type - for example, "Infected Data Straight", "Infected Data Backward".

 

You may also add units and description information.

 

If you have more than one entity type in your source files, you will see multiple tabs on the Map control - one for each entity type.

 

datamap06

 

If you wish to bypass the auto detection process and to create a tab for a source entity on your own, use the buttons shown below:

 

datamap07

 

You may also add, delete, or change the order of the rows.

 

datamap08

 

 

So far the mapping has information about “Source Entity Type” but in this case, we don’t have yet the corresponding Data Entity type, so we need to create that now.

 

Creating Data Entity Types

 

datamap09

 

A quick way to create a Data Entity Type for each entity type in your source data is to click the Create Data Entity Types button:

 

datamap10

 

Alternatively, in each tab of data grid the control provides the tool to handle the corresponding data entity type. Use the buttons shown below to create, rename or delete data entity types.

 

datamap11

 

When the system completes the generation of each Data Entity Type,

the Map Control is updated to show this, and

the newly created data entity types appear in the “Data Entity Types” section of the Model Control.  

 

For each variable of mapping the system creates a set of variables which have the same name and a different suffix according to interpolation type.

In the example below, Infected Data in the source file has produced Infected Data Raw and Infected Data Straight in the StrainData entity type.

 

datamap12

 

If you had previously created a Data Entity Type: you can use your map to connect the source data to your existing data entity. Once your source tabs are complete,

 

datamap13

 

 

Selecting an existing Data Entity Type

 

Choose the corresponding Data Entity Type from the list of existing data entity types:

 

datamap14

 

Then, for each variable in the source data, choose the Data Name from the menu in the corresponding cell of the Data Name column.

 

datamap15

 

You can also start typing the name of the data entity variable and the auto-complete will show you the relevant names:

 

datamap16

 

Once the table is complete, your data source files are connected by the data map to the data entities. In the model, you may now use the variables in the data entities as inputs to other variables.