Import file

Permissions needed: Data management

Import steps:

  1. Upload file

  2. Select import settings

  3. Import file into DB

1.Upload file

To start the upload click on the "Import file" button on the Search page (see Search & Manage Data for more information). After that the import window is displayed (see below) where you can drag&drop your file or choose a file with the File Chooser window (click on the "Choose a file" link).

images/download/attachments/18580711/import_1.png

The file is uploaded to Graphlytic server for analysis. Nothing is imported in this step.

You can upload CSV file (raw data) or XLS and XLSX files (Microsoft Excel files). You can also upload a ZIP file which contains multipls CSV, XLS or XLSX files. Only the first file from the ZIP archive will be used.

2.Select import settings

After a successful upload the Import Settings window is displayed. This window is slightly different depending on whether you are importing a CSV or an Excel file but only the CSV alternative is described here because it contains more options than the Excel one.

images/download/attachments/18580711/import_2_csv_rels.png

2.1.Import as

images/download/thumbnails/18580711/red_1.png in the picture above.

Switch between nodes or relationship based on what type of elements you want to create. Every row (record) in the imported file represents one element and here you can choose if there are nodes or relationships in your file. The import settings window will change when you switch between nodes and relationships to show only the relevant parts. The main difference is that when you want to import relationships you have to set the rules for source and target nodes of the relationship (these nodes have to already exist in the database prior to creating a relationship between them).

In the picture above only the version for importing relationships is shown because it contains everything node importing does, plus the source and target nodes matching which is needed only when importing relationships.

2.2.Data

images/download/thumbnails/18580711/red_2.png in the picture above.

In this part of the import settings you can describe the data in the file, indicate the meaning or usage of every column in the imported file. When importing a CSV file the encoding and column separator values have to be set appropriately (quoting and escaping can be set also but it's located in the Advanced settings part of the window - see part images/download/thumbnails/18580639/red_6.png below).

First row is header - check this if your file has a header row. The header will be not imported as a data row but the values will be used as column names instead (you can also rename them as you like).

Columns - every column from the imported file is represented as a row in the columns table. Here you can set the name of the column (it's used for column identification on multiple places in the form and also as a property key when the column is used as a property). Multiple other usages can be set:

  • Column name - this name is used to identify a column in this form (also as imported property name in DB)

  • Data type - what is the type of data in this column

  • Array - check if you want to import the values as an array (you can set the array item delimiter in Advanced options)

  • Property - check if you want to import the column as a property (empty values are null by default - see Advanced options)

  • Labels - check if you want to import the values as node labels (use Array checkbox if there are multiple labels in one column)

  • Type - check if you want to import the value as a relationship type (can't be an array)

  • Sample values - here you can see a sample of the values that will be imported

Relationship type - the value entered in this input field will be used as a relationship type but only if no column is marked as Type in the columns table.

2.3.Source node matching

images/download/thumbnails/18580711/red_3.png in the picture above.

Choose which columns will be used for relationship's source node matching. You can use separate columns for node's labels data (this is optional) and node's properties (mandatory). Note that the name of the column used for node property matching has to be the same as the key (name) of the property you want to match.

2.4.Target node matching

images/download/thumbnails/18580711/red_4.png in the picture above.

Choose which columns will be used for relationship's target node matching. You can use separate columns for node's labels data (this is optional) and node's properties (mandatory). Note that the name of the column used for node property matching has to be the same as the key (name) of the property you want to match.

2.5.Merge with existing

images/download/thumbnails/18580711/red_5.png in the picture above.

You can choose if you want to create a new element for every record in your file or if you want to update the existing elements if such an element already exist. This part of the import settings lets you choose between these options and define rules how to find existing elements for updating.

Unique properties - these are the columns (properties) that will be used to find existing element for updating. The values of these columns have to be equal to the values of properties in the database and the names of these columns have to be equal to the names of properties in the database. Node labels or relationship type are also compared and have to be the same.

2.6.Advanced options

images/download/thumbnails/18580711/red_6.png in the picture above.

Settings in the Advanced options can be used in special cases but most of the time the default settings are sufficient.

Advanced options for any kind of file include:

  • Array delimiter - choose which character is used as the array delimiter when importing array values.

  • Commit size - number of elements imported in one commit. This option is useful when importing large files.

  • Empty is null - check if you want to import empty values from the file as null values.

Advanced options for Excel files include also:

  • Values are quoted (") - check if all values in the imported file are quoted with double quotation mark and you don't want to import the quotation marks.

  • Special chars are escaped (\) - check if special characters in the imported file are escaped with a backslash (the character \ ).

2.7.Import file into DB

images/download/thumbnails/18580711/red_7.png in the picture above.

After configuring all import settings click the "Import" button to start the import.