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

gremlin query to n hops and traversal of all sub edges and nodes

I am trying to create a graph where i can find all relationships with given person and list of their friends. the problem statement my graph looks like this bob ->friends -> jay jay -> friends -> mack jay -> friends - > john mack -> friends ->…
Aaron
  • 662
  • 8
  • 20
1
vote
1 answer

What Gremlin query can I write to create custom relationships between all pairs nodes that have a certain number of connections in common?

In AWS Neptune, I have a graph that has many clusters like the one defined below: g.addV('person').property('name', 'John').as('p1') .addV('person').property('name', 'Weihua').as('p2') .addV('Fellowship of the Ring').as('movie1') .addV('A New…
1
vote
0 answers

gremlinpython submit async query returns ClientConnectorCertificateError in Django

I have a module that manages Azure Cosmosdb Gremlin queries. When I call it from jupyter notebooks like this, it works fine. However, when calling it from the Django app I get a ConnectionError: Cannot connect to host…
billmanH
  • 1,298
  • 1
  • 14
  • 25
1
vote
0 answers

How to multiply some values of a groupCount() in gremlin queries if a acertain condition is met

So, imagine a simple graph for a social network, where you have profile nodes and post nodes. Profiles can follow other profiles, and profiles can also watch, like and publish posts. So overall, 4 types of edges. Then, given a target_profile and a…
jvmunhoz
  • 11
  • 1
1
vote
1 answer

Is it possible to upload files from efs instance to amazon Neptune through python

I have files stored in EFS. I want to upload the files to Neptune. I came across many references where files are uploaded to Neptune from S3. But in my use case i am having files in EFS. Is it possible to upload from efs to Neptune through…
1
vote
1 answer

search for value by key within dynamic collection

I am looking to extend discussion held here about filtering vertices based on property value from collection. However, in my case the collection is dynamic e.g. generated using store e.g. following works using a static list ['red', 'green']. I am…
Anil_M
  • 10,893
  • 6
  • 47
  • 74
1
vote
1 answer

Why "_ipython_canary_method_should_not_exist_" occurs in Jupyter?

I was trying to reach the janusgraph deployed inside the GKE cluster, using the below code. from gremlin_python import statics from gremlin_python.structure.graph import Graph from gremlin_python.process.graph_traversal import __ from…
1
vote
1 answer

How to connect Janusgraph deployed in GCP with Python runtime?

I have deployed the Janusgraph using Helm in Google cloud Containers, following the below documentation: https://cloud.google.com/architecture/running-janusgraph-with-bigtable, I'm able to fire the gremline query using Google Cloud Shell. Snapshot…
1
vote
1 answer

Gremlin filter one query's output based on another query

I have two gremlin queries. I want to filter out the output of one query based on the results of another query. For example, query 1: g.V().hasLabel('Person').values('name') gives the following output - John, Sam, Rocky query 2:…
Avijit Dasgupta
  • 2,055
  • 3
  • 22
  • 36
1
vote
0 answers

Azure Cosmosdb query runs fine in portal but not in text string

My query string is propperly escaped: "g.addV('planet').property('name','D\\PA') .property('class','terrestrial') .property('objid','2875301669077') .property('label','planet') .property('radius',0.0814) .property('mass',0.9808) …
billmanH
  • 1,298
  • 1
  • 14
  • 25
1
vote
0 answers

How to view the data created using gremlin server (from python) in ArcadeDB studio?

So, i'm trying to connect to arcade db using gremlin server, from a python script, what ever data i create ,such as new vertices and edges, how do i see them through the arcadedb studio?? Currently they are not visible (only the imported database is…
1
vote
1 answer

Gremlin Python "name 'V' is not defined" when using coalesce to chain insert edges

I am trying to batch insert edges using coalesce . And I was trying to follow this format for batch edge insert that I found on Neptune DB documentation: g.V('v-1') .outE('KNOWS') .hasId('e-1') .fold() .coalesce(unfold(), …
1
vote
0 answers

Gremlin Python N-hop query

How can I get the list of nodes N-hops away from a given node (where N is a parameter)? Here, N-hops means we need to traverse (minimum) N edges (outward) from the source node to reach the destination node. For 1-hop, the query can…
S_S
  • 1,276
  • 4
  • 24
  • 47
1
vote
1 answer

Gremlin Python shortest path between two nodes

How do we find shortest path between two nodes using gremlin-python? The example given for gremlin here shows the following gremlin query g.V(1).repeat(out().simplePath()).until(hasId(5)).path(). group().by(count(local)).next() How can I…
S_S
  • 1,276
  • 4
  • 24
  • 47
1
vote
1 answer

How to avoid StopIteration in gremlin python?

When the expected vertex or edge is not present in the database, gremlin python raises the exception StopIteration. How to resolve/prevent the exception. Query to return none or empty instead of an error. Eg: g.V().hasLabel('employee').has('name',…
Thirumal
  • 8,280
  • 11
  • 53
  • 103