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

Gremlin Python: Count vertices and its children in one query

I am trying to get the count of all vertices with a particular label and all its children in one query like so: g.V().hasLabel('folder').has('folder_name', 'root').as_('a', 'b').select('a',…
Raghav Jajodia
  • 419
  • 4
  • 6
4
votes
1 answer

Amazon Neptune: How to create custom vertex id in Python using tinkerpop/gremlinpython package?

As outlined here https://docs.aws.amazon.com/neptune/latest/userguide/access-graph-gremlin-differences.html custom vertex ids can only be set with the unquoted id property, i.e., g.addV('label1').property(id, 'customid'). How can one accomplish this…
JTW
  • 3,546
  • 8
  • 35
  • 49
4
votes
2 answers

How to retrieve a property value of a vertex in python gremlin

It might be easy, but I am really struggling with this problem. I use gremlin python lib and aws neptune db. I know the vertex id, I just want to get the value(String type in python) of one of the properties of the vertex, and update it. I have…
Hongli Bu
  • 461
  • 12
  • 37
3
votes
1 answer

gremlin how to set scriptevaluationtimeout 0

I want to set scriptevaluationtimeout 0. I'm using apache-tinkerpop-gremlin-console-3.4.9. and I want to use gremlin-python.
3
votes
1 answer

Get all paths in a graph from a node, but only ones which terminate

I have written the following query which returns all paths possible from the specified node. g.V().repeat(bothE().bothV().simplePath()).emit().dedup().path() If we had a simple graph of 3 nodes in this structure: A -- edge_1 -> B -- edge_2…
KOB
  • 4,084
  • 9
  • 44
  • 88
3
votes
1 answer

Gremlin query to find the entire sub-graph that a specific node is connected in any way to

I am brand new to Gremlin and am using gremlin-python to traverse my graph. The graph is made up of many clusters or sub-graphs which are intra-connected, and not inter-connected with any other cluster in the graph. A simple example of this is a…
KOB
  • 4,084
  • 9
  • 44
  • 88
3
votes
1 answer

Gremlin Python - "Server disconnected - please try to reconnect" error

I have a Flask web app in which I want to keep a persistent connection to an AWS Neptune graph database. This connection is established as follows: from gremlin_python.process.anonymous_traversal import traversal from…
3
votes
1 answer

Can't add vertex with python in neptune workbench

I'm trying to put together a demo of Neptune using Neptune workbench, but something's not working right. I've got this block set up: from __future__ import print_function # Python 2/3 compatibility from gremlin_python import statics from…
lostinplace
  • 1,538
  • 3
  • 14
  • 38
3
votes
1 answer

Gremlin: Find all nodes from one set with a connection to another

Given two Gremlin queries q1 and q2 and their results ri = qi.toSet(), I want to find all nodes in r1 that have a connection to a node in r2 - ignoring edge labels and direction. My current approach included the calculation of shortest paths between…
Green绿色
  • 1,620
  • 1
  • 16
  • 43
3
votes
1 answer

Geolocation distance with AWS Neptune?

I'm trying to use Amazon Neptune, in my gremlin query I need to filter nearby users and also filter by other relationships, similar to what Tinder (a dating app) does. So I need a geolocation distance calculation into the query. I can't find that…
fermmm
  • 1,078
  • 1
  • 9
  • 17
3
votes
2 answers

How to use geoshape in gremlinpython

In JanusGraph,there is some function like g.E().has('place', geoWithin(Geoshape.circle(37.97, 23.72, 50))) to search place data. Now I want to use gremlinpython to do that,but I can't find the suitable API from the document.
ehds
  • 665
  • 1
  • 6
  • 16
3
votes
1 answer

Gremlin Python - Script based method not returning all - JanusGraph

I am running JanusGraph 0.3.1 and using gremlin python 3.3.4 and python3.7 In the test case below, I created 65 vertices. When I use g.V(list_of_ids).valueMap(true).toList(). JanusGraph returns only 64 results instead of 65. As a workaround I…
Moses
  • 113
  • 8
3
votes
2 answers

Gremlin-Python: Returning a fully populated subgraph

I am using the Gremlin-Python Client to query Gremlin Server with a janusgraph backend. Running the following query: graph = Graph() g = graph.traversal().withRemote(DriverRemoteConnection('ws://localhost:8182/gremlin','g')) sg =…
Moses
  • 113
  • 8
3
votes
1 answer

OrientDB Gremlin server not working in python

I am using the orientdb and gremlin server in python, Gremlin server is started successfully, but when I am trying to add one vertex to the orientdb through gremlin code it's giving me an error. query = """graph.addVertex(label, "Test", "title",…
Ravindra Gupta
  • 1,256
  • 12
  • 42
3
votes
1 answer

Gremlin-python in jupyter notebook

I`m trying to use tinkerpop3.2.3 to conncet janusgraph0.1.1 on my centOS7, everything works fine in gremlin shell. I tried to use gremlin-python3.2.3 in python shell, it also works well. But when I moved my codes to jupyter notebook, I got…
Luke Wang
  • 31
  • 2
1
2
3
14 15