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
0
votes
1 answer

Gremlin: Find all the paths between two nodes and transform the query result into JSON format

I'm writing Gremlin python queries on a Neptune database I want to find all the paths between a node A and a node B. Then I would like to write the data into a JSON format that looks like this: { "nodes": [ { "id": 1, "name": "A",…
0
votes
1 answer

GremlinPython: ConnectionResetError: Cannot write to closing transport

I am facing the below problem very often in AWS lambda - Neptune. using the latest version gremlinpython==3.5.1. How to fix? even in the previous version - same problem user_available = g().V(cognito_username).hasNext() File…
Thirumal
  • 8,280
  • 11
  • 53
  • 103
0
votes
1 answer

How to pass multiple id's/values in the gremlin query?

How to pass multiple id's/values in the gremlin query? g.V().hasNot(T.id, [need_to_pass_multiple_id's]).....
Thirumal
  • 8,280
  • 11
  • 53
  • 103
0
votes
1 answer

How to calculate the PageRank and shortest path algorithm with gremlin in Amazon Neptune?

Is there any way to calculate PageRank and Shortest Path algorithm with gremlin in Amazon Neptune? As it said in gremlin documentation PageRank centrality can be calculated with Gremlin with the pageRank()-step which is designed to work with…
Elite
  • 5
  • 5
0
votes
0 answers

AWS Lambda access Neptune on the same VPC

I have the following lambda code to try to access Neptune from the same VPC on AWS. Which most copied from https://docs.aws.amazon.com/neptune/latest/userguide/access-graph-gremlin-python.html. But I am getting 403 Forbidden error. The source…
0
votes
1 answer

Gremlin docker server connection not working

I'm running a gremlin server using the official docker container: docker run --rm -it -p 8182:8182 --name gremlin tinkerpop/gremlin-server I then try to run the following script from the host machine: from gremlin_python.process.anonymous_traversal…
Dominus
  • 808
  • 11
  • 25
0
votes
0 answers

Gremlin Python: Response of queries are different

I think i made a mistake such a duplicate the vertices. I have two query and responses are different. from gremlin_python.process.traversal import P d_o_c = graph.V().has("cid", "value", '123124').in_('o_f_d').values().toList() c_o_d =…
Berkay
  • 91
  • 7
0
votes
1 answer

Gremlin Python: Query a list and that returns key/value list

I want to query a list and the query response must return to me which response of the list item. For example: a = [1,2,3] graph.V().has("cid", "value", P.within(a)).in_('o_f_c').out('o_f_c').values().toList() The response of above query…
0
votes
1 answer

How to return NULL/empty space when the expected property doesn't exist in some of verxtes /edges

I am getting the following error, because some of the vertexes don't have the expected property. The property does not exist as the key has no associated value for the provided element Query:- get_g().V().hasLabel(search_vertex).has(T.id,…
Thirumal
  • 8,280
  • 11
  • 53
  • 103
0
votes
1 answer

How to write a Gremlin query when the number of input vertices is unknown?

How to write a Gremlin query when the number of input vertices is unknown? Scenario: 1. Poll -> Already existing vertex. 2. Poll Question -> User might send multiple questions that are unknown and multiple options to the question (unknown list). I…
Thirumal
  • 8,280
  • 11
  • 53
  • 103
0
votes
1 answer

Accessing and compare properties of the stored edge in traversal

I have following graph model: I want to select user, who has performed action via the controller. The performed-by edge contains used_user_key property, that i want to use in order to select the called-by edge connected to the required user on the…
Bogdan Sulima
  • 418
  • 4
  • 10
0
votes
1 answer

How to unit test Gremlin Queries on JanusGraph using FastAPI and GremlinPython

I have written a Python REST API using FastAPI. It connects to Janus Graph on a remote machine and runs some Gremlin Queries using the GremlinPython API. While writing my unit tests using FastAPI's built in test client, I cannot mock Janus Graph and…
RRR
  • 31
  • 2
0
votes
1 answer

AWS Neptune python gremlin certificate verify failed

I have setup a ssh tunnel from local machine to neptune db and established a connection using endpoint. ssh -L 8182:***.us-east-1.neptune.amazonaws.com:8182 **** I see gremlin console work fine and i can able to run graph query but When i attempt…
0
votes
1 answer

How to add properties with a specific type into gremlinpython?

Currently i am trying to import via gremlinpython a large graph from igraph programmatically . I am rather new to gremlin and the endpoints i may use it with. The problem i currently face is that a property in a node/edge can have multiple types.…
Luxii
  • 133
  • 2
  • 9
0
votes
1 answer

How can I make complex Gremlin queries in AWS Neptune without variables?

I'm using Amazon Neptune, which does not support variables. For complex queries, however, I need to use a variable in multiple places. How can I do this without querying twice for the same data? Here's the problem I'm trying to tackle: Given a…