Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
02-11-2022 03:43 AM
Dear all,
I am currently facing problems of graph projection.
I used the example code of GDS_Retail_Demo from Alicia Frame for my own data set. But after running the louvain community I found out that no property (in my case: person's name) will be shown on the generated community graph. Then I was aware that my original node properties are not projected to my in-memory graph. Therefore, I would like to include them.
CALL gds.graph.create(
'PersonTopicgraphWithProperties',
{
Person: {properties: 'FirstName'},
Topic: {properties: 'Topic'}
},
'HAS_SKILLS'
)
YIELD graphName, nodeProjection, nodeCount AS nodes, relationshipCount AS rels
My intention was to do person segmentation based on their skills or expertise.
But I then got the error message that the projection doesn't support String.
How should I deal with that? If the GDS Library doesn't support any String type label, how should I know who is assigned to which Louvain community then?
Thank you
Best Regards
02-11-2022 02:36 PM
If you want to see who is in each louvain community, you can join that with the results of your algorithm using gds.util.asNode
:
CALL gds.louvain.stream('myGraph')
YIELD nodeId, communityId, intermediateCommunityIds
RETURN gds.util.asNode(nodeId).name AS name, communityId, intermediateCommunityIds
ORDER BY name ASC
what that will return is the string property - from the database - of name for each node id in your graph projection.
You can use a similar approach if you're exporting data, by specifying additionalNodeProperties
(see Export operations - Neo4j Graph Data Science)
02-16-2022 06:22 AM
Wow thanks! It works!
But I currently have some upcoming questions:
additionalNodeProperties
for exporting the graph:Thanks so much for help and sorry for so many upcoming questions.
Best Regards
All the sessions of the conference are now available online