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 1 OVER e1 YIELD $^.start.name AS startName, $$.end.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 1 OVER e1 YIELD e1.prop1
For Build-in Properties¶
There are four build-in properties in the edge:
- _src: source vertex ID of the edge
- _dst: destination ID of the edge
- _type: edge type
- _rank: 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 1 OVER e1 YIELD e1._src as startVID /* which is, 1 */, e1._dst as endVID
This statement returns all the neighbors of vertex
1 over edge type
e1, by referencing
e1._src as the starting vertex ID (which, of course, is
e1._dst as the ending vertex ID.