-
Notifications
You must be signed in to change notification settings - Fork 5
Description
Hi Daniel, I am trying to export Hetnets to neo4j by running the neo4j-import.ipynb using neo4j-community-3.5.1 under windows 10.
The neo4j-import.ipynb involves creating a new instance of neo4j, modifying the configuration files, starting the neo4j server, reading a graph from a file, exporting it to neo4j, and then stopping the server. I have followed all the required steps, but unfortunately, I am facing issues that I'm unable to resolve on my own.
To give you a brief overview, here is the exporting code snippet (trying to export a single hetnet.json.bz2 instead of using ‘ProcessPool’).
neo4j_bin = os.path.join('D:/integrate1111/integrate/neo4j/neo4j-community-3.5.1_rephetio-v2.0.1/', 'bin', 'neo4j.bat')
neo4j_version = 'neo4j-community-3.5.1'
db_name = 'rephetio-v2.0.1'
listen_address_0 = 7474
connector_0 = 7687
#create a Neo4j instance and start the server
neo4j_dir = create_instance(neo4j_version, db_name, listen_address_0, connector_0, overwrite=True)
hetnet_to_neo4j(path='D:/integrate1111/integrate/data/hetnet.json.bz2', neo4j_dir=neo4j_dir, listen_address=listen_address_0)
#check command
result = subprocess.run([neo4j_bin, 'start'])
if result.returncode != 0:
print(f'Error starting Neo4j: {result.returncode}')
else:
print('Neo4j started successfully')It turns out that the 47031 nodes in hetnet.json.bz2 was imported successfully to neo4j. But the relationships are not. The output message is as follow:
neo4j\neo4j-community-3.5.1_rephetio-v2.0.1
Starting neo4j server with neo4j\neo4j-community-3.5.1_rephetio-v2.0.1\bin\neo4j.bat
Reading graph from [D:/integrate1111/integrate/data/hetnet.json.bz2](file:///D:/integrate1111/integrate/data/hetnet.json.bz2)
Exporting graph to neo4j at http://localhost:7474/db/data/
neo4j\neo4j-community-3.5.1_rephetio-v2.0.1 'Graph' object has no attribute 'find_one'
Stopping neo4j server
Traceback (most recent call last):
File "C:\Users\我的电脑\AppData\Local\Temp\ipykernel_105868\3048707244.py", line 16, in hetnet_to_neo4j
hetnetpy.neo4j.export_neo4j(graph, uri, 1000, 250)
File "c:\anaconda\envs\myenv\Lib\site-packages\hetnetpy\neo4j.py", line 79, in export_neo4j
source = db_graph.find_one(source_label, "identifier", edge.source.identifier)
^^^^^^^^^^^^^^^^^
AttributeError: 'Graph' object has no attribute 'find_one'
Neo4j started successfully
I am hoping you might be able to provide some guidance on how to resolve this issue. Any hints, tips or advice would be greatly appreciated. Thank you very much for your time and consideration!