本文整理汇总了Java中org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal.select方法的典型用法代码示例。如果您正苦于以下问题:Java GraphTraversal.select方法的具体用法?Java GraphTraversal.select怎么用?Java GraphTraversal.select使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal
的用法示例。
在下文中一共展示了GraphTraversal.select方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: apply
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal; //导入方法依赖的package包/类
@Override
public GraphTraversal<Element, Map<String, Object>> apply(
GraphTraversal<Element, Element> traversal) {
GraphTraversal<Element, Map<String, Object>> selectTraversal;
if (selectKey2 == null) {
selectTraversal = traversal.select(selectKey1);
} else {
selectTraversal =
traversal.select(selectKey1, selectKey2, otherSelectKeys.toArray(new String[] {}));
}
if (selectKey1 != null) {
selectTraversal.by();
}
if (selectKey2 != null) {
selectTraversal.by();
}
otherSelectKeys.forEach(otherSelectKey -> {
selectTraversal.by();
});
return selectTraversal;
}
示例2: applyTraversal
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal; //导入方法依赖的package包/类
/**
* @param traversal the traversal to extend with this Fragment
* @param graph the graph to execute the traversal on
*/
public final GraphTraversal<Vertex, ? extends Element> applyTraversal(
GraphTraversal<Vertex, ? extends Element> traversal, GraknTx graph,
Collection<Var> vars, @Nullable Var currentVar) {
if (currentVar != null) {
if (!currentVar.equals(start())) {
if (vars.contains(start())) {
// If the variable name has been visited but the traversal is not at that variable name, select it
traversal.select(start().name());
} else {
// Restart traversal when fragments are disconnected
traversal.V().as(start().name());
}
}
} else {
// If the variable name has not been visited yet, remember it and use the 'as' step
traversal.as(start().name());
}
vars.add(start());
traversal = applyTraversalInner(traversal, graph, vars);
Var end = end();
if (end != null) {
assignVar(traversal, end, vars);
}
vars.addAll(vars());
return traversal;
}
示例3: selectVars
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal; //导入方法依赖的package包/类
private static <S, E> GraphTraversal<S, Map<String, E>> selectVars(GraphTraversal<S, ?> traversal, Set<Var> vars) {
if (vars.isEmpty()) {
// Produce an empty result
return traversal.constant(ImmutableMap.of());
} else if (vars.size() == 1) {
String label = vars.iterator().next().name();
return traversal.select(label, label);
} else {
String[] labelArray = vars.stream().map(Var::name).toArray(String[]::new);
return traversal.asAdmin().addStep(new SelectStep<>(traversal.asAdmin(), null, labelArray));
}
}
示例4: get_g_V_selectXaX
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal; //导入方法依赖的package包/类
@Override
public Traversal<Vertex, Object> get_g_V_selectXaX(final Pop pop) {
final GraphTraversal<Vertex, Vertex> root = g.V();
return null == pop ? root.select("a") : root.select(pop, "a");
}
示例5: get_g_V_selectXa_bX
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal; //导入方法依赖的package包/类
@Override
public Traversal<Vertex, Map<String, Object>> get_g_V_selectXa_bX(final Pop pop) {
final GraphTraversal<Vertex, Vertex> root = g.V();
return null == pop ? root.select("a", "b") : root.select(pop, "a", "b");
}
示例6: get_g_V_valueMap_selectXpop_aX
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal; //导入方法依赖的package包/类
@Override
public Traversal<Vertex, Object> get_g_V_valueMap_selectXpop_aX(final Pop pop) {
final GraphTraversal<Vertex, Map<String, Object>> root = g.V().valueMap();
return null == pop ? root.select("a") : root.select(pop, "a");
}
示例7: get_g_V_valueMap_selectXpop_a_bX
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal; //导入方法依赖的package包/类
@Override
public Traversal<Vertex, Map<String, Object>> get_g_V_valueMap_selectXpop_a_bX(final Pop pop) {
final GraphTraversal<Vertex, Map<String, Object>> root = g.V().valueMap();
return null == pop ? root.select("a", "b") : root.select(pop, "a", "b");
}