Load

Data Hub provides several methods for loading data. The primary and recommended method is through the Spring Integration Channel, but there is also a service for loading source data in CSV format.

What Happens to Data as It Loads

Data is loaded into Data Hub as key-value pairs. With CSV data, which is already a key-value mapping, it is straightforward. With other data input formats, some processing occurs to extract the key-value pairs.

Each new batch, file, or stream is considered a new data loading action. Process all data in the provided batch, file, or stream, before the data loading action completes. As each key-value pair is loaded, it is recognized as a valid raw fragment and assigned a PENDING status. Only raw items with the PENDING status, and a completed data loading action, are eligible for composition.

CSV Web Service Extension

The goal of the CSV Web Service extension is to simplify the load process of raw items into the Data Hub. It is possible to make REST calls to the CSV web service to load the data. The REST call resource contains the name of the raw item where you want to load data. The request body contains the attribute names and data that you want to load.

CSV Header

The first line in the CSV body is called the header. The header of the CSV corresponds to the attribute names of the raw item where you are trying to load data. The attribute names should be comma separated with no spaces. For example, if you want to load data into a raw item that has the raw attributes: identifier, name, description, and unit, you would place the following header in the request body:
itemnum,name,description,unittype
The order of the attributes must match the order of the data.

CSV Body

The following rows in the CSV body include the data you are loading. Each row corresponds to exactly one raw item. Following the previous example, if you have the raw attributes: identifier, name, description, and unit, and you want to load three raw items, the corresponding CSV body includes the header plus the values for each attribute:

itemnum,name,description,unittype
0,pants,wear it to cover your legs,pieces
1,shorts,kinda like pants but shorter,pieces
2,t-shirt,wear it to cover your torso,pieces

In this example, you create three raw items. Each value in a column corresponds to the value of the attribute in the same column. So, for item 0, the value for identifier is 0, the value for name is pants, and so on.

A blank value for an attribute implies that this attribute should be ignored. In this case, the value of the attribute does not change. If this attribute value has never been set, it remains the default, and, if it has been set before, the value is not updated. The blank value is in contrast to an empty string, which causes the existing attribute value to be replaced. In the following example, the value for description of item 0 is not set, and is ignored.
itemnum,name,description,unittype
0,pants,,pieces
1,shorts,kinda like pants but shorter,pieces