当前位置: 首页>>代码示例>>Java>>正文


Java GraphTraversal.select方法代码示例

本文整理汇总了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;
}
 
开发者ID:karthicks,项目名称:gremlin-ogm,代码行数:22,代码来源:Select.java

示例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;
}
 
开发者ID:graknlabs,项目名称:grakn,代码行数:36,代码来源:Fragment.java

示例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));
    }
}
 
开发者ID:graknlabs,项目名称:grakn,代码行数:13,代码来源:GraqlTraversal.java

示例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");
}
 
开发者ID:PKUSilvester,项目名称:LiteGraph,代码行数:6,代码来源:SelectTest.java

示例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");
}
 
开发者ID:PKUSilvester,项目名称:LiteGraph,代码行数:6,代码来源:SelectTest.java

示例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");
}
 
开发者ID:PKUSilvester,项目名称:LiteGraph,代码行数:6,代码来源:SelectTest.java

示例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");
}
 
开发者ID:PKUSilvester,项目名称:LiteGraph,代码行数:6,代码来源:SelectTest.java


注:本文中的org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal.select方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。