// Create an instance of the "Modern" toy graph graph = TinkerFactory.createModern() // Create the traversal source g = graph.traversal() // Get all vertices g.V() // Get the vertex with the ID "1" g.V(1) // Get the value of the "name" property on the vertex with the ID "1" g.V(1).values('name') // Start from the vertex with ID "1" and get the outgoing edges labeled "knows" g.V(1).outE('knows') // Get the names of the people vertex "1" knows (long version) g.V(1).outE('knows').inV().values('name') // Get the names of the people vertex "1" knows (concise version) g.V(1).out('knows').values('name') // Get the names of the people vertex "1" knows who are over the age of 30 g.V(1).out('knows').has('age', gt(30)).values('name')