Where are my edges?

57 views
Skip to first unread message

yair...@gmail.com

unread,
Aug 31, 2017, 3:33:33 AM8/31/17
to JanusGraph users
I am using gremlin-scala.

I connect to remote janus server that forked cassandra using:


val conf = new BaseConfiguration()
conf.setProperty("storage.backend", "cassandra")
conf.setProperty("storage.hostname", "my-ip")
conf.setProperty("index.search.hostname", "my-ip")
val graph = JanusGraphFactory.open(conf).asScala

I create vertexes and edges:

val cityA = graph + (location, name -> "City-A", population -> 400000)
val cityB= graph + (location, name -> "CityB", population -> 300000)


cityB<-- ("Road", distance -> 92) --> cityA 

and If I query these - everything is ok.

however, if I look up the vertexes in another client:

val telAviv = graph.V().has(name,"TelAviv").head()

my queries (for example find all paths from V1 to V2) don't work.

It's as it they are not stored in the DB and are only available during the same run that created them.

What am I doing wrong?

HadoopMarc

unread,
Aug 31, 2017, 3:59:08 AM8/31/17
to JanusGraph users
All graph mutations are realized within a (hidden) transaction. You have to commit() the transaction before the changes are visible to other clients. So, look for .commit methods in the gremlin-scala API .

Cheers,    Marc

Op donderdag 31 augustus 2017 09:33:33 UTC+2 schreef yair...@gmail.com:

Yair Ogen

unread,
Aug 31, 2017, 4:00:28 AM8/31/17
to HadoopMarc, JanusGraph users
I did comm at the end:

graph.tx().commit()

graph.close

--
You received this message because you are subscribed to a topic in the Google Groups "JanusGraph users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/janusgraph-users/fONPVU9xkHE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to janusgraph-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/janusgraph-users/38fbaf0f-e670-409e-b6a2-81e0ecab7b6d%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Jamie Lawson

unread,
Feb 2, 2018, 1:40:29 PM2/2/18
to JanusGraph users
Reply all
Reply to author
Forward
0 new messages