Apache TinkerPop

AT

Apache TinkerPop

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

Join
VCCvuon cham chi4/25/2024

configure gremlin-server to use remote Neptune server?

Hello, I’m wondering if it is possible to configure gremlin server to use the graph at remote Neptune instance so user can use my own authentication and not having to worry about AWS authentication methods? Many thanks!...
Ttien4/24/2024

Query optimisation

Hey, I'm optimising some queries, and found that these 2 seemingly identical queries behave very differently in term of performance ```groovy g.V(). union(...
APAndre Pinto4/23/2024

Combine two queries to perform only one

can someone help me figureout how I can combine those two queries? groups = f"g.V().hasLabel('Groups').as('group_data').elementMap().range({start_index}, {end_index}).toList()" users = f"g.V().hasLabel('Groups').as('group_data').bothE('memberOf').otherV().as('members').select('members').by(elementMap()).range({start_index}, {end_index}).toList()"...
EKElektra Kypridemou4/23/2024

compatibility with Apache Jena Fuseki

Hello! I am new in the community and trying to figure out whether TinkerPop and Gremlin is supported by Jena Fuseki. I had a look at the TinkerPop-enabled graph systems page (https://tinkerpop.apache.org/providers.html) and Fuseki is not listed there, but I see other RDF graph databases in the list, which makes me think there might be some chance for Fuseki too. Could you please help?...
NNeptunion4/21/2024

Is the first traversal pattern evaluated by Match well defined

Hi, It seems to me that if the match step is able to dynamically select the first traversal pattern (as it does all other traversal patterns), and this selection isn't the same across all traversers, the behaviour of match isn't well defined. Consider the simple graph...
Ddanielcraig234/18/2024

.mergeV() with Javascript not working

Hi, I have a nodeJS 18 lambda which is closely modeled after this documentation: https://docs.aws.amazon.com/neptune/latest/userguide/lambda-functions-examples.html#lambda-functions-examples-javascript here is my async query function: ```async function query(context) { const { userId } = context;...
Zzlfben4/17/2024

Unable to deserialize results with Gremlin-go client + JanusGraph

Hi all - I'm trying to set up a JanusGraph database and use the Gremlin-go client to run some gremlin traversals over it. I'm facing some serialization error. My docker-compose file to start a JanusGraph at localhost:8182: ```yml...
Solution:
For Python, you can also use JanusGraph-Python to get better support for JanusGraph types: https://github.com/JanusGraph/janusgraph-python (JanusGraph-Python only extends Gremlin-Python so you will still be using that. It just adds serializers for JanusGraph types)...
GGil4/5/2024

Fulltext-search-like features without ElasticSearch, OpenSearch, Solr and such?

I've read in multiple sources that Apache TinkerPop isn't optimized for text search operations like partial string matching or Regex matching. A common "solution" seems to involve integrating the database with fulltext search engines like ElasticSearch or Solr. Is there another way of handling these kind of operations without adding another tool? I'm afraid this is getting way more complex than I wanted. Just some context, what I'm trying to do is filter nodes by one of their properties called legal_name, some similar to SQL...
KKatlin4/4/2024

Conditionally updating a variable with choose()

How do I create and update a variable with a conditional? I need a number to be calculated based on an arrangement of requirements. Here is a very simplified example of what I was trying to do: `g.addV('App').property('name', 'A').property('requirement1', true).property('requirement2', true). addV('App').property('name', 'B').property('requirement1', true).property('requirement2', false). addV('App').property('name', 'C').property('requirement1', false).property('requirement2', false).property('requirement3', true)...
Solution:
sorry, but it looks like this question was missed last week somehow. i think you're mostly on track for the best way to do this by using choose(). you could simplify your syntax a fair bit i think by using sack(): ```gremlin> g.withSack(0).V(). ......1> project('id', 'name', 'requirement1', 'requirement2', 'requirement3', 'value'). ......2> by('id'). ......3> by('name')....
PPhillip4/3/2024

Systems Analysis Report on Apache TinkerPop - Where to Start?

Hey all, I'm currently writing an alaysis on Apache TinkerPop for grad school and was just hoping that someone could point me in the right direction for some good materials or some example uses for this system! Any answers are appreciated, finding out a good chunk on my own through the official docs, but just wanted to see if there are any specific things that the community here thinks are notable. Have not used this before so trying to put together resources in order for me to better explain "w...
Solution:
i'm not sure what you're looking for when it comes to "example uses for this system" - i assume you mean real-world use case examples. you often have to search for the actual TinkerPop implementations to get some of those answers at times. TinkerPop as a framework tends to not get the core mention in blog posts and other news items. anyway, here's a few cases you could look at: https://innovation.ebayinc.com/tech/engineering/how-we-export-billion-scale-graphs-on-transactional-graph-databases/ https://aws.amazon.com/blogs/database/cox-automotive-scales-digital-personalization-using-an-identity-graph-powered-by-amazon-neptune/?pg=ln&sec=c ...
Ddmcmanus4/3/2024

Lambda example in TypeScript

Does anyone know where I can find example code that demonstrates up-to-date best practices for writing TypeScript Lambda Functions that interact with Neptune?
Rrpuga3/23/2024

mergeE(): increment counter on match

Hi, is there an easy way to increment an existing edge property based on its current value using mergeE() in one single query? (e.g., counter += 1) Something similar to this: ``` g.mergeE([(T.label):'called', (from): person1, (to):person2])....
Solution:
gremlin> g.mergeE([(Direction.from):44,(Direction.to):8]).valueMap(true)
==>[id:5062,label:route,dist:549]
gremlin> g.mergeE([(Direction.from):44,(Direction.to):8]).valueMap(true)
==>[id:5062,label:route,dist:549]
and then...
Ddracule_redrose3/22/2024

Serialization Issue

I have a weird error, when I am connecting with JanusGraph gremlin client using conf/remote-graph-binary.yaml I am able to get results. But when I am trying to use my java application I am getting, java.io.IOException: Serializer for custom type 'janusgraph.RelationIdentifier' not found. Googling around I got that this is due to serialization issue. It looks to me that the gremlin-client and my java application has similar configs but gremlin-client is not having any serialization problem. ``` hosts: [localhost] port: 8182...
Solution:
I have faced a similar issue in the past (but mostly related to gremlin-python) and @Boxuan Li suggested a solution in the JanusGraph discord server. It was something like along these lines: ``` private static MessageSerializer createGraphBinaryMessageSerializerV1() { final GraphBinaryMessageSerializerV1 serializer = new GraphBinaryMessageSerializerV1();...
Ddracule_redrose3/19/2024

Design decision related to multiple heterogenous relational graphs

I'm working with over 100k instances of heterogeneous, relational node-and-edge attributed graphs, each graph having around 5k vertices and 10k edges. Vertices are of 3 types with 10 attributes (7 numerical, 3 string), and edges are of 5 types with 8 attributes (4 numerical, 4 string). Considering the complexity and size of the data, running queries like traversal paths, average clustering coefficients, and identifying nodes in clustering triangles across all these instances presents a significant challenge. I've been using a naive gremlin-server setup with an in-memory database to run my queries on one graph instance, but it's becoming clear that this approach isn't sustainable for multi-graph persistence or memory efficiency, as a single graph instance consumes about 1.2 GB of RAM. I'm exploring the possibility of switching to JanusGraph with a Berkeley DB backend to support persistent storage of multiple graphs (based on the feedback I got from the gremlin google group, https://groups.google.com/g/gremlin-users/c/UotOZFVvi3k/m/-hVd2oNNAQAJ). Given the data structure and requirements, especially the need for efficient loading and querying of individual graph instances in a possibly serializable fashion, do you think JanusGraph with Berkeley DB is a viable solution, or are there alternative approaches I should consider for managing and querying this volume of graph data effectively?...
Solution:
No we actually recommend using user-defined IDs
Mmrckzgl3/11/2024

Stackoverflow when adding a larger list of property values using traverser.property()

Hey, we encounter a stack overflow: ``` Exception during Transaction, rolling back ... org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep.hasNext(org/apache/tinkerpop/gremlin/process/traversal/step/util/AbstractStep.java:150): Java::JavaLang::StackOverflowError from org.apache.tinkerpop.gremlin.process.traversal.step.util.ExpandableStepIterator.next(org/apache/tinkerpop/gremlin/process/traversal/step/util/ExpandableStepIterator.java:55)...
Ccpchung3/10/2024

java: package org.apache.tinkerpop.shaded.jackson.core does not exist

While trying to mvn clean install with jdk11, I ran into the above error using the master branch. Any idea?
TTanvir3/6/2024

Performance issue in large graphs

When performing changes in large graph (ca. 100K nodes, 500K edges) which is stored in one kryo file I am experiencing some huge delays. Just as an example, when writing initially I can change 10K nodes in minutes, but when the graph is big the same changes need more than one hour. Is there any easy solution possible, i.e., like breaking down and saving in smaller files etc. Any suggestion is helpful. Initial preference is saving in file system (local or network). Thanks for your suggestions/sol...
Solution:
I'm not sure if any of the other serializations such as GraphML or GraphSON might perform better, but I would say this is likely not a common way we see those graphs used so we may not have too much data on which techniques may work best. With the exception of TinkerGraph which is often used as an in-memory, somewhat ephemeral, graph, we typically see persistent graph stores used where the data is persisted on disk by the database and you do not need to constantly reload the data each time. If y...
Ttien3/4/2024

Concurrent queries to authentication required sever resulted in 401 error

Hey guys, playing around with gremlin & encountered this very odd error where concurrent queries will break authentication: ```js import gremlin from "gremlin"; ...
Solution:
Looks like a bug. Could you create an issue in https://issues.apache.org/jira/projects/TINKERPOP ?...
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/...
Next