GithubHelp home page GithubHelp logo

okuc / titan-web-example Goto Github PK

View Code? Open in Web Editor NEW

This project forked from thinkaurelius/titan-web-example

0.0 2.0 0.0 163 KB

This is an example project that shows one way to build a RESTful Java web app around Titan, Cassandra, and Elasticsearch.

License: Apache License 2.0

Groovy 9.69% Java 59.74% HTML 2.43% Ruby 3.09% Shell 25.05%

titan-web-example's Introduction

titan-web-example

This is an example project that shows one way to build a RESTful Java web app around Titan, Cassandra, and Elasticsearch.

Cassandra is used in Remote Server Mode. Elasticsearch is used remotely as well.

The "web portion" of the application is built using Spring (with annotations based config), JAX-RS, and Jersey. It is assumed that you are already familiar with these technologies.

This project also shows how Groovy classes can be injected into a Java web app to enable Gremlin Groovy sweetness. (See GroovyGraphOp.groovy.)

The Graph of the Gods example data set is used.

A Servlet Filter is used to show how TitanGraph transactions can be managed with pre/post request Filters.

A Vagrant box is provided that hosts Cassandra and Elasticsearch.

This project is built against Titan 0.5.0. and TinkerPop 2.5.0.

Getting Started

If you prefer to install Cassandra and Elasticsearch manually then skip the first 3 steps but make sure you adjust the titan-cassandra-es.properties file's host values accordingly. You can use the Vagrant file and bootstrap script for installation information.

  • Install Virtual Box (because you need it for Vagrant).

  • Install Vagrant.

  • Vagrant up! This will start a VM that has compatible versions of Cassandra and Elasticsearch running. The host IP is 10.10.10.10. The VM also contains a Titan distribution with a pre-configured titan-cassandra-es.properties file that you can use for local gremlin shell access. (The Titan distro isn't actually used by the web app at all.)

cd titan-web-example/vagrant; vagrant up
  • Load the project in your favorite IDE (or compile and run the following via mvn).

  • Run the classesthatrunthings.PopulateDB class. This will load the "Graph of the Gods" example data set.

  • Run the classesthatrunthings.RunApp class. This will launch the web app in an embedded Jetty container.

  • Visit http://localhost:9091

Try the links. If they work then you're ready to dig in to the code and see what's happening. The TitanWebService class is a great place to start.

Resources

Titan Docs

http://gremlindocs.com

http://thinkaurelius.com/blog/

Q&A happens in the Aurelius Google Group or on http://stackoverflow.com. If you have questions then those are the best places to search first.

titan-web-example's People

Contributors

desertblade avatar dimitrijs avatar rjbriody avatar

Watchers

 avatar  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.