Kennh
Kennh
ATApache TinkerPop
Created by Balan on 8/23/2024 in #questions
How can we extract values only
If I understand this correctly, you are first trying to take the result of a gremlin query that returns Latitude and Longitude (like in the initial post you made), and use those values in the in the math() step that calculates the Haversine formula (your latest post). If that is the case, you have two options. 1. You should combine this into one Gremlin query. You can save the results of the Latitude and Longitude to variables or use them in a by() modulator to the math step. Assuming that those values are properties on a vertex called 'lat' and 'lon' it would look something like g.V().project('Latitude', 'Longitude').by('lat').by('lon').math(...). You would replace the ... in the math() step with the Haversine formula. 2. If you want to keep these as two separate queries, then you should use one of the Gremlin Languages Variants (GLVs) which are essentially drivers that will automatically deserialize the result into the appropriate type so you don't have to deal with the GraphSON (which is what your initial post shows). Read triggan's answer above for more details about that.
8 replies
ATApache TinkerPop
Created by Max on 9/3/2024 in #questions
Gremlin query to order vertices with some locked to specific positions
I don't think there is that sort of fine-grained control over traversal iteration order or collection order. Do you have any ideas @spmallette ?
16 replies
ATApache TinkerPop
Created by Memo on 8/27/2024 in #questions
Query works when executed in console but not in javascript
Is this problem specific to this query? If you run a simple query like g.V().count().next() do you see incorrect results as well?
3 replies
ATApache TinkerPop
Created by Balan on 8/23/2024 in #questions
How can we extract values only
Could you clarify what you mean by "only values". What is the query you are running now? Or are you saying that you don't want the "@type" information and you only want the "@value", in which case you are going to want to use the untyped serializer like "GraphSONUntypedMessageSerializerV1". The HTTP accept header for such a request would be "application/vnd.gremlin-v1.0+json;types=false"
8 replies
ATApache TinkerPop
Created by b4lls4ck on 8/22/2024 in #questions
How to speed up gremlin query
This seems like a JanusGraph-specific performance question so you may be able to get more help by asking in the JanusGraph Discord. For TinkerPop in general though, I'd start with the profile() step. It'll let you know which step is taking the most time and I believe JanusGraph returns some index details in there as well. That information could probably be used as a starting point to help you tweak your indices.
5 replies
ATApache TinkerPop
Created by criminosis on 7/27/2024 in #questions
op_traversal P98 Spikes
There could potentially be lots of different causes for this as there are a lot of pieces in the scenario you laid out. Something worth investigating is whether transactions are causing a slowdown. JanusGraph itself has different options for transactional behavior. I'm not that familiar with JanusGraph, but I believe it has different locking mechanisms based on the storage backend being used.
9 replies
ATApache TinkerPop
Created by Limosin18 on 7/3/2024 in #questions
Optimising python-gremlin for fastApi
Yea, the thread you mentioned has some good information that is relevant to your question. The gremlin-python module currently isn't async which is why it blocks. There is an open JIRA about adding full async support, https://issues.apache.org/jira/browse/TINKERPOP-2774 , you can see that there are others that use FastAPI that have run into similar situations and have had similar questions. Feel free to leave a comment in that JIRA if you are interested in seeing full async support. In any case, following the advice from the thread you linked will probably lead to the highest RPS you can have for now until TINKERPOP-2774 is implemented. Would you consider your question solved for now?
4 replies
ATApache TinkerPop
Created by pm_osc on 5/17/2024 in #questions
Authorization with transaction results in error
I've looked into your real use case a little closer and I don't think there's a workaround at this time. Side note, you should end your traversals with a terminating step like iterate() or else they don't do anything. So your query should actually be gtx.addV().property('name', 'test1').property('age', 11).iterate(). The error you are seeing with "This AuthorizationHandler..." occurs after the transaction attempts to commit so it shouldn't actually prevent the commit from occurring. The real problem you will encounter is a different server issue that Lyndon was alluding to earlier. The problem is that the authorization handler on the server is accidentally converting the request from the client from a session request (which is used for transactions on the server side) to a regular request. Lyndon actually has a proposed fix for this https://github.com/apache/tinkerpop/pull/2622/files . This fix should go into the next release, but I'm not sure when that release will happen. Lately, there has been a quarterly release cadence so it hopefully shouldn't be too far off.
12 replies
ATApache TinkerPop
Created by pm_osc on 5/17/2024 in #questions
Authorization with transaction results in error
This is caused by a bug in the server. The auth handler doesn't properly take care of the "close" request sent from the driver (which the Console uses internally). If you're interested, this is the line that causes it https://github.com/apache/tinkerpop/blob/3.7.0/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/WebSocketAuthorizationHandler.java#L83 . It's a bit more complicated than simply adding support for it in the auth handler because the "close" request was supposed to be have deprecated back in 3.3.11 but it was brought back into the driver after. I guess I'm trying to say there isn't actually a simple and complete fix even though the cause of the issue is obvious. If you need to use sessions directly, then I don't think there are any current workarounds. However, it sounds like you just want to use transactions, depending on how you use transactions, and whether your rely on autocommit/autorollback, we might be able to find a workaround.
12 replies
ATApache TinkerPop
Created by pm_osc on 5/17/2024 in #questions
Authorization with transaction results in error
Sorry, it looks like no one's had a chance to look into this yet. I'll try to reproduce this issue tomorrow and get back to you with some more detailed information. Thanks for providing such a detailed repro case.
12 replies
ATApache TinkerPop
Created by RuS2m on 6/1/2024 in #questions
Analyzing samples of Gremlin Queries in Neptune Notebook
I'm not familiar with trying to figure out which portion of the graph is most frequently used based on the Gremlin queries issued against it. There might be some Neptune-specific functionality that can help as well. Does anyone from @neptune have any insights that could help?
9 replies
ATApache TinkerPop
Created by gdotv on 2/23/2024 in #questions
Configuring Websockets connection to pass through a proxy server
As far as I can tell, gremlin-driver doesn't have support for SOCKS proxies right now. gremlin-driver uses netty as its client library so you would need to add a SOCKS proxy handler to the netty pipeline to support this. Adding something like the Socks4ProxyHandler to https://github.com/apache/tinkerpop/blob/master/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Channelizer.java#L189 might work.
13 replies
ATApache TinkerPop
Created by salman_walmart on 1/3/2024 in #questions
Integration tests for AWS Neptune DB
If that is the case, then I think the blog that was linked earlier (https://aws.amazon.com/blogs/database/automated-testing-of-amazon-neptune-data-access-with-apache-tinkerpop-gremlin/) probably has the best setup for now. Its example show how you can use GremlinServer with TinkerGraph in a docker container as a test double for Neptune. Since it seems like you are using Java, you actually have a simpler option which is to just include tinkergraph-gremlin as a test dependency and run your queries directly against a local instance of TinkerGraph. As always, you'll want to keep in mind provider specific differences which are outlined for Neptune here https://docs.aws.amazon.com/neptune/latest/userguide/access-graph-gremlin-differences.html
7 replies
ATApache TinkerPop
Created by salman_walmart on 1/3/2024 in #questions
Integration tests for AWS Neptune DB
Could you explain a little more in-depth the type of testing that you are doing? Is this something you want to run fairly often (per commit) or something that is run closer to releases?
7 replies
ATApache TinkerPop
Created by Dragos Ciupureanu on 12/6/2023 in #questions
Testing against AWS Neptune
Actually, a correction to what I said earlier.
There aren't, however, any tests for write operations (most providers use different ways of representing Id) so you may find a lot of differences there.
This isn't true, there actually are tests for write operations like addV(), mergeV(), etc.
12 replies
ATApache TinkerPop
Created by Dragos Ciupureanu on 12/6/2023 in #questions
Testing against AWS Neptune
What do people do to test the clients against multiple engines, if at all?
I think there are enough subtle differences between different providers that some adjustments need to be made for client code to work against them. In general though, providers will test their read queries against this suite (https://github.com/apache/tinkerpop/tree/master/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features). Some of these tests may get opted out if a provider doesn't support a specific feature. There aren't, however, any tests for write operations (most providers use different ways of representing Id) so you may find a lot of differences there.
12 replies
ATApache TinkerPop
Created by Dragos Ciupureanu on 12/6/2023 in #questions
Testing against AWS Neptune
I'm not sure if you've seen this blog post before but it touches upon a lot of what was said here (https://aws.amazon.com/blogs/database/automated-testing-of-amazon-neptune-data-access-with-apache-tinkerpop-gremlin/)
12 replies
ATApache TinkerPop
Created by chiujl on 5/30/2023 in #questions
Error running gremlin.bat from WIN11 machine
@Boxuan Li , the gremlin.bat wasn't fixed. You need to use the gremlin-java8.bat instead. Theres an argument to be made that we should just replace the gremlin.bat with gremlin-java8.bat.
18 replies
ATApache TinkerPop
Created by Lyndon on 9/13/2023 in #questions
RepeatStep does not appear to respect barriers
In which case, you might want to make a devlist post.
12 replies
ATApache TinkerPop
Created by Lyndon on 9/13/2023 in #questions
RepeatStep does not appear to respect barriers
At first glance, this would probably be ok, but I get the feeling there will be a small subset of cases that will have their semantics changed.
12 replies