Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
12-09-2020 06:57 PM
I tried to find Ingredients DC in the Recipe graph from GDS playground but found no way to get it.
I found a video explaining it easily with other method but it seems not so easy with GDS:
I tried several things I can imagine but still failed:
call gds.alpha.degree.stream({
nodeProjection: ['Ingredient', 'Recipe'],
relationshipProjection: 'CONTAINS_INGREDIENT'}) yield nodeId, score
match (n) where id(n)= nodeId
return n, score order by score desc limit 10
==> this returns scores for Recipe not Ingredient.
I know how to get the number of edges of Ingredients and divide them with the total number of Recipe and it will be DC of Ingredients:
match p = (i:Ingredient)--(:Recipe) return i, count(p) as degree order by degree desc limit 10
But I need to show customer doing it with GDS if there is a way.
Solved! Go to Solution.
12-20-2020 04:09 PM
I think you need to inverse your relationship direction for GDS
otherwise you can also just use size( (ingredient)<-[:CONTAINS_INGREDIENT]-()) as degree
in a regular cypher query.
12-20-2020 04:09 PM
I think you need to inverse your relationship direction for GDS
otherwise you can also just use size( (ingredient)<-[:CONTAINS_INGREDIENT]-()) as degree
in a regular cypher query.
12-21-2020 02:39 AM
Hi Michael.
Yes. Now I found it in the latter part of the guide.
https://guides.neo4j.com/4.0-intro-graph-algos-exercises/PracticalApplication.html
Happy Christmas!
Dongho.
All the sessions of the conference are now available online