Coder Social home page Coder Social logo

janusgraph-configuredgraphfactory's Introduction

JanusGraph-ConfiguredGraphFactory

The purpose of this repo is to share a base setup to run a docerized JanusGraph with a ConfiguredGraphFactory. This will bring up a JanusGraph and a Cassandra instances, setup a template configuration pointing to Cassandra and create a default graph called default_graph.

To bring it up run the following commands:

$ docker network create jgTestNetwork
$ docker-compose up -d

To tear it down:

$ docker-compose down
$ docker network rm jgTestNetwork

Connect with Gremlin

Once JanusGraph is running you should be able to connect using Gremlin as always and use ConfiguredGraphFactory to mange your graphs on-runtime.

  1. Connect to JanusGraph
gremlin> :remote connect tinkerpop.server conf/remote.yaml session
==>Configured localhost/127.0.0.1:8182-[0cba27bd-3ad3-44ba-9a97-9226f0490d9a]
gremlin> :remote console
==>All scripts will now be sent to Gremlin Server - [localhost/127.0.0.1:8182]-[0cba27bd-3ad3-44ba-9a97-9226f0490d9a] - type ':remote console' to return to local mode
  1. Access the default graph
gremlin> ConfiguredGraphFactory.getGraphNames()
==>default_graph
gremlin> default_graph_traversal.V().valueMap()
gremlin> default_graph_traversal.addV("Person").property("name","Dona").next()
==>v[4184]
gremlin> default_graph_traversal.V().valueMap()
==>{name=[Dona]}
  1. Create a new graph configuration
gremlin> map = [:]
gremlin> map.put("storage.backend", "inmemory")
==>null
gremlin> map.put("graph.graphname", "volatile_graph")
==>null
gremlin> ConfiguredGraphFactory.createConfiguration(new MapConfiguration(map))
gremlin> ConfiguredGraphFactory.getGraphNames()
==>default_graph
==>volatile_graph
gremlin> graph = ConfiguredGraphFactory.open("volatile_graph")
==>standardjanusgraph[inmemory:[127.0.0.1]]

janusgraph-configuredgraphfactory's People

Contributors

brunoberisso avatar twilmes avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

twilmes

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.