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


Java JanusGraph.traversal方法代码示例

本文整理汇总了Java中org.janusgraph.core.JanusGraph.traversal方法的典型用法代码示例。如果您正苦于以下问题:Java JanusGraph.traversal方法的具体用法?Java JanusGraph.traversal怎么用?Java JanusGraph.traversal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.janusgraph.core.JanusGraph的用法示例。


在下文中一共展示了JanusGraph.traversal方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: main

import org.janusgraph.core.JanusGraph; //导入方法依赖的package包/类
public static void main(String argv[]) throws Exception {
  JanusGraph graph = JanusGraphFactory.open(Schema.CONFIG_FILE);
  HadoopQueryRunner q = new HadoopQueryRunner(graph.traversal(), "testUser1");
  int runs = 10;

  for(int i =0; i < runs; i++) {
    LOGGER.info("New timeline (run {} of {})", i+1, runs);
    q.printTimeline(q.getTimeline3(10));
  }
  q.close();
  graph.close();
}
 
开发者ID:marcelocf,项目名称:janusgraph_tutorial,代码行数:13,代码来源:NewTimeline.java

示例2: main

import org.janusgraph.core.JanusGraph; //导入方法依赖的package包/类
public static void main(String argv[]) throws Exception {
  JanusGraph graph = JanusGraphFactory.open(Schema.CONFIG_FILE);
  HadoopQueryRunner q = new HadoopQueryRunner(graph.traversal(), "testUser1");
  int runs = 10;

  for(int i =0; i < runs; i++) {
    LOGGER.info("Previous timeline (run {} of {})", i+1, runs);
    q.printTimeline(q.getTimeline2(10));
  }
  q.close();
  graph.close();
}
 
开发者ID:marcelocf,项目名称:janusgraph_tutorial,代码行数:13,代码来源:OldTimeline.java

示例3: get

import org.janusgraph.core.JanusGraph; //导入方法依赖的package包/类
private static Vertex get(final JanusGraph graph, final String key, final String value) {
    final GraphTraversalSource g = graph.traversal();
    final Iterator<Vertex> it = g.V().has(key, value);
    if (it.hasNext()) {
        return it.next();
    }
    return null;
}
 
开发者ID:awslabs,项目名称:dynamodb-janusgraph-storage-backend,代码行数:9,代码来源:MarvelGraphFactory.java

示例4: main

import org.janusgraph.core.JanusGraph; //导入方法依赖的package包/类
public static void main(String[] args) {
    JanusGraph graph = JanusGraphFactory.open("conf/janusgraph-berkeleyje-lucene.properties");
    GraphTraversalSource g = graph.traversal();
    if (g.V().count().next() == 0) {
        // load the schema and graph data
        GraphOfTheGodsFactory.load(graph);
    }
    Map<String, ?> saturnProps = g.V().has("name", "saturn").valueMap(true).next();
    LOGGER.info(saturnProps.toString());
    List<Edge> places = g.E().has("place", Geo.geoWithin(Geoshape.circle(37.97, 23.72, 50))).toList();
    LOGGER.info(places.toString());
    System.exit(0);
}
 
开发者ID:pluradj,项目名称:janusgraph-java-example,代码行数:14,代码来源:JavaExample.java

示例5: main

import org.janusgraph.core.JanusGraph; //导入方法依赖的package包/类
/**
 * Run every example query, outputting results via @LOGGER
 *
 * @param argv
 * @throws Exception
 */
public static void main(String[] argv) throws Exception {
  JanusGraph graph = JanusGraphFactory.open(Schema.CONFIG_FILE);
  GraphTraversalSource graphTraversalSource = graph.traversal();

  QueryRunner queryRunner = new QueryRunner(graphTraversalSource, "testUser0");

  LOGGER.info("Initialized the builtin query executor");

  queryRunner.runQueries();

  queryRunner.close();

  graph.close();

  System.exit(0);
}
 
开发者ID:marcelocf,项目名称:janusgraph_tutorial,代码行数:23,代码来源:BuiltinQueries.java


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