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
2
votes
2 answers

Python and graph database. Use java lib wrapper or REST api?

I want to ask you about the best way to use graph database (Neo4j) in Python. What you think, should I use "neo4j/python-embedded" (neo4j/python-embedded with JPype) or maybe "bulbflow" (bulbflow, with Rexster, Gremlin and REST api)? Is REST api…
User
  • 1,978
  • 5
  • 26
  • 47
2
votes
1 answer

Turn gremlin query result with elementMap into JSON [gremlinpython 3.6.1]

Continuing discussion from here. I've a query that provides list of paths along-with elementMap(). How do I convert this data to JSON to be consumed by rest of the code. I did look here that talks about using GraphSONMapper. However, I am using…
Anil_M
  • 10,893
  • 6
  • 47
  • 74
2
votes
0 answers

How to connect gremlin with python runtime in GCP environment?

Janusgraph is deployed and running in GCP container, I can access that using Cloud shell. I want to perform some CRUD operation using python runtime. What are the connection URL, and ports I have to mention to get proper result. Docs used to create…
2
votes
1 answer

Gremlin / tinkerpop: insert key:value property constant in every vertex and edge traversed then return path

Using AWS Neptune with Gremlin query language (last version). Using sample data inserted this way: g.addV('test_report').property('name', 'REF').property('creationDateTime','2022-07-01 00:00:00.000000') g.addV('test_reportrelease').property('name',…
Cwellan
  • 305
  • 1
  • 3
  • 12
2
votes
1 answer

Efficient controlled random walks in gremlin

Goal The objective is to efficiently generate random walks on a relatively large graph with uneven probabilities of going through edges depending on their type. Configuration Ubuntu VM, 23Go RAM JanusGraph 0.6.1 full Local graph (default…
GregoirePelegrin
  • 1,206
  • 2
  • 7
  • 23
2
votes
2 answers

Bulk upsert in gremlin_python fails with "TypeError: 'GraphTraversal' object is not callable"

I am new to Gremlin and trying to perform bulk upsert in neptune db with gremlin_python. I found this solution in google groups l = [ [name:'josh',age:29,country:'usa'], [name:'bar',age:24,country:'usa']]; g.inject(l). …
Yury Lvov
  • 21
  • 2
2
votes
2 answers

Can I use the Gremlin Python client in a Jupyter notebook and avoid event loop errors?

I am aware of the graph-notebook project that allows Gremlin queries to be submitted using magic commands. However, sometimes I need to code in Python and connect to the server using code, from within a regular Jupyter notebook cell. If, using the…
2
votes
1 answer

Neptune - RuntimeError: Connection was already closed in pythongremlin

I keep getting the following error even after implementing backoff. connection -> db.py import os import logging import sys from gremlin_python.driver import serializer from gremlin_python.driver.protocol import GremlinServerError from…
Thirumal
  • 8,280
  • 11
  • 53
  • 103
2
votes
0 answers

Why am I getting "AttributeError: 'NoneType' object has no attribute 'processor'" using client instance of gramlin_python?

I am using Jupyter Notebook to execute gremlin query over Neptune Database and retrieving information from MySQL database and generating gremlin query string, which is being execute by Client module of "gremlin_python library" as follows. def…
Ranjit Soni
  • 594
  • 6
  • 19
2
votes
1 answer

Merge vertices, including properties and incoming/outgoing edges

How can I merge vertices, including their incoming/outgoing edges and their properties? I used this answer and it does almost exactly what I hoped for, but in case both vertices have the same property, only one of them gets to the resulting united…
Amitay Dror
  • 155
  • 6
2
votes
1 answer

Is there a way to cast a gremlinpython Graph to a networkx Graph

I want to cast a gremlinpython Graph (gremlin_python.structure.graph.Graph) into a networkx graph. I found that with package ipython-gremlin (https://github.com/davebshow/ipython-gremlin) one can convert vertices to pandas dataframes and edges to…
cabo
  • 127
  • 1
  • 9
2
votes
1 answer

How to make gremlin_python DriverRemoteConnection to have timeout and retry limit for each submit?

Disclaimer: We are currently using gremlinpython==3.4.8 and I believe some of this has been addressed in the more recent releases but I'm not sure. In general this seems like a very active repository with some relevant changes in the past two latest…
user3659451
  • 1,913
  • 9
  • 30
  • 43
2
votes
1 answer

Vertex in Python Gremlin not updating

Using python gremlin on Neptune workbench, I have two functions: The first adds a Vertex with a set of properties, and returns a reference to the traversal operation The second adds to that traversal operation. For some reason, the first function's…
lostinplace
  • 1,538
  • 3
  • 14
  • 38
2
votes
1 answer

Retrieve all IDs for duplicate vertices in Gremlin

Problem I am running a query which finds duplicate vertices by the name property. I would like to know the IDs for all the corresponding vertices. At this time, only the ids in the where clause are returned. Example graph Here is a toy example…
Nathan McCoy
  • 3,092
  • 1
  • 24
  • 46
2
votes
2 answers

Gremlin python return edges with all properties

I'm using gremlin Python to query a Neptune DB. Given a vertices, I need to return all the outward edges with their 'from' and 'to' ids, label and any other properties. The query below query_result = g.V().has('name',…
Paul C
  • 303
  • 5
  • 15
1 2
3
14 15