'Calling properties from all vertices on a graph path in gremlin

I am building a heterogenous graph database looking at organisational structures. The vertices are: people, role, entity and each have different properties.

I want to be able to return properties from the different vertices but can’t seem to get all three vertices and multiple properties from each of them.

Any ideas?



Solution 1:[1]

from what I see in your comment

(first name, last name, age) —(fills)—> role (role name, role type, rank) <— (has) — entity (entity name, address, entity type)

You can try:

g.V("person").
  has("first name", "Bob").
  out("fils").as("a").
  in("has").as("b").
  select("a", "b").by(valueMap())

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 PrashantUpadhyay