I produce the following node and relationship data in a for loop about 1 million times. The idea is that investor nodes connect to company nodes by relationship edges:
investor = {'name': owner['name'],
'CIK': owner['CIK']}
relationship = {'isDirector': owner['isDirector'],
'isOfficer': owner['isOfficer'],
'isOther': owner['isOther'],
'isTenPercentOwner': owner['isTenPercentOwner'],
'title': owner['title']}
company = {'Name': json['issuerName'],
'SIC': json['issuerSIC'],
'Ticker Symbol': json['issuerTradingSymbol'],
'CIK': json['issuerCIK'],
'EIN': json['issuerEIN']}
How do I complete the following code to get the dicts above into neo4j community edition?
from py2neo import Graph, authenticate
authenticate("localhost:7474", "neo4j", "neo")
graph = Graph()
for json in long_list_of_dicts:
investor = {...}
company = {...}
relationship = {...}
# Code to import investor, company, relationship data into neo4j
You could use
UNWINDclause. Something likeIf some of your json items is list again, you can use UNWIND as much as you like:
UNWIND document.list_of_some_property