本文整理汇总了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();
}
示例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();
}
示例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;
}
示例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);
}
示例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);
}