Flynnt
Flynnt
ATApache TinkerPop
Created by rpuga on 3/23/2024 in #questions
mergeE(): increment counter on match
I think that the best approche for the use case is a change in the data models. And not in using the merge step. with the introduction of a vertex « phone calls » and « call » (for exemple) phone calls beeing liked to the two person and liked to each call. This way a new call is just a new vertex in the graph liked to a relation. And for knowing the count, you can just count the edges.
16 replies
ATApache TinkerPop
Created by rpuga on 3/23/2024 in #questions
mergeE(): increment counter on match
Totally agree. And with those, transactional problems can occurs.
16 replies
JJanusGraph
Created by dee2xu on 3/21/2024 in #questions
Indexing
Depending on your operator, the good index should be called. with equality (like in your exemple) yes the composite index should be called. In another traversal, if you go on a text operator, the mixed index will be called. It’s also depends on the type of index you specified for your property in your mixed index.
6 replies
ATApache TinkerPop
Created by rpuga on 3/23/2024 in #questions
mergeE(): increment counter on match
And what about delegating this « business stuff » to an event strategy ?
16 replies
ATApache TinkerPop
Created by Lyndon on 8/10/2023 in #questions
Gremlin Query for amount of time and return all results?
Checkout the timeLimit step. It may do what you want
7 replies
JJanusGraph
Created by slygren on 8/2/2023 in #questions
Find all paths between two vertices
it was the emit step before the repeat that provoque that. Emit pas the traverser to the next step. In your case,the traverser was emited without any filtering with the "has('lbl', 'DexpiElement').has('tagname', 'A-20LV0011')" that was used only to stop the repeat step.
28 replies
JJanusGraph
Created by slygren on 8/2/2023 in #questions
Find all paths between two vertices
Glad i could help you
28 replies
JJanusGraph
Created by slygren on 8/2/2023 in #questions
Find all paths between two vertices
g.V().hasLabel( 'DexpiElement').has('tagname', 'tagA').as("start").repeat( bothE('HAS_CHILD', 'HAS_CONNECTION', 'HAS_NODE', 'CONNECTED_TO', 'MAIN_CONNECTED_FROM','MAIN_CONNECTED_TO', 'HAS_GRAPHICS').otherV().dedup().simplePath()).until(hasLabel("DexpiElement").has('tagname', 'tagB')).path().unfold() ==>v[0] ==>e[17][0-HAS_CONNECTION->6] ==>v[6] ==>e[18][6-HAS_CHILD->8] ==>v[8] ==>e[19][8-HAS_CHILD->10] ==>v[10] ==>e[20][10-HAS_CHILD->12] ==>v[12] ==>e[21][12-HAS_CHILD->14] ==>v[14] ==>e[22][14-HAS_CHILD->2] ==>v[2] gremlin> g.V().hasLabel( 'DexpiElement').has('tagname', 'tagA').as("start").repeat( bothE('HAS_CHILD', 'HAS_CONNECTION', 'HAS_NODE', 'CONNECTED_TO', 'MAIN_CONNECTED_FROM','MAIN_CONNECTED_TO', 'HAS_GRAPHICS').otherV().dedup().simplePath()).until(hasLabel("DexpiElement").has('tagname', 'tagB')).path().unfold().hasLabel("DexpiElement") ==>v[0] ==>v[6] ==>v[8] ==>v[10] ==>v[12] ==>v[14] ==>v[2]
28 replies
JJanusGraph
Created by slygren on 8/2/2023 in #questions
Find all paths between two vertices
you can filter the edges with a label filter. I'm sure that your schema is well made and that edges and Vertex dosen't share labels.
28 replies
JJanusGraph
Created by slygren on 8/2/2023 in #questions
Find all paths between two vertices
g.V().hasLabel( 'DexpiElement').has('tagname', 'tagA').as("start").repeat( both('HAS_CHILD', 'HAS_CONNECTION', 'HAS_NODE', 'CONNECTED_TO', 'MAIN_CONNECTED_FROM','MAIN_CONNECTED_TO', 'HAS_GRAPHICS').dedup().simplePath()).until(hasLabel("DexpiElement").has('tagname', 'tagB')).path().unfold().valueMap(true) ==>[id:0,label:DexpiElement,tagname:[tagA]] ==>[id:6,label:DexpiElement,tagname:[tagD]] ==>[id:8,label:DexpiElement,tagname:[tagE]] ==>[id:10,label:DexpiElement,tagname:[tagF]] ==>[id:12,label:DexpiElement,tagname:[tagG]] ==>[id:14,label:DexpiElement,tagname:[tagH]] ==>[id:2,label:DexpiElement,tagname:[tagB]]
28 replies
JJanusGraph
Created by slygren on 8/2/2023 in #questions
Find all paths between two vertices
(exemple with a TinkerGraph)
28 replies
JJanusGraph
Created by slygren on 8/2/2023 in #questions
Find all paths between two vertices
g.V().hasLabel( 'DexpiElement').has('tagname', 'tagA').as("start").repeat( both('HAS_CHILD', 'HAS_CONNECTION', 'HAS_NODE', 'CONNECTED_TO', 'MAIN_CONNECTED_FROM','MAIN_CONNECTED_TO', 'HAS_GRAPHICS').dedup().simplePath()).until(hasLabel("DexpiElement").has('tagname', 'tagB')).path().unfold() ==>v[0] ==>v[6] ==>v[8] ==>v[10] ==>v[12] ==>v[14] ==>v[2]
28 replies
JJanusGraph
Created by slygren on 8/2/2023 in #questions
Find all paths between two vertices
no need It's already there
28 replies
JJanusGraph
Created by slygren on 8/2/2023 in #questions
Find all paths between two vertices
it will return the Vid, and you can follow the traversal
28 replies
JJanusGraph
Created by slygren on 8/2/2023 in #questions
Find all paths between two vertices
so, you can just unfold after the path step
28 replies
JJanusGraph
Created by slygren on 8/2/2023 in #questions
Find all paths between two vertices
the " .where(values('dexpi_id')) .values('dexpi_id') .fold() .as('ids')" is twisted. What are you wanteing to do ?
28 replies
JJanusGraph
Created by slygren on 8/2/2023 in #questions
Find all paths between two vertices
the path step can by modulated with a "by" step. You can also unfold the path and have acces to the elements traversed (Vertex or Edges) : g.V().hasLabel( 'DexpiElement').has('tagname', 'tagA').as("start").repeat( both('HAS_CHILD', 'HAS_CONNECTION', 'HAS_NODE', 'CONNECTED_TO', 'MAIN_CONNECTED_FROM','MAIN_CONNECTED_TO', 'HAS_GRAPHICS').dedup().simplePath()).until(hasLabel("DexpiElement").has('tagname', 'tagB')).path().unfold().valueMap() ==>[tagname:[tagA]] ==>[tagname:[tagD]] ==>[tagname:[tagE]] ==>[tagname:[tagF]] ==>[tagname:[tagG]] ==>[tagname:[tagH]] ==>[tagname:[tagB]] Just be aware that in this case, the unfold will unfold all the path if there is more than one path found. After the unfold step, you can continue your traversal like you want (with the value map in the exemple)
28 replies
JJanusGraph
Created by slygren on 8/2/2023 in #questions
Find all paths between two vertices
Hi, the problem comes from the emit step placed before the repeat step. The emit step put the current traverser in the results (kind of) : this works as intended : g.addV('DexpiElement').property("tagname","tagA").as("a"). addV('DexpiElement').property("tagname","tagB").as("b"). addV('DexpiElement').property("tagname","tagC").as("c"). addV('DexpiElement').property("tagname","tagD").as("d"). addV('DexpiElement').property("tagname","tagE").as("e"). addV('DexpiElement').property("tagname","tagF").as("f"). addV('DexpiElement').property("tagname","tagG").as("g"). addV('DexpiElement').property("tagname","tagH").as("h"). addE("HAS_CHILD").from("a").to("c"). addE("HAS_CONNECTION").from("a").to("d"). addE("HAS_CHILD").from("d").to("e"). addE("HAS_CHILD").from("e").to("f"). addE("HAS_CHILD").from("f").to("g"). addE("HAS_CHILD").from("g").to("h"). addE("HAS_CHILD").from("h").to("b") gremlin> g.V().hasLabel( 'DexpiElement').has('tagname', 'tagA').as("start").repeat( both('HAS_CHILD', 'HAS_CONNECTION', 'HAS_NODE', 'CONNECTED_TO', 'MAIN_CONNECTED_FROM','MAIN_CONNECTED_TO', 'HAS_GRAPHICS').dedup().simplePath()).until(hasLabel("DexpiElement").has('tagname', 'tagB')).path().by("tagname") ==>[tagA,tagD,tagE,tagF,tagG,tagH,tagB] with the emit step before the repeat, you have all the path traversed : gremlin> g.V().hasLabel( 'DexpiElement').has('tagname', 'tagA').as("start").emit().repeat( both('HAS_CHILD', 'HAS_CONNECTION', 'HAS_NODE', 'CONNECTED_TO', 'MAIN_CONNECTED_FROM','MAIN_CONNECTED_TO', 'HAS_GRAPHICS').dedup().simplePath()).until(hasLabel("DexpiElement").has('tagname', 'tagB')).path().by("tagname") ==>[tagA] ==>[tagA,tagC] ==>[tagA,tagD] ==>[tagA,tagD,tagE] ==>[tagA,tagD,tagE,tagF] ==>[tagA,tagD,tagE,tagF,tagG] ==>[tagA,tagD,tagE,tagF,tagG,tagH] ==>[tagA,tagD,tagE,tagF,tagG,tagH,tagB]
28 replies
JJanusGraph
Created by 4j4y. on 7/28/2023 in #questions
Storing large temporal data in janusgraph
It’s difficult to answer you question without any info about your schéma / model.
4 replies
JJanusGraph
Created by dezmaeth on 7/27/2023 in #questions
ERROR org.apache.tinkerpop.gremlin.server.util.ServerGremlinExecutor - Could not invoke constructor
This error usually append when the backends are unreachable no ?
10 replies