Closed Howie-Arup closed 2 months ago
Yes. Apologies. Definitely a typo. If you are in a hurry for this to be fixed, find the folder where topologicpy is installed and go into the Neo4j py file, find that line and change it to .Keys. Then restart your process and test again. This will be fixed in the next release
Thank you for your reply @wassimj . I have modified it in the Neo4j py file. But I got another error when exporting the topologicpy graph to neo4j graph.
I used the codes below:
from topologicpy.Topology import Topology
from topologicpy.Graph import Graph
from topologicpy import Neo4j
IFC_file_path = "sample.ifc"
graph_topo = Graph.ByIFCPath(IFC_file_path)
username="..."
password="..."
url="..."
graph_neo4j = Neo4j.Neo4j.ByParameters(url=url, username=username, password=password)
topo_neo4j = Neo4j.Neo4j.AddGraph(neo4jGraph=graph_neo4j, graph=graph_topo, labelKey='None', relationshipKey='None')
But it seems that there is something wrong with the graph object to execute the Cypher:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Cell In[5], line 4
1 # Create an instance of the Neo4j graph
2 graph_neo4j = Neo4j.Neo4j.ByParameters(url=url, username=username, password=password)
----> 4 topo_neo4j = Neo4j.Neo4j.AddGraph(neo4jGraph=graph_neo4j, graph=graph_topo, labelKey='None', relationshipKey='None')
File c:\Users\Howie.Liu\AppData\Local\miniforge3\envs\graphrag\lib\site-packages\topologicpy\Neo4j.py:336, in Neo4j.AddGraph(neo4jGraph, graph, labelKey, relationshipKey, mantissa, tolerance)
334 nodeName = str(values[keys.index(labelKey)])
335 n = py2neo.Node(nodeName, **pydict)
--> 336 neo4jGraph.cypher.execute("CREATE INDEX FOR (n:%s) on (n.name)" %
337 n.nodelabel)
338 tx.create(n)
339 nodes.append(n)
AttributeError: 'Graph' object has no attribute 'cypher'
I wonder where is the problem in the library or I misused it?
@Howie-Arup I just published a new version of topologicpy (v0.7.56). n this version, the Neo4j class has been re-written using the native neo4j driver. The reason for that is that py2neo, which topologic used previously, has been declared EOL. The new API is much simpler, but allows you to convert between topologic and neo4j graphs easily. When you include a cypher string, sub-graphs can be retrieved from the graph database. A Project Jupyter notebook has also been included for you to test.
@Howie-Arup I just published a new version of topologicpy (v0.7.56). n this version, the Neo4j class has been re-written using the native neo4j driver. The reason for that is that py2neo, which topologic used previously, has been declared EOL. The new API is much simpler, but allows you to convert between topologic and neo4j graphs easily. When you include a cypher string, sub-graphs can be retrieved from the graph database. A Project Jupyter notebook has also been included for you to test.
@wassimj Fantastic! Many thanks!
Hi, I am trying to store the topologicpy graph to neo4j. The codes are as below.
The error is as below.
It seems that there is a typo in the
keys = Dictionary.Keyus(vDict)
?