optional
Returns an optional result if the specified traversal yields a result; otherwise, returns the calling element.
Synopsis
optional(traversal\_fragment)
Examples
Returns the friends of John Doe, since he has friends:
g.V().has('person', 'name', 'John Doe').optional(out('knows'))
Returns Julia Child, since she has no linked friends:
g.V().has('person', 'name', 'Julia Child').optional(out('knows'))