0

I have 565 articles in Neo4j and I ran LPA to obtain clusters.

I have the following result: 69 communities.

I would like to display all the communities at the same time in Neo4j.

I tried several Cypher queries with the property key 'community' but it didn't work.

My data looks like this:

enter image description here

How can I do it ?

cybersam
  • 63,203
  • 6
  • 53
  • 76
LJRB
  • 199
  • 2
  • 11
  • Show what you have tried. – cybersam Aug 06 '20 at 23:09
  • I tried this : `MATCH (n) WHERE EXISTS(n.community) RETURN n, n.community` It displays all the article nodes but not the communities. When I do this : `MATCH (n) WHERE n.community = 1102 RETURN n, n.title` I can see one community. – LJRB Aug 07 '20 at 08:19
  • I think this is a simple issue. You are probably using the neo4j Browser's `Graph` [view](https://neo4j.com/docs/browser-manual/current/operations/result-frames/), which only shows returned nodes and relationships. Try using the `Text` or `Table` view to see all the returned values. Your first query should work. – cybersam Jan 20 '23 at 19:56

1 Answers1

3

Presumably, you are using the neo4j Browser to visualize your results.

When your Cypher query returns any nodes, relationships, or paths, the browser will automatically show you the Graph view (on the left side of the result panel, you should see icons with captions that may include Graph, Table, Text, etc.). The Graph view only shows nodes and relationships, and not anything else that was returned.

However, if you click on the other icons (say, Table or Text), you should see more results -- like the communities, presented in different formats.

By the way, specifying the node label would make your query more efficient (and adding an index would make it even more efficient if you have a lot of ARTICLE nodes):

MATCH (n:ARTICLE) WHERE EXISTS(n.community)
RETURN n, n.community
cybersam
  • 63,203
  • 6
  • 53
  • 76