I have created two vertices, one with label "Book" and another with label "User". The "Book" vertex has a property called "title" and the "User" vertex has the properties "first_name" and "last_name".
SELECT * FROM cypher ('goodreads_db', $$
MATCH (v)
RETURN v
$$) as (v agtype);
v
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
{"id": 844424930131969, "label": "User", "properties": {"read": 9, "country": "Brazil", "reading": 2, "last_name": "Matsumoto", "first_name": "Matheus"}}::vertex
{"id": 1125899906842625, "label": "Book", "properties": {"pages": 336, "title": "To Kill a Mockingbird", "author": "Harper Lee", "rating": 4.27, "ratings": 5574002, "reviews": 107847, "language": "English"}}::vertex
(2 rows)
When I try to visualize these nodes on AGE Viewer, it does not show the book title nor the user’s first name on top of their vertices. Instead, it shows the book’s id and nothing on the user’s vertex (image below). Is there any way that I can output the book’s title and the user’s first name instead of what is currently displaying? If so, how?
3
Answers
I don’t think you can change what shows on the top as of now in Age Viewer. But you can do that on the console:
You can find a way to change the id value to an alias, but as of now we cannot change what’s on top.
Yes! Apache-age provides you the facility to visualize the properties on the top of their vertices.
Since it depends on the creation of nodes, if you had provided the query for creating nodes then I would be more clear to work on problem.
But I have took example to show the working.
Let’s walk through the example to clearly understand it.
First let’s create PERSON nodes
Now creates some nodes for COUNTRY.
Create the relationship between nodes
Visualizeing the graph created.
Here is the result:
There is a field above the graph with a list of the nodes and edges’ labels, click on the label you want to change and a menu will appear below the graph, then choose the "caption" you want to display, that’s what will show on top of the vertex.