You can refer a vertex or edge's property in
Reference From Vertex¶
For Source Vertex¶
$^ is used to get a source vertex's property,
tag_name indicates the source vertex's
prop_name specifies the property name.
For Destination Vertex¶
$$ indicates the ending vertex,
prop_name are the vertex's tag and property respectively.
nebula> GO FROM 100 OVER follow YIELD $^.player.name AS startName, $$.player.age AS endAge;
Use the above query to get the source vertex's property name and ending vertex's property age.
Reference From Edge¶
You can use the following syntax to get an edge's property.
edge_type is the edge's type, meanwhile
edge_prop is the property.
nebula> GO FROM 100 OVER follow YIELD follow.degree;
For Built-in Properties¶
There are four built-in properties in the edge:
- _src: source vertex ID of the edge
- _dst: destination ID of the edge
- _type: edge type
- _ranking: the edge's ranking
You can use
_dst to get the starting and ending vertices' ID, and they are very commonly used to show a graph path.
nebula> GO FROM 100 OVER follow YIELD follow._src AS startVID /* starting vertex is 100 */, follow._dst AS endVID;
This statement returns all the neighbors of vertex
100 over edge type
follow, by referencing
follow._src as the starting vertex ID (which, of course, is
follow._dst as the ending vertex ID.