Dynamic Graphs is Java irrealizable ? #2990
-
Hello, thank you for browsing I tried my best, still can't find Java best practices for ConfiguredGraphFactory I implemented these examples using Gremlin
I see these discussions again
I have read the official configuration document Dynamic Graphs several times, And follow his instructions to read the Using TinkerPop’s withRemote Functionality document, Gremlin-Java is considered the canonical, reference implementation of Gremlin and serves as the foundation by which all other Gremlin language variants should emulate gremlin-server Uses gremlin-server-configuration.yaml to start the serviceOnce I've done the above configuration, I use these two classes JanusGraphFactory.getGraphNames();
ConfiguredGraphFactory.getGraphNames();
Code execution successfulgremlin-server Uses gremlin-server-cql-es.yaml to start the service
Code execution failuregremlin-server Uses gremlin-server-configuration.yaml to start the service
Configuration File DescriptionThe gremlin-server startup mode is to overwrite file gremlin-server.yaml with file gremlin-server-configuration.yaml gremlin-servergremlin-server.yaml Derived from gremlin-server-configuration.yaml
janusgraph-cql-configurationgraph.properties
gremlin-clientremote-objects.yaml
java-clinetremote-objects.yaml
conf/remote-graph.properties
pom.xml
Operating Environment janusgraph-0.6.1 If you need any other configuration or logs please contact me and I will continue to provide them. The last: It would be great if JanusGraph could provide Java's ConfiguredGraphFactory best practices, which would greatly enrich the documentation and help more beginners explore the graph world Thanks again for your reading and suggestions ! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
Can you please add:
In the pom.xml for your java client app you only need the janusgraph-driver dependency. The other JanusGraph and TinkerPop deps can only hurt, if library conflicts occur. |
Beta Was this translation helpful? Give feedback.
-
I suspect that Gremlin Server simply does not run with the gremlin-server.yaml + conf/janusgraph-cql-configurationgraph.properties as listed above. So, after connecting with the java gremlin client, check in the logs/janusgraph.log that there is not a line like: 3445 [main] INFO org.apache.tinkerpop.gremlin.server.util.ServerGremlinExecutor - A GraphTraversalSource is now bound to [g] with graphtraversalsource[standardjanusgraph[inmemory:[127.0.0.1]], standard] When Gremlin Server runs with the ConfigurationManagementGraph, connecting with the remote client will not cause a log line to appear. Also not that you do not need to overwrite the conf/gremlin-server/gremlin-server.yaml file, but that you can do: |
Beta Was this translation helpful? Give feedback.
-
OK, this was confusing and could have benefitted from clearer thinking on my side. The difference between running the ConfiguredGraphFactory code in Gremlin Console and in a java gremlin client, is that Gremlin Console does some trickery to run all groovy code remotely after the withRemote method call. The java gremlin client, however, tries to run the ConfiguredGraphFactory code locally. No time to look into this right now, but the obvious workaround seems to use the procedures described in https://tinkerpop.apache.org/docs/current/reference/#gremlin-java-scripts. I guess, though, that understanding the root cause is most important for you now. |
Beta Was this translation helpful? Give feedback.
OK, this was confusing and could have benefitted from clearer thinking on my side. The difference between running the ConfiguredGraphFactory code in Gremlin Console and in a java gremlin client, is that Gremlin Console does some trickery to run all groovy code remotely after the withRemote method call. The java gremlin client, however, tries to run the ConfiguredGraphFactory code locally. No time to look into this right now, but the obvious workaround seems to use the procedures described in https://tinkerpop.apache.org/docs/current/reference/#gremlin-java-scripts. I guess, though, that understanding the root cause is most important for you now.