-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot get properties of Elements on remote graph with scalaGraph #223
Comments
and also I found using valueMap with remote graph, I have to pass in valueMap(true) to get the properties using GraphTraversalSource: https://stackoverflow.com/questions/45764199/janusgraph-cluster-always-returns-vertex-without-properties-referencevertex |
As you mentioned already, Did you see https://github.com/mpollmeier/gremlin-scala-examples/ ? It contains a JanusGraph example repo and I just added a line to prove that you can add edges. |
Hi, I am basically want to achieve exactly the same as the DSE example but with JanusGraph: Thanks, |
Ok, I understand the issue now. I don't have much capacity to fiddle with this myself, but just had a brief look at Janus' documentation. Have you tried to pass the remote url etc. in the config that you pass to JanusGraphFactory, rather than using
|
Hi, the Thanks for your help here. |
To follow up on this old issue, I believe I have similar problems. Well, similar in that I found I can not use the fancy operators with remote connections (if I do the data is not saved). I have forked gremlin-scala-examples to show this: I'm using JanusGraph Server as my server here, but whatever it's mostly just Gremlin Server underneath: rwilcox/gremlin-scala-examples JanusGraph example for JanusGraph Server There are three examples here:
(@TitiHl these all use TL; DR:
BUT, I used the
By going through issue history, I found #118, which has the following comment link - which is one of the reasons why
But methods like The reason why operating on a graph vs operating on a traversal is important is because it seems to be that the (best? only?) way to connect to Gremlin ... err JanusGraph... Server is via TraversalSource's withRemote method. @mpollmeier does this logic sound right to you? (I'm a relative newbie to this project and graph / tinkerpop in general) @TitiHl : I have not tested the original bug with this configuration ( In general, It would be great to somehow have the |
Interesting - I'll run this tomorrow and see if I can find a workaround. The docs suggest to run |
Awesome, thanks! Take a look at the JanusGraph Server Getting Started, but TL;DR: use |
Ok so it turns out that we shouldn't use I've made a start to change everything to use a traversal (only for vertices so far) in f740788 - let me know your thoughts. So I can actually test this, maybe you help me with the following: when I run your test cases, I get the following error:
Any ideas what's wrong? Some missing configuration? Thanks for bringing this back up and providing a nice project to reproduce, @rwilcox Other random thoughts:
|
Woh, awesome! I'll take a look at the changes probably tomorrow, (And that buffer underflow error sounds familiar too - I can't place it but I'll check it out at work tomorrow... maybe there it will come to me). I have answers to your random thoughts now:
Yes, in my reading sample code / readings docs / and code provided to me from others on my Current Graph Database Project, I believe the
Maybe. What I believe / assume is happening is that creating a traversal off an EmptyGraph will give you only features available in generic Gremlin Server, but basing the traversal off a JanusGraph gives you JanusGraph features. I'm super interested in what the local graph instance is used for in remote traversal situations: is it just a bootstrap mechanism or is it used somehow ie does it hold a subgraph in memory for cache reasons????? I may go ask the JanusGraph people, as my lead engineer had similar questions (ie if it is used for something like caching, that may have memory implications for mid to large graphs). |
It would certainly be a good idea to use the graph instance for some local caching, but I don't think it's doing that, instead it just seems to be a bootstrap for the traversal.. |
@rwilcox any news re the |
No, and my browser history and notes didn't help either :( |
'No' as in, if you run the test locally it works, and you don't get that exception? |
Correct - on OS X 10.12 with |
How about if you run it in sbt? I'm on linux with java 1.8
I just freshly unpacked janusgraph and ran
and sbt
|
Ok, super weird: |
Ok, super interesting. In my IntelliJ test configuration there's a checkbox to "use SBT". It was off. When I checked it to be on I got the same error in IntelliJ. I guess I can see the Scala IntelliJ plugin somehow wanting to bypass sbt for Reasons by default |
That's good news, we're getting the same results :) |
Hey, I'm also interested in this. I got a similar
Hope it helps! |
For what it's worth, I'm running into the same issues trying to connect to a new Amazon Neptune GraphDB Cluster.
Gives the same errors: |
@alicefuzier thanks for sharing, but that didn't fix the exception I'm getting:
I don't know much about Janus and it's serialisation unfortunately. @apatzer that's the error you get when you add a vertex with |
Ok I just figured out how to connect to janusgraph. Use a different serialiser.
I'll continue with the changes to allow adding vertices to a remotegraph shortly. |
I just found some time to dig deeper into this. The underlying problem is that the configuration for remote is not stored in the graph instance, but in the TraversalSource. Because of that, one cannot simply call e.g. I just released gremlin-scala 3.3.1.2 and provided a working example for gremlin-server. I'm still fighting with janusgraph (the basic setup is here), and assume I need to release a new version for 3.3.0, since Janusgraph hasn't released anything for 3.3.1 yet. |
It looks like I'm running into a similar issue even with 3.3.1.2 when interacting with a Neptune graph.
Have you found any solutions other than changing the serializer? Neptune does not have such an IORegistry published as far as I can tell |
Turns out it was user error.. You can modify my above example to add this unmodified serializer and it will function properly
Thanks for the great work bringing gremlin to scala! |
Quick update re JanusGraph: since it's last release (0.2.0) is still based on tinkerpop 3.2.x I can't backport the new model for handling this in remote graphs, because it relies on |
A quick update... JanusGraph 0.3.0 was released on July 31, 2018. It now supports tinkerpop 3.3.3. |
Finally got around to setting up a remote janusgraph example: https://github.com/mpollmeier/gremlin-scala-examples/blob/fcc048e/janusgraph/src/test/scala/SimpleSpec.scala#L55 I found debugging the serialisers non-straightforward, but here's a setup that works:
|
@mpollmeier Actually, this problem is still actual for Amazon Neptune. At least I have no idea how to initialize connection in a way it worked. |
does anyone have a working setup for gremlin-groovy or gremlin-java? this isn't really a gremlin-scala specific issue.. |
I can't get the gremlin-server example to work. It adds vertices / edges fine as in the provided example.. but fails to retrieve any property values |
@nkconnor @mpollmeier For neptune I'm using the following setup. Still new to gremlin, so not sure how much of this is specific to issues with Neptune. I sort of walked it back from using idomatic (gremlin-)scala in a lot of areas, but am still able to use the Like @hudsonmd said, adding the following serializer is important:
And then for retrieving an item map with properties:
Calling the valueMap before head is important if you want properties - also calling head seems to stop a traversal, so something like Updates for properties in neptune seem to only work if you first delete the property. I was running into this gnarly bug where if you try to increase the property value of a Double it works, but if you try to decrease it it does not.
|
@Joe29 are you able to use
|
@nkconnor It's been a couple of weeks since I touched the code, but I do recall having problems with |
@nkconnor If you want to get up and running feel free to use this, though it's not pretty (two json libs??). I'm also making some assumptions here about the type of data/case class. Let me know if you find a cleaner solution.
|
Thanks for the help Joe.... I'm going to look around at other graph libraries since the remote support is limited |
Hi,
Thanks for building this nice wrapper for Scala :D. I am currently use this on a Remote JanusGraph by calling:
val scalaGraph: ScalaGraph = EmptyGraph.instance().asScala().configure(_.withRemote(DriverRemoteConnection.using(cluster, "g")))
but found I lost some syntax benefit for gremlin-scala, say, if I want to add an edge between v1 and v2, I can no logger call:
val edge = v1 --- ("reference", metadata -> "EdgeTest", deleted -> false) --> v2
Exceptions below:
I believe this is the cause of EmptyGraph as a underlying graph.
referring to this example:
https://github.com/mpollmeier/gremlin-scala-examples/blob/master/dse-graph/src/test/scala/SimpleSpec.scala
instead I have to call
val a = StepLabel[Vertex]() val b = StepLabel[Vertex]() scalaGraph.V(v1.id).as(a).V(v2.id).as(b).addE(REFERENCE).from(a).to(b).property(metadata, "EdgeTest").property(deleted, false).iterate()
this is one of the examples that I cannot use nice wrapper provided by gremlin-scala when I am working on a remote graph, so wondering if i missed sth. here as I am still manipulating on a ScalaGraph or there is a better way to add vertex/edges in remote graph.
Thanks for your help in advance.
Alex
The text was updated successfully, but these errors were encountered: