You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| -h | --host TEXT | Redis server host (default: 127.0.0.1) |
19
+
| -p | --port INTEGER | Redis server port (default: 6379) |
20
+
| -a | --password TEXT | Redis server password |
21
+
| -n | --nodes TEXT | path to node csv file [required]|
22
+
| -r | --relations TEXT | path to relationship csv file |
23
+
| -t | --max-token-count INT | max number of tokens sent in each Redis query (default 1024) |
24
+
| -b | --max-buffer-size INT | max batch size (MBs) of each Redis query (default 4096) |
25
+
| -c | --max-token-size INT | max size (MBs) of each token sent to Redis (default 500) |
26
+
25
27
26
28
The only required arguments are the name to give the newly-created graph (which can appear anywhere) and at least one node CSV file.
27
29
The nodes and relationship flags should be specified once per input file.
28
30
31
+
The flags for `max-token-count`, `max-buffer-size`, and `max-token-size` should only be specified if the memory overhead of graph creation is too high. The bulk loader builds large graphs by sending binary tokens (each of which holds multiple nodes or relations) to Redis in batches. By lowering these limits from their defaults, the size of each transmission to Redis is lowered and fewer entities are held in memory, at the expense of a longer overall runtime.
The label (for nodes) or relationship type (for relationships) is derived from the base name of the input CSV file. In this query, we'll construct two sets of nodes, labeled `Person` and `Country`, and two types of relationships - `KNOWS` and `VISITED`.
36
+
The label (for nodes) or relationship type (for relationships) is derived from the base name of the input CSV file. In this example, we'll construct two sets of nodes, labeled `Person` and `Country`, and two types of relationships - `KNOWS` and `VISITED`.
33
37
34
38
## Input constraints
35
-
### Node files
36
-
- Node inputs are expected to be in a conventional table format. Each field in the header is a property name, which for each node is associated with the value in that column.
39
+
### Node identifiers
40
+
- If both nodes and relations are being created, each node must be associated with a unique identifier.
41
+
- The identifier is the first column of each label CSV file. If this column's name starts with an underscore (`_`), the identifier is internal to the bulk loader operation and does not appear in the resulting graph. Otherwise, it is treated as a node property.
42
+
- Each identifier must be entirely unique across all label files.
43
+
- Source and destination nodes in relation CSV files should be referred to by their identifiers.
44
+
- The uniqueness restriction is lifted if only nodes are being created.
45
+
46
+
### Entity properties
47
+
- Property types do not need to be explicitly provided.
48
+
- Properties are not required to be exclusively composed of any type.
49
+
- The types currently supported by the bulk loader are:
50
+
-`boolean`: either `true` or `false` (case-insensitive, not quote-interpolated).
51
+
-`numeric`: an unquoted value that can be read as a floating-point or integer type.
52
+
-`string`: any field that is either quote-interpolated or cannot be casted to a numeric or boolean type.
53
+
-`NULL`: an empty field.
54
+
55
+
### Label file format:
37
56
- Each row must have the same number of fields.
38
-
-Extraneous whitespace is ignored.
39
-
-Value types do not need to be provided. Properties are not required to be exclusively composed of numeric or string types.
40
-
-There is no uniqueness constraint on nodes.
57
+
-Leading and trailing whitespace is ignored.
58
+
-The first field of a label file will be the node identifier, as described in [Node Identifiers](#node-identifiers).
59
+
-All fields are property keys that will be associated with each node.
41
60
42
61
### Relationship files
43
-
- Relationship inputs have no headers.
44
-
- Each row should specify a source and destination node ID.
45
-
- All specified node IDs must exist in the database, as described in [Determining Node IDs](#determining-node-ids).
62
+
- Each row must have the same number of fields.
63
+
- Leading and trailing whitespace is ignored.
64
+
- The first two fields of each row are the source and destination node identifiers. The names of these fields in the header do not matter.
65
+
- If the file has more than 2 fields, all subsequent fields are relationship properties that adhere to the same rules as node properties.
46
66
- Described relationships are always considered to be directed (source->destination).
47
-
- The bulk insert script does not yet support adding properties to relationships (though this can be done after the fact with RedisGraph queries).
48
-
-_NOTE_ Relationship processing does not yet include node lookups. The entries in a relationship file should all be integers corresponding to node IDs.
49
-
50
-
51
-
### Determining Node IDs
52
-
Node IDs are assigned in order of insertion. Node files are processed in the order specified by the user on the command line (though all Node files are processed before Relationship files).
53
-
54
-
The first node in the first node file will have an ID of 0, and subsequent nodes across all files are ordered consecutively.
55
-
56
-
If a relationship file has the line:
57
-
```
58
-
0,11
59
-
```
60
-
This indicates that there is a relationship from the first node in the first node file to the 12th node to be inserted, regardless of which file it may appear in.
0 commit comments