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
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`.
33
33
34
34
## 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.
35
+
### Node identifiers
36
+
- If both nodes and relations are being created, each node must be associated with a unique identifier.
37
+
- 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.
38
+
- Source and destination nodes in relation CSV files should be referred to by their identifiers.
39
+
- The name of the identifier columns otherwise do not matter, so long as no node has a duplicated value.
40
+
- The uniqueness restriction is lifted if only nodes are being created.
41
+
42
+
### Entity properties
43
+
- Property types do not need to be explicitly provided.
44
+
- Properties are not required to be exclusively composed of any type.
45
+
- The types currently supported by the bulk loader are:
46
+
-`boolean`: either `true` or `false` (case-insensitive, not quote-interpolated).
47
+
-`numeric`: an unquoted value that can be read as a floating-point or integer type.
48
+
-`string`: any field that is either quote-interpolated or cannot be casted to a numeric or boolean type.
49
+
-`NULL`: an empty field.
50
+
51
+
### Label file format:
37
52
- 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.
53
+
-Leading and trailing whitespace is ignored.
54
+
-The first field of a label file will be the node identifier, as described in [Node Identifiers](#node-identifiers).
55
+
-With the possible exception of the first, each field in the header is a property key. The value in that position for each node is the property associated with that key.
41
56
42
57
### 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).
58
+
- Each row must have the same number of fields.
59
+
- Leading and trailing whitespace is ignored.
60
+
- 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.
61
+
- If the file has more than 2 fields, all subsequent fields are relationship properties that adhere to the same rules as node properties.
46
62
- 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