You can import and export data in the Files drawer.
Import
Nodes or edges can be imported to the current graphset by the following steps. It is important to note that the import process will not create schemas, please ensure that the needed schemas already exist prior to the import.
1. Upload
Click the + icon located next to the title Import, select either Node or Edge and proceed to choose a CSV file from your local machine:
The CSV file should only hold information pertaining to nodes/edges of a single schema. Below are the examples of the CSV file for node schema @student (left) and edge schema @relate (right):
It is suggested to put the property names in the header of the CSV file.
2. Configure
Once the file is uploaded, proceed to configure its format:
- Column Delimitor: Select the appropriate option from comma (,), semicolon (;), or vertical bar (|), based on your CSV format.
- Properties in Header: Enable this option if you have included property names in the first row of the CSV file.
You may click Preview to check before proceeding:
The header is treated as the first node info if the Properties in Header option is disabled:
Click Next to configure the schema and properties as outlined below:
- Begin by selecting the appropriate schema from the Schema dropdown menu.
- After selecting the schema, the system will automatically correlate the existing properties under that schema with the property names mentioned in the CSV file header. Red warning icons will appear beside those properties that do not match. If the CSV file does not commence with property names, all property names and types will be void, accompanied by red warning icons.
- For properties marked with red warning icons, even after inputting the names and types, the warning icons will not vanish immediately. They will disappear once you click the + icon in the opt column or click Create the selected properties to generate the properties.
To exclude a column from the import process and prevent it from being imported, select the _ignore option from the type dropdown menu.
Once all the red warning icons have been resolved, proceed to click Next in order to initiate the import process.
3. Import
Before executing the import, confirm the following:
- Number of inserts per group: Ultipa Manager segments the data into groups for import. In principle, having a larger amount of data in each group (resulting in fewer groups) can potentially speed up the import process.
- Select your preferred method for data import: Insert, Upsert, or Overwrite.
After confirming these settings, proceed to click Import.
Import Records
Each import record comprises the following details:
- Type: The type of data imported (either node or edge).
- File Name: The name of the CSV file that was imported.
- Status Code: The code indicating the status of the import, which includes values like Uploading, Upload Succeeded, Upload Failed, Importing, Import Succeeded, Import Failed.
- Finished Count: The count of data items that were processed.
- Failed Count: The count of data items that failed to be imported.
- Success Count: The count of data items that were successfully imported.
- Error File: A downloadable error file containing information about nodes/edges that failed to import. If Failed Count is 0, this can be disregarded.
- Error Log: A downloadable error log. If Failed Count is 0, this can be disregarded.
- Create Time: The timestamp indicating when the file was imported.
If you encounter the error message "rpc error: code = ResourceExhausted desc = Received message larger than max (31324123 vs. 4194304)" or a similar message in the Error Log, it indicates that during the import of a data batch, the packet size, which is 31324123 bytes, exceeds the limit of 4194304 bytes. To resolve this issue, you can either reduce the number of inserts per group, or increase the max_rpc_msgsize in the server config. It's important to note that the latter solution necessitates a server reboot and is still bound by the packet size limit (40M) of the Go SDK used by Ultipa Manager during the import process.
In the upper-right corner of each record, there is a set of options: Import, Configure, and Delete. These choices offer you the flexibility to navigate the "upload - configure - import" process in a way that suits your needs. You can exit the process at any stage and pick up where you left off later, or even reuse previously uploaded files. Should you decide to re-import the same file, the corresponding record will be overwritten. Keep in mind that the availability of these options depends on the ongoing status of the upload or import procedure.
Export
Ultipa Manager allows you to export the structure and nodes/edges of the current graphset.
Export Structure
You can export the UQL statements that create the graphset along with all its schemas and properties into a single .uql file.
Export Nodes/Edges
Prior to exporting, you need to configure the following options:
- Schema: Select the node/edge schema(s) you want to export. You may choose single schema, multiple schemas or all schemas.
- Property: Select the property(-ies) you want to export. If you specify more than one schema, all properties of those schemas will be exported by default.
- Limit: Set a limit on the number of nodes/edges to export,
-1
means to export all.
Each individual node/edge schema will be exported to its own separate CSV file. If you are exporting multiple schemas, please ensure that your web browser permits bulk downloads.
If you encounter a message like 'rpc error: code = ResourceExhausted desc = Sent message larger than max (31324123 vs. 4194304)' or something similar when exporting, it indicates that the packet size during data export exceeds the set limit. To resolve this, you can increase the max_rpc_msgsize in the server configuration and then reboot the server. Keep in mind that the number of exports per group is determined by the system and cannot be manually defined by users.