org.janusgraph.example.GraphOfTheGodsFactory Java Examples

The following examples show how to use org.janusgraph.example.GraphOfTheGodsFactory. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: LoadData.java    From janusgraph-visualization with Apache License 2.0 5 votes vote down vote up
public static void main(String[] args) {
    ClassPathResource classPathResource = new ClassPathResource("janusgraph.properties");
    File file = classPathResource.getFile();
    String path = file.getPath();
    JanusGraph graph = JanusGraphFactory.open(path);
    GraphTraversalSource g = graph.traversal();
    g.V().drop().iterate();
    g.tx().commit();
    graph.tx().commit();
    GraphOfTheGodsFactory.load(graph);
    graph.close();
}
 
Example #2
Source File: JavaExample.java    From janusgraph-java-example with Apache License 2.0 5 votes vote down vote up
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<Object, Object> 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);
}
 
Example #3
Source File: GraphOfTheGodsTest.java    From dynamodb-janusgraph-storage-backend with Apache License 2.0 4 votes vote down vote up
public GraphOfTheGodsTest(final TestCombination combination) {
    graph = TestGraphUtil.instance.openGraph(combination.getDataModel());
    GraphOfTheGodsFactory.loadWithoutMixedIndex(graph, true);
}