addV

Specify a vertex from a traversal.

Synopsis

g.addV('vertexLabel')
   .[ property ('property_key') ... ]
Table 1. Legend
Syntax conventions Description
Lowercase and uppercase Literal keyword. Includes ().
Italics Variable value. Replace with a user-defined value.
[] Optional. Square brackets ( [] ) surround optional command arguments. Do not type the square brackets.
{} Group. Braces ( {} ) identify a group to choose from. Do not type the braces.
| Or. A vertical bar ( | ) separates alternative elements. Type any one of the elements. Do not type the vertical bar.
... Repeatable. An ellipsis ( ... ) indicates that you can repeat the syntax element as often as required.

Description

The addV() step is a map/sideEffect. A vertex is added from a traversal g using addV. A previously created vertex label must be specified. Property key-value pairs may be optionally specified.

Examples

Create a vertex with a vertex label person with the properties personId, name, and gender.
g.addV('person').
   property('personId', 25).
   property('name','Stephen Smith').
   property('gender', 'M')