Neo4j with Python [Upload data into Neo4j with Python]
Вставка
- Опубліковано 22 лип 2024
- Learn how to use Python to upload data into a Neo4j graph database.
GIT repo with Jupyter notebook:
github.com/discover-python/PY...
Neo4j python library documentation:
neo4j.com/docs/api/python-dri...
0:00 Introduction
0:24 Create Database
1:00 Create fictional transactions
3:55 Upload to MariaDB (optional)
4:08 Write to Neo4j
Dude you are a life saver. I HAD no idea where to start manipulating a data base outside of their workbench but you made it look easy!
Thank you so much for this video!
No problem, glad I can help!
Thank you so much!
There aren't enough good concise neo4j video tutorials on youtube. I hope you can make some more in the future if you ever have some time and feel like it.
No problem, is there anything specific you are trying to do with Neo4j? Would it be helpful to see Neo4j being used as a replacement to a rational database?
@@discoverpython9614 As a matter of fact, yes. That is an area that I think a lot of folks are interested in, myself included.
What I was working on was entirely different, though. I was analyzing the relationships between COVID symptoms by comparing the similarity of key words. Regardless, I am well aware of some healthcare companies interested in replacing their relational databases with graph databases, so a video on that would be super interesting.
This is very useful as a beginners' guide for using Neo4j with Python. Thank you very much!
Glad it was helpful!
wonderful video! just one doubt, each time i run all the cells on python notebook and check for the nodes in neo4j, it just keeps multiplying. Any fix for this issue?
Many thanks.... God bless you :)
Great video. As an aside wonder if there are any CEOs out there who flip a coin or run python random number to decide what transaction they are going to perform for the day
7:18 you say that is possible to concatenate multiple commands together and execute them more rapidly, could you elaborate? I'm interested in how to speed up the process of writing onto a neo4j database, as I have to write hundredth of thousands of edges every time, and iterating one by one is way too slow.
Sure, there are neo4j clauses you can use to programmatically create edges within neo4j.
For example, instead of creating the edges via individual requests, you can use something like the foreach clause which can create the edges based on certain conditions after you have loaded in your data.
Have a look at this link below from the documentation:
neo4j.com/docs/cypher-manual/current/clauses/foreach/
Hi, the video is good.
I have a question, i want to connect neo4j desktop and python using an IP Address(as in graphDB=GraphDatabase.driver(uri="bolt://localhost:7687", auth=( "kaberi", "kaberi")) ,instead of localhost *i want to give IP Address) . Is it possible..?
I have been looking into so many tutorials videos and documents but did'nt find any a way out.Kindly help
Hi Kaveri, I'm sorry I missed this comment!!! The python doc's say that this needs to be a hostname rather than a IP address so what you can consider doing is adding a hostname alias on your machine then using that hostname in your driver function ..
If you need help adding a hostname to your machine then let me know. Sorry again for such a late response!
Absolutely remarkable :) Do you have any idea about connecting Looker and Neo4j ?
Thats a bit tricky since the data out of Neo4j is pretty poor quality and hard to manipulate. If you want I can make a video to demonstrate this.
Hi, what the fastest way to import a large dataset to neo4j with python. As a dataframe using pandas or as a json/csv with apoc library?
It depends, how large is your dataset? If you are using a dataset less than 100K rows then I would say it doesn't matter too much which method you use. However, if your dataset is very large and you are running it on your local PC, then you will probably hit a heap/memory error so it might be better to use Python and break the upload into multiple iterations.
@@discoverpython9614 It's larger yes, though my problem is that neo4j and python don't use a lot of resources while running, and that's why it takes so much time. If i had a way to increase the use of resources on my local pc i think it would be ok.
@@damisg7 Have you tried uploading the data in parallel? Neo4j supports concurrent connections so this would be a way to increase the speed of your data import.
@@damisg7 check out the multiprocessing package for python or if you know Go you can also use it to preform a concurrent import
Hi, Could you make a video for import csv data into neo4j with python?
No problem, here is the link to that video. ua-cam.com/video/0rs1Wdd7eCI/v-deo.html
@@discoverpython9614 Hey Thanks for the link, but the video is not available .
so finally we have the financial data of 50000 nodes but why we don't have the relation between them? graph theory is about finding relation between nodes right?
This is a two part process. After you have imported your data as nodes, you need to define the relationships you want to see... does that make sense?
I got like 101 for a tutorial video
nice
Although this video is about creating nodes in neo4j from python, the example that you give is completely wrong. Transactions are NOT nodes! Transactions are RELATIONSHIPS BETWEEN TWO OR MORE VENDOR NODES. So you should create nodes from vendors not transactions.