Froodooo
Froodooo

Reputation: 177

Load example GraphSON file in Gremlin with Cassandra

I'm trying to load the example Graph of the Gods file that is distributed with Titan with the loadGraphSON function. I have executed the following steps and are working with Titan 0.5.4 with Hadoop 2.

  1. Downloaded and unpacked a fresh Titan 0.5.4 with Hadoop 2.
  2. Started Titan, Rexster, Cassandra, ElasticSearch with the command bin/titan.sh -c cassandra-es start
  3. Run Gremlin with: bin/gremlin.sh
  4. Open a new TitanFactory instance with the required settings: g = TitanFactory.open('conf/titan-cassandra-es.properties')
  5. Then I tried to load the Graph of the Gods from the examples-directory with g.loadGraphSON("examples/graph-of-the-gods")

I do not get an error, but trying to show all vertices with g.V returns nothing. Am I executing the rights steps here, or am I doing something wrong?

Upvotes: 1

Views: 2001

Answers (2)

charrison
charrison

Reputation: 857

If you're not setting up a Titan Hadoop job, you could try using the Blueprints GraphSON reader to load graph data. See https://github.com/tinkerpop/blueprints/wiki/GraphSON-Reader-and-Writer-Library

In a Gremlin shell it looks a bit like this:

inStream = new FileInputStream("../examples/graph-of-the-gods.json")
GraphSONReader.inputGraph(g, inStream)

Upvotes: 0

stephen mallette
stephen mallette

Reputation: 46226

Note that this question was answered on the Aurelius Graphs Mailing List:

https://groups.google.com/d/msg/aureliusgraphs/FiCvX891r6g/BkmWj3xc3ikJ

Basically:

1) the filename should be examples/graph-of-the-gods.json

2) you can also use GraphOfTheGodsFactory.load(g) which will also create indexes and type definitions

I'd say the second point above would be the preferred manner in which to load Graph of the Gods.

Upvotes: 0

Related Questions