Skip to content

Setup Unipop in JVM application

seanbarzilay edited this page Oct 10, 2017 · 1 revision

To use Unipop in a JVM based application we can use Maven as our dependency manager and add the required modules in the dependencies section of your pom.xml file.

The coordinates for the modules are

<dependency>
    <groupId>com.github.unipop-graph</groupId>
    <artifactId>unipop-elastic</artifactId>
    <version>0.2.1</version>
</dependency>
<dependency>
    <groupId>com.github.unipop-graph</groupId>
    <artifactId>unipop-jdbc</artifactId>
    <version>0.2.1</version>
</dependency>
<dependency>
    <groupId>com.github.unipop-graph</groupId>
    <artifactId>unipop-rest</artifactId>
    <version>0.2.1</version>
</dependency>

Then you can simply use it in your code by:

import org.unipop.structure.UniGraph;

class MyClass {
    private UniGraph graph;
    private GraphTraversalSource g;

    public MyClass(Configuration conf) {
        this.graph = UniGraph.open(conf);
        this.g = graph.traversal();
    }
}