Giter VIP home page Giter VIP logo

janusgraph_tutorial's Introduction

JanusGraph tutorial

NOTE: it goes without saying that you need a properly configured JDK in your environment.

This is a hands on guide for JanusGraph. It is organized in sections (each folder is an independent project with a section) and it is expected you follow each guide in order.

Starging Janus Graph

Every code here assumes you are running JanusGraph 0.1.0 locally.

For the lazy

You should be ashamed. BUT, here is a shortcut:

./start_janus.sh

For the ones that want to really learn stuff

This is fairly simple; just download janus and tell it to start up.

$ wget https://github.com/JanusGraph/janusgraph/releases/download/v0.1.0/janusgraph-0.1.0-hadoop2.zip
$ unzip janusgraph-0.1.0-hadoop2.zip 
$ cd janusgraph-0.1.0-hadoop2/
$ ./bin/janusgraph.sh start

The last command should output:

Forking Cassandra...
Running `nodetool statusthrift`.. OK (returned exit status 0 and printed string "running").
Forking Elasticsearch...
Connecting to Elasticsearch (127.0.0.1:9300)... OK (connected to 127.0.0.1:9300).
Forking Gremlin-Server...
Connecting to Gremlin-Server (127.0.0.1:8182)..... OK (connected to 127.0.0.1:8182).
Run gremlin.sh to connect.

Meaning you have cassandra and elasticsearch listening on the loopback interface. This is important for the examples to work.

If you need to clean your data:

  1. stop janus graph
  2. rm -rf db
  3. start janus graph

It is also recommended that you read:

Why

I wrote this guide after trying to find my way through this technology. I had to learn it because the traditional tools were not enough for the kind of data processing required in the task assigned to me.

JanusGraph has proven to be a solid and reliable solution to our project and I hope this guide is useful for you.

This is by no means a complete guide to JanusGraph. But I believe that following this using the official documentation as a reference is enough framework for you to really dive into this technology.

Scope

On this tutorial we will build the backend database of a twitter clone. The sections are divided into:

  1. basic schema
  2. data loading
  3. querying
  4. hadoop integration
  5. indexing for performance

By the end of this tutorial you should be able to design your own (very simple but functional) database backend using JanusGraph.

There is also a last section included with some recommended experiments for after you are done.

Code

Every Java code depends on the main schema class. This is a design decision to reuse code and have more consistency in naming. Also, by doing so, we avoid usage of hard coded Strings as much as possible.

To ease your life, there is a simple shell script in each section called run.sh. This will build and evoke the example code for you.

Java

We are using the standard gradle application plugin naming conventions on Java projects; this means that we have the folders:

/src/main/
  dist
  resources
  java

Inside dist you will find the JanusGraph configuration files. Each section has its own files. In resources there is the log4j.properties file. And java contains the implementation.

Ruby

In our ruby example codes we are relying on:

  • RVM: for ruby version management (if you use someting different, please prepare your env).
  • bundler (gem install bundler): for dependency management.
  • gremlin driver gem: a really simple driver in ruby for JanusGraph.

janusgraph_tutorial's People

Contributors

ngocson2vn avatar beylerian avatar

Watchers

James Cloos avatar Sai Krishna Makineni avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.