Created
August 26, 2014 00:42
-
-
Save jpemberthy/3393d1ed0dd454f8ab7b to your computer and use it in GitHub Desktop.
titan.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Apache Titan | |
[http://thinkaurelius.github.io/titan/](http://thinkaurelius.github.io/titan/) | |
### What is it? | |
They sell it as a scalable graph database optimized for storing and querying graphs containing hundreds of billions AND TRILLIONS of vertices and edges distributed across a multi-machine cluster. | |
So if that's true, we should be able to use at WHI. | |
--- | |
### Some Features | |
* Support for various storage backends including **Cassandra**. | |
* Native integration with the [TinkerPop](http://www.tinkerpop.com) graph stack. | |
* Gremlin: a domain specific language for traversing property graphs. | |
* Rexster: a graph server that exposes any Blueprints graph through several mechanisms with a general focus on REST. | |
* A lot more ... | |
---- | |
### Basic Introduction with Cassandra. | |
Create a graph | |
```xml | |
<graph> | |
<graph-name>demo</graph-name> | |
<properties> | |
<storage.backend>cassandra</storage.backend> | |
<storage.keyspace>demo</storage.keyspace> | |
</properties> | |
</graph> | |
``` | |
--- | |
Add a few Vertices | |
```ruby | |
justin = g.addVertex(null, [ name: "Justin", type: "user" ]) | |
selena = g.addVertex(null, [ name: "Selena", type: "user" ]) | |
efron = g.addVertex(null, [ name: "Efron", type: "user" ]) | |
pony = g.addVertex(null, [ name: "My Little Pony", type: "entry" ]) | |
``` | |
Add a few Edges | |
```ruby | |
g.addEdge(justin, pony, "hearted") | |
g.addEdge(selena, pony, "hearted") | |
``` | |
Commit your changes! | |
```ruby | |
g.commit() | |
``` | |
--- | |
Simple operations traversing the graph | |
```ruby | |
justin.out("hearted").map | |
# ==> { name=My Little Pony, type=entry } | |
selena.out("hearted").map | |
# ==> { name=My Little Pony, type=entry } | |
selena.out("friend").out("hearted").map | |
g.commit() | |
g.addEdge(selena, justin, "friend") | |
selena.out("friend").out("hearted").map | |
# ==> { name=My Little Pony, type=entry } | |
``` | |
--- | |
### Helen | |
Manipulate and traverse Titan graphs via Rexster. | |
[github.com/jpemberthy/helen](http://github.com/jpemberthy/helen) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment