tinkergraph

How to fix 'java.lang.NoClassDefFoundError: org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalSource$GraphTraversalSourceStub'?

馋奶兔 提交于 2021-02-19 09:25:04
问题 I am trying to initialize an in-memory graph using TinkerGraph. Firstly, i have defined the bean in my context xml file and tried to initialise the TinkerGraph. My intention is to unit test the classes that i have created for forming the gremlin queries, the end queries that i get from these classes are in the form of a string, so in order to execute them through the TinkerGraph, i have the used the approach given in the following post: Get Gremlin query as a String and execute it in java

Shortest path taking into consideration the weight on tinkergraph in Java

无人久伴 提交于 2021-01-29 08:16:16
问题 I'm trying to find the shortest path taking into consideration the weights properties on the edges my work is on TinkerGraph and i want to do it in java. gremlin is not very helpful for me g.V().has(id1). repeat(both().simplePath()). until(has(id2)).as("path"). map(unfold().coalesce(values("weight"), constant(0)). sum()).as("cost"). select("cost","path").next().get("path"); this gives me the shortest path without taking into consideration the weight property on the edges . EDITED: my example:

How to Perfrom Where Filter in Gremlin queries

天涯浪子 提交于 2020-07-23 06:52:36
问题 where(​ and​ (​ choose(constant(0).is(1),​ select('WorkLocation'). is(within('Not Updated')),​ select('WorkLocation')),​ ​ choose(constant(1).is(1),​ select('Status'). is(within('Red', 'Orange')),​ select('Status')),​ ​ choose(constant(0).is(1),​ select('ConfirmationDate'). is(between(637281491635663900, 637258237221895200)),​ select('ConfirmationDate'))​ )​ ) In the Above Where condition Query, I have to do a filter on three fields WorkLocation, Status, ConfirmationDate, I have used choose

How to Perfrom Where Filter in Gremlin queries

戏子无情 提交于 2020-07-23 06:51:17
问题 where(​ and​ (​ choose(constant(0).is(1),​ select('WorkLocation'). is(within('Not Updated')),​ select('WorkLocation')),​ ​ choose(constant(1).is(1),​ select('Status'). is(within('Red', 'Orange')),​ select('Status')),​ ​ choose(constant(0).is(1),​ select('ConfirmationDate'). is(between(637281491635663900, 637258237221895200)),​ select('ConfirmationDate'))​ )​ ) In the Above Where condition Query, I have to do a filter on three fields WorkLocation, Status, ConfirmationDate, I have used choose

Re-running an existing route in a Tinkerpop Graph

不羁的心 提交于 2020-04-18 05:47:23
问题 If i have a pre-run route from the shortestPath which is returned as a list of vertex, how can i then re-run that on a graph with the same set of vertices, to return the edges which it has used. i.e. PATH = (V(1), V(2), V(3), V(4), V(5), V(6)), how would the command look to replay that path on a new graph with the same vertices, returning the edges, which contain different properties. So to confirm i need to input this explicit Path to return the edges? 回答1: If I knew my path was [v[1],v[4],v