Anant example-janusgraph-notebook

License: Apache License 2.0

Language: Jupyter Notebook

JanusGraph Notebook

A tutorial for running JanusGraph on Cassandra and Elasticsearch, and then integrating within AWS Graph Notebook.

For more information, see the blog post.

Setup

Start everything using docker-compose

docker-compose up -d

You can now find it open in http://localhost:8888

Login using password: tensorflow

Setup a connection in a notebook

Out of the box, the Graph Notebook lib provides dozens of notebooks to try out. Unfortunately those with seed data for loading into your graph mostly don't work since they use custom string ids, and JanusGraph doesn't support that.

However, you can load in the air routes data manually using the commands below, which will allow you to use the Air-Routes-Gremlin notebook

Load seed data

./scripts/load-in-airroutes.sh
docker cp ./tmp jg-notebook-janusgraph:/opt/tmp/

docker exec -it jg-notebook-janusgraph ./bin/gremlin.sh
:remote connect tinkerpop.server conf/remote.yaml
g = traversal().withRemote('conf/remote-graph.properties')
path = "/opt/tmp/air-routes.xml";
g.io(path).read().iterate();

Run this at the top of any notebook that you try. Do it here as well.

%%graph_notebook_config
{
  "host": "janusgraph",
  "port": 8182,
  "ssl": false,
  "gremlin": {
    "traversal_source": "g"
  }
}

Example of how this works is given here: http://localhost:8888/notebooks/notebooks/sample-config.ipynb

Run the notebook!

You can find it here: http://localhost:8888/notebooks/notebooks/sample-config.ipynb

Start a console

Want to just use your standard Gremlin console for whatever reason?

docker exec -it jg-notebook-janusgraph ./bin/gremlin.sh
:remote connect tinkerpop.server conf/remote.yaml
g = traversal().withRemote('conf/remote-graph.properties')

# g.V() or whatever you want to run

TODOs

  • Add script or docs to index into Elasticsearch (we have ES setup - but out of the box it isn't being used!)

Credits:

Based heavily on:

Related Tools

GrafanaCassandraDatasource

License : MIT License

Language : Go

82

10

27

Ansible Dse

License : No License

Language : Python

Charts

License : Apache License 2.0

Language : Shell

Cql Vim

License : No License

Language : Vim script

Need Cassandra Training?

WE GOT YOU COVERED.

Anant US provides online training for Apache Cassandra that covers all the important skills you need to know in order to work with this high performance, open source NoSQL database.

Join Our Newsletter!

Sign up below to receive email updates and see what's going on with our company.