Normal JSON to GraphSON format & how to load

416 views
Skip to first unread message

Adrian Pop

unread,
Jul 5, 2017, 9:49:52 AM7/5/17
to Gremlin-users

I have two questions:

  1. 1. Where I can actually find the basic format for a GraphSON file, that is guaranteed to be successfully loaded by the gremlin console? I'm trying to convert a JSON (with about 10-20 fields) to another file that can be queried by gremlin but I can't actually find any relevant information about the fields reserved by the graphson format or how I should handle the IDs etc. I exported the modern graph they provide and it's not even a valid JSON (Multiple JSON root elements), but a list of JSONs [1] I also saw fields like outE, inE...are these fields something I manually have to create?

  2. 2. If I am able to create the JSON, where do I tell the server to load it as the base graph when I start it? In the config file or in the script?

Thanks! Adrian

[1] https://pastebin.com/drwXhg5k


Stephen Mallette

unread,
Jul 5, 2017, 10:41:48 AM7/5/17
to Gremlin-users

--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/3ed95ec3-85d5-49de-98e2-1b72eb80b101%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Adrian Pop

unread,
Jul 5, 2017, 12:55:38 PM7/5/17
to Gremlin-users
I still find it difficult to create a new graph from an existing JSON (where each field must be a vertex and between each of them must be an edge => for n fields => n vertices => n * (n + 1) / 2 edges). But...the outE and inE are kind of hard to make, in my oppinion. Using the wrapAdjacencyList property does not make this any easier, because it's exactly the other way around. There isn't a parser that does this, right? 

By the way, if I actually manage to create a graph with the first method, if I use gremlin.tinkergraph.graphLocation and gremlin.tinkergraph.graphFormat in the config file, I will be able to use it right away, right? The property of graphLocation will be the path to the JSON I just generated and it will know to automatically load and parse it.
Reply all
Reply to author
Forward
0 new messages