本文整理汇总了Java中org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal.out方法的典型用法代码示例。如果您正苦于以下问题:Java GraphTraversal.out方法的具体用法?Java GraphTraversal.out怎么用?Java GraphTraversal.out使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal
的用法示例。
在下文中一共展示了GraphTraversal.out方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: applyTraversalInner
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal; //导入方法依赖的package包/类
@Override
public GraphTraversal<Vertex, ? extends Element> applyTraversalInner(
GraphTraversal<Vertex, ? extends Element> traversal, GraknTx graph, Collection<Var> vars) {
GraphTraversal<Vertex, Vertex> vertexTraversal = Fragments.outSubs(Fragments.isVertex(traversal));
if (required()) {
return vertexTraversal.outE(PLAYS.getLabel()).has(Schema.EdgeProperty.REQUIRED.name()).otherV();
} else {
return vertexTraversal.out(PLAYS.getLabel());
}
}
示例2: shouldWordWrapCorrectly
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal; //导入方法依赖的package包/类
@Test
public void shouldWordWrapCorrectly() {
GraphTraversal<?, ?> traversal = __.V().out().out();
String toString = traversal.explain().prettyPrint();
assertFalse(toString.contains("VertexStep(OUT,vertex),\n"));
//System.out.println(toString);
///
traversal = __.V().out().out().out().out();
toString = traversal.explain().prettyPrint();
assertTrue(toString.contains("VertexStep(OUT,vertex),"));
//System.out.println(toString);
///
for (int i = 0; i < 30; i++) {
traversal = __.V();
for (int j = 0; j < i; j++) {
traversal.out();
}
traversal.asAdmin().setStrategies(TraversalStrategies.GlobalCache.getStrategies(Graph.class));
toString = traversal.explain().prettyPrint();
if (i < 3)
assertFalse(toString.contains("VertexStep(OUT,vertex),\n"));
else {
assertTrue(Stream.of(toString.split("\n"))
.filter(s -> s.startsWith(" "))
.map(String::trim)
.filter(s -> Character.isLowerCase(s.charAt(0)))
.findAny()
.isPresent()); // all indented word wraps should start with steps
assertTrue(toString.contains("vertex"));
}
for (int j = 80; j < 200; j++) {
for (final String line : traversal.explain().prettyPrint(j).split("\n")) {
assertTrue(line.length() <= j);
}
}
// System.out.println(toString);
}
}
示例3: apply
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal; //导入方法依赖的package包/类
@Override
public GraphTraversal<Element, Vertex> apply(GraphTraversal<Element, Element> traversal) {
return traversal.out(label);
}