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

How to implement Gremlin query corresponding to Neo4j cypher query?

I have the following Cypher query(neo4j) and want to convert it to a Gremlin query. MATCH d=(a:Actor {id:" + entityId +'})-[r:ACTING_IN*0..2]-(m) WITH d, RELATIONSHIPS(d) AS rels WHERE NONE (rel in r WHERE rel.Type = "Hollywood") RETURN…
Ranjit Soni
  • 594
  • 6
  • 19
0
votes
1 answer

How to set current datetime in gremlin console?

How to set current DateTime in the gremlin console? I need to add an audit field created_on with current_timestamp as default value Eg: g.addV('student').property('name', 'Thirumal').property('created_on', datetime()) In, the above query, I am…
Thirumal
  • 8,280
  • 11
  • 53
  • 103
0
votes
1 answer

Getting timeout error while connecting with AWS Neptune database from lambda function

I am trying to connect with the AWS Neptune database using gremlinpython library from the AWS Lambda function. from gremlin_python.driver import client query = "g.V().count()" uri = "wss://aws-neptune-endpoint:8182/gremlin" clientt =…
Ranjit Soni
  • 594
  • 6
  • 19
0
votes
1 answer

Get score from AWS Neptune Search

I want to get the scores for each search result like you would be able to in elasticsearch. How do you do this through Neptune? I'm using this gremlin query, but I'm not sure how you would get the score out of it. limit = 100 g.withSideEffect( …
Danny
  • 244
  • 3
  • 14
0
votes
1 answer

Neptune AWS sortOrder asc and desc don't give reverses of each other

I am searching for with my_table and I get all the tables I expect, sorted by score (though I am not sure if it's in the correct order since I don't know how to get the scores from elasticsearch). When I reverse it (i.e. from sortOrder DESC to ASC),…
Danny
  • 244
  • 3
  • 14
0
votes
1 answer

Get or Create vertex/edge in Apache TinkerPop Gremlin in one query

How to get or create vertex/edge in Apache TinkerPop Gremlin in one query? Currently I am doing, id = None if g.V().has('employee', 'name', 'thirumal').hasNext(): id = g.V().has('employee', 'name', 'thirumal').values('id') else: id = uuid4() …
Thirumal
  • 8,280
  • 11
  • 53
  • 103
0
votes
1 answer

How does AWS Neptune fts.maxResults affect the search results?

When I set the maxResults to 100, I get 20 results. When I set the maxResults to 10, I get 1 result. From the docs: maxResults – The maximum number of results to return. The default is the index.max_result_window OpenSearch setting, which…
Danny
  • 244
  • 3
  • 14
0
votes
1 answer

Send string gremlin query to Amazon Neptune database using TinkerPop's gremlinpython

We can do the following to create a connection, and then attached the connection to the graph g object, and then use g to mirror gremlin query inline. from gremlin_python import statics from gremlin_python.structure.graph import Graph …
0
votes
1 answer

Gremlin query to group by multiple columns (from vertex, and edge)

I have a developer vertex and a project vertex and an edge with start date and end date properties. A developer can work only on one project at a given point of time. Sometimes they are assigned to multiple projects with the same start date by user…
user2026504
  • 69
  • 1
  • 9
0
votes
1 answer

gremlin_python throws RuntimeError exception due to aiohttp.WSMsgType.closed when adding property to vertex

I received the following error when using gremlin_python to run a a Gremlin query to save a property to an existing vertex using Gremlin Server inside a docker container on my local machine. …
Sam Martin
  • 1,238
  • 10
  • 19
0
votes
2 answers

How to use multiple union step in gremlin query?

I want to convert following cypher query in gremlin but facing issue while using union. match d=(s:Group{id:123})<-[r:Member_Of*]-(p:Person) with d, RELATIONSHIPS(d) as rels WHERE NONE(rel in rels WHERE EXISTS(rel.`Ceased On`)) return…
Ranjit Soni
  • 594
  • 6
  • 19
0
votes
2 answers

How to use pagination in Apache TinkerPop Gremlin?

How to use pagination in apache tinker pop gremlin? Trying to get both count and the vertex properties g.V().hasLabel('person').fold().as('persons','count'). select('persons','count'). by(range(local, 2, 4)). …
Thirumal
  • 8,280
  • 11
  • 53
  • 103
0
votes
1 answer

How to update an edge properties if it already exists?

I'm writing a gremlin python query with the intention that Create an edge if it doesn't exist Update the edge properties if it does I read some answers here already and got the first part figured out using coalesce but I'm not sure how to update…
bandzbond
  • 5
  • 2
0
votes
1 answer

How to filter datetime using gremlin_python

I want to filter the vertex based out of a date. I don't know from which package i have to refer the gt graph = Graph() remote_connection = DriverRemoteConnection(gremlin, 'g') g =…
0
votes
3 answers

Gremlin how to filter the results of a projection?

I have a query like this g.V.has('id', 1).outE() .project('edge','vertex') .by(valueMap('number')) .by(inV().valueMap()) it returns a dictionary that looks like this: {"edge": { ...}, "vertex": { ..., "city": a value,…
lalala
  • 3
  • 3