panza
panza

Reputation: 1431

Convert Json file into GraphJSON to be imported into Titan

I have been looking at ways to convert a JSON file into a GraphJSON graph and I have come across the GraphJSON Reader and Writer Library.

However, what I do not really understand is whether I can read out directly from a path where a JSON file resides and parse it into a graph/GraphJSON.

Can you help?

Upvotes: 1

Views: 386

Answers (1)

Mohamed Taher Alrefaie
Mohamed Taher Alrefaie

Reputation: 16253

This is how I would solve this issue:

  1. Read your JSON files using GSON or Jackson, then
  2. Feed this data into a subclass of Vertex/Edge of your implementation of these Tinkerpop 3 interfaces.
  3. Use the GraphSON writer methods to "graphitise" your data, save your data into an OutputStream.

I'm assuming you're using Tinkerpop3 and Titan 1.0.0, this is the right documentation.

Good luck!

P.S: If you're doing this for the sack of importing data into Titan, you might be overcomplicating the issue of data import. Just import it straight away.

Upvotes: 1

Related Questions