# Graph Neural Networks and Neo4J

**URL:** <https://community.neo4j.com/t/graph-neural-networks-and-neo4j/19983>\
**Category:** Graph Data Science / Graph Analytics\
**Created:** [June 13, 2020, 4:28pm UTC](https://community.neo4j.com/t/graph-neural-networks-and-neo4j/19983 "2020-06-13T16:28:21Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![otaviocx](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/otaviocx/32/10963_2.png) [@otaviocx](https://community.neo4j.com/u/otaviocx)\
**Post date:** [June 13, 2020, 4:28pm UTC](https://community.neo4j.com/t/graph-neural-networks-and-neo4j/19983/1 "2020-06-13T16:28:21Z")

</div>

Hi folks, I've recently started research about Graph Neural Networks (GNN) applied on Knowledge Graphs. Is there already any initiative (as Graph Data Science Library) that facilitate the usage of GNN in Neo4j? Currently, I'm extracting data from Neo4j using Python and running GNN models with [DGL](https://www.dgl.ai/).

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![otaviocx](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/otaviocx/32/10963_2.png) [@otaviocx](https://community.neo4j.com/u/otaviocx)\
**Post date:** [July 19, 2020, 3:15pm UTC](https://community.neo4j.com/t/graph-neural-networks-and-neo4j/19983/2 "2020-07-19T15:15:24Z")

</div>

Ok, it seems there is no initiative like that. So, is there anyone needing it too? If so, are you interested in work together to create such tool/library in a collaborative way?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![jggomez](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/jggomez/32/7793_2.png) [@jggomez](https://community.neo4j.com/u/jggomez)\
**Post date:** [July 19, 2020, 4:27pm UTC](https://community.neo4j.com/t/graph-neural-networks-and-neo4j/19983/3 "2020-07-19T16:27:52Z")

</div>

Yeah, there is a course about data science. This course has a chapter about predictions so you can see some ML examples with graphs.

Thanks

[https://neo4j.com/graphacademy/online-training/data-science](https://neo4j.com/graphacademy/online-training/data-science)

---

<div class="post-metadata">

**Author:** ![otaviocx](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/otaviocx/32/10963_2.png) [@otaviocx](https://community.neo4j.com/u/otaviocx)\
**Post date:** [July 21, 2020, 2:57am UTC](https://community.neo4j.com/t/graph-neural-networks-and-neo4j/19983/4 "2020-07-21T02:57:36Z")

</div>

Hi @jggomez, thanks for the reply. It seems the course you've linked is about classical ML methods with Graph Data Science Library. Actually, I'm interested in something specific for Graph Neural Networks (GNN). I mean, a library that I can use inside Neo4j to be able to create GNN models and also train and run them inside Neo4j. I need something similar to GDS but for GNNs.

---

<div class="post-metadata">

**Author:** ![jggomez](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/jggomez/32/7793_2.png) [@jggomez](https://community.neo4j.com/u/jggomez)\
**Post date:** [July 21, 2020, 10:10pm UTC](https://community.neo4j.com/t/graph-neural-networks-and-neo4j/19983/5 "2020-07-21T22:10:15Z")

</div>

> [@otaviocx](#):
>
> GNNs

I don't know... but you can extract the information and apply GNN.

Thanks

---

<div class="post-metadata">

**Author:** ![roberto1](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/roberto1/32/9505_2.png) [@roberto1](https://community.neo4j.com/u/roberto1)\
**Post date:** [October 22, 2020, 6:27pm UTC](https://community.neo4j.com/t/graph-neural-networks-and-neo4j/19983/6 "2020-10-22T18:27:10Z")

</div>

Hi @otaviocx I think they released some [algorithms](https://neo4j.com/blog/announcing-graph-native-machine-learning-in-neo4j/?ref=social-blog)

---

<div class="post-metadata">

**Author:** ![alicia\_frame1](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/alicia_frame1/32/6998_2.png) [@alicia\_frame1](https://community.neo4j.com/u/alicia_frame1)\
**Post date:** [October 27, 2020, 3:03pm UTC](https://community.neo4j.com/t/graph-neural-networks-and-neo4j/19983/7 "2020-10-27T15:03:46Z")

</div>

Hi @otaviocx check out our most recent 1.4 release, which features GraphSAGE andNode2Vec within Neo4j: [https://neo4j.com/docs/graph-data-science/1.4-preview/](https://neo4j.com/docs/graph-data-science/1.4-preview/)

You may also want to check out the presentation from NODES on Graph Native Learning with GraphSAGE and the model catalog: [https://neo4j.com/video/nodes-2020/?href=nodes-2020-home](https://neo4j.com/video/nodes-2020/?href=nodes-2020-home)

---

<div class="post-metadata">

**Author:** ![dhivyamohan05](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/dhivyamohan05/32/15185_2.png) [@dhivyamohan05](https://community.neo4j.com/u/dhivyamohan05)\
**Post date:** [July 26, 2021, 6:25am UTC](https://community.neo4j.com/t/graph-neural-networks-and-neo4j/19983/8 "2021-07-26T06:25:31Z")

</div>

Even i have started by research in the same. trying to implement GNN with DGL extracting from neo4j. I have no ideas how to do it. can you please help me with resource or codes how to extract data from neo4j to implement GNN

---

<div class="post-metadata">

**Author:** ![alicia\_frame1](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/alicia_frame1/32/6998_2.png) [@alicia\_frame1](https://community.neo4j.com/u/alicia_frame1)\
**Post date:** [July 26, 2021, 2:21pm UTC](https://community.neo4j.com/t/graph-neural-networks-and-neo4j/19983/9 "2021-07-26T14:21:21Z")

</div>

@dhivyamohan05 check out this blog post: [Neo4j & DGL — a seamless integration | by Kristof Neys | Towards Data Science](https://towardsdatascience.com/neo4j-dgl-a-seamless-integration-624ad6edb6c0)

---

<div class="post-metadata">

**Author:** ![dhivyamohan05](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/dhivyamohan05/32/15185_2.png) [@dhivyamohan05](https://community.neo4j.com/u/dhivyamohan05)\
**Post date:** [July 30, 2021, 6:38am UTC](https://community.neo4j.com/t/graph-neural-networks-and-neo4j/19983/10 "2021-07-30T06:38:30Z")

</div>

thank u @alicia_frame1

---

<div class="post-metadata">

**Author:** ![cwingho](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/cwingho/32/20763_2.png) [@cwingho](https://community.neo4j.com/u/cwingho)\
**Post date:** [November 8, 2021, 8:01am UTC](https://community.neo4j.com/t/graph-neural-networks-and-neo4j/19983/11 "2021-11-08T08:01:28Z")

</div>

Hi. So can I say that, I can compute the node embeddings using the Node2Vec or GraphSAGE function provided by gds, and use the node embeddings to fit into different machine learning models. Not necessary to use the DGL, right?

Thanks

---

<div class="post-metadata">

**Author:** ![alicia\_frame1](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/alicia_frame1/32/6998_2.png) [@alicia\_frame1](https://community.neo4j.com/u/alicia_frame1)\
**Post date:** [November 8, 2021, 2:48pm UTC](https://community.neo4j.com/t/graph-neural-networks-and-neo4j/19983/12 "2021-11-08T14:48:06Z")

</div>

@cwingho That's correct: you can use Node2Vec, GraphSAGE, or FastRP to generate graph embeddings _in Neo4j_, without having to use DGL.

The advantage with using a Neo4j procedure, instead of DGL, is that you don't have to do the ETL - exporting all the data to your python environment, reshaping it for DGL, and then sorting out where to save the results. That means its typically much simpler, faster, and less error prone.

Once you've got your embeddings, you can either export them to you ML environment _or_ use the built in supervised ML in neo4j: [https://neo4j.com/docs/graph-data-science/current/algorithms/ml-models/](https://neo4j.com/docs/graph-data-science/current/algorithms/ml-models/)

---

<div class="post-metadata">

**Author:** ![rambozhao721](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/rambozhao721/32/22872_2.png) [@rambozhao721](https://community.neo4j.com/u/rambozhao721)\
**Post date:** [March 10, 2022, 6:05am UTC](https://community.neo4j.com/t/graph-neural-networks-and-neo4j/19983/13 "2022-03-10T06:05:59Z")

</div>

hello sir,I also start the rearch about the application of GNN on neo4j,but I do not know how to extract data from Neo4j and use Python to run GNN models.Could you give me some help?
