Fixing Neo4j Graph Visualization Colors: Axiom vs Resource

Resumo

This discussion on the Neo4j server addresses a common visualization challenge where Resource labels override Axiom label colors in Neo4j Desktop. The community explores solutions for adjusting label priority to match specific graph visualization requirements found in technical literature. By modifying label assignments and ordering, users can effectively control node color rendering in their graph results.

amberharbor-15 OP

Hello,

I'm running a query from the listing 3.18 of https://www.manning.com/books/knowledge-graphs-and-llms-in-action

MATCH path1=(n:HpoPhenotype)<-[:SUBCLASSOF]-(m:HpoPhenotype) WHERE n.label = "Diabetes mellitus" 
WITH path1 
MATCH path2=(i:HpoPhenotype)<-[ :ANNOTATEDSOURCE]-(j)
WHERE i.label in ["Diabetes mellitus", "Type I diabetes mellitus"]
WITH path1, path2, j
MATCH path3=(j)-[:ANNOTATEDPROPERTY|HASSYNONYMTYPE]-()
RETURN path1, path2, path3;

In the book, this gives a colour-coded graph with two different node colours. But I see that Resource labels' colour overrides Axiom label colour, and everything looks green in Neo4j Desktop.

How do I make the graph visualisation look like in the book?

Fixing Neo4j Graph Visualization Colors: Axiom vs Resource - Image 1
Fixing Neo4j Graph Visualization Colors: Axiom vs Resource - Image 2

@amberharbor-15 Hello, I'm running a query from the listing 3.18 of https://www.manning.com/books/knowledge-graphs-…
happybeacon-37

let me tag a team member!

goldenquartz-17

I sent this author a note 🙂

warmranger-95

hi there, probably there are some differences between the version we used when we worked at the book and the current version. If the label are returned in alphabetical order my suggestion would be to change Resource label in _Resource and this should privilege the other ordering in the visualisation. If this doesn't fix probably is the order of assignment that define the order in the visualisation at that point I would try remove add a new label and see if it wins in the visual order. If so, then add a temporary new label (to find the nodes you need), remove the old one and re-add it again.

let me know which worked

amberharbor-15 OP

thank you for the reply. I didn't hope that the author's book is hanging out here.

Unfortunately, this is beyond my Neo4j expertise level. I'll try to pop on a Neo4j meetup and ask people to show me around.

Meanwhile I'll just progress with a book. Thank you for writing it.

As últimas novidades de Neo4j