Questions tagged [gremlinpython]

see https://pypi.org/project/gremlinpython/ Gremlin-Python implements Gremlin within the Python language and can be used on any Python virtual machine including the popular CPython machine.

Links

223 questions
1
vote
0 answers

Multiprocessing gremlinpython queries

Goal: Accelerate the random walk generation by using multiple processes. Get the list of vertices ids from which I want random walks to be generated in an input queue Start as much processes as possible with the correct parameters Make them put the…
1
vote
1 answer

gremlin_python query 'object is not callable' error when trying to filter

I have some experience with using gremlin in the console but I'm fairly new to gremlin in python. I have found a query that does what I want it to do in the console but I get a 'GraphTraversal' object is not callable error when I try to convert it…
d95l
  • 13
  • 2
1
vote
1 answer

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 gremlin_python.driver.driver_remote_connection import…
user1187968
  • 7,154
  • 16
  • 81
  • 152
1
vote
0 answers

Tinkerpop Gremlin: Add both vertex and edge conditionally

need some tips/advise on a gremlin query ... :) I have these types of vertices ... orders: id, cid (string), ts (long) // predicates for the orders ip: id phone: id // few more and Edges go from predicates to orders: ip -- ip_used_in -->…
sas1138
  • 338
  • 5
  • 16
1
vote
1 answer

Spawning child traversals anonymously using Gremlin-python and graphexp

I'm trying to create a graph from scratch that i'm visualising in graphexp, but i'm struggling to undertand the anonymized traversals concept and how to create them I'm using python 3.9 and gremlinpython 3.5.1 Creating the connection and…
1
vote
1 answer

What is the correct way to store date/timestamp in Gremlin based database like Neptune?

What is the correct way to store date/time stamp in a gremlin-based database like Amazon Neptune? When I try the following in python current_timestamp = datetime.datetime.now() g.E('d').property('otp_verified_on', current_timestamp).next() it gives…
Thirumal
  • 8,280
  • 11
  • 53
  • 103
1
vote
1 answer

Is there a way to execute text gremlin query with PartitionStrategy

I'm looking for an implementation to run text query ex: "g.V().limit(1).toList()" while using the PatitionStrategy in Apache TinkerPop. I'm attempting to build a REST interface to run queries on selected graph paritions only. I know how to run a raw…
rrmerugu
  • 1,826
  • 2
  • 20
  • 26
1
vote
2 answers

How to traverse using `startsWith()` in gremlin?

How to traverse using startsWith() in…
Thirumal
  • 8,280
  • 11
  • 53
  • 103
1
vote
1 answer

Why running same query for tinkergraph and janusgraph, produces different result?

I tried following query with Gremlin and Tinkerpop gremlin> graph = TinkerGraph.open() ==>tinkergraph[vertices:0 edges:0] gremlin> g = traversal().withEmbedded(graph) ==>graphtraversalsource[tinkergraph[vertices:0 edges:0], standard] gremlin> v =…
Sumit Kumar
  • 678
  • 4
  • 19
1
vote
1 answer

Error in event loop with Flask, gremlin python and uWSGI

I'm running into a problem when using Flask with a gremlin database (it's an Amazon Neptune database) and using uWSGI. Everything works fine in my unit tests which use the test_client provided by Flask. However, in production we use uWSGI and there…
cts
  • 1,790
  • 1
  • 13
  • 27
1
vote
0 answers

Python/Neptune/Gremlin: "'list' object has no attribute 'next'"

I trying to mirror the following gremlin code in Python to do pagination. gremlin> t = g.V().hasLabel('person');[] gremlin> t.next(2) ==>v[1] ==>v[2] gremlin> t.next(2) ==>v[4] ==>v[6] Here are the Python code from…
user1187968
  • 7,154
  • 16
  • 81
  • 152
1
vote
1 answer

Add count of outgoing edges to a vertice's elementMap

using the airport dataset, I want to return a full elementMap of every airport - plus the count of incoming "route" edges. What I have right now looks like this (Link to the example: https://gremlify.com/z05d54wyt99) g.V().hasLabel('airport'). …
R4h4
  • 65
  • 4
1
vote
1 answer

Gremlin with low response time on 50M edge on AWS Neptune

I am implementing a recommendation system with gremlin. I have 2M users and 20k books. When a user buys a book, it creates an edge to the book. I have total of 50M edge over the graph. I am using basic queries but it runs too slow. I am planing to…
1
vote
1 answer

How do you add edges to existing vertices in Gremlin-python?

What is the standard way to add edges between two already existing vertices in gremlin-python? I've tried numerous iterations including the two code versions below, but unfortunately they all lead to errors. Code snippet 1: v1=…
Sagar
  • 11
  • 1
1
vote
1 answer

How to handle Transaction (Rollback and Commit) in Gremlin - AWS Neptune

How to handle Transaction (Rollback and Commit) in Gremlin - AWS Neptune? In a request, I have two details, 1. Create student vertex with properties 2. Create Edge b/w class & student 3. Create a list of subjects vertex…
Thirumal
  • 8,280
  • 11
  • 53
  • 103