spmallette
spmallette
ATApache TinkerPop
Created by gdotv on 1/20/2025 in #questions
Neptune, Gremlin Java & Bindings
the translators in 4.x will generate grammar compliant gremlin (in addition to the programming language verisons).
25 replies
ATApache TinkerPop
Created by gdotv on 1/20/2025 in #questions
Neptune, Gremlin Java & Bindings
25 replies
ATApache TinkerPop
Created by gdotv on 1/20/2025 in #questions
Neptune, Gremlin Java & Bindings
....dont think it's identical though.
25 replies
ATApache TinkerPop
Created by cdegroc on 1/20/2025 in #questions
Hot reloading of SSL certificates in gremlin-server
i dont think there's any way to currently do the reloads, so something would have to be built. @Kennh any thoughts on this one?
5 replies
ATApache TinkerPop
Created by gdotv on 1/20/2025 in #questions
Neptune, Gremlin Java & Bindings
it will be nice when we have the new translators based on the grammar available. i think it will be easier to extend and will definitely produce better translations.
25 replies
ATApache TinkerPop
Created by gdotv on 1/20/2025 in #questions
Neptune, Gremlin Java & Bindings
@G.V() - Gremlin IDE (Arthur) with a small modification, it's possible to change the existing translators in 3.x to replace variable placeholders for the values in the bindings. adding this override to GroovyTranslator.DefaultTypeTranslator:
@Override
protected Script convertToScript(final Object object) {
if (object instanceof Bytecode.Binding) {
return super.convertToScript(((Bytecode.Binding) object).value());
} else {
return super.convertToScript(object);
}
}
@Override
protected Script convertToScript(final Object object) {
if (object instanceof Bytecode.Binding) {
return super.convertToScript(((Bytecode.Binding) object).value());
} else {
return super.convertToScript(object);
}
}
seems to make it work how you want:
gremlin> g = TinkerFactory.createModern().traversal()
==>graphtraversalsource[tinkergraph[vertices:6 edges:6], standard]
gremlin> b = new org.apache.tinkerpop.gremlin.process.traversal.Bindings()
==>bindings[main]
gremlin> t = g.V().has('name',b.of("n","josh"));[]
gremlin> translator = GroovyTranslator.of("g")
==>translator[g:gremlin-groovy]
gremlin> translator.translate(t).getScript()
==>g.V().has("name","josh")
gremlin> g = TinkerFactory.createModern().traversal()
==>graphtraversalsource[tinkergraph[vertices:6 edges:6], standard]
gremlin> b = new org.apache.tinkerpop.gremlin.process.traversal.Bindings()
==>bindings[main]
gremlin> t = g.V().has('name',b.of("n","josh"));[]
gremlin> translator = GroovyTranslator.of("g")
==>translator[g:gremlin-groovy]
gremlin> translator.translate(t).getScript()
==>g.V().has("name","josh")
I guess from your perspective that means you create your own extension to DefaultTypeTranslator then hand it to GroovyTranslator.of("g", <YourTypeTranslator>). i think that would work. The 4.x translators based on the grammar (and not bytecode) are designed to allow this sort of translation more directly, but that's not something you should have to worry about for a while i guess.
25 replies
ATApache TinkerPop
Created by b4lls4ck on 7/9/2024 in #questions
I am unsure on how to use Python to add graphs to JanusGraph
an easy thing to try is to test your connection/graph with Gremlin Console and see what happens: https://tinkerpop.apache.org/docs/current/reference/#connecting-via-console
56 replies
ATApache TinkerPop
Created by b4lls4ck on 7/9/2024 in #questions
I am unsure on how to use Python to add graphs to JanusGraph
i'm not sure what is amiss now if you see that "g" is configured via the logs and dont see any other errors/warnings on server startup. that's a bit strange. it should work under those conditions
56 replies
ATApache TinkerPop
Created by b4lls4ck on 7/9/2024 in #questions
I am unsure on how to use Python to add graphs to JanusGraph
you need next() (i.e. a terminator step) to trigger the traversal. without it, you wont send the request to the server, so it makes sense that removing next() doesnt' produce an error, but then it wont produce anything else
56 replies
ATApache TinkerPop
Created by b4lls4ck on 7/9/2024 in #questions
I am unsure on how to use Python to add graphs to JanusGraph
that looks like a problem with java compatibility. what version of java are you using?
java -version
java -version
i'd prefer 17 if possible.
56 replies
ATApache TinkerPop
Created by b4lls4ck on 7/9/2024 in #questions
I am unsure on how to use Python to add graphs to JanusGraph
i think you should check in on the output of the startup of Gremlin Server. it should show a line like:
[INFO] ServerGremlinExecutor - A GraphTraversalSource is now bound to [g] with ...
If you don't see that then you might have some kind of error in startup that is preventing your access to "g".
56 replies
ATApache TinkerPop
Created by fycoder on 12/29/2024 in #questions
How to dynamically add custom Steps at runtime?
You can use Groovy for all manner of trickery (AST manipulation, basic metaprogramming APIs, etc), but I'd take care with depending on it given the security risks associated with it. TinkerPop has been slowly moving away from it, first with bytecode based requests and more currently with the Gremlin ANTLR grammar. There is a general consensus that the latter will ultimately replace groovy/bytecode going forward into the future. I'm not sure if any of that impacts your decisions on how to maintain your service using 3.5.x but I thought it was important to share.
7 replies
ATApache TinkerPop
Created by Valentyn Kahamlyk on 12/23/2024 in #questions
Graph computer question
i'd say this is the bug:
gremlin> g.V(1,1).count()
==>2
gremlin> g.V(1,1).count()
==>2
i wonder when that got introduced.......
4 replies
ATApache TinkerPop
Created by blacklight on 11/25/2024 in #questions
mergeV with onMerge when extra properties are unknown
hi - if the extra properties are not known upfront, are you saying that they aren't included in the inject() as in that example? where would they come from then?
3 replies
ATApache TinkerPop
Created by red on 10/14/2024 in #questions
Naming multiple vertices
@red like @Kelvin Lawrence i think that to give good advice we'd need to better understand what the query looks like prior to this point because i think it might be best to avoid trying to iterate two collections at the same time in Gremlin. it can be done, but it's not particularly pretty and often times rethinking how a query is written can remove the need to do that. if you could give us a Gremlin script with sample data and then what a full query looks like as an example then we could try to optimize it.
9 replies
ATApache TinkerPop
Created by pieter on 10/18/2024 in #questions
select T.id + optional properties
there's a number of ways you might try to solve that. how about just using coalesce() in the by():
gremlin> g = TinkerFactory.createModern().traversal()
==>graphtraversalsource[tinkergraph[vertices:6 edges:6], standard]
gremlin> g.V().as('a').out().as('b').select('a','b').by('name').by('age')
==>[a:marko,b:27]
==>[a:marko,b:32]
gremlin> g.V().as('a').out().as('b').select('a','b').by('name').by(coalesce(values('age'), constant(-1)))
==>[a:marko,b:-1]
==>[a:marko,b:27]
==>[a:marko,b:32]
==>[a:josh,b:-1]
==>[a:josh,b:-1]
==>[a:peter,b:-1]
gremlin> g = TinkerFactory.createModern().traversal()
==>graphtraversalsource[tinkergraph[vertices:6 edges:6], standard]
gremlin> g.V().as('a').out().as('b').select('a','b').by('name').by('age')
==>[a:marko,b:27]
==>[a:marko,b:32]
gremlin> g.V().as('a').out().as('b').select('a','b').by('name').by(coalesce(values('age'), constant(-1)))
==>[a:marko,b:-1]
==>[a:marko,b:27]
==>[a:marko,b:32]
==>[a:josh,b:-1]
==>[a:josh,b:-1]
==>[a:peter,b:-1]
the second one fails because you did select(...).elementMap(...) which isn't possible because elementMap() can't work on the Map that select() produces.
5 replies
ATApache TinkerPop
Created by Memo on 10/16/2024 in #questions
Basic vertex querying does not work in Amazon Neptune but it works with local Gremlin Server
Neptune does not yet support the "properties on elements" feature that was introduced in TinkerPop 3.7.x that allows graph elements like Vertex and Edge to be returned with properties. If you care to understand the history around this design choice you can read this: https://lists.apache.org/thread/xltcon4zxnwq4fyw2r2126syyrqm8spy In 3.7.x we describe how "properties on elements" works in the upgrade documentation: https://tinkerpop.apache.org/docs/current/upgrade/#_properties_on_elements It is therefore expected that when you return a Vertex with Neptune you don't get any properties, but it is odd that when you use elementMap() or valueMap() that you get empty maps. I'm not sure what to make of that. could you say what Neptune and TinkerPop versions you are using?
9 replies
ATApache TinkerPop
Created by gdotv on 10/17/2024 in #questions
Is there a way to specify a query execution timeout via the GremlinLangScriptEngine?
no, it's just like standard ScriptEngine implementations in that it operates in the current thread without interrupt. we'd wrapped the GremlinScriptEngine up into the GremlinExecutor to try to generalize behavior for timeouts and Future based execution. you would have to use that class to get that sort of behavior and avoid direct use of the GremlinLangScriptEngine directly.
5 replies
ATApache TinkerPop
Created by Alex on 10/11/2024 in #questions
Possibilities to improve performance on query?
with Neptune you can't use the profile() step. you have to use the /profile endpoint as shown in that link i provided
7 replies
ATApache TinkerPop
Created by Alex on 10/11/2024 in #questions
Possibilities to improve performance on query?
it might be helpful if you share a profile of your query: https://docs.aws.amazon.com/neptune/latest/userguide/gremlin-profile-api.html
7 replies