TinkerPop integration

Since BigConnect uses a native graph-based data model, it's just normal to think of Apache TinkerPop. For those that don't know, Apache TinkerPop™ is a graph computing framework for both graph databases (OLTP) and graph analytic systems (OLAP). The integration code is located in a new GitHub repository named bc-gremlin and is currently a working version.

All Gremlin traversal predicates are being pushed down to BigConnect, which in turn pushes them down to the search index, so numeric comparisons, text and geo matching should be really fast.

To get started, here is a step-by-step guide to launch a Gremlin Console on a BigConnect Graph.

  1. Download and unzip the Gremlin Console 3.4.0 from https://www.apache.org/dyn/closer.lua/tinkerpop/3.4.0/apache-tinkerpop-gremlin-console-3.4.0-bin.zip
  2. Clone the bc-gremlin GitHub repository: git clone https://github.com/mware-solutions/bc-gremlin.git
  3. Inside the bc-gremlin folder run mvn -Pgenerate-deps package
  4. Copy all jars from target/lib to the Gremlin Console installation folder, inside ext/bigconnect/plugin
  5. Copy target/bc-gremlin-0.9.jar to the Gremlin Console installation folder, inside ext/bigconnect/lib
  6. Inside the Gremlin Console installation folder, create a file named bc.properties inside the conf/ folder, with the following content:
gremlin.graph=com.mware.bigconnect.gremlin.structure.TinkerBcGraph=com.mware.ge.rocksdb.RocksDBGraphrocksdb.data.path=/tmp/bigconnect/datarocksdb.wal.path=/tmp/bigconnect/walstreamingPropertyValueDataFolder=/tmp/bigconnect/spvauths=Administrator
  1. Start the Gremlin Console using bin/gremlin.sh
  2. Activate the BigConnect plugin:
:plugin use bigconnectgraph = GraphFactory.open('conf/bc.properties')g = graph.traversal()
  1. Create a sample graph:
g.addV("airport").property("code","AUS").as("aus").
 addV("airport").property("code","DFW").as("dfw").
 addV("airport").property("code","LAX").as("lax").
 addV("airport").property("code","JFK").as("jfk").
 addV("airport").property("code","ATL").as("atl").
 addE("route").from("aus").to("dfw").
 addE("route").from("aus").to("atl").
 addE("route").from("atl").to("dfw").
 addE("route").from("atl").to("jfk").
 addE("route").from("dfw").to("jfk").
 addE("route").from("dfw").to("lax").iterate()
  1. Start querying
g.E().count().next()
g.V().count().next()

You can do the same thing from Java. Just add bc-gremlin as a Maven dependency to your project and create a new TinkerPop graph using the following sample code:

CODE: https://gist.github.com/flaviusburca/a35429b64e699ae67793d6a93a5e0096.js

Back to Blog