Import file

Permission: 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 for more information). After that the import modal window is displayed (see below) where you can drag&drop your file or choose a file with file chooser window (click on the "Choose a file" link).

images/download/attachments/15434019/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 successful upload the import settings modal window is displayed. This window is slightly different whether you are importing CSV or Excel file but only the CSV alternative is described here because it contains more options than the Excel one.

images/download/attachments/15434019/import_2_csv_rels.png

2.1.Import as

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 relationship (these nodes has to already exist in database prior to creating a relationship between them).

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

2.2.Data

In this part of the import settings you can describe the data in the file, select the meaning or usage of every column. 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 6 below).

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

Columns - every column from 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 column in this form (also as imported property name in DB)

  • Data type - what data type should be used when importing this column

  • Array - check if you want to import the values as an array (you can set the value 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 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

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 have to be the same as the key (name) of the property you want to match.

2.4.Target node matching

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 have to be the same as the key (name) of the property you want to match.

2.5.Merge with existing

You can choose if you want to create new element for every record in your file or if you want to update 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 DB and the names of these columns have to be equal to the names of properties in DB. Node labels or relationship type is also compared and has to be equal.

2.6.Advanced options

Settings in the Advanced options can be used in some non-usual cases but for most of the times the default settings are sufficient.

Advanced options for any kind of file includes:

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

  • Commit size - number of elements imported in one commit. It 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 includes also:

  • Values are quoted (") - check if all values in CSV 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 CSV are escaped with backslash

3.Import file into DB

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