Questions tagged [gremlin]
Gremlin is the graph traversal language and virtual machine of Apache TinkerPop™
3,182
questions
0
votes
0
answers
9
views
Gremlin - How to use the folded List Result of one traversal as the operand of a within statement
I am currently working on a query that pulls a list of viewed products for a user and then pulls a list of products purchased within orders. I would like to filter the list of viewed products against ...
2
votes
0
answers
33
views
Complex Cypher Traversal with Math
I'm relatively new to Neo4j and graph databases, so bear with me.
I want to traverse through our Neo4j database in the most efficient way possible. While traversing, I need to do some math along the ...
0
votes
1
answer
33
views
Efficient count of incoming edges Janusgraph
Goal:
Sort the vertices of a given label by the descending number of incoming edges of a given type in the most efficient way.
Configuration:
Ubuntu VM, 23Go RAM
JanusGraph 0.6.1 full
local graph (...
0
votes
1
answer
31
views
Performant Gemlin query for fetching nodes with corresponding edges in specified depth
I'm trying to fetch a specific node in my graph by its id with its outgoing nodes and edges in a specified depth. The resulting JSON should make it easy to determine which edge belongs to which node. ...
0
votes
1
answer
24
views
How to rename groupBy labels in Gremlin query?
gremlin> g.V().has('KType', 'ec2.Subnet').groupCount().by('DefaultForAz')
2==>{false=4, true=14}
I need to rename the group by tags, and bring in something logical instead. In this case, it ...
0
votes
0
answers
50
views
Gremlin - Add/Update property for an existing vertex
I've tried adding sideEffect or using property with gremlin:
const addSource = this.__.addV(source.label)
.property(GREMLIN_ID, source.id)
.property("created_timestamp", new Date(...
1
vote
1
answer
26
views
Gremlin - avoid traversing already seen edges
I've the following model which I'd like to model as a graph in Azure CosmmodDB.
So I have a user that can be in multiple groups, user can also have multiple permissions attached, groups can also have ...
0
votes
0
answers
26
views
Gremlin JavaScript client doesn't throw exception on socket disconnection
I'm using the gremlin package version 3.5.2 with NodeJS.
If the server disconnects while the client waits for a query result from the server (await t.next()), the promise never finishes and the ...
0
votes
2
answers
42
views
Is there a way to group by month name from a date field in neptune
I am using aws neptune because of all the advantages it brings for developing a very configurable solution etc. It has been going very well till now until I am required to pull reports based on month ...
1
vote
1
answer
25
views
I am facing issues with group() in gremlin
I am trying to find the count of all workspaces group by Customer, and then sorting the response with the count value.
t3 = g.withSideEffect("Neptune#repeatMode","BFS")
.V().has(&...
0
votes
1
answer
28
views
Gremlin to Gremlinq translation: How to select those edges whose out vertices satisfy a condition?
I have this gremlin query:
g.V().hasLabel('Resource').has('name', 'Studio')
.inE("IsAssignedTo")
.as("roles")
.outV().has("User", "name", "Jon Doe")....
1
vote
1
answer
41
views
AWS Neptune Query gremlins slowness on cold call
I'm currently running some queries with a big gap of performance between first call (up to 2 minutes) and the following one (around 5 seconds).
This duration difference can be seen through the gremlin ...
1
vote
1
answer
14
views
Gremlin how do I get the outV of Edge?
Let's say I want to filter my Edges by the outV.
Can't seem to figure out what to do after g.E().hasLabel('HasGeneralPhoneLineType')
I've tried:
g.E().hasLabel('HasGeneralPhoneLineType').has('outV','...
0
votes
1
answer
25
views
Neptune DB slow query when using text predications
When trying to find list of users that startsWith some text example :
g.V().hasLabel('user').has('username', startingWith('m')).limit(12).values('username'); //4 Seconds
g.V().hasLabel('user').has('...
0
votes
1
answer
28
views
Unable to filter Gremlin query result conditionally
I have Gremlin query where I need to filter the result at the end. An employee id, skill name and date is passed as parameters. If the employee has that skill, only that employee id will be returned ...
0
votes
1
answer
34
views
Gremlin/Python: run query as string
I have the following code, and run as expected. But I need to use the "g" traversal object to manipulate the graph.
from gremlin_python.process.anonymous_traversal import traversal
from ...
0
votes
1
answer
46
views
gremlin query to control return result format
We can get all the data we want from a query with gremlin.
For example,
g.V(1234)
.project("identifier", "associations")
.by(valueMap(true)).by(unfold())
.by(bothE().local(...
0
votes
1
answer
28
views
Why CommitAsync does not complete in Gremlin .NET Transactions
I am having trouble with gremlin .NET
Gremlin server: 3.6.0
Gremlin .NET: 3.6.0
Code:
var gremlinServer = new GremlinServer("localhost", 8182);
ConnectionPoolSettings connectionPoolSettings =...
1
vote
1
answer
30
views
+50
Missing Gremlin methods and types in typescript types package
I'm working with gremlin 3.5.2 and have the types dependency on:
"@types/gremlin": "^3.5.2"
But the tx() method isn't defined on the GraphTraversalSource.
I see the method is ...
0
votes
1
answer
46
views
Can I use Flutter with an embedded graph database preferably using Gremlin (Apache TinkerPop)?
I'm wondering what options are out there for a mobile app written in Flutter to preferably embed and use a local graph database like Bitsy or any other Gremlin/Apache TinkerPop compatible graph ...
0
votes
1
answer
41
views
How to convert cypher to gremlin?
I am new to gremlin.I need to convert my cypher query to gremlin.
My cypher query:
match(s:Student)-[:STUDIED_AT]-(c:College)
with s,c
match(s)-[:LIVES_IN]-(l:Location)
return s,c,l limit 10
I ...
0
votes
0
answers
29
views
Could anyone translate this emit().repeat() Gremlin Query to ExRam.GremLinq
I am trying to translate this query to GremLinq
g.V().has("Role", "name", within("Admin", "Super Admin"))
.emit()
.repeat(out('IsParentOf'))
.out('...
0
votes
1
answer
45
views
Check if a vertex exist, if it doesn't create it using an injected list of properties
UPDATE:
I feel silly. Decided to just query the db for a list of all the names, list_of_names_in_db = g.V().hasLabel('Person').values('name').toList() then comparing list_of_name_in_db to batch and ...
1
vote
1
answer
50
views
TinkerPop Gremlin Repeat until nodes with specified label
In my graph there are 2 type of labels: a and b and a boolean property travel_by.
I would like to perform BFS (with max depth of 5): start from a given node and get all the first nodes with label a.
I ...
1
vote
1
answer
23
views
Gremlin - run additional traversal in same query in case not enough values are found
Is there a way to check how many records were found, and in case less than X records were returned do another query?
For example first run this query ->
g.V().
hasLabel('courseContent').
has('...
0
votes
0
answers
27
views
Gremlin - get random query results after filtering
I have the following query:
g.V().
hasLabel('courseContent').
has('status', 'active').as('cc').
outE('ccBelongsToCourse').
has('status', 'active').
inV().
hasLabel('course').
has('...
1
vote
1
answer
72
views
Neptune and Gremlin - wild CPU utilization
Issue
I'm seeing extremely high CPU utilization when making [what seems like] a fairly common ask to a graph database. In fact, the utilization is so large that Amazon Neptune seems to "tap out&...
0
votes
1
answer
27
views
Query for multiples edges select() with count() gremlin
Trying to get the corresponding count of selected values in a single query with gremlin.
g
.V("00000000000000000000000000000000").outE().as("fpEdges")
.V("facade00-0000-...
0
votes
1
answer
19
views
Java Gremlin union with project incompatible types error
I have such gremlin query which perfectly works in gremlin console:
g.V().has("Role", "id", "billing-admin").union(
__.valueMap().by(__.unfold()),
__.project(&...
1
vote
1
answer
30
views
How do we convert string to number in a gremlin step?
I have a graph which has vertex E1 with property "price" and "name" which are storing String values. I need to calculate sum of the column "price" grouped by "name&...
1
vote
1
answer
45
views
Connection refused when connecting to JanusGraph using gremlin-go
I fail to connect to JanusGraph via gremlin-go - connection is refused. According to gremlin-go documentation, it allows to connect to any graph database that supports TinkerPop3, e.g. JanusGraph, ...
0
votes
1
answer
30
views
Gremlin - Expecting valueMap values are as a string instead of array
g.V(VertexId).valueMap("tags") returns
{'tags': ['My Last Day', 'Poor Connection > Netenter code herework Issue', 'Or Hello > Equals Hi > Last Message ', 'Network Issue', 'Last ...
0
votes
1
answer
35
views
Gremlin query does not show constant error message when values not found
I have a Gremlin query where I need to check almost in every step if the passed param values are found, if yes then proceed to the next step otherwise exit the query with an error message which will ...
-1
votes
1
answer
26
views
How to get a properly formatted Tree hierarchy Json using Gremlin query
I am trying to retrieve the Tree hierarchy structure from AWS Neptune DB. i am using the below query to retrieve the data in JSON format
g.V().hasLabel(labelid.toLowerCase()).has("name", &...
0
votes
1
answer
26
views
Sack Sum By operation causes AWS Neptune error
Problem up-front: AWS Neptune seems to break when using a .sack(__.sum).by() operation.
Background:
Here is a small bit of data on which to test
The query in question works fine via the Gremlin ...
0
votes
1
answer
16
views
How to recursively search UP a Gremlin TinkerPop tree using Until and In
I have a TinkerPop Graph on a Gremlin Server and I'm trying to recursively search up a tree from a leaf until I can get to the root.
Given a tree that looks like this
I can query Items and Packages ...
0
votes
1
answer
128
views
Gremlin: Shortest logistical route between A and B while respecting schedules + other constraints
Preface
I'm new to Gremlin and working through Kelvin Lawrence's awesome eBook on the topic in order to solve a specific use-case.
Due to the sheer amount to learn, I'm asking this question to get ...
0
votes
1
answer
74
views
Mysterious timeout when connecting to neptune db
I'm getting this error message when trying to connect to a aws neptune db from a lambda:
2022-05-05T18:36:04.114Z e0c9ee4c-0e1d-49c7-ad05-d8bab79d3ea6 WARN Determining whether retriable error:...
0
votes
1
answer
42
views
Sort vertices by presence of 2 properties
UPDATE 1
I've added the descLength and imageLength properties to allow for easier sorting. The idea is that constant(0) can be used to fill in the values for users who lack either property, and any ...
0
votes
1
answer
24
views
Is there a version of gremlin "bothE" that isn't actually "eitherE"?
I want to find all vertecies which has an edge to a specific vertex but the vertex should also have an edge back to the other vertex.
The following query does not behave in the way i want, it seems ...
0
votes
2
answers
65
views
Why is my gremlin.net gremlin client not working with azure cosmos graph db
I've set up a serverless azure cosmos graph db account and now I'm trying to connect to it using the following code:
.AddSingleton(s =>
{
var connectionPool = new ConnectionPoolSettings
...
1
vote
1
answer
45
views
Could not locate method: NeptuneGraphTraversal.values()
I'm getting this error Could not locate method: NeptuneGraphTraversal.values() when running a query using gremlin for aws neptune. The specific query is this:
import { process } from 'gremlin';
const ...
0
votes
1
answer
47
views
Gremlin HasStep label condition on vertex or edge
Is there any way to find out if hasLabel() step is applied on vertices or edges? I know we can keep track of it while iterating through all the steps in recursion. But it may not be straight forward ...
0
votes
1
answer
33
views
How do I pull specific property values from an injected object when adding a batch of edges in a Gremlin/TinkerPop traversal?
I want to add batches of edges to a JanusGraph db that already contains nodes. I want my edges to support setting dynamic/optional properties.
I've cobbled together the following traversal (based on ...
0
votes
0
answers
58
views
Gremlin Java client throws a java.util.concurrent.TimeoutException
We have a AWS Neptune db.r4.large instance which with 2vCPUs can run 4 threads and hence 4 queries maximum at a time. We use the Gremlin Java client to connect to AWS Neptune. We are seeing regular ...
0
votes
1
answer
70
views
AWS Neptune: Notebook Does Not Connect Though I Can Connect to the DB from my EC2 Instance
Problem
I have created an AWS Neptune DB cluster and it does not connect from the Jyupiter Notebook (SageMaker). The status check does not respond and eventually displays a timeout message after a ...
0
votes
0
answers
16
views
Java connect to gremlinserver
strong text
Trying to connect gremlin server, but problem occured.
Then I change the GraphMessageSerializerV3d0 to GraphSONMessageSerializerV3d0,but also have some problems.enter image description ...
1
vote
1
answer
64
views
How to load a XML file in Gremlin
gremlin> graph.io(graphml()).readGraph('airroutes.xml')
airroutes.xml (The system cannot find the file specified)
Type ':help' or ':h' for help.
Display stack trace? [yN]
g=graph.traversal()
This ...
1
vote
2
answers
31
views
Project by, with optional properties
I believe this question is for Tinkerpop, not specific to the CosmosDB implementation; just some semantics might be baked into my query examples.
I've developed a data layer that creates queries based ...
0
votes
1
answer
43
views
create vertex if not exists with nodejs gremlin
I'm trying to use the technique described here for preventing duplicated edges in gremlin. I'm working in javascript and the query is failing with this error: Server error: Neither the map, ...