Cypher Query to show Node Labels in Graph

There are a few things that could be happening here, but to be more precise, we'll need the Cypher query you're running.

  1. The text on a node in the Browser defaults to the value of the name property of that node.
  2. In the browser, you can select which property will be used for the text, for specific Labels.

The nodes which have no text have no value to display. It's that simple.

Breakdown

CREATE (a:Example {name:'this', name2: 'that'})

image

Click the Label at the top
image

And then chose a property at the bottom:
image

image

If you delete that property...
image

Showing labels in your graph.

The only way to do that reliably, without mutating your data, is with virtual nodes.
https://neo4j.com/docs/labs/apoc/current/virtual/
That's a deep rabbit-hole, so I'm not going into it.

The other thing you can do is just create a new property, and set it to the string of your labels...

MATCH (a)
SET a :Ex2
SET a.nameLabel = REDUCE(res = "", x in labels(a) | x + ", " + res)
RETURN a

image

1 Like