Write to gryo


Lilly <lfie...@...>
 


Hi everyone,

I am using Java and trying to write a Tinkergraph to Gryo format. To do so I tried:
g.io("file.kryo").write().iterate()
As suggested in the tinkerpop documentation.
However, this results in the following Exception:

Exception in thread "main" java.lang.IllegalArgumentException: Class is not registered: org.janusgraph.graphdb.relations.RelationIdentifier
Note: To register this class use: kryo.register(org.janusgraph.graphdb.relations.RelationIdentifier.class);

I could not find anything on how to perform this registration.
It works fine with graphml format.

Would be great if someone could help me out,
Thank you!
Lilly

Could some


"ow...@gmail.com" <owner...@...>
 

Seems you mean Janusgraph instead Tinkergraph

This snippet works as expected:

graph = JanusGraphFactory.build().
set("storage.backend","inmemory").
open()
g = graph.traversal()
g.addV().as("v1").addV().as("v2").addE("E").from("v1").to("v2")
g.tx().commit()
g.io("file.kryo").write()
g.io("file.kryo").read()
g.V()


четверг, 3 сентября 2020 г. в 11:20:12 UTC+3, Lilly:


Hi everyone,

I am using Java and trying to write a Tinkergraph to Gryo format. To do so I tried:
g.io("file.kryo").write().iterate()
As suggested in the tinkerpop documentation.
However, this results in the following Exception:

Exception in thread "main" java.lang.IllegalArgumentException: Class is not registered: org.janusgraph.graphdb.relations.RelationIdentifier
Note: To register this class use: kryo.register(org.janusgraph.graphdb.relations.RelationIdentifier.class);

I could not find anything on how to perform this registration.
It works fine with graphml format.

Would be great if someone could help me out,
Thank you!
Lilly

Could some


Lilly <lfie...@...>
 

Thank you for your answer.
The problem is, I was actually meaning a Tinkergraph which is constructed by "subgraphing" a janusgraph.
I also tried it in the console like so:

gremlin> subG = g.E().has("record_count",gt(4000)).subgraph("sub").cap("sub").next()
==>tinkergraph[vertices:122 edges:106]
gremlin> subG.traversal().io("test.kryo").write().iterate()
Class is not registered: org.janusgraph.graphdb.relations.RelationIdentifier
Note: To register this class use: kryo.register(org.janusgraph.graphdb.relations.RelationIdentifier.class);
Type ':help' or ':h' for help.
Display stack trace? [yN]
gremlin> kryo.register(org.janusgraph.graphdb.relations.RelationIdentifier.class)
No such property: kryo for class: groovysh_evaluate
Type ':help' or ':h' for help.
Display stack trace? [yN]
gremlin> subG.configuration().setProperty("storage.backend","inmemory")
==>null
gremlin> subG.configuration().getString("storage.backend")
==>inmemory
gremlin> t = subG.traversal()
==>graphtraversalsource[tinkergraph[vertices:122 edges:106], standard]
gremlin> t.io("file.kryo").write()
Class is not registered: org.janusgraph.graphdb.relations.RelationIdentifier
Note: To register this class use: kryo.register(org.janusgraph.graphdb.relations.RelationIdentifier.class);

I cannot set the backand option on the Janusgraph associated with g, since this does not fit into memory.
Anything else i can do?

Thank you!
ow...@... schrieb am Donnerstag, 3. September 2020 um 11:48:36 UTC+2:

Seems you mean Janusgraph instead Tinkergraph

This snippet works as expected:

graph = JanusGraphFactory.build().
set("storage.backend","inmemory").
open()
g = graph.traversal()
g.addV().as("v1").addV().as("v2").addE("E").from("v1").to("v2")
g.tx().commit()
g.io("file.kryo").write()
g.io("file.kryo").read()
g.V()


четверг, 3 сентября 2020 г. в 11:20:12 UTC+3, Lilly:

Hi everyone,

I am using Java and trying to write a Tinkergraph to Gryo format. To do so I tried:
g.io("file.kryo").write().iterate()
As suggested in the tinkerpop documentation.
However, this results in the following Exception:

Exception in thread "main" java.lang.IllegalArgumentException: Class is not registered: org.janusgraph.graphdb.relations.RelationIdentifier
Note: To register this class use: kryo.register(org.janusgraph.graphdb.relations.RelationIdentifier.class);

I could not find anything on how to perform this registration.
It works fine with graphml format.

Would be great if someone could help me out,
Thank you!
Lilly

Could some


Nicolas Trangosi <nicolas...@...>
 

Hi Lilly,
Have yuo tried to register JanusGraphIoRegistry ?

g.io(out)
.with(IO.writer, IO.gryo)
.with(IO.registry, JanusGraphIoRegistry.class.getName())
.write()


Regards,
Nicolas
Le jeudi 3 septembre 2020 à 16:13:35 UTC+2, Lilly a écrit :
Thank you for your answer.
The problem is, I was actually meaning a Tinkergraph which is constructed by "subgraphing" a janusgraph.
I also tried it in the console like so:

gremlin> subG = g.E().has("record_count",gt(4000)).subgraph("sub").cap("sub").next()
==>tinkergraph[vertices:122 edges:106]
gremlin> subG.traversal().io("test.kryo").write().iterate()
Class is not registered: org.janusgraph.graphdb.relations.RelationIdentifier
Note: To register this class use: kryo.register(org.janusgraph.graphdb.relations.RelationIdentifier.class);
Type ':help' or ':h' for help.
Display stack trace? [yN]
gremlin> kryo.register(org.janusgraph.graphdb.relations.RelationIdentifier.class)
No such property: kryo for class: groovysh_evaluate
Type ':help' or ':h' for help.
Display stack trace? [yN]
gremlin> subG.configuration().setProperty("storage.backend","inmemory")
==>null
gremlin> subG.configuration().getString("storage.backend")
==>inmemory
gremlin> t = subG.traversal()
==>graphtraversalsource[tinkergraph[vertices:122 edges:106], standard]
gremlin> t.io("file.kryo").write()
Class is not registered: org.janusgraph.graphdb.relations.RelationIdentifier
Note: To register this class use: kryo.register(org.janusgraph.graphdb.relations.RelationIdentifier.class);

I cannot set the backand option on the Janusgraph associated with g, since this does not fit into memory.
Anything else i can do?

Thank you!
ow...@... schrieb am Donnerstag, 3. September 2020 um 11:48:36 UTC+2:
Seems you mean Janusgraph instead Tinkergraph

This snippet works as expected:

graph = JanusGraphFactory.build().
set("storage.backend","inmemory").
open()
g = graph.traversal()
g.addV().as("v1").addV().as("v2").addE("E").from("v1").to("v2")
g.tx().commit()
g.io("file.kryo").write()
g.io("file.kryo").read()
g.V()


четверг, 3 сентября 2020 г. в 11:20:12 UTC+3, Lilly:

Hi everyone,

I am using Java and trying to write a Tinkergraph to Gryo format. To do so I tried:
g.io("file.kryo").write().iterate()
As suggested in the tinkerpop documentation.
However, this results in the following Exception:

Exception in thread "main" java.lang.IllegalArgumentException: Class is not registered: org.janusgraph.graphdb.relations.RelationIdentifier
Note: To register this class use: kryo.register(org.janusgraph.graphdb.relations.RelationIdentifier.class);

I could not find anything on how to perform this registration.
It works fine with graphml format.

Would be great if someone could help me out,
Thank you!
Lilly

Could some


Ce message et ses pièces jointes peuvent contenir des informations confidentielles ou privilégiées et ne doivent donc pas être diffusés, exploités ou copiés sans autorisation. 
Si vous avez reçu ce message par erreur, veuillez le signaler a l'expéditeur et le détruire ainsi que les pièces jointes. 
Les messages électroniques étant susceptibles d'altération, DCbrain décline toute responsabilité si ce message a été altéré, déformé ou falsifié. Merci. 

This message and its attachments may contain confidential or privileged information that may be protected by law; they should not be distributed, used or copied without authorisation. If you have received this email in error, please notify the sender and delete this message and its attachments. As emails may be altered, DCbrain is not liable for messages that have been modified, changed or falsified. Thank you.


Lilly <lfie...@...>
 

Hi Nicolas,
Thank you so much this works like a charm!

Lilly

Nicolas Trangosi schrieb am Sonntag, 6. September 2020 um 21:15:12 UTC+2:

Hi Lilly,
Have yuo tried to register JanusGraphIoRegistry ?

g.io(out)
.with(IO.writer, IO.gryo)
.with(IO.registry, JanusGraphIoRegistry.class.getName())
.write()


Regards,
Nicolas
Le jeudi 3 septembre 2020 à 16:13:35 UTC+2, Lilly a écrit :
Thank you for your answer.
The problem is, I was actually meaning a Tinkergraph which is constructed by "subgraphing" a janusgraph.
I also tried it in the console like so:

gremlin> subG = g.E().has("record_count",gt(4000)).subgraph("sub").cap("sub").next()
==>tinkergraph[vertices:122 edges:106]
gremlin> subG.traversal().io("test.kryo").write().iterate()
Class is not registered: org.janusgraph.graphdb.relations.RelationIdentifier
Note: To register this class use: kryo.register(org.janusgraph.graphdb.relations.RelationIdentifier.class);
Type ':help' or ':h' for help.
Display stack trace? [yN]
gremlin> kryo.register(org.janusgraph.graphdb.relations.RelationIdentifier.class)
No such property: kryo for class: groovysh_evaluate
Type ':help' or ':h' for help.
Display stack trace? [yN]
gremlin> subG.configuration().setProperty("storage.backend","inmemory")
==>null
gremlin> subG.configuration().getString("storage.backend")
==>inmemory
gremlin> t = subG.traversal()
==>graphtraversalsource[tinkergraph[vertices:122 edges:106], standard]
gremlin> t.io("file.kryo").write()
Class is not registered: org.janusgraph.graphdb.relations.RelationIdentifier
Note: To register this class use: kryo.register(org.janusgraph.graphdb.relations.RelationIdentifier.class);

I cannot set the backand option on the Janusgraph associated with g, since this does not fit into memory.
Anything else i can do?

Thank you!
ow...@... schrieb am Donnerstag, 3. September 2020 um 11:48:36 UTC+2:
Seems you mean Janusgraph instead Tinkergraph

This snippet works as expected:

graph = JanusGraphFactory.build().
set("storage.backend","inmemory").
open()
g = graph.traversal()
g.addV().as("v1").addV().as("v2").addE("E").from("v1").to("v2")
g.tx().commit()
g.io("file.kryo").write()
g.io("file.kryo").read()
g.V()


четверг, 3 сентября 2020 г. в 11:20:12 UTC+3, Lilly:

Hi everyone,

I am using Java and trying to write a Tinkergraph to Gryo format. To do so I tried:
g.io("file.kryo").write().iterate()
As suggested in the tinkerpop documentation.
However, this results in the following Exception:

Exception in thread "main" java.lang.IllegalArgumentException: Class is not registered: org.janusgraph.graphdb.relations.RelationIdentifier
Note: To register this class use: kryo.register(org.janusgraph.graphdb.relations.RelationIdentifier.class);

I could not find anything on how to perform this registration.
It works fine with graphml format.

Would be great if someone could help me out,
Thank you!
Lilly

Could some


Ce message et ses pièces jointes peuvent contenir des informations confidentielles ou privilégiées et ne doivent donc pas être diffusés, exploités ou copiés sans autorisation. 
Si vous avez reçu ce message par erreur, veuillez le signaler a l'expéditeur et le détruire ainsi que les pièces jointes. 
Les messages électroniques étant susceptibles d'altération, DCbrain décline toute responsabilité si ce message a été altéré, déformé ou falsifié. Merci. 

This message and its attachments may contain confidential or privileged information that may be protected by law; they should not be distributed, used or copied without authorisation. If you have received this email in error, please notify the sender and delete this message and its attachments. As emails may be altered, DCbrain is not liable for messages that have been modified, changed or falsified. Thank you.