redisgraph-bulk-loader | A Python utility for building RedisGraph databases from CSV inputs | Graph Database library
kandi X-RAY | redisgraph-bulk-loader Summary
kandi X-RAY | redisgraph-bulk-loader Summary
A Python utility for building RedisGraph databases from CSV inputs.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Bulk insert operation
- Sends the query buffer
- Process entities
- Parse a list of schemas
- Process all entities in the file
- Convert inferred property value to binary
- Convert an array property to a binary string
- Convert a line into a binary string
- Perform bulk update
- Process update_csv
- Updates statistics from a result
- Emit the given query buffer
- Parses the header
- Convert a header to a schema
- Convert a schema type to a schema type
- Pack the entity header
redisgraph-bulk-loader Key Features
redisgraph-bulk-loader Examples and Code Snippets
:ID(User), name:STRING, rank:INT
0, "Jeffrey", 5
1, "Filipe", 8
:START_ID(User), :END_ID(User), reaction_count:INT
0, 1, 25
1, 0, 10
redisgraph-bulk-update GRAPHNAME [OPTIONS]
python3 redisgraph_bulk_loader/bulk_update.py GRAPHNAME [OPTIONS]
redisgraph-bulk-update SocialGraph --csv User.csv --query "MERGE (:User {id: row[0], name: row[1], rank: row[2]})"
redisgraph-bulk-update S
storeNum | Location | daysOpen |
118 | 123 Main St | ['Mon', 'Wed', 'Fri']
136 | 55 Elm St | ['Sat', 'Sun']
Community Discussions
Trending Discussions on redisgraph-bulk-loader
QUESTION
I am trying to use the redisgraph-bulk-loader to load the dataset into the RedisGraph instance running in a docker container. However, it returns with IndexError: list index out of range
which I do not understand. I have read the documentation and my CSV files are valid.
I have opened an issue here.
Command :
$ redisgraph-bulk-loader DemoGraph --enforce-schema --nodes-with-label TBox import/nodes.csv --relations-with-type relations import/relationships.csv
Log :
...ANSWER
Answered 2021-Apr-20 at 15:54The error you're encountering occurs at this line - https://github.com/RedisGraph/redisgraph-bulk-loader/blob/master/redisgraph_bulk_loader/entity_file.py#L233 .
At this point, we are trying to retrieve the type specified after the colon in a specific field of a header line. As such, an IndexError
indicates that no colon was found in one of the fields.
Looking at relationship.csv
, I see that the header row ends with "properties__title","properties__uri","end__labels__002"
. These columns should have a colon-separated type, like the preceding fields.
QUESTION
Below are the few issues I am getting when I am trying to upload a file with around one million records. Help me on resolving the issues. When I am try to find the solution in blogs, all are suggesting to modify some logic. But I am using redisgraph-bulk-loader utility directly.
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe8 in position 3565: invalid continuation byte
_csv.Error: line contains NULL byte
Not working if column value contains quotes and comma.
redisgraph_bulk_loader.bulk_insert.CSVError: /home/ec2-user/test.csv:2 Expected 4 columns, encountered 5 ('1,3,4,"5,6"')
GraphName should be unique always for each new upload. In this case, if I want to add some more nodes to same graph or if I want establish relationships from some other file how to achieve this.
...ANSWER
Answered 2020-Jun-12 at 14:24As answered in the issue you opened on the redisgraph-bulk-loader repository:
Not working if column value contains quotes and comma.
This may be resolvable by using the --quote
argument to change input-quoting behavior. The next suggestion would render this unnecessary, however.
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe8 in position 3565: invalid continuation byte _csv.Error: line contains NULL byte
These may also be problems with type inference logic. You may wish to try using an updated branch (to be merged soon) that introduces enforced schema; this will solve your first problem as well.
git checkout improve-loader-logic
And updated your header rows as described in the updated branch's docs.
If this does not resolve your issues, you may need to look deeper into encoding problems.
GraphName should be unique always for each new upload. In this case, if I want to add some more nodes to same graph or if I want establish relationships from some other file how to achieve this.
The bulk loader is a one-time tool, and currently all updates to existing graphs must be made using Cypher queries.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install redisgraph-bulk-loader
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page