Apache TinkerPop

AT

Apache TinkerPop

Apache TinkerPop is an open source graph computing framework and the home of the Gremlin graph query language.

Join
Ttobaseru3/2/2024

Discrepancy between console server id conventions and Neptune

So I'm working with my test server and on Neptune--and I'm noticing a difference in the type of the T.id field. Is there any way to configure the type of id generated by the gremlin server?
Solution:
Amazon Neptune uses strings for all IDs. You can configure a Gremlin Server to also use String IDs. There is a nice writeup here that may be useful (it's from the graph-notebook repo but the steps still apply) https://github.com/aws/graph-notebook/tree/main/additional-databases/gremlin-server
No description
Aaustinjb322/28/2024

how to connect the amothic/neptune container to the volume?

I need to know which directory needs to attach to containeer. so that the data is stored safely. even after a restart.
Solution:
Check out the graphLocation and graphFormatconfig options here: https://tinkerpop.apache.org/docs/current/reference/#tinkergraph-configuration You may also want to use a mapped directory from your local machine to ensure data is not lost if the contianer is deleted: https://docs.docker.com/storage/volumes/...
Sskywalker_1010102/28/2024

Docker yaml authentication settings (gremlinserver.authentication) question

Does anyone have any experience setting up authentication on Docker by using the supplied .yaml file? I'm having trouble passingin a map to properly set one of the options: gremlinserver.authentication.config. Additional info, but not related to the my main problem: I have a file with the contents of username/password pairs which follow the schema: ...
Solution:
Due to gremlin server expecting a map, but docker being unable to pass it to the server in the format that is expected.
I think you simply have a slight misunderstanding of the YAML format here. YAML is basically a nested map of maps. Now, if your YAML looks like this: ...
LVLonnie VanZandt2/27/2024

Gremlin Injection Attacks?

Is anyone talking about or looking into attacks and mitigations for Gremlin Injection Attacks? That is, just like all the commentary on how to design your PHP-based web frontend with Postgres backend to not be a sucker for an easy SQL Injection Attack, is anyone looking at how to handle your users of your Gremlin Server when those users give you Groovy lambdas that are rich in aggressive behavior?
Solution:
I think this goes back to a different thread we had where I mentioned that security was a reason driving an idea that lambdas should not be allowed outside of embedded use cases and why they should be removed otherwise. For some lightweight security you can try to sandbox the ScriptEngine in the server: https://tinkerpop.apache.org/docs/current/reference/#script-execution but it is not a perfect solution and really just a reference implementation that we have. Some commercial offerings in the...
Ttien2/26/2024

Returned vertex properties (JS client)

Hi, I've got a question regarding the returned vertex value when using the JS client. How come non-array properties are parsed & returned as an array of length 1, as seen in the example below? Thank you. ```json { "id": 4104, "label": "account",...
Solution:
array is used to work with properties whose cardinality list or set gremlin> g.addV('test').property(list,'a','1').property(list,'a','2') ==>v[13] gremlin> g.V(13).valueMap() ==>[a:[1,2]]...
Mmpsharp#4152/25/2024

Anyone using Tinkerpop docker as a local Cosmos replacement

Running into some random issues. Looking for tips and tricks.
Solution:
One thing to consider in trying to do this is that you would likely use TinkerGraph and Gremlin Server for this local replacement. CosmosDB has a number of limitations and differences that this local environment would not catch, so it's possible that you could write some Gremlin that works locally but then fails when you try the same query on CosmosDB. That said, if you stay aware of those differences, stick to sending scripts and prefer the 3.4.x server release it could give you a basic but not...
Ggdotv2/23/2024

Configuring Websockets connection to pass through a proxy server

Hey, I'm working on making G.V() fully proxy aware, but I can't seem to get websockets connection to pass through a SOCKS/HTTP proxy configuration. I've got all the proxy configuration java system properties set and working for HTTP connections. Is there any specific configuration to add to let the Gremlin driver to use a configured proxy?...
Rrj2/23/2024

python goblin vs spring-data-goblin for interactions with gremlin server

I want an OGM to interact with my gremlin server. What would be a good choice?
Solution:
I've not kept up with the latest changes to these libraries. Goblin might be the most currently maintained one. If you're using Python I suppose I'd start there. Not sure if anyone here can chime in with some success stories around using OGMs. Most applications I hear about tend to just use Gremlin directly.
Aaustinjb322/20/2024

Is there any open source version of data visualizer for aws neptune?

Is there any open source version of data visualizer for aws neptune. I'll need it since it essential for me for using neptune for small scale purposes. I have used g.V(), and it was perfect for my use case. But because of budget constraints. Can;t offered it. Any solutions?
Solution:
AWS maintains Graph Explorer and Graph Notebook (https://docs.aws.amazon.com/neptune/latest/userguide/visualization-graph-explorer.html and https://github.com/aws/graph-notebook), there's some overlap with what G.V() offers. I was gonna suggest to hit me up re your budget constraints to see if we can work on something there too!
Sskywalker_1010102/17/2024

Dynamic select within query not working.

Any insights or help would be greatly appreciated. I have to pass a list of lists in the format below. Hundreds of them which is why I'm trying to iterate in a single query. Please explain why accessing element 0 within the row data works here:...
Solution:
Sorry it took a while for someone to get to this. I think your problem here is that you are trying to use has(String, Traversal) in __.V().hasLabel('UsdValue').has('date', select('row').limit(local, 1).unfold()) but it doesn't work the way you expect. basically, the result of the traversal you give to has() is not given as the value to the comparator. More generally, P does not take a Traversal making any such usage impossible. It is designed to work such that the value of "UsdValue" i...
Aamandeep15202/16/2024

Adding multiple properties to a vertex using gremlin-go

Hello Community, I have a question regarding how multiple properties can be added to a vertex using gremlin-go. I did something like this ...
Solution:
to add all properties from map to same vertex can be used something like `t := g.AddV("Person") for k, v := range prop { t = t.Property(k,v) }...
RRN2/15/2024

Is it possible to walk 2 different graphs using custom TraversalStrategy in Gremlin?

I have 2 different graphs in 2 different Neptune cluster. Both of them can have few reference vertices referring to vertex in other graph. e.g. As we walk through graph A and reach a reference vertex (referring to vertex in graph B), we should be able to traverse normally further inside Graph B and get the results of the query. Basically Graph A + Graph B should act as single virtual graph.
Solution:
At this time, there would be no easy way to do this and I don't think a custom TraversalStrategy would help in any way i can imagine. Maybe the closest thing I can imagine would be to subgraph the two graphs with their references vertices and merge them to a single TinkerGraph in your application and then run additional queries on that directly. I'm not sure that suits a lot of use cases we hear about though in relation to this feature so that suggestion may not be helpful. cc/ @Dave Bechberg...
LVLonnie VanZandt2/14/2024

SideEffect a variable, Use it later after BarrierStep?

I seek a query that builds a list and then needs to both sum the list's mapped values and divide the resulting sum by the count of the original list. This would be the mean() step - if the mapped list was still a Gremlin traversal object that offered mean(). However, the mapped list is, by that time, a Groovy list and mean() is no longer available....
Solution:
It can be done with all Gremlin steps in 3.7.1 where you have date functions available. Assuming: ```groovy g.addV().as('a'). addE('link').from('a').to('a').property('createdDate', '2023-01-01T00:00:00Z'). addE('link').from('a').to('a').property('createdDate', '2023-01-01T00:30:00Z')....
MAM. alhaddad2/14/2024

Memory issue on repeat

I am traversing all nodes occuring in the same cluster given one of the nodes in that cluster. Surprisingly, after a depth limit im getting memory issues as showing in the image: Engine is Neptune 1.2.1.0...
Solution:
If using a t3.medium or t4g.medium instance, the amount of memory available for a query execution thread is very constrained. Memory allocation per thread increases as you go up in instance size until you get to the 4xlarge or 8xlarge sizes (at which point, memory allocation is at maximum per thread).
No description
Ffunki2/12/2024

Which database should i use for my DJ set planning software?

Hi, i want to develop a software that lets DJs plan a set (i.e. playlist) and i'm wondering if graph databases are the right way and if yes, which one to pick. The workflow is that the software automatically reads all tracks from the DJ software on the computer and the DJ has to tell the software which tracks mix well together. These links are called "transitions" and contain some data like difficulty grade, quality rating and notes. The software should then assist DJs when selecting tracks (or specifically the next track) for a playlist by considering the "non-repeating transition depth" of a given track....
Solution:
Sorry we missed this question. I think I could see how a graph could fit here. It seems like a sensible use case. As for the graph database to choose, i tend to almost always suggest that If you are new to graphs you should just start with TinkerGraph. It will help you get started with the least amount of pain. Once you understand it, learn some Gremln and get to know the features and capabilties of other graph databases then you can make the switch. For the most part, you should be able to make...
Aaustinjb322/12/2024

How will i add unique values to the vertices or edge properties in Neptune

I can't get a doc regarding adding unique data through gremlin. Is there any way to do it, other than the preset unqiue which is available only in field id
Solution:
if by "unique data" i can't help wondering you're looking for some mechanism to define constraints on a property key. if so, there is no such feature for Neptune. You would have to contrive some system for ensuring uniqueness on your own. There are graphs that have full schema support like JanusGraph that can use an index to support uniqueness: https://docs.janusgraph.org/schema/index-management/index-performance/#index-uniqueness
Aaustinjb322/9/2024

Not getting result in hasId() but id().is() works

I don't get any response using g.V().hasId(48). But when i use g.V().id().is(48). it shows output. So, how will i use hasId(). I'm a beginner. I don;t have much idea in it
Solution:
It's different queries. g.V().hasId(48) or same g.V(48) should return Vertex with id == 48. g.V().id().is(48) can return 48 if Vertex with id == 48 present. great resource to start learning about Gremlin is https://kelvinlawrence.net/book/Gremlin-Graph-Guide.html...
PPaule962/9/2024

dotnet `Enumeration has not started. Call MoveNext` if I try to enumerate over a result

I recently try to use gremlin to created a graph and query this graph. Currently I get it working to push data into the graph. 🎉 But now my problem is to get data back from the graph. What is working is something like that: ```csharp...
Solution:
You're on .NET 8, right? This is unfortunately a known issue which will be fixed in the next release: https://issues.apache.org/jira/browse/TINKERPOP-3029 I'm afraid you'll probably have to use .NET 7 until the next release...
No description
Aaustinjb322/9/2024

I can't create an edge in aws neptune using gremlin. I can create vertices. but not edge.

import { driver, process as gremlinProcess, structure } from "gremlin"; async function checkOut() { const DriverRemoteConnection = driver.DriverRemoteConnection; const Graph = structure.Graph;...
Ccriminosis2/5/2024

Iterating over responses

I've got a query akin to this in a python application using gremlin-python: ``` t = traversal().with_remote(DriverRemoteConnection(url, "g")) \ .V().has("some_vertex", "some_property", "foo").values()...
Solution:
it is the batch size to the client. it just doesn't wait for the client to tell it to send the next batch. the purpose of the batch was to control the rough size of each response, otherwise you could end up with a situation where the server might be serlializing too much in memory or sending responses that exceeded the max content length for a response