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 person_id, name, gender, nickname, and country.
g.addV('person').
   property('person_id', 'e7cd5752-bc0d-4157-a80f-7523add8dbcd' as UUID).
   property('name', 'Julia CHILD').
   property('gender','F').
   property('nickname', ['Jay', 'Julia'] as Set).
   property('country', [['USA', '1912-08-12' as LocalDate, '1944-01-01' as LocalDate] as Tuple, ['Ceylon', '1944-01-01' as LocalDate, '1945-06-01' as LocalDate] as Tuple, ['France', '1948-01-01' as LocalDate, '1960-01-01' as LocalDate] as Tuple, ['USA', '1960-01-01' as LocalDate, '2004-08-13' as LocalDate] as Tuple])