2
votes

I am a Neo4j beginner and grateful for the Neo4j browser to show visualisations. I am using Neo4j 2.2 because it's the version being used in the book I'm following along with

Please help me try to understand if I have a syntax error or more specifically, if there's a gap in my understanding about how nodes are created.

I would like to achieve this:

enter image description here

Creating Node - Matthew

As you can see node 'Matthew' has the name overlaid on top of it. Hovering over, and you see the properties and labels. Note the property 'Name' enter image description here

I used this Cypher query to create it

CREATE (matthew:MALE:STUDENT {Name:'Matthew', surname:'Cooper',age:36, country:'US'});

Creating Node - Lisa

Node Lisa has the name overlaid on it too. If you hover over you see enter image description here

I used the following Cypher query

CREATE (lisa:FEMALE {name:'Lisa', surname:'Adams', age:15, country:'Canada'});

The Question

Note that the name property in the Matthew query is spelt with Sentence case ie Name and the Lisa query is spelt in lower case name If I create a Lisa node with sentence case, the name won't be overlaid over the top. Why is this? I would have thought they'd be the same. What's the difference between 'Name' and 'name' Are cypher query properties case-sensitive?

Here is a screenshot of executing the Lisa cypher query using the same spelling of the name and the property isn't overlaid on the node in the visualisation.

enter image description here

1
Attribute names and values are case sensitive in Neo4j. I expect the reason it does not show up after the fact is that the display property for the FEMALE labels is not set properly. Click on the FEMALE label at the top of the browser so you can set the display property for that particular label at the bottom. - Dave Bennett
This is the correct answer. Quite why I needed to explicitly set that in the UI I don't know. It was set by default/automagically for the Male label. Thank you! - HowApped
It was probably auto-correlated to something else the first time you created the FEMALE node. It would then remain that way until you switched it after the fact. - Dave Bennett
Thanks Dave. His first was the correct answer. - HowApped

1 Answers

0
votes

Yes Cypher properties are case sensitive.

It uses a heuristic on which attributes to show as caption and stores that in the styling, which you can see with :style.

You can download and edit and upload that file again or override it with a command like this

:style 
node { color: ... }
...

In the caption attribute you see which property is used.

see also: https://neo4j.com/developer/guide-neo4j-browser/#_styling_neo4j_browser_visualization